Hi everyone,
I'm running linux davinci on custom hardware with an AM1808.
I got a problem to make working my touchscreen and gpio used as external
interrupt together.
My touchscreen alone is working well but when I add support for gpio used as
external interrupt, the touchscreen is not work anymore. They seems to use
the same input event.
Here is what I did to add *gpio-keys* into *board-da850-evm.c* :
*static struct gpio_keys_button da850_evm_ui_keys[] = {*
*
*
* [0] = {*
* .code = KEY_RECORD, //input event code (KEY_*, SW_*)*
* .gpio = DA850_GPIO_INTERRUPT,*
* .active_low = 0,*
* .desc = "gpio_interrupt",*
* .type = EV_KEY, //input event type (EV_KEY, EV_SW)*
* .wakeup = 0, //configure the button as a wake-up source*
* .debounce_interval = 1, //debounce ticks interval in msecs*
* //.can_disable*
* },*
*};*
*
*
*static struct gpio_keys_platform_data da850_evm_ui_keys_pdata = {*
* .buttons = da850_evm_ui_keys,*
* .nbuttons = ARRAY_SIZE(da850_evm_ui_keys),*
*};*
*
*
*static struct platform_device da850_evm_ui_keys_device = {*
* .name = "gpio-keys",*
* .id = 0,*
* .dev = {*
* .platform_data = &da850_evm_ui_keys_pdata*
* },*
*};*
*
*
*...*
*
*
*ret = platform_device_register(&da850_evm_ui_keys_device);*
*if (ret)*
* pr_warning("da850_evm_init: gpio interrupt registration failed: %d\n",
ret);*
Both input devices are correclty initialized by the kernel :
*input: gpio-keys as /devices/platform/gpio-keys.0/input/input0*
*input: TPS6507x Touchscreen as
/devices/platform/i2c_davinci.1/i2c-1/1-0048/input/input1*
I wrote an application to read /dev/input/event0, and it allows me to grab
interrupt events that occurred on the gpio.
*struct input_event ev;*
*fd = open( "/dev/input/event0", O_RDONLY );*
*rb = read(fd, &ev, sizeof(struct input_event));*
printf("ev.type: %d | ev.code: %d | ev.value: %d\n", ev.type, ev.code,
ev.value);
When I use it I read correctly events on the gpio but I got an error message
on the touchscreen:
*selected device is not a touchscreen I understand*
*
*
I got */dev/input/touchscreen0 *in my filesystem but for an unknowm reason
the touchscreen also use event0. I tried to cat /dev/input/event0 and I see
event from my gpio interrupt AND the touchscreen.
I would like to create a new eventX in /dev/input to redirect gpio interrupt
there. Is there any way to do that?
Here's more info:
*# cat /proc/bus/input/devices*
*I: Bus=0019 Vendor=0001 Product=0001 Version=0100*
*N: Name="gpio-keys"*
*P: Phys=gpio-keys/input0*
*S: Sysfs=/devices/platform/gpio-keys.0/input/input0*
*U: Uniq=*
*H: Handlers=kbd event0*
*B: EV=3*
*B: KEY=80 0 0 0 0 0*
*
*
*I: Bus=0018 Vendor=0000 Product=fe2e Version=0100*
*N: Name="TPS6507x Touchscreen"*
*P: Phys=1-0048/input0*
*S: Sysfs=/devices/platform/i2c_davinci.1/i2c-1/1-0048/input/input1*
*U: Uniq=*
*H: Handlers=event1*
*B: EV=b*
*B: KEY=400 0 0 0 0 0 0 0 0 0 0*
*B: ABS=1000003*
Thanks!
Best regards,
Nicolas
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source