Skip to contentSkip to conversation

I2C Slave support - how to use it?

DISCUSSION Peter Hüwe 2 participants 2 messages Mar 17, 2015 – Mar 18, 2015 1 message not in the archive I2C subsystem host drivers

lore
Share & tools
lore
#0 lore raw

Hi Wolfram,

I think the I2C slave support is an excellent feature you added to Linux (thanks for that) but I somehow have some problems to get it working on -rc4.

What are the magical commands to get a linux slave on e.g. bus 1?

What I tried:
modprobe i2c-dev
modprobe i2c-slave-eeprom

# echo i2c_slave_eeprom 0x20 > /sys/bus/i2c/devices/i2c-1/new_device 
[ 16.119] i2c i2c-1: new_device: Instantiated device i2c_slave_eeprom at 0x20
# find /sys -name '*eeprom*'
/sys/bus/i2c/drivers/i2c-slave-eeprom
/sys/module/i2c_slave_eeprom
/sys/module/i2c_slave_eeprom/drivers/i2c:i2c-slave-eeprom
# ls  -lah /sys/bus/i2c/devices/1-0020/
insgesamt 0
drwxr-xr-x 3 root root    0 18. Mär 00:11 .
drwxr-xr-x 5 root root    0 18. Mär 00:11 ..
-r--r--r-- 1 root root 4,0K 18. Mär 00:11 modalias
-r--r--r-- 1 root root 4,0K 18. Mär 00:11 name
drwxr-xr-x 2 root root    0 18. Mär 00:11 power
lrwxrwxrwx 1 root root    0 18. Mär 00:11 subsystem -> ../../../../../bus/i2c
-rw-r--r-- 1 root root 4,0K 18. Mär 00:11 uevent

--> the slave-eeprom file mentioned here is not present.
https://marc.info/?l=linux-i2c&m=142616417313963&w=4

Thanks,
Peter

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 2 lines

I think the I2C slave support is an excellent feature you added to Linux

Thanks!

Quoted 3 lines

--> the slave-eeprom file mentioned here is not present.
https://marc.info/?l=linux-i2c&m=142616417313963&w=4

Does your I2C bus driver have slave support? In upstream, this is only the Renesas R-Car driver so far. Check the 'Developer manual' to find out what is needed.