diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2006-09-16 18:00:54 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-10-01 12:06:37 -0400 |
commit | efd92dfaad962c4fbaf4251b28578c97bd3aa85f (patch) | |
tree | d3f0a68985fb72423681ac005df3500d8e3955b3 /drivers/serial/serial_cs.c | |
parent | 7ef057fa707897c19725d7e07123e57f6aea79db (diff) |
[SERIAL] serial_cs: add configuration quirk
Add a quirk primerily to handle tweaks to the link->conf structure,
eg as required for Socket cards.
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.c | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c index 8e48cb659b3d..788ba404efc6 100644 --- a/drivers/serial/serial_cs.c +++ b/drivers/serial/serial_cs.c | |||
@@ -84,6 +84,7 @@ struct serial_quirk { | |||
84 | unsigned int manfid; | 84 | unsigned int manfid; |
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 (*wakeup)(struct pcmcia_device *); | 88 | void (*wakeup)(struct pcmcia_device *); |
88 | int (*post)(struct pcmcia_device *); | 89 | int (*post)(struct pcmcia_device *); |
89 | }; | 90 | }; |
@@ -164,6 +165,19 @@ static void quirk_wakeup_possio_gcc(struct pcmcia_device *link) | |||
164 | outb(0xC, ctrl + 1); | 165 | outb(0xC, ctrl + 1); |
165 | } | 166 | } |
166 | 167 | ||
168 | /* | ||
169 | * Socket Dual IO: this enables irq's for second port | ||
170 | */ | ||
171 | static void quirk_config_socket(struct pcmcia_device *link) | ||
172 | { | ||
173 | struct serial_info *info = link->priv; | ||
174 | |||
175 | if (info->multi) { | ||
176 | link->conf.Present |= PRESENT_EXT_STATUS; | ||
177 | link->conf.ExtStatus = ESR_REQ_ATTN_ENA; | ||
178 | } | ||
179 | } | ||
180 | |||
167 | static const struct serial_quirk quirks[] = { | 181 | static const struct serial_quirk quirks[] = { |
168 | { | 182 | { |
169 | .manfid = MANFID_IBM, | 183 | .manfid = MANFID_IBM, |
@@ -208,6 +222,12 @@ static const struct serial_quirk quirks[] = { | |||
208 | .manfid = MANFID_SOCKET, | 222 | .manfid = MANFID_SOCKET, |
209 | .prodid = PRODID_SOCKET_DUAL_RS232, | 223 | .prodid = PRODID_SOCKET_DUAL_RS232, |
210 | .multi = 2, | 224 | .multi = 2, |
225 | .config = quirk_config_socket, | ||
226 | }, { | ||
227 | .manfid = MANFID_SOCKET, | ||
228 | .prodid = ~0, | ||
229 | .multi = -1, | ||
230 | .config = quirk_config_socket, | ||
211 | } | 231 | } |
212 | }; | 232 | }; |
213 | 233 | ||
@@ -504,6 +524,13 @@ next_entry: | |||
504 | } | 524 | } |
505 | if (info->multi && (info->manfid == MANFID_3COM)) | 525 | if (info->multi && (info->manfid == MANFID_3COM)) |
506 | link->conf.ConfigIndex &= ~(0x08); | 526 | link->conf.ConfigIndex &= ~(0x08); |
527 | |||
528 | /* | ||
529 | * Apply any configuration quirks. | ||
530 | */ | ||
531 | if (info->quirk && info->quirk->config) | ||
532 | info->quirk->config(link); | ||
533 | |||
507 | i = pcmcia_request_configuration(link, &link->conf); | 534 | i = pcmcia_request_configuration(link, &link->conf); |
508 | if (i != CS_SUCCESS) { | 535 | if (i != CS_SUCCESS) { |
509 | cs_error(link, RequestConfiguration, i); | 536 | cs_error(link, RequestConfiguration, i); |
@@ -592,11 +619,13 @@ static int multi_config(struct pcmcia_device * link) | |||
592 | cs_error(link, RequestIRQ, i); | 619 | cs_error(link, RequestIRQ, i); |
593 | link->irq.AssignedIRQ = 0; | 620 | link->irq.AssignedIRQ = 0; |
594 | } | 621 | } |
595 | /* Socket Dual IO: this enables irq's for second port */ | 622 | |
596 | if (info->multi && (info->manfid == MANFID_SOCKET)) { | 623 | /* |
597 | link->conf.Present |= PRESENT_EXT_STATUS; | 624 | * Apply any configuration quirks. |
598 | link->conf.ExtStatus = ESR_REQ_ATTN_ENA; | 625 | */ |
599 | } | 626 | if (info->quirk && info->quirk->config) |
627 | info->quirk->config(link); | ||
628 | |||
600 | i = pcmcia_request_configuration(link, &link->conf); | 629 | i = pcmcia_request_configuration(link, &link->conf); |
601 | if (i != CS_SUCCESS) { | 630 | if (i != CS_SUCCESS) { |
602 | cs_error(link, RequestConfiguration, i); | 631 | cs_error(link, RequestConfiguration, i); |