PCMCIA: soc_common: convert to a stand alone module
Subsystems (2)
RFC PATCH 1/10 PCMCIA: soc_common: convert to a stand alone module
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.
--- drivers/pcmcia/Kconfig | 6 ++++++ drivers/pcmcia/Makefile | 10 ++++------ drivers/pcmcia/soc_common.c | 16 +++++++--------- 3 files changed, 17 insertions(+), 15 deletions(-)
drivers/pcmcia/Kconfig +6 -0
@@ -196,9 +196,13 @@ config PCMCIA_BCM63XX tristate "bcm63xx pcmcia support" depends on BCM63XX && 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)/
@@ -209,6 +213,7 @@ config PCMCIA_SA1100 config PCMCIA_SA1111 tristate "SA1111 support" depends on ARM && ARCH_SA1100 && SA1111 && PCMCIA + select PCMCIA_SOC_COMMON help Say Y here to include support for SA1111-based PCMCIA or CF sockets, found on the Jornada 720, Graphicsmaster and other
@@ -222,6 +227,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
drivers/pcmcia/Makefile +4 -6
@@ -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_SA1111) += sa11xx_core.o sa1111_cs.o +obj-$(CONFIG_PCMCIA_SOC_COMMON) += soc_common.o +obj-$(CONFIG_PCMCIA_SA1100) += sa11xx_base.o sa1100_cs.o +obj-$(CONFIG_PCMCIA_SA1111) += sa11xx_base.o sa1111_cs.o obj-$(CONFIG_M32R_PCC) += m32r_pcc.o obj-$(CONFIG_M32R_CFC) += m32r_cfc.o obj-$(CONFIG_PCMCIA_AU1X00) += au1x00_ss.o
@@ -35,9 +36,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
@@ -77,4 +75,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)
drivers/pcmcia/soc_common.c +7 -9
@@ -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 *opsmutex_unlock (&soc_pcmcia_sockets_lock);return ret; } +EXPORT_SYMBOL (soc_common_drv_pcmcia_probe);int soc_common_drv_pcmcia_remove (struct device *dev) {
@@ -772,9 +769,6 @@ int soc_common_drv_pcmcia_remove(struct device *dev)release_resource (&skt->res_io);release_resource (&skt->res_skt); } -if (list_empty (&soc_pcmcia_sockets)) -soc_pcmcia_cpufreq_unregister (); -mutex_unlock (&soc_pcmcia_sockets_lock);kfree (sinfo);
@@ -782,3 +776,7 @@ int soc_common_drv_pcmcia_remove(struct device *dev)return 0 ; }EXPORT_SYMBOL (soc_common_drv_pcmcia_remove); + +MODULE_AUTHOR ("John Dorsey <[email protected]>" ); +MODULE_DESCRIPTION ("Linux PCMCIA Card Services: Common SoC support" ); +MODULE_LICENSE ("Dual MPL/GPL" );
Signature · 1 line
1.6.2.5
RFC PATCH 2/10 PCMCIA: soc_common: provide single socket add/remove functionality
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.
--- drivers/pcmcia/soc_common.c | 230 +++++++++++++++++++++++-------------------- drivers/pcmcia/soc_common.h | 3 +- 2 files changed, 125 insertions(+), 108 deletions(-)
drivers/pcmcia/soc_common.c +123 -107
@@ -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,0x10000 ); -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,0x10000 ); +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 =pcmcia_register_socket (&skt->socket); -if (ret) - goto out_err_7; +list_add (&skt->node, &soc_pcmcia_sockets); -WARN_ON (skt->socket.sock != i); +/* +* We initialize default socket timing here, because +* we are not guaranteed to see a SetIOMap operation at +* runtime. +*/ + skt->ops->set_timing (skt); -add_timer (&skt->poll_timer); + ret = skt->ops->hw_init (skt); +if (ret) + goto out_err_6; - ret =device_create_file (&skt->socket.dev, &dev_attr_status); -if (ret) - goto out_err_8; - } + skt->socket.ops = &soc_common_pcmcia_operations; + 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; -dev_set_drvdata (dev, sinfo); - ret =0 ; - goto out; + skt->status =soc_common_pcmcia_skt_state (skt); -do { - skt = &sinfo->skt[i]; + ret =pcmcia_register_socket (&skt->socket); +if (ret) + goto out_err_7; + +add_timer (&skt->poll_timer); + +mutex_unlock (&soc_pcmcia_sockets_lock); + + ret =device_create_file (&skt->socket.dev, &dev_attr_status); +if (ret) + goto out_err_8; + +return ret; -device_remove_file (&skt->socket.dev, &dev_attr_status); out_err_8: -del_timer_sync (&skt->poll_timer); -pcmcia_unregister_socket (&skt->socket); +mutex_lock (&soc_pcmcia_sockets_lock); +del_timer_sync (&skt->poll_timer); +pcmcia_unregister_socket (&skt->socket); out_err_7: -flush_scheduled_work (); +flush_scheduled_work (); - ops->hw_shutdown (skt); + skt->ops->hw_shutdown (skt); out_err_6: -list_del (&skt->node); -iounmap (skt->virt_io); +list_del (&skt->node); +mutex_unlock (&soc_pcmcia_sockets_lock); +iounmap (skt->virt_io); out_err_5: -release_resource (&skt->res_attr); +release_resource (&skt->res_attr); out_err_4: -release_resource (&skt->res_mem); +release_resource (&skt->res_mem); out_err_3: -release_resource (&skt->res_io); +release_resource (&skt->res_io); out_err_2: -release_resource (&skt->res_skt); +release_resource (&skt->res_skt); out_err_1: - i--; - }while (i >0 ); -kfree (sinfo); - - out: -mutex_unlock (&soc_pcmcia_sockets_lock);return ret; } -EXPORT_SYMBOL (soc_common_drv_pcmcia_probe); +EXPORT_SYMBOL (soc_pcmcia_add_one); -int soc_common_drv_pcmcia_remove (struct device *dev) +int soc_common_drv_pcmcia_probe (struct device *dev,struct pcmcia_low_level *ops, +struct skt_dev_info *sinfo) { -struct skt_dev_info *sinfo =dev_get_drvdata (dev); -int i; +struct soc_pcmcia_socket *skt; +int ret, i; -dev_set_drvdata (dev,NULL ); +/* +* Initialise the per-socket structure. +*/ +for (i = ret =0 ; i < sinfo->nskt; i++) { + skt = &sinfo->skt[i]; -mutex_lock (&soc_pcmcia_sockets_lock); -for (i =0 ; i < sinfo->nskt; i++) { -struct soc_pcmcia_socket *skt = &sinfo->skt[i]; + skt->socket.owner = ops->owner; + skt->socket.dev.parent = dev; -del_timer_sync (&skt->poll_timer); + skt->dev = dev; + skt->ops = ops; -pcmcia_unregister_socket (&skt->socket); + ret =soc_pcmcia_add_one (skt); +if (ret) +break ; -flush_scheduled_work (); +WARN_ON (skt->socket.sock != i); + } - skt->ops->hw_shutdown (skt); +if (ret) { +while (--i >=0 ) +soc_pcmcia_remove_one (&sinfo->skt[i]); +kfree (sinfo); + }else { +dev_set_drvdata (dev, sinfo); + } -soc_common_pcmcia_config_skt (skt, &dead_socket); +return ret; +} +EXPORT_SYMBOL (soc_common_drv_pcmcia_probe); -list_del (&skt->node); -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); - } -mutex_unlock (&soc_pcmcia_sockets_lock); +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);
drivers/pcmcia/soc_common.h +2 -1
@@ -135,7 +135,8 @@ extern void soc_pcmcia_enable_irqs(struct soc_pcmcia_socket *skt, struct pcmcia_extern void soc_common_pcmcia_get_timing (struct soc_pcmcia_socket *,struct soc_pcmcia_timing *); -extern struct list_head soc_pcmcia_sockets; +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);
Signature · 1 line
1.6.2.5
RFC PATCH 3/10 PCMCIA: soc_common: push socket removal down to SoC specific support
In reply to Russell King - ARM LinuxMechanically 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.
--- drivers/pcmcia/pxa2xx_base.c | 11 ++++++++++- drivers/pcmcia/sa1100_generic.c | 11 ++++++++++- drivers/pcmcia/sa1111_generic.c | 10 +++++++++- drivers/pcmcia/soc_common.c | 16 ---------------- drivers/pcmcia/soc_common.h | 1 - 5 files changed, 29 insertions(+), 20 deletions(-)
drivers/pcmcia/pxa2xx_base.c +10 -1
@@ -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 device *dev)
drivers/pcmcia/sa1100_generic.c +10 -1
@@ -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,
drivers/pcmcia/sa1111_generic.c +9 -1
@@ -152,7 +152,15 @@ static int pcmcia_probe(struct sa1111_dev *dev) static int __devexit pcmcia_remove(struct sa1111_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 ; }
drivers/pcmcia/soc_common.c +0 -16
@@ -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 <[email protected]>" );MODULE_DESCRIPTION ("Linux PCMCIA Card Services: Common SoC support" );MODULE_LICENSE ("Dual MPL/GPL" );
drivers/pcmcia/soc_common.h +0 -1
@@ -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
Signature · 1 line
1.6.2.5
RFC PATCH 4/10 PCMCIA: soc_common: push socket probe down into SoC specific support
In reply to Russell King - ARM LinuxMove 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.
--- 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(-)
drivers/pcmcia/pxa2xx_base.c +47 -30
@@ -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; }
drivers/pcmcia/sa11xx_base.c +56 -35
109 lines not on this page · raw message
drivers/pcmcia/soc_common.c +0 -37
@@ -740,43 +740,6 @@ int soc_pcmcia_add_one(struct soc_pcmcia_socket *skt) }EXPORT_SYMBOL (soc_pcmcia_add_one); -int soc_common_drv_pcmcia_probe (struct device *dev,struct pcmcia_low_level *ops, -struct skt_dev_info *sinfo) -{ -struct soc_pcmcia_socket *skt; -int ret, i; - -/* -* Initialise the per-socket structure. -*/ -for (i = ret =0 ; i < sinfo->nskt; i++) { - skt = &sinfo->skt[i]; - - skt->socket.owner = ops->owner; - skt->socket.dev.parent = dev; - - skt->dev = dev; - skt->ops = ops; - - ret =soc_pcmcia_add_one (skt); -if (ret) -break ; - -WARN_ON (skt->socket.sock != i); - } - -if (ret) { -while (--i >=0 ) -soc_pcmcia_remove_one (&sinfo->skt[i]); -kfree (sinfo); - }else { -dev_set_drvdata (dev, sinfo); - } - -return ret; -} -EXPORT_SYMBOL (soc_common_drv_pcmcia_probe); -MODULE_AUTHOR ("John Dorsey <[email protected]>" );MODULE_DESCRIPTION ("Linux PCMCIA Card Services: Common SoC support" );MODULE_LICENSE ("Dual MPL/GPL" );
drivers/pcmcia/soc_common.h +0 -2
@@ -138,8 +138,6 @@ extern void soc_common_pcmcia_get_timing(struct soc_pcmcia_socket *, struct soc_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); -#ifdef CONFIG_PCMCIA_DEBUG
Signature · 1 line
1.6.2.5
RFC PATCH 5/10 PCMCIA: sa1111: wrap soc_pcmcia_socket to contain sa1111 specific data
In reply to Russell King - ARM Linux--- 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/sa1111_generic.c | 58 ++++++++++++++++++++++++++++-------- drivers/pcmcia/sa1111_generic.h | 14 ++++++++ drivers/pcmcia/sa11xx_base.c | 21 ++++++++---- drivers/pcmcia/sa11xx_base.h | 2 + 10 files changed, 123 insertions(+), 40 deletions(-)
drivers/pcmcia/pxa2xx_base.c +12 -7
@@ -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)
drivers/pcmcia/pxa2xx_base.h +3 -0
@@ -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); +
drivers/pcmcia/pxa2xx_lubbock.c +6 -4
@@ -32,6 +32,7 @@ static int lubbock_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_t *state) { + struct sa1111_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); -sa1111_set_io (SA1111_DEV (skt->dev), pa_dwr_mask, pa_dwr_set); +sa1111_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 ); -sa1111_set_io (SA1111_DEV (skt->dev), pa_dwr_mask,0 ); +sa1111_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 sa1111_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 =sa1111_pcmcia_add (sadev, &lubbock_pcmcia_ops, + pxa2xx_drv_pcmcia_add_one); }return ret;
drivers/pcmcia/sa1100_badge4.c +6 -1
@@ -134,6 +134,9 @@ static struct pcmcia_low_level badge4_pcmcia_ops = { .socket_init = sa1111_pcmcia_socket_init, .socket_suspend = sa1111_pcmcia_socket_suspend, + + .first = 0, + .nr = 2, };int pcmcia_badge4_init (struct device *dev)
@@ -146,7 +149,9 @@ int pcmcia_badge4_init(struct device *dev) __func__, badge4_pcmvcc, badge4_pcmvpp, badge4_cfvcc); - ret =sa11xx_drv_pcmcia_probe (dev, &badge4_pcmcia_ops,0 ,2 ); +sa11xx_drv_pcmcia_ops (&badge4_pcmcia_ops); + ret =sa1111_pcmcia_add (dev, &badge4_pcmcia_ops, + sa11xx_drv_pcmcia_add_one); }return ret;
drivers/pcmcia/sa1100_jornada720.c +14 -6
@@ -24,6 +24,7 @@static int jornada720_pcmcia_hw_init (struct soc_pcmcia_socket *skt) { +struct sa1111_pcmcia_socket *s =to_skt (skt);unsigned int pin =GPIO_A0 |GPIO_A1 |GPIO_A2 |GPIO_A3 ;/*
@@ -31,9 +32,9 @@ static int jornada720_pcmcia_hw_init(struct soc_pcmcia_socket *skt)*/ GRER |=0x00000002 ;/* Set GPIO_A<3:1> to be outputs for PCMCIA/CF power controller: */ -sa1111_set_io_dir (SA1111_DEV (skt->dev), pin,0 ,0 ); -sa1111_set_io (SA1111_DEV (skt->dev), pin,0 ); -sa1111_set_sleep_io (SA1111_DEV (skt->dev), pin,0 ); +sa1111_set_io_dir (s->dev, pin,0 ,0 ); +sa1111_set_io (s->dev, pin,0 ); +sa1111_set_sleep_io (s->dev, pin,0 );return sa1111_pcmcia_hw_init (skt); }
@@ -41,6 +42,7 @@ static int jornada720_pcmcia_hw_init(struct soc_pcmcia_socket *skt)static int jornada720_pcmcia_configure_socket (struct soc_pcmcia_socket *skt,const socket_state_t *state) { +struct sa1111_pcmcia_socket *s =to_skt (skt);unsigned int pa_dwr_mask, pa_dwr_set;int ret;
@@ -97,7 +99,7 @@ jornada720_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_sunsigned long flags;local_irq_save (flags); -sa1111_set_io (SA1111_DEV (skt->dev), pa_dwr_mask, pa_dwr_set); +sa1111_set_io (s->dev, pa_dwr_mask, pa_dwr_set);local_irq_restore (flags); }
@@ -113,14 +115,20 @@ static struct pcmcia_low_level jornada720_pcmcia_ops = { .socket_init = sa1111_pcmcia_socket_init, .socket_suspend = sa1111_pcmcia_socket_suspend, + + .first = 0, + .nr = 2, };int __devinit pcmcia_jornada720_init (struct device *dev) {int ret = -ENODEV ; -if (machine_is_jornada720 ()) - ret =sa11xx_drv_pcmcia_probe (dev, &jornada720_pcmcia_ops,0 ,2 ); +if (machine_is_jornada720 ()) { +sa11xx_drv_pcmcia_ops (&jornada720_pcmcia_ops); + ret =sa1111_pcmcia_add (dev, &jornada720_pcmcia_ops, + sa11xx_drv_pcmcia_add_one); + }return ret; }
drivers/pcmcia/sa1100_neponset.c +7 -2
@@ -43,6 +43,7 @@static int neponset_pcmcia_configure_socket (struct soc_pcmcia_socket *skt,const socket_state_t *state) { +struct sa1111_pcmcia_socket *s =to_skt (skt);unsigned int ncr_mask, ncr_set, pa_dwr_mask, pa_dwr_set;int ret;
@@ -99,7 +100,7 @@ neponset_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_staNCR_0 = (NCR_0 & ~ncr_mask) | ncr_set;local_irq_restore (flags); -sa1111_set_io (SA1111_DEV (skt->dev), pa_dwr_mask, pa_dwr_set); +sa1111_set_io (s->dev, pa_dwr_mask, pa_dwr_set); }return 0 ;
@@ -121,6 +122,8 @@ static struct pcmcia_low_level neponset_pcmcia_ops = { .configure_socket = neponset_pcmcia_configure_socket, .socket_init = neponset_pcmcia_socket_init, .socket_suspend = sa1111_pcmcia_socket_suspend, + .first = 0, + .nr = 2, };int pcmcia_neponset_init (struct sa1111_dev *sadev)
@@ -135,7 +138,9 @@ int pcmcia_neponset_init(struct sa1111_dev *sadev)sa1111_set_io_dir (sadev,GPIO_A0 |GPIO_A1 |GPIO_A2 |GPIO_A3 ,0 ,0 );sa1111_set_io (sadev,GPIO_A0 |GPIO_A1 |GPIO_A2 |GPIO_A3 ,0 );sa1111_set_sleep_io (sadev,GPIO_A0 |GPIO_A1 |GPIO_A2 |GPIO_A3 ,0 ); - ret =sa11xx_drv_pcmcia_probe (&sadev->dev, &neponset_pcmcia_ops,0 ,2 ); +sa11xx_drv_pcmcia_ops (&neponset_pcmcia_ops); + ret =sa1111_pcmcia_add (sadev, &neponset_pcmcia_ops, + sa11xx_drv_pcmcia_add_one); }return ret;
drivers/pcmcia/sa1111_generic.c +45 -13
104 lines not on this page · raw message
drivers/pcmcia/sa1111_generic.h +14 -0
@@ -1,6 +1,20 @@#include "soc_common.h" #include "sa11xx_base.h" +struct sa1111_pcmcia_socket { +struct soc_pcmcia_socket soc; +struct sa1111_dev *dev; +struct sa1111_pcmcia_socket *next; +}; + +static inline struct sa1111_pcmcia_socket *to_skt (struct soc_pcmcia_socket *s) +{ + return container_of(s, struct sa1111_pcmcia_socket, soc); +} + +int sa1111_pcmcia_add (struct sa1111_dev *dev,struct pcmcia_low_level *ops, +int (*add)(struct soc_pcmcia_socket *)); +extern int sa1111_pcmcia_hw_init (struct soc_pcmcia_socket *);extern void sa1111_pcmcia_hw_shutdown (struct soc_pcmcia_socket *);extern void sa1111_pcmcia_socket_state (struct soc_pcmcia_socket *,struct pcmcia_state *);
drivers/pcmcia/sa11xx_base.c +14 -7
@@ -171,7 +171,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 sa11xx_drv_pcmcia_add_one (struct soc_pcmcia_socket *skt) +int sa11xx_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 ;
@@ -195,14 +195,10 @@ static int sa11xx_drv_pcmcia_add_one(struct soc_pcmcia_socket *skt)return soc_pcmcia_add_one (skt); } +EXPORT_SYMBOL (sa11xx_drv_pcmcia_add_one); -int sa11xx_drv_pcmcia_probe (struct device *dev,struct pcmcia_low_level *ops, -int first,int nr) +void sa11xx_drv_pcmcia_ops (struct pcmcia_low_level *ops) { -struct skt_dev_info *sinfo; -struct soc_pcmcia_socket *skt; -int i; -/* * set default MECR calculation if the board specific * code did not specify one...
@@ -216,6 +212,17 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops,#ifdef CONFIG_CPU_FREQ ops->frequency_change = sa1100_pcmcia_frequency_change;#endif +} +EXPORT_SYMBOL (sa11xx_drv_pcmcia_ops); + +int sa11xx_drv_pcmcia_probe (struct device *dev,struct pcmcia_low_level *ops, +int first,int nr) +{ +struct skt_dev_info *sinfo; +struct soc_pcmcia_socket *skt; +int i, ret =0 ; + +sa11xx_drv_pcmcia_ops (ops); sinfo =kzalloc (SKT_DEV_INFO_SIZE (nr),GFP_KERNEL );if (!sinfo)
drivers/pcmcia/sa11xx_base.h +2 -0
@@ -118,6 +118,8 @@ static inline unsigned int sa1100_pcmcia_cmd_time(unsigned int cpu_clock_khz, } +int sa11xx_drv_pcmcia_add_one (struct soc_pcmcia_socket *skt); +void sa11xx_drv_pcmcia_ops (struct pcmcia_low_level *ops);extern int sa11xx_drv_pcmcia_probe (struct device *dev,struct pcmcia_low_level *ops,int first,int nr);#endif /* !defined(_PCMCIA_SA1100_H) */
Signature · 1 line
1.6.2.5
RFC PATCH 6/10 PCMCIA: sa1111: remove duplicated initializers
In reply to Russell King - ARM Linux--- drivers/pcmcia/pxa2xx_lubbock.c | 4 ---- drivers/pcmcia/sa1100_badge4.c | 6 ------ drivers/pcmcia/sa1100_jornada720.c | 32 +++++++++----------------------- drivers/pcmcia/sa1100_neponset.c | 4 ---- drivers/pcmcia/sa1111_generic.c | 11 ++++++++--- drivers/pcmcia/sa1111_generic.h | 3 --- 6 files changed, 17 insertions(+), 43 deletions(-)
drivers/pcmcia/pxa2xx_lubbock.c +0 -4
@@ -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 = sa1111_pcmcia_hw_init, - .hw_shutdown = sa1111_pcmcia_hw_shutdown, - .socket_state = sa1111_pcmcia_socket_state, .configure_socket = lubbock_pcmcia_configure_socket, .socket_init = sa1111_pcmcia_socket_init, - .socket_suspend = sa1111_pcmcia_socket_suspend, .first =0 , .nr =2 , };
drivers/pcmcia/sa1100_badge4.c +0 -6
@@ -127,14 +127,8 @@ badge4_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_statestatic struct pcmcia_low_level badge4_pcmcia_ops = { .owner =THIS_MODULE , - .hw_init = sa1111_pcmcia_hw_init, - .hw_shutdown = sa1111_pcmcia_hw_shutdown, - .socket_state = sa1111_pcmcia_socket_state, .configure_socket = badge4_pcmcia_configure_socket, - .socket_init = sa1111_pcmcia_socket_init, - .socket_suspend = sa1111_pcmcia_socket_suspend, - .first =0 , .nr =2 , };
drivers/pcmcia/sa1100_jornada720.c +9 -23
@@ -22,23 +22,6 @@#define SOCKET1_POWER (GPIO_GPIO1 | GPIO_GPIO3)#define SOCKET1_3V GPIO_GPIO3 -static int jornada720_pcmcia_hw_init (struct soc_pcmcia_socket *skt) -{ -struct sa1111_pcmcia_socket *s =to_skt (skt); -unsigned int pin =GPIO_A0 |GPIO_A1 |GPIO_A2 |GPIO_A3 ; - -/* -* What is all this crap for? -*/ -GRER |=0x00000002 ; -/* Set GPIO_A<3:1> to be outputs for PCMCIA/CF power controller: */ -sa1111_set_io_dir (s->dev, pin,0 ,0 ); -sa1111_set_io (s->dev, pin,0 ); -sa1111_set_sleep_io (s->dev, pin,0 ); - -return sa1111_pcmcia_hw_init (skt); -} -static int jornada720_pcmcia_configure_socket (struct soc_pcmcia_socket *skt,const socket_state_t *state) {
@@ -108,14 +91,8 @@ jornada720_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_sstatic struct pcmcia_low_level jornada720_pcmcia_ops = { .owner =THIS_MODULE , - .hw_init = jornada720_pcmcia_hw_init, - .hw_shutdown = sa1111_pcmcia_hw_shutdown, - .socket_state = sa1111_pcmcia_socket_state, .configure_socket = jornada720_pcmcia_configure_socket, - .socket_init = sa1111_pcmcia_socket_init, - .socket_suspend = sa1111_pcmcia_socket_suspend, - .first =0 , .nr =2 , };
@@ -125,6 +102,15 @@ int __devinit pcmcia_jornada720_init(struct device *dev)int ret = -ENODEV ;if (machine_is_jornada720 ()) { +unsigned int pin =GPIO_A0 |GPIO_A1 |GPIO_A2 |GPIO_A3 ; + +GRER |=0x00000002 ; + +/* Set GPIO_A<3:1> to be outputs for PCMCIA/CF power controller: */ +sa1111_set_io_dir (dev, pin,0 ,0 ); +sa1111_set_io (dev, pin,0 ); +sa1111_set_sleep_io (dev, pin,0 ); +sa11xx_drv_pcmcia_ops (&jornada720_pcmcia_ops); ret =sa1111_pcmcia_add (dev, &jornada720_pcmcia_ops, sa11xx_drv_pcmcia_add_one);
drivers/pcmcia/sa1100_neponset.c +0 -4
@@ -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 = sa1111_pcmcia_hw_init, - .hw_shutdown = sa1111_pcmcia_hw_shutdown, - .socket_state = sa1111_pcmcia_socket_state, .configure_socket = neponset_pcmcia_configure_socket, .socket_init = neponset_pcmcia_socket_init, - .socket_suspend = sa1111_pcmcia_socket_suspend, .first =0 , .nr =2 , };
drivers/pcmcia/sa1111_generic.c +8 -3
@@ -28,12 +28,12 @@ static struct pcmcia_irqs irqs[] = { { 1, IRQ_S1_BVD1_STSCHG, "SA1111 CF BVD1" }, }; -int sa1111_pcmcia_hw_init (struct soc_pcmcia_socket *skt) +static int sa1111_pcmcia_hw_init (struct soc_pcmcia_socket *skt) {return soc_pcmcia_request_irqs (skt, irqs,ARRAY_SIZE (irqs)); } -void sa1111_pcmcia_hw_shutdown (struct soc_pcmcia_socket *skt) +static void sa1111_pcmcia_hw_shutdown (struct soc_pcmcia_socket *skt) {soc_pcmcia_free_irqs (skt, irqs,ARRAY_SIZE (irqs)); }
@@ -111,7 +111,7 @@ void sa1111_pcmcia_socket_init(struct soc_pcmcia_socket *skt)soc_pcmcia_enable_irqs (skt, irqs,ARRAY_SIZE (irqs)); } -void sa1111_pcmcia_socket_suspend (struct soc_pcmcia_socket *skt) +static void sa1111_pcmcia_socket_suspend (struct soc_pcmcia_socket *skt) {soc_pcmcia_disable_irqs (skt, irqs,ARRAY_SIZE (irqs)); }
@@ -122,6 +122,11 @@ int sa1111_pcmcia_add(struct sa1111_dev *dev, struct pcmcia_low_level *ops,struct sa1111_pcmcia_socket *s;int i, ret =0 ; + ops->hw_init = sa1111_pcmcia_hw_init; + ops->hw_shutdown = sa1111_pcmcia_hw_shutdown; + ops->socket_state = sa1111_pcmcia_socket_state; + ops->socket_suspend = sa1111_pcmcia_socket_suspend; + s =kzalloc (sizeof (*s) * ops->nr,GFP_KERNEL );if (!s)return -ENODEV ;
drivers/pcmcia/sa1111_generic.h +0 -3
@@ -15,12 +15,9 @@ static inline struct sa1111_pcmcia_socket *to_skt(struct soc_pcmcia_socket *s)int sa1111_pcmcia_add (struct sa1111_dev *dev,struct pcmcia_low_level *ops,int (*add)(struct soc_pcmcia_socket *)); -extern int sa1111_pcmcia_hw_init (struct soc_pcmcia_socket *); -extern void sa1111_pcmcia_hw_shutdown (struct soc_pcmcia_socket *);extern void sa1111_pcmcia_socket_state (struct soc_pcmcia_socket *,struct pcmcia_state *);extern int sa1111_pcmcia_configure_socket (struct soc_pcmcia_socket *,const socket_state_t *);extern void sa1111_pcmcia_socket_init (struct soc_pcmcia_socket *); -extern void sa1111_pcmcia_socket_suspend (struct soc_pcmcia_socket *);extern int pcmcia_badge4_init (struct device *);extern int pcmcia_jornada720_init (struct device *);
Signature · 1 line
1.6.2.5
RFC PATCH 7/10 PCMCIA: soc_common: constify soc_pcmcia_socket ops member
In reply to Russell King - ARM LinuxNo one should modify the ops structure supplied to soc_pcmcia_socket so make it const.
--- drivers/pcmcia/soc_common.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/pcmcia/soc_common.h +1 -1
@@ -37,7 +37,7 @@ struct soc_pcmcia_socket {/* * Core PCMCIA state */ -struct pcmcia_low_level *ops; +const struct pcmcia_low_level *ops;unsigned int status;socket_state_t cs_state;
Signature · 1 line
1.6.2.5
RFC PATCH 8/10 PCMCIA: soc_common: remove 'dev' member from soc_pcmcia_socket
In reply to Russell King - ARM LinuxThe 'dev' member is now only ever written, so we can safely remove it.
--- 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(-)
drivers/pcmcia/pxa2xx_base.c +0 -1
@@ -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;
drivers/pcmcia/sa11xx_base.c +0 -1
@@ -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;
drivers/pcmcia/soc_common.h +0 -1
@@ -30,7 +30,6 @@ struct soc_pcmcia_socket {/* * Info from low level handler */ -struct device *dev;unsigned int nr;unsigned int irq;
Signature · 1 line
1.6.2.5
RFC PATCH 9/10 PCMCIA: ss: allow PCI IRQs > 255
In reply to Russell King - ARM Linux--- include/pcmcia/ss.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
include/pcmcia/ss.h +1 -1
@@ -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;
Signature · 1 line
1.6.2.5
RFC PATCH 10/10 PCMCIA: stop duplicating pci_irq in soc_pcmcia_socket
In reply to Russell King - ARM Linuxskt->irq is a mere duplication of pcmcia_socket's pci_irq member. Get rid of it.
--- 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/sa1111_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(-)
drivers/pcmcia/pxa2xx_base.c +1 -1
@@ -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)
drivers/pcmcia/pxa2xx_cm_x255.c +1 -1
@@ -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 );
drivers/pcmcia/pxa2xx_cm_x270.c +1 -1
@@ -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 );
drivers/pcmcia/pxa2xx_e740.c +1 -1
@@ -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 );
drivers/pcmcia/pxa2xx_mainstone.c +1 -1
@@ -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)); }
drivers/pcmcia/pxa2xx_palmld.c +1 -1
@@ -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:
drivers/pcmcia/pxa2xx_palmtx.c +1 -1
@@ -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:
drivers/pcmcia/pxa2xx_sharpsl.c +1 -1
@@ -66,7 +66,7 @@ static int sharpsl_pcmcia_hw_init(struct soc_pcmcia_socket *skt) } } - skt->irq =SCOOP_DEV [skt->nr].irq; + skt->socket.pci_irq =SCOOP_DEV [skt->nr].irq;return 0 ; }
drivers/pcmcia/pxa2xx_trizeps4.c +2 -2
@@ -53,7 +53,7 @@ static int trizeps_pcmcia_hw_init(struct soc_pcmcia_socket *skt)gpio_free (GPIO_PRDY );return -EINVAL ; } - skt->irq =IRQ_GPIO (GPIO_PRDY ); + skt->socket.pci_irq =IRQ_GPIO (GPIO_PRDY );break ;#ifndef CONFIG_MACH_TRIZEPS_CONXS
@@ -63,7 +63,7 @@ static int trizeps_pcmcia_hw_init(struct soc_pcmcia_socket *skt)break ; }/* release the reset of this card */ -pr_debug ("%s: sock %d irq %d\n" , __func__, skt->nr, skt->irq); +pr_debug ("%s: sock %d irq %d\n" , __func__, skt->nr, skt->socket.pci_irq);/* supplementory irqs for the socket */ for (i =0 ; i <ARRAY_SIZE (irqs); i++) {
drivers/pcmcia/pxa2xx_viper.c +1 -1
@@ -40,7 +40,7 @@ static int viper_pcmcia_hw_init(struct soc_pcmcia_socket *skt) {unsigned long flags; - skt->irq =gpio_to_irq (VIPER_CF_RDY_GPIO ); + skt->socket.pci_irq =gpio_to_irq (VIPER_CF_RDY_GPIO );if (gpio_request (VIPER_CF_CD_GPIO ,"CF detect" )) goto err_request_cd;
drivers/pcmcia/sa1100_assabet.c +1 -1
@@ -27,7 +27,7 @@ static struct pcmcia_irqs irqs[] = {static int assabet_pcmcia_hw_init (struct soc_pcmcia_socket *skt) { - skt->irq =ASSABET_IRQ_GPIO_CF_IRQ ; + skt->socket.pci_irq =ASSABET_IRQ_GPIO_CF_IRQ ;return soc_pcmcia_request_irqs (skt, irqs,ARRAY_SIZE (irqs)); }
drivers/pcmcia/sa1100_cerf.c +1 -1
@@ -27,7 +27,7 @@ static struct pcmcia_irqs irqs[] = {static int cerf_pcmcia_hw_init (struct soc_pcmcia_socket *skt) { - skt->irq =CERF_IRQ_GPIO_CF_IRQ ; + skt->socket.pci_irq =CERF_IRQ_GPIO_CF_IRQ ;return soc_pcmcia_request_irqs (skt, irqs,ARRAY_SIZE (irqs)); }
drivers/pcmcia/sa1100_h3600.c +2 -2
@@ -25,8 +25,8 @@ static struct pcmcia_irqs irqs[] = {static int h3600_pcmcia_hw_init (struct soc_pcmcia_socket *skt) { - skt->irq = skt->nr ?IRQ_GPIO_H3600_PCMCIA_IRQ1 - :IRQ_GPIO_H3600_PCMCIA_IRQ0 ; + skt->socket.pci_irq = skt->nr ?IRQ_GPIO_H3600_PCMCIA_IRQ1 + :IRQ_GPIO_H3600_PCMCIA_IRQ0 ;return soc_pcmcia_request_irqs (skt, irqs,ARRAY_SIZE (irqs));
drivers/pcmcia/sa1100_shannon.c +1 -1
@@ -28,7 +28,7 @@ static int shannon_pcmcia_hw_init(struct soc_pcmcia_socket *skt)GAFR &= ~(SHANNON_GPIO_EJECT_0 |SHANNON_GPIO_EJECT_1 |SHANNON_GPIO_RDY_0 |SHANNON_GPIO_RDY_1 ); - skt->irq = skt->nr ?SHANNON_IRQ_GPIO_RDY_1 :SHANNON_IRQ_GPIO_RDY_0 ; + skt->socket.pci_irq = skt->nr ?SHANNON_IRQ_GPIO_RDY_1 :SHANNON_IRQ_GPIO_RDY_0 ;return soc_pcmcia_request_irqs (skt, irqs,ARRAY_SIZE (irqs)); }
drivers/pcmcia/sa1100_simpad.c +1 -1
@@ -28,7 +28,7 @@ static int simpad_pcmcia_hw_init(struct soc_pcmcia_socket *skt)clear_cs3_bit (VCC_3V_EN |VCC_5V_EN |EN0 |EN1 ); - skt->irq =IRQ_GPIO_CF_IRQ ; + skt->socket.pci_irq =IRQ_GPIO_CF_IRQ ;return soc_pcmcia_request_irqs (skt, irqs,ARRAY_SIZE (irqs)); }
drivers/pcmcia/sa1111_generic.c +1 -1
@@ -137,10 +137,10 @@ int sa1111_pcmcia_add(struct sa1111_dev *dev, struct pcmcia_low_level *ops,return -ENOMEM ; s->soc.nr = ops->first + i; - s->soc.irq = s->soc.nr ?IRQ_S1_READY_NINT :IRQ_S0_READY_NINT ; s->soc.ops = ops; s->soc.socket.owner = ops->owner; s->soc.socket.dev.parent = &dev->dev; + s->soc.socket.pci_irq = s->soc.nr ?IRQ_S1_READY_NINT :IRQ_S0_READY_NINT ; s->dev = dev; ret =add (&s->soc);
drivers/pcmcia/sa11xx_base.c +1 -1
@@ -235,10 +235,10 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, skt = &sinfo->skt[i]; skt->nr = 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 =sa11xx_drv_pcmcia_add_one (skt);if (ret)
drivers/pcmcia/soc_common.c +4 -4
@@ -144,10 +144,10 @@ soc_common_pcmcia_config_skt(struct soc_pcmcia_socket *skt, socket_state_t *stat*/ if (skt->irq_state !=1 && state->io_irq) { skt->irq_state =1 ; -set_irq_type (skt->irq,IRQ_TYPE_EDGE_FALLING ); +set_irq_type (skt->socket.pci_irq,IRQ_TYPE_EDGE_FALLING ); }else if (skt->irq_state ==1 && state->io_irq ==0 ) { skt->irq_state =0 ; -set_irq_type (skt->irq,IRQ_TYPE_NONE ); +set_irq_type (skt->socket.pci_irq,IRQ_TYPE_NONE ); } skt->cs_state = *state;
@@ -491,7 +491,8 @@ static ssize_t show_status(struct device *dev, struct device_attribute *attr, ch p+=sprintf (p,"Vcc : %d\n" , skt->cs_state.Vcc); p+=sprintf (p,"Vpp : %d\n" , skt->cs_state.Vpp); - p+=sprintf (p,"IRQ : %d (%d)\n" , skt->cs_state.io_irq, skt->irq); + p+=sprintf (p,"IRQ : %d (%d)\n" , skt->cs_state.io_irq, + skt->socket.pci_irq);if (skt->ops->show_timing) p+=skt->ops->show_timing (skt, p);
@@ -694,7 +695,6 @@ int soc_pcmcia_add_one(struct soc_pcmcia_socket *skt) 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->status =soc_common_pcmcia_skt_state (skt);
drivers/pcmcia/soc_common.h +0 -1
@@ -31,7 +31,6 @@ struct soc_pcmcia_socket {* Info from low level handler */ unsigned int nr; -unsigned int irq;/* * Core PCMCIA state
Signature · 1 line
1.6.2.5
PATCH 1/1 pcmcia: Fix additional platforms after removal of skt->irq in 66024db57d5b9011e274b314affad68f370c0d6f
---
Russell's original patch is currently in linux-next (and hence I'm guessing heading for the merge window?). In the intervening time, 2 platforms have been added using the now nonexistent skt-irq. This patch fixes them as per the other platforms.
drivers/pcmcia/pxa2xx_palmtc.c | 2 +- drivers/pcmcia/pxa2xx_stargate2.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/pcmcia/pxa2xx_palmtc.c +1 -1
@@ -67,7 +67,7 @@ static int palmtc_pcmcia_hw_init(struct soc_pcmcia_socket *skt)if (ret) goto err7; - skt->irq =IRQ_GPIO (GPIO_NR_PALMTC_PCMCIA_READY ); + skt->socket.pci_irq =IRQ_GPIO (GPIO_NR_PALMTC_PCMCIA_READY );return 0 ; err7:
drivers/pcmcia/pxa2xx_stargate2.c +1 -1
@@ -40,7 +40,7 @@ static struct pcmcia_irqs irqs[] = {static int sg2_pcmcia_hw_init (struct soc_pcmcia_socket *skt) { - skt->irq =IRQ_GPIO (SG2_S0_GPIO_READY ); + skt->socket.pci_irq =IRQ_GPIO (SG2_S0_GPIO_READY );return soc_pcmcia_request_irqs (skt, irqs,ARRAY_SIZE (irqs)); }
Signature · 1 line
1.6.4.4
PATCH 1/1 pcmcia: Fix additional platforms after removal of skt->irq in 66024db57d5b9011e274b314affad68f370c0d6f
Actually, sorry for the noise. Please hold off on this one, there are more problems due to the same patch set. Should have waited for the compile to finish!
Jonathan
Quoted 38 lines
Signed-off-by Jonathan Cameron <[email protected]>---
Russell's original patch is currently in linux-next (and hence I'm guessing heading for the merge window?). In the intervening time, 2 platforms have been added using the now nonexistent skt-irq. This patch fixes them as per the other platforms.
drivers/pcmcia/pxa2xx_palmtc.c | 2 +- drivers/pcmcia/pxa2xx_stargate2.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)drivers/pcmcia/pxa2xx_palmtc.c +1
-1@@ -67,7 +67,7 @@ static int palmtc_pcmcia_hw_init(struct soc_pcmcia_socket *skt)if (ret) goto err7; - skt->irq =IRQ_GPIO (GPIO_NR_PALMTC_PCMCIA_READY ); + skt->socket.pci_irq =IRQ_GPIO (GPIO_NR_PALMTC_PCMCIA_READY );return 0 ; err7:drivers/pcmcia/pxa2xx_stargate2.c +1
-1@@ -40,7 +40,7 @@ static struct pcmcia_irqs irqs[] = {static int sg2_pcmcia_hw_init (struct soc_pcmcia_socket *skt) { - skt->irq =IRQ_GPIO (SG2_S0_GPIO_READY ); + skt->socket.pci_irq =IRQ_GPIO (SG2_S0_GPIO_READY );return soc_pcmcia_request_irqs (skt, irqs,ARRAY_SIZE (irqs)); }
cover PCMCIA soc_common re-factorization
In reply to Russell King - ARM LinuxThis is a re-post of the previous patch series, but rebased forward earlier on this month. Review comments would be nice to have, or alternatively acks.
Lastly, is there an active PCMCIA maintainer who should take these?
cover PCMCIA soc_common re-factorization
Quoted 5 lines · Russell King - ARM Linux
This is a re-post of the previous patch series, but rebased forward earlier on this month. Review comments would be nice to have, or alternatively acks.
Lastly, is there an active PCMCIA maintainer who should take these?
Oh, and sorry for the stupid dates; next time I'll remember to delete the Date: header from the git format-patch output.
cover PCMCIA soc_common re-factorization
In reply to Russell King - ARM LinuxQuoted 1 line
Lastly, is there an active PCMCIA maintainer who should take these?
Dominik is very active these days (see pcmcia ml-archives).
Signature · 9 lines
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ | -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091028/0ac78fa0/attachment.sig>
Dominik Brodowski
maintainercover PCMCIA soc_common re-factorization
In reply to Russell King - ARM LinuxRussell,
Quoted 3 lines · Russell King - ARM Linux
This is a re-post of the previous patch series, but rebased forward earlier on this month. Review comments would be nice to have, or alternatively acks.
Acked-by / Signed-off-by: Dominik Brodowski <[email protected]> .
Quoted 1 line
Lastly, is there an active PCMCIA maintainer who should take these?
Do you have a git tree to pull from, or shall I apply each patch locally? Alternatively, you're free to push it upstream yourself; as the PCMCIA core is only touched in one (albeit _very_ useful) line.
Best,
Dominik
cover PCMCIA soc_common re-factorization
Quoted 3 lines · Dominik Brodowski
Do you have a git tree to pull from, or shall I apply each patch locally? Alternatively, you're free to push it upstream yourself; as the PCMCIA core is only touched in one (albeit _very_ useful) line.
Thanks. Here's a URL you can pull them from:
ssh://master.kernel.org/home/rmk/linux-2.6-arm.git pcmcia
Dominik Brodowski
maintainercover PCMCIA soc_common re-factorization
Quoted 8 lines · Russell King - ARM Linux
Quoted 3 lines · Dominik Brodowski
Do you have a git tree to pull from, or shall I apply each patch locally? Alternatively, you're free to push it upstream yourself; as the PCMCIA core is only touched in one (albeit _very_ useful) line.
Thanks. Here's a URL you can pull them from:
ssh://master.kernel.org/home/rmk/linux-2.6-arm.git pcmcia
Thanks! I've applied the patches you sent me by mail, though, as your tree was based on something more recent from Linus than my tree, and I wanted to avoid a merge of Linus' tree into my tree.
http://git.kernel.org/?p=linux/kernel/git/brodo/pcmcia-2.6.git;a=summary
should have your patches momentarily.
Best,
Dominik
RFC PATCH 1/10 PCMCIA: soc_common: convert to a stand alone module
In reply to Russell King - ARM LinuxHi Russell,
This one is causing me some build problems.
As things currently stand I can't build the pxa2xx support for pcmcia with a stargate2 as a module. It's fine if built in.
Note by this I meant building with the whole pcmcia subsytem as modules.
As module get a load of undefined symbols:
ERROR: "soc_pcmcia_request_irqs" [drivers/pcmcia/pxa2xx_stargate2.ko] undefined!
ERROR: "soc_pcmcia_free_irqs" [drivers/pcmcia/pxa2xx_stargate2.ko] undefined!
ERROR: "soc_pcmcia_enable_irqs" [drivers/pcmcia/pxa2xx_stargate2.ko] undefined!
ERROR: "soc_pcmcia_disable_irqs" [drivers/pcmcia/pxa2xx_stargate2.ko] undefined!
ERROR: "soc_pcmcia_add_one" [drivers/pcmcia/pxa2xx_base.ko] undefined!
ERROR: "soc_common_pcmcia_get_timing" [drivers/pcmcia/pxa2xx_base.ko] undefined!
ERROR: "soc_pcmcia_remove_one" [drivers/pcmcia/pxa2xx_base.ko] undefined! make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2
Relevant bits of .config
# Bus support
#
# CONFIG_PCI_SYSCALL is not set
# CONFIG_ARCH_SUPPORTS_MSI is not setCONFIG_PCCARD=mCONFIG_PCMCIA=mCONFIG_PCMCIA_LOAD_CIS=yCONFIG_PCMCIA_IOCTL=y
#
# PC-card bridges
#CONFIG_PCMCIA_SOC_COMMON=yCONFIG_PCMCIA_PXA2XX=m
# CONFIG_PCMCIA_DEBUG is not set
I think the fix is:
drivers/pcmcia/Kconfig +1 -1
@@ -200,7 +200,7 @@ config PCMCIA_BCM63XX depends on BCM63XX && PCMCIA config PCMCIA_SOC_COMMON - bool + tristate config PCMCIA_SA1100 tristate "SA1100 support"
Quoted 136 lines
Convert
soc_common.cto 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 forsoc_commonto register/remove the cpufreq notifier.Signed-off-by Russell King <[email protected]>--- drivers/pcmcia/Kconfig | 6 ++++++ drivers/pcmcia/Makefile | 10 ++++------ drivers/pcmcia/soc_common.c | 16 +++++++--------- 3 files changed, 17 insertions(+), 15 deletions(-)drivers/pcmcia/Kconfig +6
-0@@ -196,9 +196,13 @@ config PCMCIA_BCM63XX tristate "bcm63xx pcmcia support" depends on BCM63XX && 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)/@@ -209,6 +213,7 @@ config PCMCIA_SA1100 config PCMCIA_SA1111 tristate "SA1111 support" depends on ARM && ARCH_SA1100 && SA1111 && PCMCIA + select PCMCIA_SOC_COMMON help Say Y here to include support for SA1111-based PCMCIA or CF sockets, found on the Jornada 720, Graphicsmaster and other@@ -222,6 +227,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 controllerdrivers/pcmcia/Makefile +4
-6@@ -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_SA1111) += sa11xx_core.o sa1111_cs.o +obj-$(CONFIG_PCMCIA_SOC_COMMON) += soc_common.o +obj-$(CONFIG_PCMCIA_SA1100) += sa11xx_base.o sa1100_cs.o +obj-$(CONFIG_PCMCIA_SA1111) += sa11xx_base.o sa1111_cs.o obj-$(CONFIG_M32R_PCC) += m32r_pcc.o obj-$(CONFIG_M32R_CFC) += m32r_cfc.o obj-$(CONFIG_PCMCIA_AU1X00) += au1x00_ss.o@@ -35,9 +36,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@@ -77,4 +75,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)drivers/pcmcia/soc_common.c +7
-9@@ -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 *opsmutex_unlock (&soc_pcmcia_sockets_lock);return ret; } +EXPORT_SYMBOL (soc_common_drv_pcmcia_probe);int soc_common_drv_pcmcia_remove (struct device *dev) {@@ -772,9 +769,6 @@ int soc_common_drv_pcmcia_remove(struct device *dev)release_resource (&skt->res_io);release_resource (&skt->res_skt); } -if (list_empty (&soc_pcmcia_sockets)) -soc_pcmcia_cpufreq_unregister (); -mutex_unlock (&soc_pcmcia_sockets_lock);kfree (sinfo);@@ -782,3 +776,7 @@ int soc_common_drv_pcmcia_remove(struct device *dev)return 0 ; }EXPORT_SYMBOL (soc_common_drv_pcmcia_remove); + +MODULE_AUTHOR ("John Dorsey <[email protected]>" ); +MODULE_DESCRIPTION ("Linux PCMCIA Card Services: Common SoC support" ); +MODULE_LICENSE ("Dual MPL/GPL" );
RFC PATCH 1/10 PCMCIA: soc_common: convert to a stand alone module
Quoted 3 lines · Jonathan Cameron
Hi Russell,
This one is causing me some build problems.
Well, I've no idea what's happened to Dominik. While I may be the author of these patches, I didn't commit them, so they're out of my control.
There are some outstanding merge issues which SFR identified, and so far Dominik has been quiet on them.
For the time being, I'll merge your patch into my git tree, but unless Dominik hands my patches back to me for merging, it will be lost.
Dominik Brodowski
maintainerRFC PATCH 1/10 PCMCIA: soc_common: convert to a stand alone module
Russell,
Quoted 2 lines · Russell King - ARM Linux
For the time being, I'll merge your patch into my git tree, but unless Dominik hands my patches back to me for merging, it will be lost.
your patches -- which you asked me to merge and push upstream -- are on their way to Linus. I'll merge this bugfix to your patch later and push it upstream, too, unless you prefer to do that independently.
Best,
Dominik
RFC PATCH 1/10 PCMCIA: soc_common: convert to a stand alone module
Quoted 9 lines · Dominik Brodowski
Russell,
Quoted 2 lines · Russell King - ARM Linux
For the time being, I'll merge your patch into my git tree, but unless Dominik hands my patches back to me for merging, it will be lost.
your patches -- which you asked me to merge and push upstream -- are on their way to Linus. I'll merge this bugfix to your patch later and push it upstream, too, unless you prefer to do that independently.
Yes I did at the time, but things change. Since you've been totally silent on the merge conflicts between your PCMCIA tree and my tree which SFR reported on December 1st:
| Hi Dominik,
|
| Today's linux-next merge of the pcmcia tree got a conflict in
| drivers/pcmcia/sa1100_h3600.c between commit
| 6ce8f65e71f0d80ee23b543be09789dd865a99be ("ARM: 5811/1: pcmcia: convert
| sa1100_h3600 driver to gpiolib") from the arm tree and commit
| 66024db57d5b9011e274b314affad68f370c0d6f ("PCMCIA: stop duplicating
| pci_irq in soc_pcmcia_socket") from the pcmcia tree.
|
| I fixed it up (see below) and can carry the fix as necessary. Please
| check the fix below....
To which there was this reply:
| Fix looks good to me, and testing next-20091201 on real device (h3600) | shows no problems with pcmcia. | | Perhaps this merge conflict can be avoided by merging Russell's PCMCIA | patches through arm tree. But, anyway, it's Russell and Dominik | to decide.
And a reply from me agreeing that it would probably make more sense in light of this for my patches to go through my tree.
This is no longer possible, so I'm going to kick out the conflicting code for the time being. The conflicting stuff can be merged at some later date once this kind of issue is solved.
Dominik Brodowski
maintainerRFC PATCH 1/10 PCMCIA: soc_common: convert to a stand alone module
Russell,
Quoted 7 lines · Russell King - ARM Linux
Quoted 6 lines · Dominik Brodowski
Russell,
Quoted 2 lines · Russell King - ARM Linux
For the time being, I'll merge your patch into my git tree, but unless Dominik hands my patches back to me for merging, it will be lost.
Quoted 7 lines
Quoted 3 lines
your patches -- which you asked me to merge and push upstream -- are on their way to Linus. I'll merge this bugfix to your patch later and push it upstream, too, unless you prefer to do that independently.
Yes I did at the time, but things change. Since you've been totally silent on the merge conflicts between your PCMCIA tree and my tree which SFR reported on December 1st:
Well, as this was an addition through your tree, I didn't consider it neccessary to comment on it.
Quoted 21 lines
| Hi Dominik, | | Today's linux-next merge of the pcmcia tree got a conflict in | drivers/pcmcia/sa1100_h3600.c between commit | 6ce8f65e71f0d80ee23b543be09789dd865a99be ("ARM: 5811/1: pcmcia: convert | sa1100_h3600 driver to gpiolib") from the arm tree and commit | 66024db57d5b9011e274b314affad68f370c0d6f ("PCMCIA: stop duplicating | pci_irq in soc_pcmcia_socket") from the pcmcia tree. | | I fixed it up (see below) and can carry the fix as necessary. Please | check the fix below....
To which there was this reply:
| Fix looks good to me, and testing next-20091201 on real device (h3600) | shows no problems with pcmcia. | | Perhaps this merge conflict can be avoided by merging Russell's PCMCIA | patches through arm tree. But, anyway, it's Russell and Dominik | to decide.
Quoted 2 lines
And a reply from me agreeing that it would probably make more sense in light of this for my patches to go through my tree.
Well, another option would have been to merge the other changes to drivers/pcmcia/ via PCMCIA -- something which has not even been suggested. More and more I think some if not all PCMCIA socket drivers should reside in subdirectories to drivers/pcmcia/ .
Quoted 3 lines
This is no longer possible, so I'm going to kick out the conflicting code for the time being. The conflicting stuff can be merged at some later date once this kind of issue is solved.
That's one option, yes.
Best,
Dominik
RFC PATCH 1/10 PCMCIA: soc_common: convert to a stand alone module
Quoted 14 lines · Dominik Brodowski
Russell,
Quoted 11 lines · Russell King - ARM Linux
Quoted 9 lines · Dominik Brodowski
Russell,
Quoted 2 lines · Russell King - ARM Linux
For the time being, I'll merge your patch into my git tree, but unless Dominik hands my patches back to me for merging, it will be lost.
your patches -- which you asked me to merge and push upstream -- are on their way to Linus. I'll merge this bugfix to your patch later and push it upstream, too, unless you prefer to do that independently.
Quoted 6 lines
Quoted 3 lines
Yes I did at the time, but things change. Since you've been totally silent on the merge conflicts between your PCMCIA tree and my tree which SFR reported on December 1st:
Well, as this was an addition through your tree, I didn't consider it neccessary to comment on it.
Which, in spite of the discussion surrounding the conflict, and the resulting fall-out from it, would seem to have been the wrong decision.
Quoted 22 lines
Quoted 22 lines
| Hi Dominik, | | Today's linux-next merge of the pcmcia tree got a conflict in | drivers/pcmcia/sa1100_h3600.c between commit | 6ce8f65e71f0d80ee23b543be09789dd865a99be ("ARM: 5811/1: pcmcia: convert | sa1100_h3600 driver to gpiolib") from the arm tree and commit | 66024db57d5b9011e274b314affad68f370c0d6f ("PCMCIA: stop duplicating | pci_irq in soc_pcmcia_socket") from the pcmcia tree. | | I fixed it up (see below) and can carry the fix as necessary. Please | check the fix below....
To which there was this reply:
| Fix looks good to me, and testing next-20091201 on real device (h3600) | shows no problems with pcmcia. | | Perhaps this merge conflict can be avoided by merging Russell's PCMCIA | patches through arm tree. But, anyway, it's Russell and Dominik | to decide.
Quoted 5 lines
Quoted 2 lines
And a reply from me agreeing that it would probably make more sense in light of this for my patches to go through my tree.
Well, another option would have been to merge the other changes to
drivers/pcmcia/via PCMCIA -- something which has not even been suggested.
That would mean merging a bunch of other non-PCMCIA related changes through your tree as well.
Do you want all the non-PCMCIA related changes in your tree as well?
Quoted 2 lines
More and more I think some if not all PCMCIA socket drivers should reside in subdirectories to
drivers/pcmcia/.
That's a completely separate issue.