I need to use I2C led component PCA9533/02
In a first try, i have activated “Device Drivers → Led Support → LED driver for PCA9532 dimmer” and added to device tree file “imx7-colibri-eval-v3.dtsi” following code:
Also added file leds-pca9532.h in “/home/guest/linux-toradex/arch/arm/boot/dts/include/dt-bindings/leds” where are defined the definition used in device tree.
(I have added it in section “&i2c4”, the same i2c of capacitive touch because i need them on the same bus).
Both kernel and device tree are compiled correctly.
After that I was stuck because I’m not able to access kernel driver from user space and my qt app. How to do that?
Second try, I have activated “Device Drivers → Led Support → Enable GPIO support for PCA9532” because i see that some people use it from user space accessing “/sys/class/leds” using it as gpio.
Kernel compiled correctly but I don’t have any led in “/sys"class/leds”, only “mmc0”.
Is there a particular reason you set this question to private? Usually the whole community may profit from you asking and us answering any such questions. If you don’t mind we therefore would set it to public. OK?
How about the driver debug logs ? Did you see any debug messages ? h/w connections good ? Can you see the slave device addr getting detected with ‘i2c tools’ ?
I assume you are using the toradex_4.1-2.0.x-imx-next kernel branch.
The PCA9532 device tree integration has only been added to the kernel around kernel version 4.8. So your device tree nodes are not evaluated by the PCA9532 driver.
So you would either have to:
instantiate and register platform data for your PCA9532
Using i2cdetect, component is correctly detected at address 0x63.
I’m able to turn on and off RGB led using i2cset command.
Yesterday, following example in this page as i2c communication from user space, I’m able to open i2c bus and access to the slave, but not to write or read to i2c bus (RGB led don’t turn on and off).
Today i modify the write routine, removing the slave address from the buffer (following this example):