Access to event from CM109 driver module

Submitted by Anonymous
on December 16, 2008 - 10:47am

Hello.

At this URL
https://kerneltrap.org/mailarchive/linux-kernel/2008/8/5/2829124
You give the possibility to acces to the GPIO register of CM109 chipset.
I make and load a module from this cm109.c. I put CM109_DEBUG to 1 so I can see a kernel message with dmesg command when I make a change on GPIO register.
But I don't detect any event with my program.
In my program, I open /dev/input/event6 which correspond to the idVendor and idproduct of CM109 and obtain an handle : fd1 .
Then :
ioctl(fd1, EVIOCGBIT(0, sizeof(evtype_bitmask)), evtype_bitmask);

printf("Supported event types:\n");
for (ev_type = 0; ev_type < EV_MAX; ev_type++)
{
if (test_bit(ev_type, evtype_bitmask))
{
printf(" Event type 0x%02x ", ev_type);
switch ( ev_type)
{
case EV_SYN:
printf(" (Sync)\n");
break;
case EV_REL:
printf(" (Relative Axes)\n");
break;
case EV_KEY :
printf(" (Keys or Buttons)\n");
break;

.../...
int nb;
while (1)
{
nb= read(fd1, &ev1, sizeof(struct input_event));

if(nb != -1)
printf("Event: time %ld.%06ld, type %d, code %d, value %d\n",
ev1.time.tv_sec, ev1.time.tv_usec, ev1.type,
ev1.code, ev1.value);
}

The read returns always with -1. So It's seem to be not the good solution for finding the event

Could you help me please and give me some issue to found the event coming from the kernel module ?
Thank you. Alain from France.