i2c

How to prevent “error: 'symbol' undeclared here” despite EXPORT_SYMBOL in a Linux kernel module?

旧时模样 提交于 2019-11-30 14:35:05
I'm embedding some driver into a Linux kernel when I get this error (I'm adding the device in the board file and registering it): error: 'kxtf9_get_slave_descr' undeclared here (not in a function) I located the function above in a driver file struct ext_slave_descr *kxtf9_get_slave_descr(void) { return &kxtf9_descr; } EXPORT_SYMBOL(kxtf9_get_slave_descr); Shouldn't it made "visible" by EXPORT_SYMBOL? The C file containing the code above has no header file (I didn't write it, I just found it here and I'm implementing. They say it's tested so I assume an header is not needed? The rest of the

What are the disadvantages of bit banging SPI/I2C in embedded applications

拈花ヽ惹草 提交于 2019-11-30 05:34:50
问题 I have come to understand that bit banging is horrible practice when it comes to SPI/I2C over GPIO. Why so? 回答1: Bit-banging carries a software overhead consuming CPU cycles that you could otherwise utilise for other purposes. This may have a noticeable effect on system responsiveness to other events, and in a hard real-time system , may significantly impact the systems ability to meet real-time deadlines. If the bit-banged interface is not to have a detrimental effect on real-time

Reading / writing from using I2C on Linux

怎甘沉沦 提交于 2019-11-29 17:30:12
问题 I'm trying to read/write to a FM24CL64-GTR FRAM chip that is connected over a I2C bus on address 0b 1010 011 . When I'm trying to write 3 bytes (data address 2 bytes, + data one byte), I get a kernel message ( [12406.360000] i2c-adapter i2c-0: sendbytes: NAK bailout. ), as well as the write returns != 3. See code below: #include <linux/i2c-dev.h> #include <fcntl.h> #include <unistd.h> #include <stdint.h> int file; char filename[20]; int addr = 0x53; // 0b1010011; /* The I2C address */ uint16

I2C device linux driver [closed]

你说的曾经没有我的故事 提交于 2019-11-29 07:04:07
How to make a character device for i2c device, with open, close, ioctl etc. functions? I was looking for information about it last two weeks and couldn't find anything working. I found some information in Essential Linux Device Drivers, but it was written for 2.6 kernel, and i use 3.4.79 (i'm trying to write this driver for cubieboard2 on cubian distr) so this book has many deprecated functions, i tried to write my driver like there, but it still don't work (give me kernel errors while i'm truing to cat character device). Can anyone explain me what to do with it, or at least give me a working

usage of driver_data member of I2C device id table

核能气质少年 提交于 2019-11-29 00:38:49
I am trying to understand I2C client drivers. As per my understanding before registering I2C driver we have to define i2c_device_id table and device tree compatible table. I have following doubts. Could please help me to understand. 1) The definition of i2c_device_id structure contains two members ( name , driver_data ). The 1st member ( name ) is used to define the device name which will be used during driver binding, what is the use of the 2nd member ( driver_data ). 2) Driver binding will happen based on i2c_device_id table or device tree compatible string. Thanks in advance. 1) The

I2C device linux driver [closed]

血红的双手。 提交于 2019-11-28 00:26:48
问题 How to make a character device for i2c device, with open, close, ioctl etc. functions? I was looking for information about it last two weeks and couldn't find anything working. I found some information in Essential Linux Device Drivers, but it was written for 2.6 kernel, and i use 3.4.79 (i'm trying to write this driver for cubieboard2 on cubian distr) so this book has many deprecated functions, i tried to write my driver like there, but it still don't work (give me kernel errors while i'm

usage of driver_data member of I2C device id table

一个人想着一个人 提交于 2019-11-27 21:31:34
问题 I am trying to understand I2C client drivers. As per my understanding before registering I2C driver we have to define i2c_device_id table and device tree compatible table. I have following doubts. Could please help me to understand. 1) The definition of i2c_device_id structure contains two members ( name , driver_data ). The 1st member ( name ) is used to define the device name which will be used during driver binding, what is the use of the 2nd member ( driver_data ). 2) Driver binding will

How can you flush a write using a file descriptor?

岁酱吖の 提交于 2019-11-26 12:25:43
问题 It turns out this whole misunderstanding of the open() versus fopen() stems from a buggy I2C driver in the Linux 2.6.14 kernel on an ARM. Backporting a working bit bashed driver solved the root cause of the problem I was trying to address here. I\'m trying to figure out an issue with a serial device driver in Linux (I2C). It appears that by adding timed OS pauses (sleeps) between writes and reads on the device things work ... (much) better. Aside: The nature of I2C is that each byte read or