aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King - ARM Linux <linux@arm.linux.org.uk>2009-03-26 17:14:19 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2009-11-09 02:30:08 -0500
commit0f767de6a26a07f7d58394512b6f6c96322f047f (patch)
tree564a8c8c1b2ba960b03bf3235e16239f0ece9937
parenta7149f9a26eb44a5658d56335c23104ba529e9f6 (diff)
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. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
-rw-r--r--drivers/pcmcia/Kconfig6
-rw-r--r--drivers/pcmcia/Makefile10
-rw-r--r--drivers/pcmcia/soc_common.c16
3 files changed, 17 insertions, 15 deletions
diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig
index 0c44dddd9b7a..f3ccbccf5f21 100644
--- a/drivers/pcmcia/Kconfig
+++ b/drivers/pcmcia/Kconfig
@@ -178,9 +178,13 @@ config PCMCIA_BCM63XX
178 tristate "bcm63xx pcmcia support" 178 tristate "bcm63xx pcmcia support"
179 depends on BCM63XX && PCMCIA 179 depends on BCM63XX && PCMCIA
180 180
181config PCMCIA_SOC_COMMON
182 bool
183
181config PCMCIA_SA1100 184config PCMCIA_SA1100
182 tristate "SA1100 support" 185 tristate "SA1100 support"
183 depends on ARM && ARCH_SA1100 && PCMCIA 186 depends on ARM && ARCH_SA1100 && PCMCIA
187 select PCMCIA_SOC_COMMON
184 help 188 help
185 Say Y here to include support for SA11x0-based PCMCIA or CF 189 Say Y here to include support for SA11x0-based PCMCIA or CF
186 sockets, found on HP iPAQs, Yopy, and other StrongARM(R)/ 190 sockets, found on HP iPAQs, Yopy, and other StrongARM(R)/
@@ -191,6 +195,7 @@ config PCMCIA_SA1100
191config PCMCIA_SA1111 195config PCMCIA_SA1111
192 tristate "SA1111 support" 196 tristate "SA1111 support"
193 depends on ARM && ARCH_SA1100 && SA1111 && PCMCIA 197 depends on ARM && ARCH_SA1100 && SA1111 && PCMCIA
198 select PCMCIA_SOC_COMMON
194 help 199 help
195 Say Y here to include support for SA1111-based PCMCIA or CF 200 Say Y here to include support for SA1111-based PCMCIA or CF
196 sockets, found on the Jornada 720, Graphicsmaster and other 201 sockets, found on the Jornada 720, Graphicsmaster and other
@@ -204,6 +209,7 @@ config PCMCIA_PXA2XX
204 depends on (ARCH_LUBBOCK || MACH_MAINSTONE || PXA_SHARPSL \ 209 depends on (ARCH_LUBBOCK || MACH_MAINSTONE || PXA_SHARPSL \
205 || MACH_ARMCORE || ARCH_PXA_PALM || TRIZEPS_PCMCIA \ 210 || MACH_ARMCORE || ARCH_PXA_PALM || TRIZEPS_PCMCIA \
206 || ARCH_VIPER || ARCH_PXA_ESERIES || MACH_STARGATE2) 211 || ARCH_VIPER || ARCH_PXA_ESERIES || MACH_STARGATE2)
212 select PCMCIA_SOC_COMMON
207 help 213 help
208 Say Y here to include support for the PXA2xx PCMCIA controller 214 Say Y here to include support for the PXA2xx PCMCIA controller
209 215
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile
index a03a38acd77d..382938313991 100644
--- a/drivers/pcmcia/Makefile
+++ b/drivers/pcmcia/Makefile
@@ -22,8 +22,9 @@ obj-$(CONFIG_I82365) += i82365.o
22obj-$(CONFIG_I82092) += i82092.o 22obj-$(CONFIG_I82092) += i82092.o
23obj-$(CONFIG_TCIC) += tcic.o 23obj-$(CONFIG_TCIC) += tcic.o
24obj-$(CONFIG_PCMCIA_M8XX) += m8xx_pcmcia.o 24obj-$(CONFIG_PCMCIA_M8XX) += m8xx_pcmcia.o
25obj-$(CONFIG_PCMCIA_SA1100) += sa11xx_core.o sa1100_cs.o 25obj-$(CONFIG_PCMCIA_SOC_COMMON) += soc_common.o
26obj-$(CONFIG_PCMCIA_SA1111) += sa11xx_core.o sa1111_cs.o 26obj-$(CONFIG_PCMCIA_SA1100) += sa11xx_base.o sa1100_cs.o
27obj-$(CONFIG_PCMCIA_SA1111) += sa11xx_base.o sa1111_cs.o
27obj-$(CONFIG_M32R_PCC) += m32r_pcc.o 28obj-$(CONFIG_M32R_PCC) += m32r_pcc.o
28obj-$(CONFIG_M32R_CFC) += m32r_cfc.o 29obj-$(CONFIG_M32R_CFC) += m32r_cfc.o
29obj-$(CONFIG_PCMCIA_AU1X00) += au1x00_ss.o 30obj-$(CONFIG_PCMCIA_AU1X00) += au1x00_ss.o
@@ -35,9 +36,6 @@ obj-$(CONFIG_BFIN_CFPCMCIA) += bfin_cf_pcmcia.o
35obj-$(CONFIG_AT91_CF) += at91_cf.o 36obj-$(CONFIG_AT91_CF) += at91_cf.o
36obj-$(CONFIG_ELECTRA_CF) += electra_cf.o 37obj-$(CONFIG_ELECTRA_CF) += electra_cf.o
37 38
38sa11xx_core-y += soc_common.o sa11xx_base.o
39pxa2xx_core-y += soc_common.o pxa2xx_base.o
40
41au1x00_ss-y += au1000_generic.o 39au1x00_ss-y += au1000_generic.o
42au1x00_ss-$(CONFIG_MIPS_PB1000) += au1000_pb1x00.o 40au1x00_ss-$(CONFIG_MIPS_PB1000) += au1000_pb1x00.o
43au1x00_ss-$(CONFIG_MIPS_PB1100) += au1000_pb1x00.o 41au1x00_ss-$(CONFIG_MIPS_PB1100) += au1000_pb1x00.o
@@ -77,4 +75,4 @@ pxa2xx-obj-$(CONFIG_MACH_PALMLD) += pxa2xx_palmld.o
77pxa2xx-obj-$(CONFIG_MACH_E740) += pxa2xx_e740.o 75pxa2xx-obj-$(CONFIG_MACH_E740) += pxa2xx_e740.o
78pxa2xx-obj-$(CONFIG_MACH_STARGATE2) += pxa2xx_stargate2.o 76pxa2xx-obj-$(CONFIG_MACH_STARGATE2) += pxa2xx_stargate2.o
79 77
80obj-$(CONFIG_PCMCIA_PXA2XX) += pxa2xx_core.o $(pxa2xx-obj-y) 78obj-$(CONFIG_PCMCIA_PXA2XX) += pxa2xx_base.o $(pxa2xx-obj-y)
diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c
index ef7e9e58782b..a2d448f20b0f 100644
--- a/drivers/pcmcia/soc_common.c
+++ b/drivers/pcmcia/soc_common.c
@@ -609,15 +609,14 @@ static int soc_pcmcia_cpufreq_register(void)
609 "notifier for PCMCIA (%d)\n", ret); 609 "notifier for PCMCIA (%d)\n", ret);
610 return ret; 610 return ret;
611} 611}
612fs_initcall(soc_pcmcia_cpufreq_register);
612 613
613static void soc_pcmcia_cpufreq_unregister(void) 614static void soc_pcmcia_cpufreq_unregister(void)
614{ 615{
615 cpufreq_unregister_notifier(&soc_pcmcia_notifier_block, CPUFREQ_TRANSITION_NOTIFIER); 616 cpufreq_unregister_notifier(&soc_pcmcia_notifier_block, CPUFREQ_TRANSITION_NOTIFIER);
616} 617}
618module_exit(soc_pcmcia_cpufreq_unregister);
617 619
618#else
619static int soc_pcmcia_cpufreq_register(void) { return 0; }
620static void soc_pcmcia_cpufreq_unregister(void) {}
621#endif 620#endif
622 621
623int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, 622int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops,
@@ -668,9 +667,6 @@ int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops
668 goto out_err_5; 667 goto out_err_5;
669 } 668 }
670 669
671 if (list_empty(&soc_pcmcia_sockets))
672 soc_pcmcia_cpufreq_register();
673
674 list_add(&skt->node, &soc_pcmcia_sockets); 670 list_add(&skt->node, &soc_pcmcia_sockets);
675 671
676 /* 672 /*
@@ -743,6 +739,7 @@ int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops
743 mutex_unlock(&soc_pcmcia_sockets_lock); 739 mutex_unlock(&soc_pcmcia_sockets_lock);
744 return ret; 740 return ret;
745} 741}
742EXPORT_SYMBOL(soc_common_drv_pcmcia_probe);
746 743
747int soc_common_drv_pcmcia_remove(struct device *dev) 744int soc_common_drv_pcmcia_remove(struct device *dev)
748{ 745{
@@ -773,9 +770,6 @@ int soc_common_drv_pcmcia_remove(struct device *dev)
773 release_resource(&skt->res_io); 770 release_resource(&skt->res_io);
774 release_resource(&skt->res_skt); 771 release_resource(&skt->res_skt);
775 } 772 }
776 if (list_empty(&soc_pcmcia_sockets))
777 soc_pcmcia_cpufreq_unregister();
778
779 mutex_unlock(&soc_pcmcia_sockets_lock); 773 mutex_unlock(&soc_pcmcia_sockets_lock);
780 774
781 kfree(sinfo); 775 kfree(sinfo);
@@ -783,3 +777,7 @@ int soc_common_drv_pcmcia_remove(struct device *dev)
783 return 0; 777 return 0;
784} 778}
785EXPORT_SYMBOL(soc_common_drv_pcmcia_remove); 779EXPORT_SYMBOL(soc_common_drv_pcmcia_remove);
780
781MODULE_AUTHOR("John Dorsey <john+@cs.cmu.edu>");
782MODULE_DESCRIPTION("Linux PCMCIA Card Services: Common SoC support");
783MODULE_LICENSE("Dual MPL/GPL");