aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/serial_cs.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2006-09-16 18:07:46 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-10-01 12:06:45 -0400
commitf3d106881b06a423455f95916e666acebe6503f2 (patch)
tree586e062a4eab63813dfe539f49d5766c476eaae5 /drivers/serial/serial_cs.c
parent20f130495c07cd01fb423c3dec7f045038118dec (diff)
[SERIAL] serial_cs: Add quirk for brainboxes 2-port RS232 card
Mauro Ziliani reports that this card has a higher clock rate. Rather than tweak the 8250 driver to handle this, add a quirk to pass the correct clock rate to the driver. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/serial/serial_cs.c')
-rw-r--r--drivers/serial/serial_cs.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c
index 704922073bbf..1267cbed52f5 100644
--- a/drivers/serial/serial_cs.c
+++ b/drivers/serial/serial_cs.c
@@ -85,6 +85,7 @@ struct serial_quirk {
85 unsigned int prodid; 85 unsigned int prodid;
86 int multi; /* 1 = multifunction, > 1 = # ports */ 86 int multi; /* 1 = multifunction, > 1 = # ports */
87 void (*config)(struct pcmcia_device *); 87 void (*config)(struct pcmcia_device *);
88 void (*setup)(struct pcmcia_device *, struct uart_port *);
88 void (*wakeup)(struct pcmcia_device *); 89 void (*wakeup)(struct pcmcia_device *);
89 int (*post)(struct pcmcia_device *); 90 int (*post)(struct pcmcia_device *);
90}; 91};
@@ -108,6 +109,16 @@ struct serial_cfg_mem {
108 u_char buf[256]; 109 u_char buf[256];
109}; 110};
110 111
112/*
113 * vers_1 5.0, "Brain Boxes", "2-Port RS232 card", "r6"
114 * manfid 0x0160, 0x0104
115 * This card appears to have a 14.7456MHz clock.
116 */
117static void quirk_setup_brainboxes_0104(struct pcmcia_device *link, struct uart_port *port)
118{
119 port->uartclk = 14745600;
120}
121
111static int quirk_post_ibm(struct pcmcia_device *link) 122static int quirk_post_ibm(struct pcmcia_device *link)
112{ 123{
113 conf_reg_t reg = { 0, CS_READ, 0x800, 0 }; 124 conf_reg_t reg = { 0, CS_READ, 0x800, 0 };
@@ -192,6 +203,11 @@ static void quirk_config_socket(struct pcmcia_device *link)
192 203
193static const struct serial_quirk quirks[] = { 204static const struct serial_quirk quirks[] = {
194 { 205 {
206 .manfid = 0x0160,
207 .prodid = 0x0104,
208 .multi = -1,
209 .setup = quirk_setup_brainboxes_0104,
210 }, {
195 .manfid = MANFID_IBM, 211 .manfid = MANFID_IBM,
196 .prodid = ~0, 212 .prodid = ~0,
197 .multi = -1, 213 .multi = -1,
@@ -386,6 +402,10 @@ static int setup_serial(struct pcmcia_device *handle, struct serial_info * info,
386 port.dev = &handle_to_dev(handle); 402 port.dev = &handle_to_dev(handle);
387 if (buggy_uart) 403 if (buggy_uart)
388 port.flags |= UPF_BUGGY_UART; 404 port.flags |= UPF_BUGGY_UART;
405
406 if (info->quirk && info->quirk->setup)
407 info->quirk->setup(handle, &port);
408
389 line = serial8250_register_port(&port); 409 line = serial8250_register_port(&port);
390 if (line < 0) { 410 if (line < 0) {
391 printk(KERN_NOTICE "serial_cs: serial8250_register_port() at " 411 printk(KERN_NOTICE "serial_cs: serial8250_register_port() at "