aboutsummaryrefslogtreecommitdiff
path: root/drivers/pcmcia
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r--drivers/pcmcia/Kconfig5
-rw-r--r--drivers/pcmcia/Makefile1
-rw-r--r--drivers/pcmcia/omap_cf.c48
-rw-r--r--drivers/pcmcia/pxa2xx_stargate2.c137
4 files changed, 14 insertions, 177 deletions
diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig
index 1740a63b814d..bf495bf0f48a 100644
--- a/drivers/pcmcia/Kconfig
+++ b/drivers/pcmcia/Kconfig
@@ -210,7 +210,7 @@ config PCMCIA_PXA2XX
depends on ARM && ARCH_PXA && PCMCIA
depends on (ARCH_LUBBOCK || MACH_MAINSTONE || PXA_SHARPSL \
|| ARCH_PXA_PALM || TRIZEPS_PCMCIA \
- || ARCOM_PCMCIA || ARCH_PXA_ESERIES || MACH_STARGATE2 \
+ || ARCOM_PCMCIA || ARCH_PXA_ESERIES \
|| MACH_VPAC270 || MACH_BALLOON3 || MACH_COLIBRI \
|| MACH_COLIBRI320 || MACH_H4700)
select PCMCIA_SOC_COMMON
@@ -246,7 +246,8 @@ config PCMCIA_VRC4171
config OMAP_CF
tristate "OMAP CompactFlash Controller"
- depends on PCMCIA && ARCH_OMAP16XX
+ depends on PCMCIA
+ depends on ARCH_OMAP16XX || (ARM && COMPILE_TEST)
help
Say Y here to support the CompactFlash controller on OMAP.
Note that this doesn't support "True IDE" mode.
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile
index 2d5657cfc49c..c43267b18f55 100644
--- a/drivers/pcmcia/Makefile
+++ b/drivers/pcmcia/Makefile
@@ -56,7 +56,6 @@ pxa2xx-obj-$(CONFIG_MACH_PALMTX) += pxa2xx_palmtx.o
pxa2xx-obj-$(CONFIG_MACH_PALMTC) += pxa2xx_palmtc.o
pxa2xx-obj-$(CONFIG_MACH_PALMLD) += pxa2xx_palmld.o
pxa2xx-obj-$(CONFIG_MACH_E740) += pxa2xx_e740.o
-pxa2xx-obj-$(CONFIG_MACH_STARGATE2) += pxa2xx_stargate2.o
pxa2xx-obj-$(CONFIG_MACH_VPAC270) += pxa2xx_vpac270.o
pxa2xx-obj-$(CONFIG_MACH_BALLOON3) += pxa2xx_balloon3.o
pxa2xx-obj-$(CONFIG_MACH_COLIBRI) += pxa2xx_colibri.o
diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c
index f0b2c2d03469..1972a8f6fa8e 100644
--- a/drivers/pcmcia/omap_cf.c
+++ b/drivers/pcmcia/omap_cf.c
@@ -16,13 +16,12 @@
#include <pcmcia/ss.h>
-#include <mach/hardware.h>
#include <asm/io.h>
#include <linux/sizes.h>
-#include <mach/mux.h>
-#include <mach/tc.h>
-
+#include <linux/soc/ti/omap1-io.h>
+#include <linux/soc/ti/omap1-soc.h>
+#include <linux/soc/ti/omap1-mux.h>
/* NOTE: don't expect this to support many I/O cards. The 16xx chips have
* hard-wired timings to support Compact Flash memory cards; they won't work
@@ -205,6 +204,8 @@ static int __init omap_cf_probe(struct platform_device *pdev)
struct omap_cf_socket *cf;
int irq;
int status;
+ struct resource *res;
+ struct resource iospace = DEFINE_RES_IO(SZ_64, SZ_4K);
seg = (int) pdev->dev.platform_data;
if (seg == 0 || seg > 3)
@@ -215,6 +216,8 @@ static int __init omap_cf_probe(struct platform_device *pdev)
if (irq < 0)
return -EINVAL;
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+
cf = kzalloc(sizeof *cf, GFP_KERNEL);
if (!cf)
return -ENOMEM;
@@ -230,29 +233,12 @@ static int __init omap_cf_probe(struct platform_device *pdev)
goto fail0;
cf->irq = irq;
cf->socket.pci_irq = irq;
-
- switch (seg) {
- /* NOTE: CS0 could be configured too ... */
- case 1:
- cf->phys_cf = OMAP_CS1_PHYS;
- break;
- case 2:
- cf->phys_cf = OMAP_CS2_PHYS;
- break;
- case 3:
- cf->phys_cf = omap_cs3_phys();
- break;
- default:
- goto fail1;
- }
- cf->iomem.start = cf->phys_cf;
- cf->iomem.end = cf->iomem.end + SZ_8K - 1;
- cf->iomem.flags = IORESOURCE_MEM;
+ cf->phys_cf = res->start;
/* pcmcia layer only remaps "real" memory */
- cf->socket.io_offset = (unsigned long)
- ioremap(cf->phys_cf + SZ_4K, SZ_2K);
- if (!cf->socket.io_offset) {
+ cf->socket.io_offset = iospace.start;
+ status = pci_remap_iospace(&iospace, cf->phys_cf + SZ_4K);
+ if (status) {
status = -ENOMEM;
goto fail1;
}
@@ -273,15 +259,6 @@ static int __init omap_cf_probe(struct platform_device *pdev)
pr_info("%s: cs%d on irq %d\n", driver_name, seg, irq);
- /* NOTE: better EMIFS setup might support more cards; but the
- * TRM only shows how to affect regular flash signals, not their
- * CF/PCMCIA variants...
- */
- pr_debug("%s: cs%d, previous ccs %08x acs %08x\n", driver_name,
- seg, omap_readl(EMIFS_CCS(seg)), omap_readl(EMIFS_ACS(seg)));
- omap_writel(0x0004a1b3, EMIFS_CCS(seg)); /* synch mode 4 etc */
- omap_writel(0x00000000, EMIFS_ACS(seg)); /* OE hold/setup */
-
/* CF uses armxor_ck, which is "always" available */
pr_debug("%s: sts %04x cfg %04x control %04x %s\n", driver_name,
@@ -309,8 +286,6 @@ static int __init omap_cf_probe(struct platform_device *pdev)
fail2:
release_mem_region(cf->phys_cf, SZ_8K);
fail1:
- if (cf->socket.io_offset)
- iounmap((void __iomem *) cf->socket.io_offset);
free_irq(irq, cf);
fail0:
kfree(cf);
@@ -324,7 +299,6 @@ static int __exit omap_cf_remove(struct platform_device *pdev)
cf->active = 0;
pcmcia_unregister_socket(&cf->socket);
del_timer_sync(&cf->timer);
- iounmap((void __iomem *) cf->socket.io_offset);
release_mem_region(cf->phys_cf, SZ_8K);
free_irq(cf->irq, cf);
kfree(cf);
diff --git a/drivers/pcmcia/pxa2xx_stargate2.c b/drivers/pcmcia/pxa2xx_stargate2.c
deleted file mode 100644
index 6efb7f814b4a..000000000000
--- a/drivers/pcmcia/pxa2xx_stargate2.c
+++ /dev/null
@@ -1,137 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * linux/drivers/pcmcia/pxa2xx_stargate2.c
- *
- * Stargate 2 PCMCIA specific routines.
- *
- * Created: December 6, 2005
- * Author: Ed C. Epp
- * Copyright: Intel Corp 2005
- * Jonathan Cameron <jic23@cam.ac.uk> 2009
- */
-
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/interrupt.h>
-#include <linux/delay.h>
-#include <linux/platform_device.h>
-#include <linux/gpio.h>
-
-#include <pcmcia/ss.h>
-
-#include <asm/irq.h>
-#include <asm/mach-types.h>
-
-#include "soc_common.h"
-
-#define SG2_S0_POWER_CTL 108
-#define SG2_S0_GPIO_RESET 82
-#define SG2_S0_GPIO_DETECT 53
-#define SG2_S0_GPIO_READY 81
-
-static struct gpio sg2_pcmcia_gpios[] = {
- { SG2_S0_GPIO_RESET, GPIOF_OUT_INIT_HIGH, "PCMCIA Reset" },
- { SG2_S0_POWER_CTL, GPIOF_OUT_INIT_HIGH, "PCMCIA Power Ctrl" },
-};
-
-static int sg2_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
-{
- skt->stat[SOC_STAT_CD].gpio = SG2_S0_GPIO_DETECT;
- skt->stat[SOC_STAT_CD].name = "PCMCIA0 CD";
- skt->stat[SOC_STAT_RDY].gpio = SG2_S0_GPIO_READY;
- skt->stat[SOC_STAT_RDY].name = "PCMCIA0 RDY";
- return 0;
-}
-
-static void sg2_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
- struct pcmcia_state *state)
-{
- state->bvd1 = 0; /* not available - battery detect on card */
- state->bvd2 = 0; /* not available */
- state->vs_3v = 1; /* not available - voltage detect for card */
- state->vs_Xv = 0; /* not available */
-}
-
-static int sg2_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
- const socket_state_t *state)
-{
- /* Enable card power */
- switch (state->Vcc) {
- case 0:
- /* sets power ctl register high */
- gpio_set_value(SG2_S0_POWER_CTL, 1);
- break;
- case 33:
- case 50:
- /* sets power control register low (clear) */
- gpio_set_value(SG2_S0_POWER_CTL, 0);
- msleep(100);
- break;
- default:
- pr_err("%s(): bad Vcc %u\n",
- __func__, state->Vcc);
- return -1;
- }
-
- /* reset */
- gpio_set_value(SG2_S0_GPIO_RESET, !!(state->flags & SS_RESET));
-
- return 0;
-}
-
-static struct pcmcia_low_level sg2_pcmcia_ops __initdata = {
- .owner = THIS_MODULE,
- .hw_init = sg2_pcmcia_hw_init,
- .socket_state = sg2_pcmcia_socket_state,
- .configure_socket = sg2_pcmcia_configure_socket,
- .nr = 1,
-};
-
-static struct platform_device *sg2_pcmcia_device;
-
-static int __init sg2_pcmcia_init(void)
-{
- int ret;
-
- if (!machine_is_stargate2())
- return -ENODEV;
-
- sg2_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1);
- if (!sg2_pcmcia_device)
- return -ENOMEM;
-
- ret = gpio_request_array(sg2_pcmcia_gpios, ARRAY_SIZE(sg2_pcmcia_gpios));
- if (ret)
- goto error_put_platform_device;
-
- ret = platform_device_add_data(sg2_pcmcia_device,
- &sg2_pcmcia_ops,
- sizeof(sg2_pcmcia_ops));
- if (ret)
- goto error_free_gpios;
-
- ret = platform_device_add(sg2_pcmcia_device);
- if (ret)
- goto error_free_gpios;
-
- return 0;
-error_free_gpios:
- gpio_free_array(sg2_pcmcia_gpios, ARRAY_SIZE(sg2_pcmcia_gpios));
-error_put_platform_device:
- platform_device_put(sg2_pcmcia_device);
-
- return ret;
-}
-
-static void __exit sg2_pcmcia_exit(void)
-{
- platform_device_unregister(sg2_pcmcia_device);
- gpio_free_array(sg2_pcmcia_gpios, ARRAY_SIZE(sg2_pcmcia_gpios));
-}
-
-fs_initcall(sg2_pcmcia_init);
-module_exit(sg2_pcmcia_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:pxa2xx-pcmcia");