Changes
CONFIG_I2C_CHARDEV=y
2. Make sure that the appropriate I2C bus is enabled in BIOS settings:<br>Chipset -> South Cluster Configuration -> LPSS Configuration'''LPSS I2C #[1-8]''' Support is set to '''ACPI mode or PCI modeSet LPSS I2C #[1-8] Speed''' is set to '''Standard Mode''' of Fast Mode'''Fast ModeNOTE:'''It’s strongly recommended that All buses are enabled in the range 1-7
busaddr=$(i2cdetect -y -r $busnum | sed -ne
's/^.*\(\(27\|4e\)\).*$/0x\1/Ip')
busaddr=$((busaddr))
4. Bind the above found device to driver (superuser privileges are necessary)
echo pca9535 $busaddr >/sys/bus/i2c/devices/i2c-${busnum}/new_device
and check the kernel debug messages for a line like that:
i2c i2c-7: new_device: Instantiated device pca9535 at 0x27
5. To find the appropriate GPIO issue the command:
ls /sys/bus/i2c/drivers/pca953x/
and look the output for a line like this:
and then issue the command:
ls /sys/class/gpio/gpiochip*/device -l
and look the output for a line like this:
/sys/class/gpio/gpiochip251/device -> ../../../7-0027
Hence, the gpiochip251 is the sought; the individual GPIO line number are from 251 to 251+15
6. The found GPIO may be operated over sysfs interface in the following way:
issue the commands:
export n=251 # desired GPIO number
echo $n >/sys/class/gpio/export
cat /sys/class/gpio/gpio$n/value # read the input value
echo 1 > /sys/class/gpio/gpio$n/value # write a value for output