aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/pcmcia_resource.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2010-07-29 13:27:09 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2010-09-29 11:20:23 -0400
commit1ac71e5a35eebee60cdcf15b3980bd94498f037b (patch)
tree22fa9342ccccce6a774af029ce51a526e55f8180 /drivers/pcmcia/pcmcia_resource.c
parent7feabb6412ea23edd298c0fa90e5aa6733eb4a42 (diff)
pcmcia: convert pcmcia_request_configuration to pcmcia_enable_device
pcmcia_enable_device() now replaces pcmcia_request_configuration(). Instead of config_req_t, all necessary flags are either passed as a parameter to pcmcia_enable_device(), or (in rare circumstances) set in struct pcmcia_device -> flags. With the last remaining user of include/pcmcia/cs.h gone, remove all references. CC: netdev@vger.kernel.org CC: linux-wireless@vger.kernel.org CC: linux-ide@vger.kernel.org CC: linux-usb@vger.kernel.org CC: laforge@gnumonks.org CC: linux-mtd@lists.infradead.org CC: alsa-devel@alsa-project.org CC: linux-serial@vger.kernel.org CC: Jiri Kosina <jkosina@suse.cz> CC: linux-scsi@vger.kernel.org Acked-by: Gustavo F. Padovan <padovan@profusion.mobi> (for drivers/bluetooth) 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.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index a1fb0dc1a71f..28de5e6e164c 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -26,7 +26,6 @@
26#include <asm/irq.h> 26#include <asm/irq.h>
27 27
28#include <pcmcia/ss.h> 28#include <pcmcia/ss.h>
29#include <pcmcia/cs.h>
30#include <pcmcia/cistpl.h> 29#include <pcmcia/cistpl.h>
31#include <pcmcia/cisreg.h> 30#include <pcmcia/cisreg.h>
32#include <pcmcia/ds.h> 31#include <pcmcia/ds.h>
@@ -230,7 +229,7 @@ EXPORT_SYMBOL(pcmcia_map_mem_page);
230 * pcmcia_fixup_iowidth() - reduce io width to 8bit 229 * pcmcia_fixup_iowidth() - reduce io width to 8bit
231 * 230 *
232 * pcmcia_fixup_iowidth() allows a PCMCIA device driver to reduce the 231 * pcmcia_fixup_iowidth() allows a PCMCIA device driver to reduce the
233 * IO width to 8bit after having called pcmcia_request_configuration() 232 * IO width to 8bit after having called pcmcia_enable_device()
234 * previously. 233 * previously.
235 */ 234 */
236int pcmcia_fixup_iowidth(struct pcmcia_device *p_dev) 235int pcmcia_fixup_iowidth(struct pcmcia_device *p_dev)
@@ -278,7 +277,7 @@ EXPORT_SYMBOL(pcmcia_fixup_iowidth);
278 * pcmcia_fixup_vpp() - set Vpp to a new voltage level 277 * pcmcia_fixup_vpp() - set Vpp to a new voltage level
279 * 278 *
280 * pcmcia_fixup_vpp() allows a PCMCIA device driver to set Vpp to 279 * pcmcia_fixup_vpp() allows a PCMCIA device driver to set Vpp to
281 * a new voltage level between calls to pcmcia_request_configuration() 280 * a new voltage level between calls to pcmcia_enable_device()
282 * and pcmcia_disable_device(). 281 * and pcmcia_disable_device().
283 */ 282 */
284int pcmcia_fixup_vpp(struct pcmcia_device *p_dev, unsigned char new_vpp) 283int pcmcia_fixup_vpp(struct pcmcia_device *p_dev, unsigned char new_vpp)
@@ -432,18 +431,21 @@ int pcmcia_release_window(struct pcmcia_device *p_dev, struct resource *res)
432} /* pcmcia_release_window */ 431} /* pcmcia_release_window */
433EXPORT_SYMBOL(pcmcia_release_window); 432EXPORT_SYMBOL(pcmcia_release_window);
434 433
435 434/**
436int pcmcia_request_configuration(struct pcmcia_device *p_dev, 435 * pcmcia_enable_device() - set up and activate a PCMCIA device
437 config_req_t *req) 436 *
437 */
438int pcmcia_enable_device(struct pcmcia_device *p_dev)
438{ 439{
439 int i; 440 int i;
440 u_int base; 441 unsigned int base;
441 struct pcmcia_socket *s = p_dev->socket; 442 struct pcmcia_socket *s = p_dev->socket;
442 config_t *c; 443 config_t *c;
443 pccard_io_map iomap; 444 pccard_io_map iomap;
444 unsigned char status = 0; 445 unsigned char status = 0;
445 unsigned char ext_status = 0; 446 unsigned char ext_status = 0;
446 unsigned char option = 0; 447 unsigned char option = 0;
448 unsigned int flags = p_dev->config_flags;
447 449
448 if (!(s->state & SOCKET_PRESENT)) 450 if (!(s->state & SOCKET_PRESENT))
449 return -ENODEV; 451 return -ENODEV;
@@ -466,23 +468,20 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev,
466 } 468 }
467 469
468 /* Pick memory or I/O card, DMA mode, interrupt */ 470 /* Pick memory or I/O card, DMA mode, interrupt */
469 c->Attributes = req->Attributes;
470 if (p_dev->_io) 471 if (p_dev->_io)
471 s->socket.flags |= SS_IOCARD; 472 s->socket.flags |= SS_IOCARD;
472 if (req->Attributes & CONF_ENABLE_DMA) 473 if (flags & CONF_ENABLE_SPKR) {
473 s->socket.flags |= SS_DMA_MODE;
474 if (req->Attributes & CONF_ENABLE_SPKR) {
475 s->socket.flags |= SS_SPKR_ENA; 474 s->socket.flags |= SS_SPKR_ENA;
476 status = CCSR_AUDIO_ENA; 475 status = CCSR_AUDIO_ENA;
477 if (!(p_dev->config_regs & PRESENT_STATUS)) 476 if (!(p_dev->config_regs & PRESENT_STATUS))
478 dev_warn(&p_dev->dev, "speaker requested, but " 477 dev_warn(&p_dev->dev, "speaker requested, but "
479 "PRESENT_STATUS not set!\n"); 478 "PRESENT_STATUS not set!\n");
480 } 479 }
481 if (req->Attributes & CONF_ENABLE_IRQ) 480 if (flags & CONF_ENABLE_IRQ)
482 s->socket.io_irq = s->pcmcia_irq; 481 s->socket.io_irq = s->pcmcia_irq;
483 else 482 else
484 s->socket.io_irq = 0; 483 s->socket.io_irq = 0;
485 if (req->Attributes & CONF_ENABLE_ESR) { 484 if (flags & CONF_ENABLE_ESR) {
486 p_dev->config_regs |= PRESENT_EXT_STATUS; 485 p_dev->config_regs |= PRESENT_EXT_STATUS;
487 ext_status = ESR_REQ_ATTN_ENA; 486 ext_status = ESR_REQ_ATTN_ENA;
488 } 487 }
@@ -510,8 +509,8 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev,
510 if (p_dev->config_regs & PRESENT_IOBASE_0) 509 if (p_dev->config_regs & PRESENT_IOBASE_0)
511 option |= COR_ADDR_DECODE; 510 option |= COR_ADDR_DECODE;
512 } 511 }
513 if ((req->Attributes & CONF_ENABLE_IRQ) && 512 if ((flags & CONF_ENABLE_IRQ) &&
514 !(req->Attributes & CONF_ENABLE_PULSE_IRQ)) 513 !(flags & CONF_ENABLE_PULSE_IRQ))
515 option |= COR_LEVEL_REQ; 514 option |= COR_LEVEL_REQ;
516 pcmcia_write_cis_mem(s, 1, (base + CISREG_COR)>>1, 1, &option); 515 pcmcia_write_cis_mem(s, 1, (base + CISREG_COR)>>1, 1, &option);
517 mdelay(40); 516 mdelay(40);
@@ -560,8 +559,8 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev,
560 p_dev->_locked = 1; 559 p_dev->_locked = 1;
561 mutex_unlock(&s->ops_mutex); 560 mutex_unlock(&s->ops_mutex);
562 return 0; 561 return 0;
563} /* pcmcia_request_configuration */ 562} /* pcmcia_enable_device */
564EXPORT_SYMBOL(pcmcia_request_configuration); 563EXPORT_SYMBOL(pcmcia_enable_device);
565 564
566 565
567/** 566/**