linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Serio keyboard issues 2.5.70
       [not found] <434747C01D5AC443809D5FC540501131097083@bobcat.unickz.com>
@ 2003-06-04 19:23 ` John Appleby
  2003-06-04 22:23   ` Russell King
  0 siblings, 1 reply; 8+ messages in thread
From: John Appleby @ 2003-06-04 19:23 UTC (permalink / raw)
  To: linux-kernel

Hi,

I'm trying to write a keyboard driver using serio/input on 2.5.70; more
of a port of the existing 2.4 driver actually, but whatever.

I'm calling serio_register_device thus:

static struct serio_dev arckbd_dev = {
        .interrupt =    arckbd_interrupt,
        .connect =      arckbd_connect,
        .disconnect =   arckbd_disconnect
};

static int __init arckbd_init(void)
{
	printk("input: Registering keyboard with serio\n");
        serio_register_device(&arckbd_dev);
        return 0;
}

And that printk is coming up fine. serio_register_device seems to add
0x021c2af8 to its tail, but then never finds my entry in
list_for_each_entry and thus never calls dev->connect(). I've added some
debugging to serio_register_device thus:

void serio_register_device(struct serio_dev *dev)
{
        struct serio *serio;
        list_add_tail(&dev->node, &serio_dev_list);
	  printk("serio: add_tail %08x\n",&dev->node);
        list_for_each_entry(serio, &serio_list, node) {
                printk("serio: register_device %08x\n",serio->dev);
                if (!serio->dev && dev->connect) {
                        printk("serio: connecting...\n");
                        dev->connect(serio, dev);
                }
        }
}

and I get nothing past "add_tail". I'd expect it to recognize my dev and
attempt to connect to it.

Any ideas? I presume I'm being an idiot as per usual.

Thanks,

John



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Serio keyboard issues 2.5.70
  2003-06-04 19:23 ` Serio keyboard issues 2.5.70 John Appleby
@ 2003-06-04 22:23   ` Russell King
  0 siblings, 0 replies; 8+ messages in thread
From: Russell King @ 2003-06-04 22:23 UTC (permalink / raw)
  To: John Appleby; +Cc: linux-kernel

On Wed, Jun 04, 2003 at 08:23:21PM +0100, John Appleby wrote:
> And that printk is coming up fine. serio_register_device seems to add
> 0x021c2af8 to its tail, but then never finds my entry in
> list_for_each_entry and thus never calls dev->connect(). I've added some
> debugging to serio_register_device thus:
> 
> void serio_register_device(struct serio_dev *dev)
> {
>         struct serio *serio;
>         list_add_tail(&dev->node, &serio_dev_list);
> 	  printk("serio: add_tail %08x\n",&dev->node);
>         list_for_each_entry(serio, &serio_list, node) {
>                 printk("serio: register_device %08x\n",serio->dev);
>                 if (!serio->dev && dev->connect) {
>                         printk("serio: connecting...\n");
>                         dev->connect(serio, dev);
>                 }
>         }
> }
> 
> and I get nothing past "add_tail". I'd expect it to recognize my dev and
> attempt to connect to it.

Do you drop out the bottom of the function?  If you have no hardware ports
registered, I'd expect this to be the case.

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Serio keyboard issues 2.5.70
  2003-06-04 22:59 Perez-Gonzalez, Inaky
@ 2003-06-04 23:03 ` Russell King
  0 siblings, 0 replies; 8+ messages in thread
From: Russell King @ 2003-06-04 23:03 UTC (permalink / raw)
  To: Perez-Gonzalez, Inaky
  Cc: 'John Appleby', 'John Appleby',
	'linux-kernel@vger.kernel.org'

On Wed, Jun 04, 2003 at 03:59:44PM -0700, Perez-Gonzalez, Inaky wrote:
> Kind of counter-intuitive :] I guess renaming to something
> that is more obvious is out of the question at this page of
> the book, right? Not that it is a big deal, though...

I believe so on both points; however, the final decision would need
to be made by Vojtech.

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: Serio keyboard issues 2.5.70
@ 2003-06-04 22:59 Perez-Gonzalez, Inaky
  2003-06-04 23:03 ` Russell King
  0 siblings, 1 reply; 8+ messages in thread
From: Perez-Gonzalez, Inaky @ 2003-06-04 22:59 UTC (permalink / raw)
  To: 'Russell King', 'John Appleby'
  Cc: 'John Appleby', 'linux-kernel@vger.kernel.org'

> From: Russell King [mailto:rmk@arm.linux.org.uk]
>
> - serio device drivers (the things which drive the hardware) using
>   serio_register_port()
> - serio protocol drivers (the things which interpret the bytes,
>   like atkbd.c) using serio_register_device()

Kind of counter-intuitive :] I guess renaming to something
that is more obvious is out of the question at this page of
the book, right? Not that it is a big deal, though...

Iñaky Pérez-González -- Not speaking for Intel -- all opinions are my own
(and my fault)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Serio keyboard issues 2.5.70
  2003-06-04 22:44 ` John Appleby
@ 2003-06-04 22:47   ` Russell King
  0 siblings, 0 replies; 8+ messages in thread
From: Russell King @ 2003-06-04 22:47 UTC (permalink / raw)
  To: John Appleby; +Cc: John Appleby, linux-kernel

On Wed, Jun 04, 2003 at 11:44:17PM +0100, John Appleby wrote:
> 
> > > and I get nothing past "add_tail". I'd expect it to recognize my dev
> and
> > > attempt to connect to it.
> > 
> > Do you drop out the bottom of the function?  If you have no hardware
> ports
> > registered, I'd expect this to be the case.
> 
> Yeah; I thought though what I was doing was registering the port.
> 
> I'm clearly missing something really obvious here. Are you saying that I
> should have registered the port somewhere else?
> 
> Sorry for the dumb questions but there's no serio documentation yet hit
> the tree, I presume as it's pretty new for non-USB devices.

You need to register:

- serio device drivers (the things which drive the hardware) using
  serio_register_port()
- serio protocol drivers (the things which interpret the bytes,
  like atkbd.c) using serio_register_device()

So, for a PS/2 keyboard connected to a some special hardware interface,
you'd use atkbd.c which registers itself with serio using
serio_register_device().  Your device driver for the "special hardware"
registers itself with serio_register_port().

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: Serio keyboard issues 2.5.70
       [not found] <434747C01D5AC443809D5FC5405011310970EA@bobcat.unickz.com>
@ 2003-06-04 22:44 ` John Appleby
  2003-06-04 22:47   ` Russell King
  0 siblings, 1 reply; 8+ messages in thread
From: John Appleby @ 2003-06-04 22:44 UTC (permalink / raw)
  To: 'Russell King', John Appleby; +Cc: linux-kernel


> > and I get nothing past "add_tail". I'd expect it to recognize my dev
and
> > attempt to connect to it.
> 
> Do you drop out the bottom of the function?  If you have no hardware
ports
> registered, I'd expect this to be the case.

Yeah; I thought though what I was doing was registering the port.

I'm clearly missing something really obvious here. Are you saying that I
should have registered the port somewhere else?

Sorry for the dumb questions but there's no serio documentation yet hit
the tree, I presume as it's pretty new for non-USB devices.

Regards,

John



^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: Serio keyboard issues 2.5.70
       [not found] <434747C01D5AC443809D5FC54050113109709D@bobcat.unickz.com>
@ 2003-06-04 20:08 ` John Appleby
  0 siblings, 0 replies; 8+ messages in thread
From: John Appleby @ 2003-06-04 20:08 UTC (permalink / raw)
  To: 'Perez-Gonzalez, Inaky', John Appleby, 'lkml'

> > void serio_register_device(struct serio_dev *dev)
> > {
> >         struct serio *serio;
> >         list_add_tail(&dev->node, &serio_dev_list);
> > 	  printk("serio: add_tail %08x\n",&dev->node);
> >         list_for_each_entry(serio, &serio_list, node) {
> >                 printk("serio: register_device %08x\n",serio->dev);
> >                 if (!serio->dev && dev->connect) {
> >                         printk("serio: connecting...\n");
> >                         dev->connect(serio, dev);
> >                 }
> >         }
> > }
> 
> Well - I don't know the real reason, but the code is
> adding the device to the 'serio_dev_list', and the
> list iteration is going over the 'serio_list'...

Yeah, I think that's correct though. At least I've traced it for PS2
keyboards and it finds its way into it.

Regards,

John



^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: Serio keyboard issues 2.5.70
@ 2003-06-04 19:51 Perez-Gonzalez, Inaky
  0 siblings, 0 replies; 8+ messages in thread
From: Perez-Gonzalez, Inaky @ 2003-06-04 19:51 UTC (permalink / raw)
  To: 'John Appleby', 'lkml (linux-kernel@vger.kernel.org)'


> void serio_register_device(struct serio_dev *dev)
> {
>         struct serio *serio;
>         list_add_tail(&dev->node, &serio_dev_list);
> 	  printk("serio: add_tail %08x\n",&dev->node);
>         list_for_each_entry(serio, &serio_list, node) {
>                 printk("serio: register_device %08x\n",serio->dev);
>                 if (!serio->dev && dev->connect) {
>                         printk("serio: connecting...\n");
>                         dev->connect(serio, dev);
>                 }
>         }
> }

Well - I don't know the real reason, but the code is
adding the device to the 'serio_dev_list', and the
list iteration is going over the 'serio_list'...


Iñaky Pérez-González -- Not speaking for Intel -- all opinions are my own
(and my fault)

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-06-04 22:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <434747C01D5AC443809D5FC540501131097083@bobcat.unickz.com>
2003-06-04 19:23 ` Serio keyboard issues 2.5.70 John Appleby
2003-06-04 22:23   ` Russell King
2003-06-04 19:51 Perez-Gonzalez, Inaky
     [not found] <434747C01D5AC443809D5FC54050113109709D@bobcat.unickz.com>
2003-06-04 20:08 ` John Appleby
     [not found] <434747C01D5AC443809D5FC5405011310970EA@bobcat.unickz.com>
2003-06-04 22:44 ` John Appleby
2003-06-04 22:47   ` Russell King
2003-06-04 22:59 Perez-Gonzalez, Inaky
2003-06-04 23:03 ` Russell King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).