Tool/software: Linux
I am integrating a PCF857r GPIO-expander driver into my Linux kernel (Version ~3.2 Linux). As this is built on an older version of the Linux kernel, I use a board file to setup this driver. Below is a piece of my code in the board file (../mach-exynos/mach-u1.c) where I setup this expander:
/* PCF8574 GPIO expander platform data */
static struct pcf857x_platform_data pcf857x_data[] = {
{
.gpio_base = 300,
},};
/* I2C1 */
static struct i2c_board_info i2c_devs1[] __initdata = {
{
I2C_BOARD_INFO("pcf857x", 0x20),
.type = "pcf8574",
.platform_data = &pcf857x_data[0],
},};
I see the PCF8574 registered on the appropriate I2C bus at the correct address (I2C1 at 0x20). However, I do not see any GPIOs being registered. For now, I have not actually connected my expander to my I2C1 bus yet, but I think I should still be able to see the GPIOs registered. Specifically, I should see GPIO 300-307 registered (as it is an 8 bit expander). But I do not.
The GPIOs that I do see from the hardware (Exynos 4210 SoC) via "cat /sys/kernel/debug/gpio" range from 0-287. Since I don't want to conflict with any physical GPIO, I chose my expander GPIOs to be out of this range (300+). Part of the problem I believe is that GPIOs out of this range don't exist. Do I need to somehow create “virtual” GPIOs so that the PCF8574 can recognize and take? I’m not sure how to proceed. Thank you.