[PATCH 6/6] Alchemy: XXS1500 PCMCIA driver rewrite

2009-10-04 Thread Manuel Lauss
Rewritten XXS1500 PCMCIA socket driver, standalone (doesn't
depend on au1000_generic.c) and added carddetect IRQ support.

Cc: Florian Fainelli flor...@openwrt.org
Cc: Linux-PCMCIA linux-pcmcia@lists.infradead.org
Signed-off-by: Manuel Lauss manuel.la...@gmail.com
---
Compile-tested only; I don't have hardware to test,
CC'ing Florian, he might still have one.

V2: this one depends on the previous db1xxx_ss.c patch to apply
cleanly; no other changes.

 arch/mips/alchemy/xxs1500/Makefile  |2 +-
 arch/mips/alchemy/xxs1500/board_setup.c |   16 --
 arch/mips/alchemy/xxs1500/platform.c|   63 ++
 drivers/pcmcia/Kconfig  |   10 +
 drivers/pcmcia/Makefile |3 +-
 drivers/pcmcia/au1000_xxs1500.c |  188 
 drivers/pcmcia/xxs1500_ss.c |  357 +++
 7 files changed, 433 insertions(+), 206 deletions(-)
 create mode 100644 arch/mips/alchemy/xxs1500/platform.c
 delete mode 100644 drivers/pcmcia/au1000_xxs1500.c
 create mode 100644 drivers/pcmcia/xxs1500_ss.c

diff --git a/arch/mips/alchemy/xxs1500/Makefile 
b/arch/mips/alchemy/xxs1500/Makefile
index 545d8f5..68671c2 100644
--- a/arch/mips/alchemy/xxs1500/Makefile
+++ b/arch/mips/alchemy/xxs1500/Makefile
@@ -5,4 +5,4 @@
 # Makefile for MyCable XXS1500 board.
 #
 
-lib-y := init.o board_setup.o
+lib-y := init.o board_setup.o platform.o
diff --git a/arch/mips/alchemy/xxs1500/board_setup.c 
b/arch/mips/alchemy/xxs1500/board_setup.c
index cad14f8..eb31350 100644
--- a/arch/mips/alchemy/xxs1500/board_setup.c
+++ b/arch/mips/alchemy/xxs1500/board_setup.c
@@ -69,22 +69,6 @@ void __init board_setup(void)
/* Enable DTR = USB power up */
au_writel(0x01, UART3_ADDR + UART_MCR); /* UART_MCR_DTR is 0x01??? */
 
-#ifdef CONFIG_PCMCIA_XXS1500
-   /* GPIO 0, 1, and 4 are inputs */
-   alchemy_gpio_direction_input(0);
-   alchemy_gpio_direction_input(1);
-   alchemy_gpio_direction_input(4);
-
-   /* GPIO2 208/9/10/11 are inputs */
-   alchemy_gpio_direction_input(208);
-   alchemy_gpio_direction_input(209);
-   alchemy_gpio_direction_input(210);
-   alchemy_gpio_direction_input(211);
-
-   /* Turn off power */
-   alchemy_gpio_direction_output(214, 0);
-#endif
-
 #ifdef CONFIG_PCI
 #if defined(__MIPSEB__)
au_writel(0xf | (2  6) | (1  4), Au1500_PCI_CFG);
diff --git a/arch/mips/alchemy/xxs1500/platform.c 
b/arch/mips/alchemy/xxs1500/platform.c
new file mode 100644
index 000..c14dcaa
--- /dev/null
+++ b/arch/mips/alchemy/xxs1500/platform.c
@@ -0,0 +1,63 @@
+/*
+ * XXS1500 board platform device registration
+ *
+ * Copyright (C) 2009 Manuel Lauss
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include linux/init.h
+#include linux/platform_device.h
+
+#include asm/mach-au1x00/au1000.h
+
+static struct resource xxs1500_pcmcia_res[] = {
+   {
+   .name   = pseudo-io,
+   .flags  = IORESOURCE_MEM,
+   .start  = PCMCIA_IO_PSEUDO_PHYS,
+   .end= PCMCIA_IO_PSEUDO_PHYS + 0x0004 - 1,
+   },
+   {
+   .name   = pseudo-attr,
+   .flags  = IORESOURCE_MEM,
+   .start  = PCMCIA_ATTR_PSEUDO_PHYS,
+   .end= PCMCIA_ATTR_PSEUDO_PHYS + 0x0004 - 1,
+   },
+   {
+   .name   = pseudo-mem,
+   .flags  = IORESOURCE_MEM,
+   .start  = PCMCIA_IO_PSEUDO_PHYS,
+   .end= PCMCIA_IO_PSEUDO_PHYS + 0x0004 - 1,
+   },
+};
+
+static struct platform_device xxs1500_pcmcia_dev = {
+   .name   = xxs1500_pcmcia,
+   .id = -1,
+   .num_resources  = ARRAY_SIZE(xxs1500_pcmcia_res),
+   .resource   = xxs1500_pcmcia_res,
+};
+
+static struct platform_device *xxs1500_devs[] __initdata = {
+   xxs1500_pcmcia_dev,
+};
+
+static int __init xxs1500_dev_init(void)
+{
+   return platform_add_devices(xxs1500_devs,
+   ARRAY_SIZE(xxs1500_devs));
+}
+device_initcall(xxs1500_dev_init);
diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig
index 22f6814..5ed3b93 100644
--- a/drivers/pcmcia/Kconfig
+++ b/drivers/pcmcia/Kconfig
@@ -203,6 +203,16 @@ config PCMCIA_ALCHEMY_DEVBOARD
 
  This driver is also 

[RFC PATCH 08/10] PCMCIA: soc_common: remove 'dev' member from soc_pcmcia_socket

2009-10-04 Thread Russell King
The 'dev' member is now only ever written, so we can safely remove it.

Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk
---
 drivers/pcmcia/pxa2xx_base.c |1 -
 drivers/pcmcia/sa11xx_base.c |1 -
 drivers/pcmcia/soc_common.h  |1 -
 3 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c
index 4421dd0..c4bdbe9 100644
--- a/drivers/pcmcia/pxa2xx_base.c
+++ b/drivers/pcmcia/pxa2xx_base.c
@@ -288,7 +288,6 @@ int __pxa2xx_drv_pcmcia_probe(struct device *dev)
 
skt-nr = ops-first + i;
skt-irq = NO_IRQ;
-   skt-dev = dev;
skt-ops = ops;
skt-socket.owner = ops-owner;
skt-socket.dev.parent = dev;
diff --git a/drivers/pcmcia/sa11xx_base.c b/drivers/pcmcia/sa11xx_base.c
index 4db8149..ac99872 100644
--- a/drivers/pcmcia/sa11xx_base.c
+++ b/drivers/pcmcia/sa11xx_base.c
@@ -236,7 +236,6 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct 
pcmcia_low_level *ops,
 
skt-nr = first + i;
skt-irq = NO_IRQ;
-   skt-dev = dev;
skt-ops = ops;
skt-socket.owner = ops-owner;
skt-socket.dev.parent = dev;
diff --git a/drivers/pcmcia/soc_common.h b/drivers/pcmcia/soc_common.h
index f7533dc..4fb06f7 100644
--- a/drivers/pcmcia/soc_common.h
+++ b/drivers/pcmcia/soc_common.h
@@ -30,7 +30,6 @@ struct soc_pcmcia_socket {
/*
 * Info from low level handler
 */
-   struct device   *dev;
unsigned intnr;
unsigned intirq;
 
-- 
1.6.2.5


___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


[RFC PATCH 10/10] PCMCIA: stop duplicating pci_irq in soc_pcmcia_socket

2009-10-04 Thread Russell King
skt-irq is a mere duplication of pcmcia_socket's pci_irq member.
Get rid of it.

Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk
---
 drivers/pcmcia/pxa2xx_base.c  |2 +-
 drivers/pcmcia/pxa2xx_cm_x255.c   |2 +-
 drivers/pcmcia/pxa2xx_cm_x270.c   |2 +-
 drivers/pcmcia/pxa2xx_e740.c  |2 +-
 drivers/pcmcia/pxa2xx_mainstone.c |2 +-
 drivers/pcmcia/pxa2xx_palmld.c|2 +-
 drivers/pcmcia/pxa2xx_palmtx.c|2 +-
 drivers/pcmcia/pxa2xx_sharpsl.c   |2 +-
 drivers/pcmcia/pxa2xx_trizeps4.c  |4 ++--
 drivers/pcmcia/pxa2xx_viper.c |2 +-
 drivers/pcmcia/sa1100_assabet.c   |2 +-
 drivers/pcmcia/sa1100_cerf.c  |2 +-
 drivers/pcmcia/sa1100_h3600.c |4 ++--
 drivers/pcmcia/sa1100_shannon.c   |2 +-
 drivers/pcmcia/sa1100_simpad.c|2 +-
 drivers/pcmcia/sa_generic.c   |2 +-
 drivers/pcmcia/sa11xx_base.c  |2 +-
 drivers/pcmcia/soc_common.c   |8 
 drivers/pcmcia/soc_common.h   |1 -
 19 files changed, 23 insertions(+), 24 deletions(-)

diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c
index c4bdbe9..c6af049 100644
--- a/drivers/pcmcia/pxa2xx_base.c
+++ b/drivers/pcmcia/pxa2xx_base.c
@@ -287,10 +287,10 @@ int __pxa2xx_drv_pcmcia_probe(struct device *dev)
skt = sinfo-skt[i];
 
skt-nr = ops-first + i;
-   skt-irq = NO_IRQ;
skt-ops = ops;
skt-socket.owner = ops-owner;
skt-socket.dev.parent = dev;
+   skt-socket.pci_irq = NO_IRQ;
 
ret = pxa2xx_drv_pcmcia_add_one(skt);
if (ret)
diff --git a/drivers/pcmcia/pxa2xx_cm_x255.c b/drivers/pcmcia/pxa2xx_cm_x255.c
index 5143a76..05913d0 100644
--- a/drivers/pcmcia/pxa2xx_cm_x255.c
+++ b/drivers/pcmcia/pxa2xx_cm_x255.c
@@ -44,7 +44,7 @@ static int cmx255_pcmcia_hw_init(struct soc_pcmcia_socket 
*skt)
return ret;
gpio_direction_output(GPIO_PCMCIA_RESET, 0);
 
-   skt-irq = skt-nr == 0 ? PCMCIA_S0_RDYINT : PCMCIA_S1_RDYINT;
+   skt-socket.pci_irq = skt-nr == 0 ? PCMCIA_S0_RDYINT : 
PCMCIA_S1_RDYINT;
ret = soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
if (!ret)
gpio_free(GPIO_PCMCIA_RESET);
diff --git a/drivers/pcmcia/pxa2xx_cm_x270.c b/drivers/pcmcia/pxa2xx_cm_x270.c
index a7b943d..5662646 100644
--- a/drivers/pcmcia/pxa2xx_cm_x270.c
+++ b/drivers/pcmcia/pxa2xx_cm_x270.c
@@ -38,7 +38,7 @@ static int cmx270_pcmcia_hw_init(struct soc_pcmcia_socket 
*skt)
return ret;
gpio_direction_output(GPIO_PCMCIA_RESET, 0);
 
-   skt-irq = PCMCIA_S0_RDYINT;
+   skt-socket.pci_irq = PCMCIA_S0_RDYINT;
ret = soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
if (!ret)
gpio_free(GPIO_PCMCIA_RESET);
diff --git a/drivers/pcmcia/pxa2xx_e740.c b/drivers/pcmcia/pxa2xx_e740.c
index d09c0dc..8bfbd4d 100644
--- a/drivers/pcmcia/pxa2xx_e740.c
+++ b/drivers/pcmcia/pxa2xx_e740.c
@@ -38,7 +38,7 @@ static struct pcmcia_irqs cd_irqs[] = {
 
 static int e740_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 {
-   skt-irq = skt-nr == 0 ? IRQ_GPIO(GPIO_E740_PCMCIA_RDY0) :
+   skt-socket.pci_irq = skt-nr == 0 ? IRQ_GPIO(GPIO_E740_PCMCIA_RDY0) :
IRQ_GPIO(GPIO_E740_PCMCIA_RDY1);
 
return soc_pcmcia_request_irqs(skt, cd_irqs[skt-nr], 1);
diff --git a/drivers/pcmcia/pxa2xx_mainstone.c 
b/drivers/pcmcia/pxa2xx_mainstone.c
index 1138551..92016fe 100644
--- a/drivers/pcmcia/pxa2xx_mainstone.c
+++ b/drivers/pcmcia/pxa2xx_mainstone.c
@@ -44,7 +44,7 @@ static int mst_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 * before we enable them as outputs.
 */
 
-   skt-irq = (skt-nr == 0) ? MAINSTONE_S0_IRQ : MAINSTONE_S1_IRQ;
+   skt-socket.pci_irq = (skt-nr == 0) ? MAINSTONE_S0_IRQ : 
MAINSTONE_S1_IRQ;
return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
diff --git a/drivers/pcmcia/pxa2xx_palmld.c b/drivers/pcmcia/pxa2xx_palmld.c
index 5ba9b36..6fb6f7f 100644
--- a/drivers/pcmcia/pxa2xx_palmld.c
+++ b/drivers/pcmcia/pxa2xx_palmld.c
@@ -45,7 +45,7 @@ static int palmld_pcmcia_hw_init(struct soc_pcmcia_socket 
*skt)
if (ret)
goto err4;
 
-   skt-irq = IRQ_GPIO(GPIO_NR_PALMLD_PCMCIA_READY);
+   skt-socket.pci_irq = IRQ_GPIO(GPIO_NR_PALMLD_PCMCIA_READY);
return 0;
 
 err4:
diff --git a/drivers/pcmcia/pxa2xx_palmtx.c b/drivers/pcmcia/pxa2xx_palmtx.c
index e07b5c5..b07b247 100644
--- a/drivers/pcmcia/pxa2xx_palmtx.c
+++ b/drivers/pcmcia/pxa2xx_palmtx.c
@@ -53,7 +53,7 @@ static int palmtx_pcmcia_hw_init(struct soc_pcmcia_socket 
*skt)
if (ret)
goto err5;
 
-   skt-irq = gpio_to_irq(GPIO_NR_PALMTX_PCMCIA_READY);
+   skt-socket.pci_irq = gpio_to_irq(GPIO_NR_PALMTX_PCMCIA_READY);
return 0;
 
 err5:
diff --git a/drivers/pcmcia/pxa2xx_sharpsl.c 

[RFC PATCH 05/10] PCMCIA: sa1111: wrap soc_pcmcia_socket to contain sa1111 specific data

2009-10-04 Thread Russell King
Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk
---
 drivers/pcmcia/pxa2xx_base.c   |   19 +++
 drivers/pcmcia/pxa2xx_base.h   |3 ++
 drivers/pcmcia/pxa2xx_lubbock.c|   10 --
 drivers/pcmcia/sa1100_badge4.c |7 -
 drivers/pcmcia/sa1100_jornada720.c |   20 
 drivers/pcmcia/sa1100_neponset.c   |9 -
 drivers/pcmcia/sa_generic.c|   58 
 drivers/pcmcia/sa_generic.h|   14 
 drivers/pcmcia/sa11xx_base.c   |   21 
 drivers/pcmcia/sa11xx_base.h   |2 +
 10 files changed, 123 insertions(+), 40 deletions(-)

diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c
index bb7e862..4421dd0 100644
--- a/drivers/pcmcia/pxa2xx_base.c
+++ b/drivers/pcmcia/pxa2xx_base.c
@@ -228,7 +228,7 @@ static const char *skt_names[] = {
 #define SKT_DEV_INFO_SIZE(n) \
(sizeof(struct skt_dev_info) + (n)*sizeof(struct soc_pcmcia_socket))
 
-static int pxa2xx_drv_pcmcia_add_one(struct soc_pcmcia_socket *skt)
+int pxa2xx_drv_pcmcia_add_one(struct soc_pcmcia_socket *skt)
 {
skt-res_skt.start = _PCMCIA(skt-nr);
skt-res_skt.end = _PCMCIA(skt-nr) + PCMCIASp - 1;
@@ -253,9 +253,18 @@ static int pxa2xx_drv_pcmcia_add_one(struct 
soc_pcmcia_socket *skt)
return soc_pcmcia_add_one(skt);
 }
 
+void pxa2xx_drv_pcmcia_ops(struct pcmcia_low_level *ops)
+{
+   /* Provide our PXA2xx specific timing routines. */
+   ops-set_timing  = pxa2xx_pcmcia_set_timing;
+#ifdef CONFIG_CPU_FREQ
+   ops-frequency_change = pxa2xx_pcmcia_frequency_change;
+#endif
+}
+
 int __pxa2xx_drv_pcmcia_probe(struct device *dev)
 {
-   int i, ret;
+   int i, ret = 0;
struct pcmcia_low_level *ops;
struct skt_dev_info *sinfo;
struct soc_pcmcia_socket *skt;
@@ -265,11 +274,7 @@ int __pxa2xx_drv_pcmcia_probe(struct device *dev)
 
ops = (struct pcmcia_low_level *)dev-platform_data;
 
-   /* Provide our PXA2xx specific timing routines. */
-   ops-set_timing  = pxa2xx_pcmcia_set_timing;
-#ifdef CONFIG_CPU_FREQ
-   ops-frequency_change = pxa2xx_pcmcia_frequency_change;
-#endif
+   pxa2xx_drv_pcmcia_ops(ops);
 
sinfo = kzalloc(SKT_DEV_INFO_SIZE(ops-nr), GFP_KERNEL);
if (!sinfo)
diff --git a/drivers/pcmcia/pxa2xx_base.h b/drivers/pcmcia/pxa2xx_base.h
index 235d681..cb5efae 100644
--- a/drivers/pcmcia/pxa2xx_base.h
+++ b/drivers/pcmcia/pxa2xx_base.h
@@ -1,3 +1,6 @@
 /* temporary measure */
 extern int __pxa2xx_drv_pcmcia_probe(struct device *);
 
+int pxa2xx_drv_pcmcia_add_one(struct soc_pcmcia_socket *skt);
+void pxa2xx_drv_pcmcia_ops(struct pcmcia_low_level *ops);
+
diff --git a/drivers/pcmcia/pxa2xx_lubbock.c b/drivers/pcmcia/pxa2xx_lubbock.c
index 6cbb1b1..35d5280 100644
--- a/drivers/pcmcia/pxa2xx_lubbock.c
+++ b/drivers/pcmcia/pxa2xx_lubbock.c
@@ -32,6 +32,7 @@ static int
 lubbock_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
const socket_state_t *state)
 {
+   struct sa_pcmcia_socket *s = to_skt(skt);
unsigned int pa_dwr_mask, pa_dwr_set, misc_mask, misc_set;
int ret = 0;
 
@@ -149,7 +150,7 @@ lubbock_pcmcia_configure_socket(struct soc_pcmcia_socket 
*skt,
 
if (ret == 0) {
lubbock_set_misc_wr(misc_mask, misc_set);
-   sa_set_io(SA_DEV(skt-dev), pa_dwr_mask, pa_dwr_set);
+   sa_set_io(s-dev, pa_dwr_mask, pa_dwr_set);
}
 
 #if 1
@@ -175,7 +176,7 @@ lubbock_pcmcia_configure_socket(struct soc_pcmcia_socket 
*skt,
 * Switch to 5V,  Configure socket with 5V voltage
 */
lubbock_set_misc_wr(misc_mask, 0);
-   sa_set_io(SA_DEV(skt-dev), pa_dwr_mask, 0);
+   sa_set_io(s-dev, pa_dwr_mask, 0);
 
/*
 * It takes about 100ms to turn off Vcc.
@@ -228,8 +229,9 @@ int pcmcia_lubbock_init(struct sa_dev *sadev)
/* Set CF Socket 1 power to standby mode. */
lubbock_set_misc_wr((1  15) | (1  14), 0);
 
-   sadev-dev.platform_data = lubbock_pcmcia_ops;
-   ret = __pxa2xx_drv_pcmcia_probe(sadev-dev);
+   pxa2xx_drv_pcmcia_ops(lubbock_pcmcia_ops);
+   ret = sa_pcmcia_add(sadev, lubbock_pcmcia_ops,
+   pxa2xx_drv_pcmcia_add_one);
}
 
return ret;
diff --git a/drivers/pcmcia/sa1100_badge4.c b/drivers/pcmcia/sa1100_badge4.c
index 1ca9737..6399314 100644
--- a/drivers/pcmcia/sa1100_badge4.c
+++ b/drivers/pcmcia/sa1100_badge4.c
@@ -134,6 +134,9 @@ static struct pcmcia_low_level badge4_pcmcia_ops = {
 
.socket_init= sa_pcmcia_socket_init,
.socket_suspend = sa_pcmcia_socket_suspend,
+
+   .first  = 0,
+   .nr = 2,
 };
 
 int 

[RFC PATCH 02/10] PCMCIA: soc_common: provide single socket add/remove functionality

2009-10-04 Thread Russell King
Factor out the functionality for adding and removing a single
socket, thereby allowing SoCs to individually register each
socket.  The advantage of this approach is that SoCs can then
extend soc_pcmcia_socket as they wish.

Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk
---
 drivers/pcmcia/soc_common.c |  230 +++
 drivers/pcmcia/soc_common.h |3 +-
 2 files changed, 125 insertions(+), 108 deletions(-)

diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c
index 38c5484..8938608 100644
--- a/drivers/pcmcia/soc_common.c
+++ b/drivers/pcmcia/soc_common.c
@@ -573,7 +573,7 @@ void soc_pcmcia_enable_irqs(struct soc_pcmcia_socket *skt,
 EXPORT_SYMBOL(soc_pcmcia_enable_irqs);
 
 
-LIST_HEAD(soc_pcmcia_sockets);
+static LIST_HEAD(soc_pcmcia_sockets);
 static DEFINE_MUTEX(soc_pcmcia_sockets_lock);
 
 #ifdef CONFIG_CPU_FREQ
@@ -618,158 +618,174 @@ module_exit(soc_pcmcia_cpufreq_unregister);
 
 #endif
 
-int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level 
*ops,
-   struct skt_dev_info *sinfo)
+void soc_pcmcia_remove_one(struct soc_pcmcia_socket *skt)
 {
-   struct soc_pcmcia_socket *skt;
-   int ret, i;
-
mutex_lock(soc_pcmcia_sockets_lock);
+   del_timer_sync(skt-poll_timer);
 
-   /*
-* Initialise the per-socket structure.
-*/
-   for (i = 0; i  sinfo-nskt; i++) {
-   skt = sinfo-skt[i];
+   pcmcia_unregister_socket(skt-socket);
 
-   skt-socket.ops = soc_common_pcmcia_operations;
-   skt-socket.owner = ops-owner;
-   skt-socket.dev.parent = dev;
+   flush_scheduled_work();
 
-   init_timer(skt-poll_timer);
-   skt-poll_timer.function = soc_common_pcmcia_poll_event;
-   skt-poll_timer.data = (unsigned long)skt;
-   skt-poll_timer.expires = jiffies + SOC_PCMCIA_POLL_PERIOD;
+   skt-ops-hw_shutdown(skt);
 
-   skt-dev= dev;
-   skt-ops= ops;
+   soc_common_pcmcia_config_skt(skt, dead_socket);
 
-   ret = request_resource(iomem_resource, skt-res_skt);
-   if (ret)
-   goto out_err_1;
+   list_del(skt-node);
+   mutex_unlock(soc_pcmcia_sockets_lock);
 
-   ret = request_resource(skt-res_skt, skt-res_io);
-   if (ret)
-   goto out_err_2;
+   iounmap(skt-virt_io);
+   skt-virt_io = NULL;
+   release_resource(skt-res_attr);
+   release_resource(skt-res_mem);
+   release_resource(skt-res_io);
+   release_resource(skt-res_skt);
+}
+EXPORT_SYMBOL(soc_pcmcia_remove_one);
 
-   ret = request_resource(skt-res_skt, skt-res_mem);
-   if (ret)
-   goto out_err_3;
+int soc_pcmcia_add_one(struct soc_pcmcia_socket *skt)
+{
+   int ret;
 
-   ret = request_resource(skt-res_skt, skt-res_attr);
-   if (ret)
-   goto out_err_4;
+   init_timer(skt-poll_timer);
+   skt-poll_timer.function = soc_common_pcmcia_poll_event;
+   skt-poll_timer.data = (unsigned long)skt;
+   skt-poll_timer.expires = jiffies + SOC_PCMCIA_POLL_PERIOD;
 
-   skt-virt_io = ioremap(skt-res_io.start, 0x1);
-   if (skt-virt_io == NULL) {
-   ret = -ENOMEM;
-   goto out_err_5;
-   }
+   ret = request_resource(iomem_resource, skt-res_skt);
+   if (ret)
+   goto out_err_1;
 
-   list_add(skt-node, soc_pcmcia_sockets);
+   ret = request_resource(skt-res_skt, skt-res_io);
+   if (ret)
+   goto out_err_2;
 
-   /*
-* We initialize default socket timing here, because
-* we are not guaranteed to see a SetIOMap operation at
-* runtime.
-*/
-   ops-set_timing(skt);
+   ret = request_resource(skt-res_skt, skt-res_mem);
+   if (ret)
+   goto out_err_3;
 
-   ret = ops-hw_init(skt);
-   if (ret)
-   goto out_err_6;
+   ret = request_resource(skt-res_skt, skt-res_attr);
+   if (ret)
+   goto out_err_4;
 
-   skt-socket.features = SS_CAP_STATIC_MAP|SS_CAP_PCCARD;
-   skt-socket.resource_ops = pccard_static_ops;
-   skt-socket.irq_mask = 0;
-   skt-socket.map_size = PAGE_SIZE;
-   skt-socket.pci_irq = skt-irq;
-   skt-socket.io_offset = (unsigned long)skt-virt_io;
+   skt-virt_io = ioremap(skt-res_io.start, 0x1);
+   if (skt-virt_io == NULL) {
+   ret = -ENOMEM;
+   goto out_err_5;
+   }
 
-   skt-status = soc_common_pcmcia_skt_state(skt);
+   mutex_lock(soc_pcmcia_sockets_lock);
 
-   ret = 

[RFC PATCH 01/10] PCMCIA: soc_common: convert to a stand alone module

2009-10-04 Thread Russell King
Convert soc_common.c to be a stand alone module, rather than wrapping
it up into the individual SoC specific base modules.  In doing this,
we need to add init/exit functions for soc_common to register/remove
the cpufreq notifier.

Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk
---
 drivers/pcmcia/Kconfig  |6 ++
 drivers/pcmcia/Makefile |   10 --
 drivers/pcmcia/soc_common.c |   16 +++-
 3 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig
index fbf965b..092866f 100644
--- a/drivers/pcmcia/Kconfig
+++ b/drivers/pcmcia/Kconfig
@@ -192,9 +192,13 @@ config PCMCIA_AU1X00
tristate Au1x00 pcmcia support
depends on SOC_AU1X00  PCMCIA
 
+config PCMCIA_SOC_COMMON
+   bool
+
 config PCMCIA_SA1100
tristate SA1100 support
depends on ARM  ARCH_SA1100  PCMCIA
+   select PCMCIA_SOC_COMMON
help
  Say Y here to include support for SA11x0-based PCMCIA or CF
  sockets, found on HP iPAQs, Yopy, and other StrongARM(R)/
@@ -205,6 +209,7 @@ config PCMCIA_SA1100
 config PCMCIA_SA
tristate SA support
depends on ARM  ARCH_SA1100  SA  PCMCIA
+   select PCMCIA_SOC_COMMON
help
  Say Y  here to include support for SA-based PCMCIA or CF
  sockets, found on the Jornada 720, Graphicsmaster and other
@@ -218,6 +223,7 @@ config PCMCIA_PXA2XX
depends on (ARCH_LUBBOCK || MACH_MAINSTONE || PXA_SHARPSL \
|| MACH_ARMCORE || ARCH_PXA_PALM || TRIZEPS_PCMCIA \
|| ARCH_VIPER || ARCH_PXA_ESERIES || MACH_STARGATE2)
+   select PCMCIA_SOC_COMMON
help
  Say Y here to include support for the PXA2xx PCMCIA controller
 
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile
index 047394d..3895869 100644
--- a/drivers/pcmcia/Makefile
+++ b/drivers/pcmcia/Makefile
@@ -22,8 +22,9 @@ obj-$(CONFIG_I82365)  += i82365.o
 obj-$(CONFIG_I82092)   += i82092.o
 obj-$(CONFIG_TCIC) += tcic.o
 obj-$(CONFIG_PCMCIA_M8XX)  += m8xx_pcmcia.o
-obj-$(CONFIG_PCMCIA_SA1100)+= sa11xx_core.o sa1100_cs.o
-obj-$(CONFIG_PCMCIA_SA)+= sa11xx_core.o sa_cs.o
+obj-$(CONFIG_PCMCIA_SOC_COMMON)+= soc_common.o
+obj-$(CONFIG_PCMCIA_SA1100)+= sa11xx_base.o sa1100_cs.o
+obj-$(CONFIG_PCMCIA_SA)+= sa11xx_base.o sa_cs.o
 obj-$(CONFIG_M32R_PCC) += m32r_pcc.o
 obj-$(CONFIG_M32R_CFC) += m32r_cfc.o
 obj-$(CONFIG_PCMCIA_AU1X00)+= au1x00_ss.o
@@ -34,9 +35,6 @@ obj-$(CONFIG_BFIN_CFPCMCIA)   += 
bfin_cf_pcmcia.o
 obj-$(CONFIG_AT91_CF)  += at91_cf.o
 obj-$(CONFIG_ELECTRA_CF)   += electra_cf.o
 
-sa11xx_core-y  += soc_common.o sa11xx_base.o
-pxa2xx_core-y  += soc_common.o pxa2xx_base.o
-
 au1x00_ss-y+= au1000_generic.o
 au1x00_ss-$(CONFIG_MIPS_PB1000)+= au1000_pb1x00.o
 au1x00_ss-$(CONFIG_MIPS_PB1100)+= au1000_pb1x00.o
@@ -75,4 +73,4 @@ pxa2xx-obj-$(CONFIG_MACH_PALMLD)  += 
pxa2xx_palmld.o
 pxa2xx-obj-$(CONFIG_MACH_E740) += pxa2xx_e740.o
 pxa2xx-obj-$(CONFIG_MACH_STARGATE2)+= pxa2xx_stargate2.o
 
-obj-$(CONFIG_PCMCIA_PXA2XX)+= pxa2xx_core.o $(pxa2xx-obj-y)
+obj-$(CONFIG_PCMCIA_PXA2XX)+= pxa2xx_base.o $(pxa2xx-obj-y)
diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c
index 163cf98..38c5484 100644
--- a/drivers/pcmcia/soc_common.c
+++ b/drivers/pcmcia/soc_common.c
@@ -608,15 +608,14 @@ static int soc_pcmcia_cpufreq_register(void)
notifier for PCMCIA (%d)\n, ret);
return ret;
 }
+fs_initcall(soc_pcmcia_cpufreq_register);
 
 static void soc_pcmcia_cpufreq_unregister(void)
 {
cpufreq_unregister_notifier(soc_pcmcia_notifier_block, 
CPUFREQ_TRANSITION_NOTIFIER);
 }
+module_exit(soc_pcmcia_cpufreq_unregister);
 
-#else
-static int soc_pcmcia_cpufreq_register(void) { return 0; }
-static void soc_pcmcia_cpufreq_unregister(void) {}
 #endif
 
 int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level 
*ops,
@@ -667,9 +666,6 @@ int soc_common_drv_pcmcia_probe(struct device *dev, struct 
pcmcia_low_level *ops
goto out_err_5;
}
 
-   if (list_empty(soc_pcmcia_sockets))
-   soc_pcmcia_cpufreq_register();
-
list_add(skt-node, soc_pcmcia_sockets);
 
/*
@@ -742,6 +738,7 @@ int soc_common_drv_pcmcia_probe(struct device *dev, struct 
pcmcia_low_level *ops

[RFC PATCH 04/10] PCMCIA: soc_common: push socket probe down into SoC specific support

2009-10-04 Thread Russell King
Move the individual socket probing and initialization down into the
SoC specific support files, thereby allowing soc_common_drv_pcmcia_probe
to be eliminated.  soc_common.c now no longer deals with distinct groups
of sockets.

Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk
---
 drivers/pcmcia/pxa2xx_base.c |   77 +--
 drivers/pcmcia/sa11xx_base.c |   91 ++
 drivers/pcmcia/soc_common.c  |   37 -
 drivers/pcmcia/soc_common.h  |2 -
 4 files changed, 103 insertions(+), 104 deletions(-)

diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c
index e069cdb..bb7e862 100644
--- a/drivers/pcmcia/pxa2xx_base.c
+++ b/drivers/pcmcia/pxa2xx_base.c
@@ -228,6 +228,31 @@ static const char *skt_names[] = {
 #define SKT_DEV_INFO_SIZE(n) \
(sizeof(struct skt_dev_info) + (n)*sizeof(struct soc_pcmcia_socket))
 
+static int pxa2xx_drv_pcmcia_add_one(struct soc_pcmcia_socket *skt)
+{
+   skt-res_skt.start = _PCMCIA(skt-nr);
+   skt-res_skt.end = _PCMCIA(skt-nr) + PCMCIASp - 1;
+   skt-res_skt.name = skt_names[skt-nr];
+   skt-res_skt.flags = IORESOURCE_MEM;
+
+   skt-res_io.start = _PCMCIAIO(skt-nr);
+   skt-res_io.end = _PCMCIAIO(skt-nr) + PCMCIAIOSp - 1;
+   skt-res_io.name = io;
+   skt-res_io.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+
+   skt-res_mem.start = _PCMCIAMem(skt-nr);
+   skt-res_mem.end = _PCMCIAMem(skt-nr) + PCMCIAMemSp - 1;
+   skt-res_mem.name = memory;
+   skt-res_mem.flags = IORESOURCE_MEM;
+
+   skt-res_attr.start = _PCMCIAAttr(skt-nr);
+   skt-res_attr.end = _PCMCIAAttr(skt-nr) + PCMCIAAttrSp - 1;
+   skt-res_attr.name = attribute;
+   skt-res_attr.flags = IORESOURCE_MEM;
+
+   return soc_pcmcia_add_one(skt);
+}
+
 int __pxa2xx_drv_pcmcia_probe(struct device *dev)
 {
int i, ret;
@@ -240,6 +265,12 @@ int __pxa2xx_drv_pcmcia_probe(struct device *dev)
 
ops = (struct pcmcia_low_level *)dev-platform_data;
 
+   /* Provide our PXA2xx specific timing routines. */
+   ops-set_timing  = pxa2xx_pcmcia_set_timing;
+#ifdef CONFIG_CPU_FREQ
+   ops-frequency_change = pxa2xx_pcmcia_frequency_change;
+#endif
+
sinfo = kzalloc(SKT_DEV_INFO_SIZE(ops-nr), GFP_KERNEL);
if (!sinfo)
return -ENOMEM;
@@ -250,40 +281,26 @@ int __pxa2xx_drv_pcmcia_probe(struct device *dev)
for (i = 0; i  ops-nr; i++) {
skt = sinfo-skt[i];
 
-   skt-nr = ops-first + i;
-   skt-irq= NO_IRQ;
-
-   skt-res_skt.start  = _PCMCIA(skt-nr);
-   skt-res_skt.end= _PCMCIA(skt-nr) + PCMCIASp - 1;
-   skt-res_skt.name   = skt_names[skt-nr];
-   skt-res_skt.flags  = IORESOURCE_MEM;
+   skt-nr = ops-first + i;
+   skt-irq = NO_IRQ;
+   skt-dev = dev;
+   skt-ops = ops;
+   skt-socket.owner = ops-owner;
+   skt-socket.dev.parent = dev;
 
-   skt-res_io.start   = _PCMCIAIO(skt-nr);
-   skt-res_io.end = _PCMCIAIO(skt-nr) + PCMCIAIOSp - 1;
-   skt-res_io.name= io;
-   skt-res_io.flags   = IORESOURCE_MEM | IORESOURCE_BUSY;
-
-   skt-res_mem.start  = _PCMCIAMem(skt-nr);
-   skt-res_mem.end= _PCMCIAMem(skt-nr) + PCMCIAMemSp - 1;
-   skt-res_mem.name   = memory;
-   skt-res_mem.flags  = IORESOURCE_MEM;
-
-   skt-res_attr.start = _PCMCIAAttr(skt-nr);
-   skt-res_attr.end   = _PCMCIAAttr(skt-nr) + PCMCIAAttrSp - 
1;
-   skt-res_attr.name  = attribute;
-   skt-res_attr.flags = IORESOURCE_MEM;
+   ret = pxa2xx_drv_pcmcia_add_one(skt);
+   if (ret)
+   break;
}
 
-   /* Provide our PXA2xx specific timing routines. */
-   ops-set_timing  = pxa2xx_pcmcia_set_timing;
-#ifdef CONFIG_CPU_FREQ
-   ops-frequency_change = pxa2xx_pcmcia_frequency_change;
-#endif
-
-   ret = soc_common_drv_pcmcia_probe(dev, ops, sinfo);
-
-   if (!ret)
+   if (ret) {
+   while (--i = 0)
+   soc_pcmcia_remove_one(sinfo-skt[i]);
+   kfree(sinfo);
+   } else {
pxa2xx_configure_sockets(dev);
+   dev_set_drvdata(dev, sinfo);
+   }
 
return ret;
 }
diff --git a/drivers/pcmcia/sa11xx_base.c b/drivers/pcmcia/sa11xx_base.c
index e15d59f..92a4348 100644
--- a/drivers/pcmcia/sa11xx_base.c
+++ b/drivers/pcmcia/sa11xx_base.c
@@ -171,6 +171,31 @@ static const char *skt_names[] = {
 #define SKT_DEV_INFO_SIZE(n) \
(sizeof(struct skt_dev_info) + (n)*sizeof(struct soc_pcmcia_socket))
 
+static int sa11xx_drv_pcmcia_add_one(struct soc_pcmcia_socket *skt)
+{
+   skt-res_skt.start = _PCMCIA(skt-nr);

[RFC PATCH 03/10] PCMCIA: soc_common: push socket removal down to SoC specific support

2009-10-04 Thread Russell King
Mechanically transplant the removal code from soc_common into each
SoC specific base support file, thereby allowing
soc_common_drv_pcmcia_remove to be removed.  No other changes.

Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk
---
 drivers/pcmcia/pxa2xx_base.c|   11 ++-
 drivers/pcmcia/sa1100_generic.c |   11 ++-
 drivers/pcmcia/sa_generic.c |   10 +-
 drivers/pcmcia/soc_common.c |   16 
 drivers/pcmcia/soc_common.h |1 -
 5 files changed, 29 insertions(+), 20 deletions(-)

diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c
index c49a726..e069cdb 100644
--- a/drivers/pcmcia/pxa2xx_base.c
+++ b/drivers/pcmcia/pxa2xx_base.c
@@ -297,7 +297,16 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device 
*dev)
 
 static int pxa2xx_drv_pcmcia_remove(struct platform_device *dev)
 {
-   return soc_common_drv_pcmcia_remove(dev-dev);
+   struct skt_dev_info *sinfo = platform_get_drvdata(dev);
+   int i;
+
+   platform_set_drvdata(dev, NULL);
+
+   for (i = 0; i  sinfo-nskt; i++)
+   soc_pcmcia_remove_one(sinfo-skt[i]);
+
+   kfree(sinfo);
+   return 0;
 }
 
 static int pxa2xx_drv_pcmcia_suspend(struct platform_device *dev, pm_message_t 
state)
diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c
index d8da5ac..9939216 100644
--- a/drivers/pcmcia/sa1100_generic.c
+++ b/drivers/pcmcia/sa1100_generic.c
@@ -83,7 +83,16 @@ static int sa11x0_drv_pcmcia_probe(struct platform_device 
*dev)
 
 static int sa11x0_drv_pcmcia_remove(struct platform_device *dev)
 {
-   return soc_common_drv_pcmcia_remove(dev-dev);
+   struct skt_dev_info *sinfo = platform_get_drvdata(dev);
+   int i;
+
+   platform_set_drvdata(dev, NULL);
+
+   for (i = 0; i  sinfo-nskt; i++)
+   soc_pcmcia_remove_one(sinfo-skt[i]);
+
+   kfree(sinfo);
+   return 0;
 }
 
 static int sa11x0_drv_pcmcia_suspend(struct platform_device *dev,
diff --git a/drivers/pcmcia/sa_generic.c b/drivers/pcmcia/sa_generic.c
index 401052a..0bce074 100644
--- a/drivers/pcmcia/sa_generic.c
+++ b/drivers/pcmcia/sa_generic.c
@@ -152,7 +152,15 @@ static int pcmcia_probe(struct sa_dev *dev)
 
 static int __devexit pcmcia_remove(struct sa_dev *dev)
 {
-   soc_common_drv_pcmcia_remove(dev-dev);
+   struct skt_dev_info *sinfo = dev_get_drvdata(dev-dev);
+   int i;
+
+   dev_set_drvdata(dev-dev, NULL);
+
+   for (i = 0; i  sinfo-nskt; i++)
+   soc_pcmcia_remove_one(sinfo-skt[i]);
+
+   kfree(sinfo);
release_mem_region(dev-res.start, 512);
return 0;
 }
diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c
index 8938608..c42b651 100644
--- a/drivers/pcmcia/soc_common.c
+++ b/drivers/pcmcia/soc_common.c
@@ -777,22 +777,6 @@ int soc_common_drv_pcmcia_probe(struct device *dev, struct 
pcmcia_low_level *ops
 }
 EXPORT_SYMBOL(soc_common_drv_pcmcia_probe);
 
-int soc_common_drv_pcmcia_remove(struct device *dev)
-{
-   struct skt_dev_info *sinfo = dev_get_drvdata(dev);
-   int i;
-
-   dev_set_drvdata(dev, NULL);
-
-   for (i = 0; i  sinfo-nskt; i++)
-   soc_pcmcia_remove_one(sinfo-skt[i]);
-
-   kfree(sinfo);
-
-   return 0;
-}
-EXPORT_SYMBOL(soc_common_drv_pcmcia_remove);
-
 MODULE_AUTHOR(John Dorsey jo...@cs.cmu.edu);
 MODULE_DESCRIPTION(Linux PCMCIA Card Services: Common SoC support);
 MODULE_LICENSE(Dual MPL/GPL);
diff --git a/drivers/pcmcia/soc_common.h b/drivers/pcmcia/soc_common.h
index 51c72ba..c33b8c3 100644
--- a/drivers/pcmcia/soc_common.h
+++ b/drivers/pcmcia/soc_common.h
@@ -139,7 +139,6 @@ void soc_pcmcia_remove_one(struct soc_pcmcia_socket *skt);
 int soc_pcmcia_add_one(struct soc_pcmcia_socket *skt);
 
 extern int soc_common_drv_pcmcia_probe(struct device *dev, struct 
pcmcia_low_level *ops, struct skt_dev_info *sinfo);
-extern int soc_common_drv_pcmcia_remove(struct device *dev);
 
 
 #ifdef CONFIG_PCMCIA_DEBUG
-- 
1.6.2.5


___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


[RFC PATCH 06/10] PCMCIA: sa1111: remove duplicated initializers

2009-10-04 Thread Russell King
Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk
---
 drivers/pcmcia/pxa2xx_lubbock.c|4 
 drivers/pcmcia/sa1100_badge4.c |6 --
 drivers/pcmcia/sa1100_jornada720.c |   28 +++-
 drivers/pcmcia/sa1100_neponset.c   |4 
 drivers/pcmcia/sa_generic.c|   11 ---
 drivers/pcmcia/sa_generic.h|3 ---
 6 files changed, 15 insertions(+), 41 deletions(-)

diff --git a/drivers/pcmcia/pxa2xx_lubbock.c b/drivers/pcmcia/pxa2xx_lubbock.c
index 35d5280..b9f8c8f 100644
--- a/drivers/pcmcia/pxa2xx_lubbock.c
+++ b/drivers/pcmcia/pxa2xx_lubbock.c
@@ -201,12 +201,8 @@ lubbock_pcmcia_configure_socket(struct soc_pcmcia_socket 
*skt,
 
 static struct pcmcia_low_level lubbock_pcmcia_ops = {
.owner  = THIS_MODULE,
-   .hw_init= sa_pcmcia_hw_init,
-   .hw_shutdown= sa_pcmcia_hw_shutdown,
-   .socket_state   = sa_pcmcia_socket_state,
.configure_socket   = lubbock_pcmcia_configure_socket,
.socket_init= sa_pcmcia_socket_init,
-   .socket_suspend = sa_pcmcia_socket_suspend,
.first  = 0,
.nr = 2,
 };
diff --git a/drivers/pcmcia/sa1100_badge4.c b/drivers/pcmcia/sa1100_badge4.c
index 6399314..1ce53f4 100644
--- a/drivers/pcmcia/sa1100_badge4.c
+++ b/drivers/pcmcia/sa1100_badge4.c
@@ -127,14 +127,8 @@ badge4_pcmcia_configure_socket(struct soc_pcmcia_socket 
*skt, const socket_state
 
 static struct pcmcia_low_level badge4_pcmcia_ops = {
.owner  = THIS_MODULE,
-   .hw_init= sa_pcmcia_hw_init,
-   .hw_shutdown= sa_pcmcia_hw_shutdown,
-   .socket_state   = sa_pcmcia_socket_state,
.configure_socket   = badge4_pcmcia_configure_socket,
-
.socket_init= sa_pcmcia_socket_init,
-   .socket_suspend = sa_pcmcia_socket_suspend,
-
.first  = 0,
.nr = 2,
 };
diff --git a/drivers/pcmcia/sa1100_jornada720.c 
b/drivers/pcmcia/sa1100_jornada720.c
index 1abdd57..755a433 100644
--- a/drivers/pcmcia/sa1100_jornada720.c
+++ b/drivers/pcmcia/sa1100_jornada720.c
@@ -22,21 +22,6 @@
 #warning *** Does SOCKET1_3V actually do anything?
 #define SOCKET1_3V GPIO_GPIO3
 
-static int jornada720_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
-{
-  struct sa_pcmcia_socket *s = to_skt(skt);
-  /*
-   * What is all this crap for?
-   */
-  GRER |= 0x0002;
-  /* Set GPIO_A3:1 to be outputs for PCMCIA/CF power controller: */
-  sa_set_io_dir(s-dev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0, 0);
-  sa_set_io(s-dev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0);
-  sa_set_sleep_io(s-dev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0);
-
-  return sa_pcmcia_hw_init(skt);
-}
-
 static int
 jornada720_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const 
socket_state_t *state)
 {
@@ -94,14 +79,8 @@ printk(%s(): config socket %d vcc %d vpp %d\n, __func__,
 
 static struct pcmcia_low_level jornada720_pcmcia_ops = {
   .owner   = THIS_MODULE,
-  .hw_init = jornada720_pcmcia_hw_init,
-  .hw_shutdown = sa_pcmcia_hw_shutdown,
-  .socket_state= sa_pcmcia_socket_state,
   .configure_socket= jornada720_pcmcia_configure_socket,
-
   .socket_init = sa_pcmcia_socket_init,
-  .socket_suspend  = sa_pcmcia_socket_suspend,
-
   .first   = 0,
   .nr  = 2,
 };
@@ -111,6 +90,13 @@ int __devinit pcmcia_jornada720_init(struct device *dev)
int ret = -ENODEV;
 
if (machine_is_jornada720()) {
+   GRER |= 0x0002;
+
+   /* Set GPIO_A3:1 to be outputs for PCMCIA/CF power 
controller: */
+   sa_set_io_dir(dev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0, 0);
+   sa_set_io(dev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0);
+   sa_set_sleep_io(dev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0);
+
sa11xx_drv_pcmcia_ops(jornada720_pcmcia_ops);
ret = sa_pcmcia_add(dev, jornada720_pcmcia_ops,
sa11xx_drv_pcmcia_add_one);
diff --git a/drivers/pcmcia/sa1100_neponset.c b/drivers/pcmcia/sa1100_neponset.c
index cb7d5e6..7b57b3b 100644
--- a/drivers/pcmcia/sa1100_neponset.c
+++ b/drivers/pcmcia/sa1100_neponset.c
@@ -116,12 +116,8 @@ static void neponset_pcmcia_socket_init(struct 
soc_pcmcia_socket *skt)
 
 static struct pcmcia_low_level neponset_pcmcia_ops = {
.owner  = THIS_MODULE,
-   .hw_init= sa_pcmcia_hw_init,
-   .hw_shutdown= sa_pcmcia_hw_shutdown,
-   .socket_state   = sa_pcmcia_socket_state,
.configure_socket   = neponset_pcmcia_configure_socket,
.socket_init= neponset_pcmcia_socket_init,
-   

[RFC PATCH 07/10] PCMCIA: soc_common: constify soc_pcmcia_socket ops member

2009-10-04 Thread Russell King
No one should modify the ops structure supplied to soc_pcmcia_socket
so make it const.

Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk
---
 drivers/pcmcia/soc_common.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/pcmcia/soc_common.h b/drivers/pcmcia/soc_common.h
index 8a755c1..f7533dc 100644
--- a/drivers/pcmcia/soc_common.h
+++ b/drivers/pcmcia/soc_common.h
@@ -37,7 +37,7 @@ struct soc_pcmcia_socket {
/*
 * Core PCMCIA state
 */
-   struct pcmcia_low_level *ops;
+   const struct pcmcia_low_level *ops;
 
unsigned intstatus;
socket_state_t  cs_state;
-- 
1.6.2.5


___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


[RFC PATCH 09/10] PCMCIA: ss: allow PCI IRQs 255

2009-10-04 Thread Russell King
Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk
---
 include/pcmcia/ss.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
index 9a3b498..d5a741e 100644
--- a/include/pcmcia/ss.h
+++ b/include/pcmcia/ss.h
@@ -172,7 +172,7 @@ struct pcmcia_socket {
u_int   irq_mask;
u_int   map_size;
u_int   io_offset;
-   u_char  pci_irq;
+   u_int   pci_irq;
struct pci_dev *cb_dev;
 
 
-- 
1.6.2.5


___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: [RFC PATCH 05/10] PCMCIA: sa1111: wrap soc_pcmcia_socket to contain sa1111 specific data

2009-10-04 Thread Larry Finger
Russell King wrote:
 Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk
 ---
  drivers/pcmcia/pxa2xx_base.c   |   19 +++
  drivers/pcmcia/pxa2xx_base.h   |3 ++
  drivers/pcmcia/pxa2xx_lubbock.c|   10 --
  drivers/pcmcia/sa1100_badge4.c |7 -
  drivers/pcmcia/sa1100_jornada720.c |   20 
  drivers/pcmcia/sa1100_neponset.c   |9 -
  drivers/pcmcia/sa_generic.c|   58 
 
  drivers/pcmcia/sa_generic.h|   14 
  drivers/pcmcia/sa11xx_base.c   |   21 
  drivers/pcmcia/sa11xx_base.h   |2 +
  10 files changed, 123 insertions(+), 40 deletions(-)

What tree is this patch for? I get the following errors when applying
to taday's pull of Linus's tree (git describe is
v2.6.32-rc1-384-ga99bbaf):

patching file drivers/pcmcia/sa1100_jornada720.c
Hunk #1 FAILED at 24.
Hunk #2 FAILED at 40.
Hunk #3 FAILED at 85.
Hunk #4 FAILED at 101.
4 out of 4 hunks FAILED -- rejects in file
drivers/pcmcia/sa1100_jornada720.c

___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


RE: PCMCIA bring up fails on ide_register()

2009-10-04 Thread Kevin Wu
Hi Peter,

We have a team to develop this Linux code, I will check with my team and see if 
we can use the latest Linux kernel instead of this old Linux kernel.

Thanks
Kevin 

-Original Message-
From: linux-pcmcia-boun...@lists.infradead.org 
[mailto:linux-pcmcia-boun...@lists.infradead.org] On Behalf Of Peter Stuge
Sent: Saturday, October 03, 2009 10:50 AM
To: linux-pcmcia@lists.infradead.org
Subject: Re: PCMCIA bring up fails on ide_register()

Kevin Wu wrote:
 I don't know. We just use Linux 2.6.14.2 as our code base to
 develop our code.

Sorry, wrong answer. It seems your development model is absolutely
incompatible with the Linux community. I think you are on your own.

If you for whatever reason insist on shipping age old Linux that's
fine - but when you want to approach the community you must really
understand that the very latest version is the only one receiving
developer attention.

You would at the very least test your code on a recent kernel,
ideally several recent kernels, to provide more data points.

It is essentially your job to know, if you work with Linux, since
there is no guarantee.


//Peter

___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia

___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia