at24 driver is built in to the kernel, I can see the sysfs node:
$ls /sys/bus/i2c/devices/10-0053
10-00530 driver eeprom modalias name of_node power subsystem uevent
I tested a couple of simple rules such as usb block device, iio device, the rules all got fired, but I just can’t get a simple i2c device to work. What did I miss here?
Thanks for the help.
Thanks for the reply, Jerry.
I checked out the link you provided, it has rules to change i2c bus group and permissions. I can achieve that too, using i2c-dev subsystem to match, however for i2c end devices, like an eeprom or other custom devices, I can’t make them to match using SUBSYSTEM==“i2c”.
I googled around, can’t find any sample rule using that, I am wondering how i2c is handled differently from other type of devices in udev?
My understanding is that udev is for busses and devices than support autoconfig: These are
PCIe
USB
All other busses and devices (SPI, I2C, CAN, …) don’t support auto-config. They get enumerated statically though the device tree. The device tree is a compiled list of processor peripherials, busses, and devices present in the system.
The bootloader loads
Kernel
Initial Ramdisk
Device Tree
Wenn the Linux Kernel starts it reads the device tree entry by entry and loads and configures each driver and device in this list. This is only done once during boot.
Your eeprom needs to be added to the device tree. udev is the wrong place.
Thanks for the reply. To clarify, I am putting all the i2c devices in the device tree. And they works fine. What I am trying to achieve here:
give the i2c devices proper group and permission.
give it a consistent path, the default sysfs path could change for different revisions of PCBs.
I understand I could write a script to create symbolic link and change the permissions, but I thought udev maybe a better way to do this?