Hello,
I am testing other touch sensors on the AM3517-EVM under embedded Linux (NOT using Android). I have a connection to I2C bus 3 on the J29 solder pads, and that is working with the driver for the touch screen.
The touch screen has an IRQ line that is active low. I have been trying to map one of signals on J29 to the GPIO function and map that GPIO to an IRQ. The line in question stays low, the IRQ line from touch screen is correct (high until IRQ) so problem is in EVM side. With no "open" lines, I'm not sure if the software to control this is working or if it is a hardware problem. I have tried both pin 62 and 61. Pin 62 is uP_McBSP3_CLKX and 61 is uP_McBSP4_CLKX.
Here are some clips from the code:
#ifdef CONFIG_ATMEL_MAXTOUCH
/*
* maXTouch Support
*/
#define GPIO_MAXTOUCH_IRQ 152 /* Pin 61 on J29 Application Board */
/* Prototype the callback functions */
static int My_maXTouch_init_irq(void);
static void My_maXTouch_exit_irq(void);
static u8 maXTouch_irq_level(void);
static struct mxt_platform_data maXTouch_platform_data = {
.numtouch = 1,
.max_x = 2048,
.max_y = 2048,
.init_platform_hw = &My_maXTouch_init_irq,
.exit_platform_hw = &My_maXTouch_exit_irq,
.valid_interrupt = &maXTouch_irq_level,
.read_chg = &maXTouch_irq_level,
};
static struct i2c_board_info __initdata maXTouch_tsc_i2c_boardinfo[] = {
{
I2C_BOARD_INFO("maXTouch", 0x4B),
.type = "maxTouch",
.platform_data = &maXTouch_platform_data,
},
};
#endif
static struct i2c_board_info __initdata am3517evm_i2c3_boardinfo[] = {
{
I2C_BOARD_INFO("tca6416-keys", 0x20),
.platform_data = &am3517evm_tca6416_keys_info,
},
{
I2C_BOARD_INFO("tca6416", 0x21),
.platform_data = &am3517evm_ui_gpio_expander_info_2,
},
#ifdef CONFIG_ATMEL_MAXTOUCH
{
I2C_BOARD_INFO("maXTouch", 0x4B),
.platform_data = &maXTouch_platform_data,
},
#endif
};
static int __init am3517_evm_i2c_init(void)
{
omap_register_i2c_bus(1, 400, NULL, 0);
omap_register_i2c_bus(2, 400, am3517evm_i2c2_boardinfo,
ARRAY_SIZE(am3517evm_i2c2_boardinfo));
#ifdef CONFIG_ATMEL_MAXTOUCH
omap_register_i2c_bus(3, 400, am3517evm_i2c3_boardinfo,
ARRAY_SIZE(am3517evm_i2c3_boardinfo));
#endif
return 0;
}
#ifdef CONFIG_ATMEL_MAXTOUCH
static int My_maXTouch_init_irq(void)
{
int ret = 0;
omap_mux_init_gpio(GPIO_MAXTOUCH_IRQ, OMAP_PIN_INPUT_PULLUP);
ret = gpio_request(GPIO_MAXTOUCH_IRQ, "maXTouch-irq");
if (ret < 0) {
printk(KERN_WARNING "failed to request GPIO#%d: %d\n",
GPIO_MAXTOUCH_IRQ, ret);
return 0;
}
if (gpio_direction_input(GPIO_MAXTOUCH_IRQ)) {
printk(KERN_WARNING "GPIO#%d cannot be configured as "
"input\n", GPIO_MAXTOUCH_IRQ);
return 0;
}
gpio_set_debounce(GPIO_MAXTOUCH_IRQ, 0xa);
return gpio_to_irq(GPIO_MAXTOUCH_IRQ);
}
static void My_maXTouch_exit_irq(void)
{
gpio_free(GPIO_MAXTOUCH_IRQ);
}
static u8 maXTouch_irq_level(void)
{
return gpio_get_value(GPIO_MAXTOUCH_IRQ) ? 0 : 1;
}
#endif
From inside am3517_evm_init(void)
#ifdef CONFIG_ATMEL_MAXTOUCH
omap_mux_init_gpio(GPIO_MAXTOUCH_IRQ, OMAP_PIN_INPUT_PULLUP);
maXTouch_tsc_i2c_boardinfo[0].irq = gpio_to_irq(GPIO_MAXTOUCH_IRQ);
i2c_register_board_info(1, maXTouch_tsc_i2c_boardinfo,
ARRAY_SIZE(maXTouch_tsc_i2c_boardinfo));
#endif