|
Question as to the method to create /dev/i2c device node,
Posted at 10/25/2017 15:24:52
View:4073
|
Replies:7
Print
Only Author
[Copy Link]
1#
if using /dev/i2c -0/1/2 in application like below, how can create the node of i2c device (/dev/i2c) ?
need to add something in dts file (pinctrl.dtsi) or if dtsi file already defined the control of each pins,
only need to define the node in ueventd.rc located in device folder of android code, is it right ?
thankful for your kindness in advance,
ex)
// Net name I2C_1 Physical address : 0x12C70000
int fd = open("/dev/i2c-4", O_RDWR);
if (fd < 0) {
printf("ERROR: open failed\n");
return -1;
}
status = ioctl(fd, I2C_SLAVE, SI702X_ADDRESS);
if (status < 0) {
printf("ERROR: ioctl error\n");
close(fd);
return -1;
} |
|