diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-07-29 10:19:39 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-09-29 11:20:22 -0400 |
commit | fc301101034c06bf56a7f71bf682c48909e401a4 (patch) | |
tree | f1faa456d436515d73679bb12587967efba05e7c /drivers/pcmcia/pcmcia_resource.c | |
parent | 1a4a046030ade0f57b8f3b476d61c7c35d894b66 (diff) |
pcmcia: simplify Status, ExtStatus register access
The Status (CISREG_CCSR) and ExtStatus (CISREG_ESR) registers were
only accessed to enable audio output for some drivers and IRQ for
serial_cs.c. The former also required setting config_req_t.Attributes
to CONF_ENABLE_SPKR; the latter can be simplified to setting this
field to CONF_ENABLE_ESR.
CC: netdev@vger.kernel.org
CC: linux-wireless@vger.kernel.org
CC: linux-serial@vger.kernel.org
CC: linux-scsi@vger.kernel.org
Tested-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia/pcmcia_resource.c')
-rw-r--r-- | drivers/pcmcia/pcmcia_resource.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c index 28717eea7c57..8834bb415d38 100644 --- a/drivers/pcmcia/pcmcia_resource.c +++ b/drivers/pcmcia/pcmcia_resource.c | |||
@@ -441,6 +441,8 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev, | |||
441 | struct pcmcia_socket *s = p_dev->socket; | 441 | struct pcmcia_socket *s = p_dev->socket; |
442 | config_t *c; | 442 | config_t *c; |
443 | pccard_io_map iomap; | 443 | pccard_io_map iomap; |
444 | unsigned char status = 0; | ||
445 | unsigned char ext_status = 0; | ||
444 | 446 | ||
445 | if (!(s->state & SOCKET_PRESENT)) | 447 | if (!(s->state & SOCKET_PRESENT)) |
446 | return -ENODEV; | 448 | return -ENODEV; |
@@ -476,12 +478,21 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev, | |||
476 | s->socket.flags |= SS_ZVCARD | SS_IOCARD; | 478 | s->socket.flags |= SS_ZVCARD | SS_IOCARD; |
477 | if (req->Attributes & CONF_ENABLE_DMA) | 479 | if (req->Attributes & CONF_ENABLE_DMA) |
478 | s->socket.flags |= SS_DMA_MODE; | 480 | s->socket.flags |= SS_DMA_MODE; |
479 | if (req->Attributes & CONF_ENABLE_SPKR) | 481 | if (req->Attributes & CONF_ENABLE_SPKR) { |
480 | s->socket.flags |= SS_SPKR_ENA; | 482 | s->socket.flags |= SS_SPKR_ENA; |
483 | status = CCSR_AUDIO_ENA; | ||
484 | if (!(req->Present & PRESENT_STATUS)) | ||
485 | dev_warn(&p_dev->dev, "speaker requested, but " | ||
486 | "PRESENT_STATUS not set!\n"); | ||
487 | } | ||
481 | if (req->Attributes & CONF_ENABLE_IRQ) | 488 | if (req->Attributes & CONF_ENABLE_IRQ) |
482 | s->socket.io_irq = s->pcmcia_irq; | 489 | s->socket.io_irq = s->pcmcia_irq; |
483 | else | 490 | else |
484 | s->socket.io_irq = 0; | 491 | s->socket.io_irq = 0; |
492 | if (req->Attributes & CONF_ENABLE_ESR) { | ||
493 | req->Present |= PRESENT_EXT_STATUS; | ||
494 | ext_status = ESR_REQ_ATTN_ENA; | ||
495 | } | ||
485 | s->ops->set_socket(s, &s->socket); | 496 | s->ops->set_socket(s, &s->socket); |
486 | s->lock_count++; | 497 | s->lock_count++; |
487 | 498 | ||
@@ -513,14 +524,13 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev, | |||
513 | pcmcia_write_cis_mem(s, 1, (base + CISREG_COR)>>1, 1, &c->Option); | 524 | pcmcia_write_cis_mem(s, 1, (base + CISREG_COR)>>1, 1, &c->Option); |
514 | mdelay(40); | 525 | mdelay(40); |
515 | } | 526 | } |
516 | if (req->Present & PRESENT_STATUS) { | 527 | if (req->Present & PRESENT_STATUS) |
517 | c->Status = req->Status; | 528 | pcmcia_write_cis_mem(s, 1, (base + CISREG_CCSR)>>1, 1, &status); |
518 | pcmcia_write_cis_mem(s, 1, (base + CISREG_CCSR)>>1, 1, &c->Status); | 529 | |
519 | } | 530 | if (req->Present & PRESENT_EXT_STATUS) |
520 | if (req->Present & PRESENT_EXT_STATUS) { | 531 | pcmcia_write_cis_mem(s, 1, (base + CISREG_ESR)>>1, 1, |
521 | c->ExtStatus = req->ExtStatus; | 532 | &ext_status); |
522 | pcmcia_write_cis_mem(s, 1, (base + CISREG_ESR)>>1, 1, &c->ExtStatus); | 533 | |
523 | } | ||
524 | if (req->Present & PRESENT_IOBASE_0) { | 534 | if (req->Present & PRESENT_IOBASE_0) { |
525 | u8 b = c->io[0].start & 0xff; | 535 | u8 b = c->io[0].start & 0xff; |
526 | pcmcia_write_cis_mem(s, 1, (base + CISREG_IOBASE_0)>>1, 1, &b); | 536 | pcmcia_write_cis_mem(s, 1, (base + CISREG_IOBASE_0)>>1, 1, &b); |