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

2009-10-27 Thread Russell King - ARM Linux
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 3cb4fd2..c9c104b 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 

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

2009-10-07 Thread Larry Finger
Russell King - ARM Linux wrote:
 This series has been rebased in my git tree - branch pcmcia.  I'll
 avoid re-posting the patches since it appears to cause dwmw2's mail
 server quite a bit of grief (it took well over an hour to deal with
 the 10 patches last time I posted.)
 
 Ignore the top commit of:
 
 http://ftp.arm.linux.org.uk/git/gitweb.cgi?p=linux-2.6-arm.git;a=shortlog;h=refs/heads/pcmcia
 
 As usual, it's also available in overall patch and mbox forms:
 
 http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/

I tested the patches. The reason it is in quotes is that the change
to Makefile, Kconfig and rsrc_nonstatic.c are the only parts that
affected my system.

Larry



___
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-07 Thread Larry Finger

On 10/07/2009 01:26 PM, Russell King - ARM Linux wrote:

On Wed, Oct 07, 2009 at 11:48:47AM -0500, Larry Finger wrote:

Russell King - ARM Linux wrote:

This series has been rebased in my git tree - branch pcmcia.  I'll
avoid re-posting the patches since it appears to cause dwmw2's mail
server quite a bit of grief (it took well over an hour to deal with
the 10 patches last time I posted.)

Ignore the top commit of:

http://ftp.arm.linux.org.uk/git/gitweb.cgi?p=linux-2.6-arm.git;a=shortlog;h=refs/heads/pcmcia

As usual, it's also available in overall patch and mbox forms:

http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/


I tested the patches. The reason it is in quotes is that the change
to Makefile, Kconfig and rsrc_nonstatic.c are the only parts that
affected my system.


In what way?


Bad choice of words. Those were the only parts I could test, and the 
system worked without any problems.


Larry

___
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-06 Thread Russell King - ARM Linux
On Mon, Oct 05, 2009 at 11:21:13AM +0200, Kristoffer Ericson wrote:
 My bad, it sent an updated version to linux-pcmcia while
 forgetting to CC arm. Also totally forgot that I still had it
 pending inside linux-arm patch tracker.

This series has been rebased in my git tree - branch pcmcia.  I'll
avoid re-posting the patches since it appears to cause dwmw2's mail
server quite a bit of grief (it took well over an hour to deal with
the 10 patches last time I posted.)

Ignore the top commit of:

http://ftp.arm.linux.org.uk/git/gitweb.cgi?p=linux-2.6-arm.git;a=shortlog;h=refs/heads/pcmcia

As usual, it's also available in overall patch and mbox forms:

http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/

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


[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 

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