This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PCA9554 I2C IO Expander in AM335x

Other Parts Discussed in Thread: PCA9554

Hi All,

We are using the PCA9554 I2C IO Expander with AM335x processor. It have 8 IO ports and 1 interrupt pin for processor. 

One of the IO ex-pander pin will act as interrupt from the Wifi Module. we are configured the PCA9554 details as follow here

i2c_board_info am335x_i2c1_boardinfo[] = {

{
I2C_BOARD_INFO("pca9554", 0x24),
.platform_data = &am335x_i2c_pca9554_platdata2,
},

..................

static struct pca953x_platform_data am335x_i2c_pca9554_platdata2 = {
.gpio_base = 136, /* Start directly after the CPU's GPIO */
.invert = 0, /* Do not invert */
.setup = am335x_pca9554_setup2,
};

static int am335x_pca9554_setup2(struct i2c_client *client,
unsigned gpio_base, unsigned ngpio,
void *context)
{
static int am335x_gpio_value[] = {
-1, -1, -1, -1, -1, -1, -1, -1
};
int n;

for (n = 0; n < ARRAY_SIZE(am335x_gpio_value); ++n) {
gpio_request(gpio_base + n, "PCA-9554GPIOExpander2");
if (am335x_gpio_value[n] < 0)
gpio_direction_input(gpio_base + n);
else
gpio_direction_output(gpio_base + n,
am335x_gpio_value[n]);
gpio_export(gpio_base + n, 0); /* Export, direction locked down */
}

return 0;
}

#define EXPANDER2_IRQ              99 /* GPIO3_3 */

static int pca9554_expander_init_irq2(void)
{
int ret = 0;

ret = gpio_request(EXPANDER2_IRQ, "pca9554-expander-irq-2");
if (ret < 0) {
printk(KERN_WARNING "failed to request GPIO#%d: %d\n",
EXPANDER2_IRQ, ret);
return ret;
}
if (gpio_direction_input(EXPANDER2_IRQ)) {
printk(KERN_WARNING "GPIO#%d cannot be configured as "
"input\n", EXPANDER2_IRQ);
return -ENXIO;
}

return ret;
}

#define AM335XEVM_WLAN_IRQ_GPIO 137

struct wl12xx_platform_data am335xevm_wlan_data = {
.irq = OMAP_GPIO_IRQ(AM335XEVM_WLAN_IRQ_GPIO),
.board_ref_clock = WL12XX_REFCLOCK_38_XTAL, /* 38.4Mhz */
.bt_enable_gpio = GPIO_TO_PIN(1, 30),
.wlan_enable_gpio = GPIO_TO_PIN(1, 9),
};

Please tell us is it not enough for receiving the interrupt from the wifi module.