Closed cristicsordas closed 1 year ago
@cristicsordas I'd look into why misc_register
can/does return EBUSY. Based on https://github.com/torvalds/linux/blob/4b810bf037e524b54669acbe4e0df54b15d87ea1/drivers/char/misc.c#L233 it looks like one way this would happen would be due to a minor number conflict. Can you prove this isn't happening?
@dwalkes I changed the minor version of the pcf driver. Now they can both be loaded. Thank you
fixed with the commit d7681b09dbf7f67b6ea0f54f48d215e4724b0bc9
The instruction "i2cdetect -y 1" shows this: 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: UU -- -- -- -- -- -- -- 48 -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: 70 -- -- -- -- -- -- --
The logs displayed with dmesg shows that the driver was loaded by the kernel:
The address for the PCA9685 controller is 0x48. Using the instructions: echo pca 0x48 > /sys/bus/i2c/devices/i2c-1/new_device /usr/bin/pcf_load (does a modprobe on the pcf driver) the driver PCF8591 fails to be loaded correctly. The logs from dmesg show this messages:
The following steps will make PCF8591 to work:
Now pcf is working and pca not. Error -16 means that the driver is BUSY, but there is no driver loaded for that address.
The commit for the PCF8591 driver implementation is here: https://github.com/cristicsordas/raspi_robot/commit/02bb8846b8c3149c107f66bfd4882cf4726fda03#diff-b0ee59f04a5847d2756ac57c330b08528eec445c6fbb8f4634928bc96391a4c9
The commit for the PCA9685 implementation is here: https://github.com/cristicsordas/raspi_robot/commit/08700a4a0fc44f712919389077988b5f2b3dcf16