Skip to content

Commit

Permalink
Merge branch 'urgent' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/brodo/pcmcia-2.6

* 'urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6:
  pcmcia: re-enable Zoomed Video support
  cm4000_cs: Fix undefined ops warning
  pcmcia vs. MECR on pxa25x/sa1111
  drivers/char/pcmcia/ipwireless/main.c: Convert release_resource to release_region/release_mem_region
  • Loading branch information
Linus Torvalds committed Feb 22, 2011
2 parents 571020d + 33619f0 commit d8204a3
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 23 deletions.
3 changes: 1 addition & 2 deletions drivers/char/pcmcia/cm4000_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,8 +830,7 @@ static void monitor_card(unsigned long p)
test_bit(IS_ANY_T1, &dev->flags))) {
DEBUGP(4, dev, "Perform AUTOPPS\n");
set_bit(IS_AUTOPPS_ACT, &dev->flags);
ptsreq.protocol = ptsreq.protocol =
(0x01 << dev->proto);
ptsreq.protocol = (0x01 << dev->proto);
ptsreq.flags = 0x01;
ptsreq.pts1 = 0x00;
ptsreq.pts2 = 0x00;
Expand Down
52 changes: 32 additions & 20 deletions drivers/char/pcmcia/ipwireless/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ static void signalled_reboot_callback(void *callback_data)
static int ipwireless_probe(struct pcmcia_device *p_dev, void *priv_data)
{
struct ipw_dev *ipw = priv_data;
struct resource *io_resource;
int ret;

p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
Expand All @@ -92,9 +91,12 @@ static int ipwireless_probe(struct pcmcia_device *p_dev, void *priv_data)
if (ret)
return ret;

io_resource = request_region(p_dev->resource[0]->start,
resource_size(p_dev->resource[0]),
IPWIRELESS_PCCARD_NAME);
if (!request_region(p_dev->resource[0]->start,
resource_size(p_dev->resource[0]),
IPWIRELESS_PCCARD_NAME)) {
ret = -EBUSY;
goto exit;
}

p_dev->resource[2]->flags |=
WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM | WIN_ENABLE;
Expand All @@ -105,46 +107,54 @@ static int ipwireless_probe(struct pcmcia_device *p_dev, void *priv_data)

ret = pcmcia_map_mem_page(p_dev, p_dev->resource[2], p_dev->card_addr);
if (ret != 0)
goto exit2;
goto exit1;

ipw->is_v2_card = resource_size(p_dev->resource[2]) == 0x100;

ipw->attr_memory = ioremap(p_dev->resource[2]->start,
ipw->common_memory = ioremap(p_dev->resource[2]->start,
resource_size(p_dev->resource[2]));
request_mem_region(p_dev->resource[2]->start,
resource_size(p_dev->resource[2]),
IPWIRELESS_PCCARD_NAME);
if (!request_mem_region(p_dev->resource[2]->start,
resource_size(p_dev->resource[2]),
IPWIRELESS_PCCARD_NAME)) {
ret = -EBUSY;
goto exit2;
}

p_dev->resource[3]->flags |= WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_AM |
WIN_ENABLE;
p_dev->resource[3]->end = 0; /* this used to be 0x1000 */
ret = pcmcia_request_window(p_dev, p_dev->resource[3], 0);
if (ret != 0)
goto exit2;
goto exit3;

ret = pcmcia_map_mem_page(p_dev, p_dev->resource[3], 0);
if (ret != 0)
goto exit3;

ipw->attr_memory = ioremap(p_dev->resource[3]->start,
resource_size(p_dev->resource[3]));
request_mem_region(p_dev->resource[3]->start,
resource_size(p_dev->resource[3]),
IPWIRELESS_PCCARD_NAME);
if (!request_mem_region(p_dev->resource[3]->start,
resource_size(p_dev->resource[3]),
IPWIRELESS_PCCARD_NAME)) {
ret = -EBUSY;
goto exit4;
}

return 0;

exit4:
iounmap(ipw->attr_memory);
exit3:
release_mem_region(p_dev->resource[2]->start,
resource_size(p_dev->resource[2]));
exit2:
if (ipw->common_memory) {
release_mem_region(p_dev->resource[2]->start,
resource_size(p_dev->resource[2]));
iounmap(ipw->common_memory);
}
iounmap(ipw->common_memory);
exit1:
release_resource(io_resource);
release_region(p_dev->resource[0]->start,
resource_size(p_dev->resource[0]));
exit:
pcmcia_disable_device(p_dev);
return -1;
return ret;
}

static int config_ipwireless(struct ipw_dev *ipw)
Expand Down Expand Up @@ -219,6 +229,8 @@ static int config_ipwireless(struct ipw_dev *ipw)

static void release_ipwireless(struct ipw_dev *ipw)
{
release_region(ipw->link->resource[0]->start,
resource_size(ipw->link->resource[0]));
if (ipw->common_memory) {
release_mem_region(ipw->link->resource[2]->start,
resource_size(ipw->link->resource[2]));
Expand Down
2 changes: 2 additions & 0 deletions drivers/pcmcia/pcmcia_resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,8 @@ int pcmcia_enable_device(struct pcmcia_device *p_dev)
flags |= CONF_ENABLE_IOCARD;
if (flags & CONF_ENABLE_IOCARD)
s->socket.flags |= SS_IOCARD;
if (flags & CONF_ENABLE_ZVCARD)
s->socket.flags |= SS_ZVCARD | SS_IOCARD;
if (flags & CONF_ENABLE_SPKR) {
s->socket.flags |= SS_SPKR_ENA;
status = CCSR_AUDIO_ENA;
Expand Down
2 changes: 1 addition & 1 deletion drivers/pcmcia/pxa2xx_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt,
}
#endif

static void pxa2xx_configure_sockets(struct device *dev)
void pxa2xx_configure_sockets(struct device *dev)
{
struct pcmcia_low_level *ops = dev->platform_data;
/*
Expand Down
1 change: 1 addition & 0 deletions drivers/pcmcia/pxa2xx_base.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
int pxa2xx_drv_pcmcia_add_one(struct soc_pcmcia_socket *skt);
void pxa2xx_drv_pcmcia_ops(struct pcmcia_low_level *ops);
void pxa2xx_configure_sockets(struct device *dev);

1 change: 1 addition & 0 deletions drivers/pcmcia/pxa2xx_lubbock.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ int pcmcia_lubbock_init(struct sa1111_dev *sadev)
lubbock_set_misc_wr((1 << 15) | (1 << 14), 0);

pxa2xx_drv_pcmcia_ops(&lubbock_pcmcia_ops);
pxa2xx_configure_sockets(&sadev->dev);
ret = sa1111_pcmcia_add(sadev, &lubbock_pcmcia_ops,
pxa2xx_drv_pcmcia_add_one);
}
Expand Down
1 change: 1 addition & 0 deletions include/pcmcia/ds.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ void pcmcia_disable_device(struct pcmcia_device *p_dev);
#define CONF_ENABLE_ESR 0x0008
#define CONF_ENABLE_IOCARD 0x0010 /* auto-enabled if IO resources or IRQ
* (CONF_ENABLE_IRQ) in use */
#define CONF_ENABLE_ZVCARD 0x0020

/* flags used by pcmcia_loop_config() autoconfiguration */
#define CONF_AUTO_CHECK_VCC 0x0100 /* check for matching Vcc? */
Expand Down

0 comments on commit d8204a3

Please sign in to comment.