From: Jean Delvare <khali@linux-fr.org>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Vojtech Pavlik <vojtech@ucw.cz>
Subject: Writing a driver for a legacy serial device
Date: Tue, 19 Jun 2007 19:05:02 +0200 [thread overview]
Message-ID: <20070619190502.05d4e0c8@hyperion.delvare> (raw)
Hi all,
I want to write a Linux kernel driver for a device which connects to
the legacy serial port. I started writing a driver, however I am
already stuck at the very beginning. The .connect function of my serial
driver is never called, and I just don't get why. I couldn't find any
documentation about writing such a legacy driver in Documentation nor
in LDD3. Is there anyone out there which could lend a helping hand?
I know that the device and my serial port both work. I can talk to the
device using minicom just fine. I have the following drivers loaded:
$ lsmod | grep 8250
8250_pnp 11648 0
8250 23464 1 8250_pnp
serial_core 19392 1 8250
Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing disabled
00:08: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
But I need to implement my driver in kernel space. My code looks like
this:
static struct serio_device_id taos_serio_ids[] = {
{
.type = SERIO_RS232,
.proto = SERIO_ANY,
.id = SERIO_ANY,
.extra = SERIO_ANY,
},
{ 0 }
};
MODULE_DEVICE_TABLE(serio, taos_serio_ids);
static struct serio_driver taos_drv = {
.driver = {
.name = "taos-evm",
},
.description = "TAOS evaluation module driver",
.id_table = taos_serio_ids,
.connect = taos_connect,
.disconnect = taos_disconnect,
.interrupt = taos_interrupt,
};
static int __init taos_init(void)
{
return serio_register_driver(&taos_drv);
}
static void __exit taos_exit(void)
{
serio_unregister_driver(&taos_drv);
}
The problem is that taos_connect is never called. I suppose that I need
different values for .type, .proto or .id, except that I just don't
know what to put there. I tried a few random values without success.
What's the trick?
Thanks,
--
Jean Delvare
next reply other threads:[~2007-06-19 17:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-19 17:05 Jean Delvare [this message]
2007-06-19 18:59 ` Writing a driver for a legacy serial device Dmitry Torokhov
2007-06-20 8:56 ` Jean Delvare
2007-06-21 3:11 ` Dmitry Torokhov
2007-06-21 9:33 ` Jean Delvare
2007-06-21 14:47 ` David Woodhouse
2007-06-21 18:38 ` Jean Delvare
2007-06-21 23:31 ` Arnd Bergmann
2007-06-22 19:47 ` Dmitry Torokhov
2007-06-23 8:34 ` Jean Delvare
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070619190502.05d4e0c8@hyperion.delvare \
--to=khali@linux-fr.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vojtech@ucw.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox