diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-07-29 20:35:47 +0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-09-29 19:20:22 +0400 |
commit | 7feabb6412ea23edd298c0fa90e5aa6733eb4a42 (patch) | |
tree | bfafe961aeb5449a71fbb389172b3a6c68b56e7c /drivers/pcmcia/pcmcia_resource.c | |
parent | 37979e1546a790c44adbc7f27a85569944480ebc (diff) | |
download | linux-7feabb6412ea23edd298c0fa90e5aa6733eb4a42.tar.xz |
pcmcia: move config_{base,index,regs} to struct pcmcia_device
Several drivers prefer to explicitly set config_{base,index,regs},
formerly known as ConfigBase, ConfigIndex and Present. Instead of
passing these values inside config_req_t, store it in struct
pcmcia_device.
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.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c index 6210e1c2b432..a1fb0dc1a71f 100644 --- a/drivers/pcmcia/pcmcia_resource.c +++ b/drivers/pcmcia/pcmcia_resource.c @@ -168,7 +168,7 @@ static int pcmcia_access_config(struct pcmcia_device *p_dev, return -EACCES; } - addr = (c->ConfigBase + where) >> 1; + addr = (p_dev->config_base + where) >> 1; ret = accessf(s, 1, addr, 1, val); @@ -443,6 +443,7 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev, pccard_io_map iomap; unsigned char status = 0; unsigned char ext_status = 0; + unsigned char option = 0; if (!(s->state & SOCKET_PRESENT)) return -ENODEV; @@ -473,7 +474,7 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev, if (req->Attributes & CONF_ENABLE_SPKR) { s->socket.flags |= SS_SPKR_ENA; status = CCSR_AUDIO_ENA; - if (!(req->Present & PRESENT_STATUS)) + if (!(p_dev->config_regs & PRESENT_STATUS)) dev_warn(&p_dev->dev, "speaker requested, but " "PRESENT_STATUS not set!\n"); } @@ -482,54 +483,53 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev, else s->socket.io_irq = 0; if (req->Attributes & CONF_ENABLE_ESR) { - req->Present |= PRESENT_EXT_STATUS; + p_dev->config_regs |= PRESENT_EXT_STATUS; ext_status = ESR_REQ_ATTN_ENA; } s->ops->set_socket(s, &s->socket); s->lock_count++; /* Set up CIS configuration registers */ - base = c->ConfigBase = req->ConfigBase; - c->CardValues = req->Present; - if (req->Present & PRESENT_COPY) { + base = p_dev->config_base; + if (p_dev->config_regs & PRESENT_COPY) { u16 tmp = 0; dev_dbg(&p_dev->dev, "clearing CISREG_SCR\n"); pcmcia_write_cis_mem(s, 1, (base + CISREG_SCR)>>1, 1, &tmp); } - if (req->Present & PRESENT_PIN_REPLACE) { + if (p_dev->config_regs & PRESENT_PIN_REPLACE) { u16 tmp = 0; dev_dbg(&p_dev->dev, "clearing CISREG_PRR\n"); pcmcia_write_cis_mem(s, 1, (base + CISREG_PRR)>>1, 1, &tmp); } - if (req->Present & PRESENT_OPTION) { + if (p_dev->config_regs & PRESENT_OPTION) { if (s->functions == 1) { - c->Option = req->ConfigIndex & COR_CONFIG_MASK; + option = p_dev->config_index & COR_CONFIG_MASK; } else { - c->Option = req->ConfigIndex & COR_MFC_CONFIG_MASK; - c->Option |= COR_FUNC_ENA|COR_IREQ_ENA; - if (req->Present & PRESENT_IOBASE_0) - c->Option |= COR_ADDR_DECODE; + option = p_dev->config_index & COR_MFC_CONFIG_MASK; + option |= COR_FUNC_ENA|COR_IREQ_ENA; + if (p_dev->config_regs & PRESENT_IOBASE_0) + option |= COR_ADDR_DECODE; } if ((req->Attributes & CONF_ENABLE_IRQ) && !(req->Attributes & CONF_ENABLE_PULSE_IRQ)) - c->Option |= COR_LEVEL_REQ; - pcmcia_write_cis_mem(s, 1, (base + CISREG_COR)>>1, 1, &c->Option); + option |= COR_LEVEL_REQ; + pcmcia_write_cis_mem(s, 1, (base + CISREG_COR)>>1, 1, &option); mdelay(40); } - if (req->Present & PRESENT_STATUS) + if (p_dev->config_regs & PRESENT_STATUS) pcmcia_write_cis_mem(s, 1, (base + CISREG_CCSR)>>1, 1, &status); - if (req->Present & PRESENT_EXT_STATUS) + if (p_dev->config_regs & PRESENT_EXT_STATUS) pcmcia_write_cis_mem(s, 1, (base + CISREG_ESR)>>1, 1, &ext_status); - if (req->Present & PRESENT_IOBASE_0) { + if (p_dev->config_regs & PRESENT_IOBASE_0) { u8 b = c->io[0].start & 0xff; pcmcia_write_cis_mem(s, 1, (base + CISREG_IOBASE_0)>>1, 1, &b); b = (c->io[0].start >> 8) & 0xff; pcmcia_write_cis_mem(s, 1, (base + CISREG_IOBASE_1)>>1, 1, &b); } - if (req->Present & PRESENT_IOSIZE) { + if (p_dev->config_regs & PRESENT_IOSIZE) { u8 b = resource_size(&c->io[0]) + resource_size(&c->io[1]) - 1; pcmcia_write_cis_mem(s, 1, (base + CISREG_IOSIZE)>>1, 1, &b); } |