sa1100: Generic CF socket support
Subsystems (3)
Russell King - ARM Linux
maintainercover sa1100: Generic CF socket support
This series adds generic soc-common based CF socket support, which in conjunction with using gpiolib and regulator, allows us to eliminate a bunch of SA11x0 specific low-level socket drivers. This series covers just SA11x0 drivers.
arch/arm/mach-sa1100/Kconfig | 4 + arch/arm/mach-sa1100/assabet.c | 39 +++++++- arch/arm/mach-sa1100/cerf.c | 18 +++- arch/arm/mach-sa1100/clock.c | 2 + arch/arm/mach-sa1100/generic.c | 44 ++++++++- arch/arm/mach-sa1100/generic.h | 8 ++ arch/arm/mach-sa1100/h3xxx.c | 17 ++++ arch/arm/mach-sa1100/include/mach/assabet.h | 6 -- arch/arm/mach-sa1100/nanoengine.c | 23 +++++ arch/arm/mach-sa1100/shannon.c | 38 ++++++++ arch/arm/mach-sa1100/simpad.c | 11 +++ drivers/pcmcia/Makefile | 3 - drivers/pcmcia/sa1100_assabet.c | 100 --------------------- drivers/pcmcia/sa1100_cerf.c | 86 ------------------ drivers/pcmcia/sa1100_generic.c | 115 ++++++++++++++++++++---- drivers/pcmcia/sa1100_generic.h | 4 - drivers/pcmcia/sa1100_h3600.c | 16 ++-- drivers/pcmcia/sa1100_nanoengine.c | 133 ---------------------------- drivers/pcmcia/sa1100_shannon.c | 104 ---------------------- drivers/pcmcia/sa1100_simpad.c | 12 +-- 20 files changed, 307 insertions(+), 476 deletions(-) delete mode 100644 drivers/pcmcia/sa1100_assabet.c delete mode 100644 drivers/pcmcia/sa1100_cerf.c delete mode 100644 drivers/pcmcia/sa1100_nanoengine.c delete mode 100644 drivers/pcmcia/sa1100_shannon.c
Signature · 3 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up According to speedtest.net: 8.21Mbps down 510kbps up
PATCH 2/8 ARM: sa1100: provide infrastructure to support generic CF sockets
Provide the SoC-level infrastructure to support the generic CF sockets.
--- arch/arm/mach-sa1100/clock.c | 2 ++ arch/arm/mach-sa1100/generic.c | 44 +++++++++++++++++++++++++++++++++++++++++- arch/arm/mach-sa1100/generic.h | 8 ++++++++ 3 files changed, 53 insertions(+), 1 deletion(-)
arch/arm/mach-sa1100/clock.c +2 -0
@@ -163,6 +163,8 @@ static struct clk_lookup sa11xx_clkregs[] = {CLKDEV_INIT ("sa1100-rtc" ,NULL ,NULL ),CLKDEV_INIT ("sa11x0-fb" ,NULL , &clk_cpu),CLKDEV_INIT ("sa11x0-pcmcia" ,NULL , &clk_cpu), +CLKDEV_INIT ("sa11x0-pcmcia.0" ,NULL , &clk_cpu), +CLKDEV_INIT ("sa11x0-pcmcia.1" ,NULL , &clk_cpu),/* sa1111 names devices using internal offsets, PCMCIA is at 0x1800 */ CLKDEV_INIT ("1800" ,NULL , &clk_cpu), CLKDEV_INIT(NULL, "OSTIMER0", &clk_36864),
arch/arm/mach-sa1100/generic.c +43 -1
85 lines not on this page · raw message
arch/arm/mach-sa1100/generic.h +8 -0
@@ -47,3 +47,11 @@ static inline int sa11x0_pm_init(void) { return 0; }#endif int sa11xx_clk_init (void ); + +struct gpiod_lookup_table ; +void sa11x0_register_pcmcia (int socket,struct gpiod_lookup_table *); + +struct fixed_voltage_config ; +struct regulator_consumer_supply ; +int sa11x0_register_fixed_regulator (int n,struct fixed_voltage_config *cfg, +struct regulator_consumer_supply *supplies,unsigned num_supplies);
Signature · 1 line
2.7.4
PATCH 3/8 ARM: sa1100/assabet: convert to generic CF sockets
In reply to Russell King - ARM LinuxConvert Assabet to use the generic CF socket support.
--- arch/arm/mach-sa1100/Kconfig | 2 + arch/arm/mach-sa1100/assabet.c | 39 ++++++++++- arch/arm/mach-sa1100/include/mach/assabet.h | 6 -- drivers/pcmcia/Makefile | 1 - drivers/pcmcia/sa1100_assabet.c | 100 ---------------------------- drivers/pcmcia/sa1100_generic.c | 3 - drivers/pcmcia/sa1100_generic.h | 1 - 7 files changed, 40 insertions(+), 112 deletions(-) delete mode 100644 drivers/pcmcia/sa1100_assabet.c
arch/arm/mach-sa1100/Kconfig +2 -0
@@ -6,6 +6,8 @@ config SA1100_ASSABET bool "Assabet" select ARM_SA1110_CPUFREQ select GPIO_REG + select REGULATOR + select REGULATOR_FIXED_VOLTAGE help Say Y here if you are using the Intel(R) StrongARM(R) SA-1110 Microprocessor Development Board (also known as the Assabet).
arch/arm/mach-sa1100/assabet.c +38 -1
@@ -14,8 +14,11 @@#include <linux/module.h> #include <linux/errno.h> #include <linux/gpio/gpio-reg.h> +#include <linux/gpio/machine.h> #include <linux/ioport.h> #include <linux/platform_data/sa11x0-serial.h> +#include <linux/regulator/fixed.h> +#include <linux/regulator/machine.h> #include <linux/serial_core.h> #include <linux/platform_device.h> #include <linux/mfd/ucb1x00.h>
@@ -445,6 +448,29 @@ static struct resource neponset_resources[] = { };#endif +static struct gpiod_lookup_table assabet_cf_gpio_table = { + .dev_id ="sa11x0-pcmcia.1" , + .table = { +GPIO_LOOKUP ("gpio" ,21 ,"ready" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("gpio" ,22 ,"detect" ,GPIO_ACTIVE_LOW ), +GPIO_LOOKUP ("gpio" ,24 ,"bvd2" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("gpio" ,25 ,"bvd1" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("assabet" ,1 ,"reset" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("assabet" ,7 ,"bus-enable" ,GPIO_ACTIVE_LOW ), + { }, + }, +}; + +static struct regulator_consumer_supply assabet_cf_vcc_consumers[] = { +REGULATOR_SUPPLY ("vcc" ,"sa11x0-pcmcia.1" ), +}; + +static struct fixed_voltage_config assabet_cf_vcc_pdata__initdata = { + .supply_name ="cf-power" , + .microvolts =3300000 , + .enable_high =1 , +}; +static void __init assabet_init (void ) {/*
@@ -490,6 +516,11 @@ static void __init assabet_init(void)platform_device_register_simple ("neponset" ,0 , neponset_resources,ARRAY_SIZE (neponset_resources));#endif + }else { +sa11x0_register_fixed_regulator (0 , &assabet_cf_vcc_pdata, + assabet_cf_vcc_consumers, +ARRAY_SIZE (assabet_cf_vcc_consumers)); + }#ifndef ASSABET_PAL_VIDEO
@@ -501,6 +532,9 @@ static void __init assabet_init(void) ARRAY_SIZE(assabet_flash_resources));sa11x0_register_irda (&assabet_irda_data);sa11x0_register_mcp (&assabet_mcp_data); + +if (!machine_has_neponset ()) +sa11x0_register_pcmcia (1 , &assabet_cf_gpio_table); }/*
@@ -768,6 +802,7 @@ fs_initcall(assabet_leds_init);void __init assabet_init_irq (void ) { +unsigned int assabet_gpio_base;u32 def_val;sa1100_init_irq ();
@@ -782,7 +817,9 @@ void __init assabet_init_irq(void)* * This must precede any driver calls to BCR_set() or BCR_clear(). */ -assabet_init_gpio ((void *)&ASSABET_BCR , def_val); + assabet_gpio_base =assabet_init_gpio ((void *)&ASSABET_BCR , def_val); + + assabet_cf_vcc_pdata.gpio = assabet_gpio_base +0 ; }MACHINE_START (ASSABET ,"Intel-Assabet" )
arch/arm/mach-sa1100/include/mach/assabet.h +0 -6
@@ -96,10 +96,4 @@ extern void assabet_uda1341_reset(int set);#define ASSABET_GPIO_BATT_LOW GPIO_GPIO (26)/* Low battery */ #define ASSABET_GPIO_RCLK GPIO_GPIO (26)/* CCLK/2 */ -/* These are gpiolib GPIO numbers, not bitmasks */ -#define ASSABET_GPIO_CF_IRQ 21/* CF IRQ */ -#define ASSABET_GPIO_CF_CD 22/* CF CD */ -#define ASSABET_GPIO_CF_BVD2 24/* CF BVD / IOSPKR */ -#define ASSABET_GPIO_CF_BVD1 25/* CF BVD / IOSTSCHG */ -#endif
drivers/pcmcia/Makefile +0 -1
@@ -46,7 +46,6 @@ sa1111_cs-$(CONFIG_SA1100_JORNADA720) += sa1111_jornada720.o sa1111_cs-$(CONFIG_ARCH_LUBBOCK) += sa1111_lubbock.o sa1100_cs-y += sa1100_generic.o -sa1100_cs-$(CONFIG_SA1100_ASSABET) += sa1100_assabet.o sa1100_cs-$(CONFIG_SA1100_CERF) += sa1100_cerf.o sa1100_cs-$(CONFIG_SA1100_COLLIE) += pxa2xx_sharpsl.o sa1100_cs-$(CONFIG_SA1100_H3100) += sa1100_h3600.o
drivers/pcmcia/sa1100_assabet.c deleted +0 -100
100 lines not on this page · raw message
drivers/pcmcia/sa1100_generic.c +0 -3
@@ -98,9 +98,6 @@ static struct pcmcia_low_level sa11x0_cf_ops = {int __init pcmcia_collie_init (struct device *dev);static int (*sa11x0_pcmcia_legacy_hw_init[])(struct device *dev) = { -#ifdef CONFIG_SA1100_ASSABET - pcmcia_assabet_init, -#endif #ifdef CONFIG_SA1100_CERF pcmcia_cerf_init, #endif
drivers/pcmcia/sa1100_generic.h +0 -1
@@ -6,7 +6,6 @@* Declaration for all machine specific init/exit functions. */ extern int pcmcia_adsbitsy_init (struct device *); -extern int pcmcia_assabet_init (struct device *);extern int pcmcia_badge4_init (struct device *);extern int pcmcia_cerf_init (struct device *);extern int pcmcia_flexanet_init (struct device *);
Signature · 1 line
2.7.4
PATCH 4/8 ARM: sa1100/cerf: convert to generic CF sockets
In reply to Russell King - ARM LinuxConvert Cerf to use the generic CF socket support.
--- arch/arm/mach-sa1100/cerf.c | 18 +++++++-- drivers/pcmcia/Makefile | 1 - drivers/pcmcia/sa1100_cerf.c | 86 ----------------------------------------- drivers/pcmcia/sa1100_generic.c | 3 -- drivers/pcmcia/sa1100_generic.h | 1 - 5 files changed, 15 insertions(+), 94 deletions(-) delete mode 100644 drivers/pcmcia/sa1100_cerf.c
arch/arm/mach-sa1100/cerf.c +15 -3
@@ -11,6 +11,7 @@*/ #include <linux/init.h> +#include <linux/gpio/machine.h> #include <linux/kernel.h> #include <linux/tty.h> #include <linux/platform_data/sa11x0-serial.h>
@@ -45,6 +46,19 @@ static struct platform_device cerfuart2_device = { .resource = cerfuart2_resources, }; +/* Compact Flash */ +static struct gpiod_lookup_table cerf_cf_gpio_table = { + .dev_id ="sa11x0-pcmcia.1" , + .table = { +GPIO_LOOKUP ("gpio" ,19 ,"bvd2" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("gpio" ,20 ,"bvd1" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("gpio" ,21 ,"reset" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("gpio" ,22 ,"ready" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("gpio" ,23 ,"detect" ,GPIO_ACTIVE_LOW ), + { }, + }, +}; +/* LEDs */ struct gpio_led cerf_gpio_leds[] = { {
@@ -151,9 +165,6 @@ static void __init cerf_map_io(void)sa1100_register_uart (0 ,3 );sa1100_register_uart (1 ,2 );/* disable this and the uart2 device for sa1100_fir */ sa1100_register_uart (2 ,1 ); - -/* set some GPDR bits here while it's safe */ -GPDR |=CERF_GPIO_CF_RESET ; }static struct mcp_plat_data cerf_mcp_data = {
@@ -167,6 +178,7 @@ static void __init cerf_init(void)platform_add_devices (cerf_devices,ARRAY_SIZE (cerf_devices));sa11x0_register_mtd (&cerf_flash_data, &cerf_flash_resource,1 );sa11x0_register_mcp (&cerf_mcp_data); +sa11x0_register_pcmcia (1 , &cerf_cf_gpio_table); }MACHINE_START (CERF ,"Intrinsyc CerfBoard/CerfCube" )
drivers/pcmcia/Makefile +0 -1
@@ -46,7 +46,6 @@ sa1111_cs-$(CONFIG_SA1100_JORNADA720) += sa1111_jornada720.o sa1111_cs-$(CONFIG_ARCH_LUBBOCK) += sa1111_lubbock.o sa1100_cs-y += sa1100_generic.o -sa1100_cs-$(CONFIG_SA1100_CERF) += sa1100_cerf.o sa1100_cs-$(CONFIG_SA1100_COLLIE) += pxa2xx_sharpsl.o sa1100_cs-$(CONFIG_SA1100_H3100) += sa1100_h3600.o sa1100_cs-$(CONFIG_SA1100_H3600) += sa1100_h3600.o
drivers/pcmcia/sa1100_cerf.c deleted +0 -86
86 lines not on this page · raw message
drivers/pcmcia/sa1100_generic.c +0 -3
@@ -98,9 +98,6 @@ static struct pcmcia_low_level sa11x0_cf_ops = {int __init pcmcia_collie_init (struct device *dev); static int (*sa11x0_pcmcia_legacy_hw_init[])(struct device *dev) = { -#ifdef CONFIG_SA1100_CERF - pcmcia_cerf_init, -#endif#if defined(CONFIG_SA1100_H3100 ) || defined(CONFIG_SA1100_H3600 ) pcmcia_h3600_init,#endif
drivers/pcmcia/sa1100_generic.h +0 -1
@@ -7,7 +7,6 @@*/ extern int pcmcia_adsbitsy_init (struct device *);extern int pcmcia_badge4_init (struct device *); -extern int pcmcia_cerf_init (struct device *);extern int pcmcia_flexanet_init (struct device *);extern int pcmcia_freebird_init (struct device *);extern int pcmcia_gcplus_init (struct device *);
Signature · 1 line
2.7.4
PATCH 5/8 ARM: sa1100/h3xxx: switch h3xxx PCMCIA to use gpiod APIs
In reply to Russell King - ARM LinuxSwitch h3xxx's PCMCIA implementation to use the gpiod APIs where possible.
--- arch/arm/mach-sa1100/h3xxx.c | 17 +++++++++++++++++ drivers/pcmcia/sa1100_h3600.c | 16 +++++++--------- 2 files changed, 24 insertions(+), 9 deletions(-)
arch/arm/mach-sa1100/h3xxx.c +17 -0
@@ -11,6 +11,7 @@*/ #include <linux/kernel.h> +#include <linux/gpio/machine.h> #include <linux/gpio.h> #include <linux/gpio_keys.h> #include <linux/input.h>
@@ -264,8 +265,24 @@ static struct platform_device *h3xxx_devices[] = { &h3xxx_micro_asic, }; +static struct gpiod_lookup_table h3xxx_pcmcia_gpio_table = { + .dev_id ="sa11x0-pcmcia" , + .table = { +GPIO_LOOKUP ("gpio" ,H3XXX_GPIO_PCMCIA_CD0 , +"pcmcia0-detect" ,GPIO_ACTIVE_LOW ), +GPIO_LOOKUP ("gpio" ,H3XXX_GPIO_PCMCIA_IRQ0 , +"pcmcia0-ready" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("gpio" ,H3XXX_GPIO_PCMCIA_CD1 , +"pcmcia1-detect" ,GPIO_ACTIVE_LOW ), +GPIO_LOOKUP ("gpio" ,H3XXX_GPIO_PCMCIA_IRQ1 , +"pcmcia1-ready" ,GPIO_ACTIVE_HIGH ), + { }, + }, +}; +void __init h3xxx_mach_init (void ) { +gpiod_add_lookup_table (&h3xxx_pcmcia_gpio_table);sa1100_register_uart_fns (&h3xxx_port_fns);sa11x0_register_mtd (&h3xxx_flash_data, &h3xxx_flash_resource,1 );platform_add_devices (h3xxx_devices,ARRAY_SIZE (h3xxx_devices));
drivers/pcmcia/sa1100_h3600.c +7 -9
@@ -24,13 +24,15 @@ static int h3600_pcmcia_hw_init(struct soc_pcmcia_socket *skt) {int err; + skt->stat[SOC_STAT_CD ].name = skt->nr ?"pcmcia1-detect" :"pcmcia0-detect" ; + skt->stat[SOC_STAT_RDY ].name = skt->nr ?"pcmcia1-ready" :"pcmcia0-ready" ; + + err =soc_pcmcia_request_gpiods (skt); +if (err) +return err; +switch (skt->nr) {case 0 : - skt->stat[SOC_STAT_CD ].gpio =H3XXX_GPIO_PCMCIA_CD0 ; - skt->stat[SOC_STAT_CD ].name ="PCMCIA CD0" ; - skt->stat[SOC_STAT_RDY ].gpio =H3XXX_GPIO_PCMCIA_IRQ0 ; - skt->stat[SOC_STAT_RDY ].name ="PCMCIA IRQ0" ; - err =gpio_request (H3XXX_EGPIO_OPT_NVRAM_ON ,"OPT NVRAM ON" );if (err) goto err01;
@@ -57,10 +59,6 @@ static int h3600_pcmcia_hw_init(struct soc_pcmcia_socket *skt) goto err06;break ;case 1 : - skt->stat[SOC_STAT_CD ].gpio =H3XXX_GPIO_PCMCIA_CD1 ; - skt->stat[SOC_STAT_CD ].name ="PCMCIA CD1" ; - skt->stat[SOC_STAT_RDY ].gpio =H3XXX_GPIO_PCMCIA_IRQ1 ; - skt->stat[SOC_STAT_RDY ].name ="PCMCIA IRQ1" ;break ; }return 0 ;
Signature · 1 line
2.7.4
PATCH 5/8 ARM: sa1100/h3xxx: switch h3xxx PCMCIA to use gpiod APIs
Quoted 4 lines · Russell King
Switch h3xxx's PCMCIA implementation to use the gpiod APIs where possible.
Signed-off-by Russell King <[email protected]>
Thanks for doing this.
Yours,
Linus Walleij
PATCH 6/8 ARM: sa1100/nanoengine: convert to generic CF sockets
In reply to Russell King - ARM LinuxConvert nanoengine to use the generic CF socket support.
--- arch/arm/mach-sa1100/nanoengine.c | 23 +++++++ drivers/pcmcia/sa1100_generic.c | 3 - drivers/pcmcia/sa1100_generic.h | 1 - drivers/pcmcia/sa1100_nanoengine.c | 133 ------------------------------------- 4 files changed, 23 insertions(+), 137 deletions(-) delete mode 100644 drivers/pcmcia/sa1100_nanoengine.c
arch/arm/mach-sa1100/nanoengine.c +23 -0
@@ -12,6 +12,7 @@*/ #include <linux/init.h> +#include <linux/gpio/machine.h> #include <linux/kernel.h> #include <linux/platform_data/sa11x0-serial.h> #include <linux/mtd/mtd.h>
@@ -99,8 +100,30 @@ static void __init nanoengine_map_io(void) Ser2HSCR0 =0 ; } +static struct gpiod_lookup_table nanoengine_pcmcia0_gpio_table = { + .dev_id ="sa11x0-pcmcia.0" , + .table = { +GPIO_LOOKUP ("gpio" ,11 ,"ready" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("gpio" ,13 ,"detect" ,GPIO_ACTIVE_LOW ), +GPIO_LOOKUP ("gpio" ,15 ,"reset" ,GPIO_ACTIVE_HIGH ), + { }, + }, +}; + +static struct gpiod_lookup_table nanoengine_pcmcia1_gpio_table = { + .dev_id ="sa11x0-pcmcia.1" , + .table = { +GPIO_LOOKUP ("gpio" ,12 ,"ready" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("gpio" ,14 ,"detect" ,GPIO_ACTIVE_LOW ), +GPIO_LOOKUP ("gpio" ,16 ,"reset" ,GPIO_ACTIVE_HIGH ), + { }, + }, +}; +static void __init nanoengine_init (void ) { +sa11x0_register_pcmcia (0 , &nanoengine_pcmcia0_gpio_table); +sa11x0_register_pcmcia (1 , &nanoengine_pcmcia1_gpio_table);sa11x0_register_mtd (&nanoengine_flash_data, nanoengine_flash_resources,ARRAY_SIZE (nanoengine_flash_resources)); }
drivers/pcmcia/sa1100_generic.c +0 -3
@@ -101,9 +101,6 @@ static int (*sa11x0_pcmcia_legacy_hw_init[])(struct device *dev) = {#if defined(CONFIG_SA1100_H3100 ) || defined(CONFIG_SA1100_H3600 ) pcmcia_h3600_init,#endif -#ifdef CONFIG_SA1100_NANOENGINE - pcmcia_nanoengine_init, -#endif #ifdef CONFIG_SA1100_SHANNON pcmcia_shannon_init,#endif
drivers/pcmcia/sa1100_generic.h +0 -1
@@ -12,7 +12,6 @@ extern int pcmcia_freebird_init(struct device *);extern int pcmcia_gcplus_init (struct device *);extern int pcmcia_graphicsmaster_init (struct device *);extern int pcmcia_h3600_init (struct device *); -extern int pcmcia_nanoengine_init (struct device *);extern int pcmcia_pangolin_init (struct device *);extern int pcmcia_pfs168_init (struct device *);extern int pcmcia_shannon_init (struct device *);
drivers/pcmcia/sa1100_nanoengine.c deleted +0 -133
133 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 7/8 ARM: sa1100/shannon: convert to generic CF sockets
In reply to Russell King - ARM LinuxConvert shannon to use the generic CF socket support.
--- arch/arm/mach-sa1100/Kconfig | 2 + arch/arm/mach-sa1100/shannon.c | 38 +++++++++++++++ drivers/pcmcia/Makefile | 1 - drivers/pcmcia/sa1100_generic.c | 3 -- drivers/pcmcia/sa1100_generic.h | 1 - drivers/pcmcia/sa1100_shannon.c | 104 ---------------------------------------- 6 files changed, 40 insertions(+), 109 deletions(-) delete mode 100644 drivers/pcmcia/sa1100_shannon.c
arch/arm/mach-sa1100/Kconfig +2 -0
@@ -139,6 +139,8 @@ config SA1100_PLEB config SA1100_SHANNON bool "Shannon" select ARM_SA1100_CPUFREQ + select REGULATOR + select REGULATOR_FIXED_VOLTAGE help The Shannon (also known as a Tuxscreen, and also as a IS2630) was a limited edition webphone produced by Philips. The Shannon is a SA1100
arch/arm/mach-sa1100/shannon.c +38 -0
@@ -5,11 +5,14 @@#include <linux/init.h> #include <linux/device.h> +#include <linux/gpio/machine.h> #include <linux/kernel.h> #include <linux/platform_data/sa11x0-serial.h> #include <linux/tty.h> #include <linux/mtd/mtd.h> #include <linux/mtd/partitions.h> +#include <linux/regulator/fixed.h> +#include <linux/regulator/machine.h> #include <video/sa1100fb.h>
@@ -72,8 +75,43 @@ static struct sa1100fb_mach_info shannon_lcd_info = { .lccr3 = LCCR3_ACBsDiv(512), }; +static struct gpiod_lookup_table shannon_pcmcia0_gpio_table = { + .dev_id ="sa11x0-pcmcia.0" , + .table = { +GPIO_LOOKUP ("gpio" ,24 ,"detect" ,GPIO_ACTIVE_LOW ), +GPIO_LOOKUP ("gpio" ,26 ,"ready" ,GPIO_ACTIVE_HIGH ), + { }, + }, +}; + +static struct gpiod_lookup_table shannon_pcmcia1_gpio_table = { + .dev_id ="sa11x0-pcmcia.1" , + .table = { +GPIO_LOOKUP ("gpio" ,25 ,"detect" ,GPIO_ACTIVE_LOW ), +GPIO_LOOKUP ("gpio" ,27 ,"ready" ,GPIO_ACTIVE_HIGH ), + { }, + }, +}; + +static struct regulator_consumer_supply shannon_cf_vcc_consumers[] = { +REGULATOR_SUPPLY ("vcc" ,"sa11x0-pcmcia.0" ), +REGULATOR_SUPPLY ("vcc" ,"sa11x0-pcmcia.1" ), +}; + +static struct fixed_voltage_config shannon_cf_vcc_pdata__initdata = { + .supply_name ="cf-power" , + .microvolts =3300000 , + .enabled_at_boot =1 , + .gpio = -EINVAL , +}; +static void __init shannon_init (void ) { +sa11x0_register_fixed_regulator (0 , &shannon_cf_vcc_pdata, + shannon_cf_vcc_consumers, +ARRAY_SIZE (shannon_cf_vcc_consumers)); +sa11x0_register_pcmcia (0 , &shannon_pcmcia0_gpio_table); +sa11x0_register_pcmcia (1 , &shannon_pcmcia1_gpio_table);sa11x0_ppc_configure_mcp ();sa11x0_register_lcd (&shannon_lcd_info);sa11x0_register_mtd (&shannon_flash_data, &shannon_flash_resource,1 );
drivers/pcmcia/Makefile +0 -1
@@ -50,7 +50,6 @@ sa1100_cs-$(CONFIG_SA1100_COLLIE) += pxa2xx_sharpsl.o sa1100_cs-$(CONFIG_SA1100_H3100) += sa1100_h3600.o sa1100_cs-$(CONFIG_SA1100_H3600) += sa1100_h3600.o sa1100_cs-$(CONFIG_SA1100_NANOENGINE) += sa1100_nanoengine.o -sa1100_cs-$(CONFIG_SA1100_SHANNON) += sa1100_shannon.o sa1100_cs-$(CONFIG_SA1100_SIMPAD) += sa1100_simpad.o pxa2xx_cm_x2xx_cs-y += pxa2xx_cm_x2xx.o pxa2xx_cm_x255.o pxa2xx_cm_x270.o
drivers/pcmcia/sa1100_generic.c +0 -3
@@ -101,9 +101,6 @@ static int (*sa11x0_pcmcia_legacy_hw_init[])(struct device *dev) = {#if defined(CONFIG_SA1100_H3100 ) || defined(CONFIG_SA1100_H3600 ) pcmcia_h3600_init,#endif -#ifdef CONFIG_SA1100_SHANNON - pcmcia_shannon_init, -#endif #ifdef CONFIG_SA1100_SIMPAD pcmcia_simpad_init,#endif
drivers/pcmcia/sa1100_generic.h +0 -1
@@ -14,7 +14,6 @@ extern int pcmcia_graphicsmaster_init(struct device *);extern int pcmcia_h3600_init (struct device *);extern int pcmcia_pangolin_init (struct device *);extern int pcmcia_pfs168_init (struct device *); -extern int pcmcia_shannon_init (struct device *);extern int pcmcia_simpad_init (struct device *);extern int pcmcia_stork_init (struct device *);extern int pcmcia_system3_init (struct device *);
drivers/pcmcia/sa1100_shannon.c deleted +0 -104
104 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 8/8 ARM: sa1100/simpad: switch simpad CF to use gpiod APIs
In reply to Russell King - ARM LinuxSwitch simpad's CF implementation to use the gpiod APIs. The inverted detection is handled using gpiolib's native inversion abilities.
--- arch/arm/mach-sa1100/simpad.c | 11 +++++++++++ drivers/pcmcia/sa1100_simpad.c | 12 +++--------- 2 files changed, 14 insertions(+), 9 deletions(-)
arch/arm/mach-sa1100/simpad.c +11 -0
@@ -4,6 +4,7 @@*/ #include <linux/module.h> +#include <linux/gpio/machine.h> #include <linux/init.h> #include <linux/kernel.h> #include <linux/tty.h>
@@ -364,6 +365,15 @@ static struct platform_device *devices[] __initdata = { &simpad_i2c, }; +/* Compact Flash */ +static struct gpiod_lookup_table simpad_cf_gpio_table = { + .dev_id ="sa11x0-pcmcia" , + .table = { +GPIO_LOOKUP ("gpio" ,GPIO_CF_IRQ ,"cf-ready" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("gpio" ,GPIO_CF_CD ,"cf-detect" ,GPIO_ACTIVE_HIGH ), + { }, + }, +};static int __init simpad_init (void )
@@ -385,6 +395,7 @@ static int __init simpad_init(void) pm_power_off = simpad_power_off; +sa11x0_register_pcmcia (-1 , &simpad_cf_gpio_table);sa11x0_ppc_configure_mcp ();sa11x0_register_mtd (&simpad_flash_data, simpad_flash_resources,ARRAY_SIZE (simpad_flash_resources));
drivers/pcmcia/sa1100_simpad.c +3 -9
@@ -12,7 +12,6 @@#include <mach/hardware.h> #include <asm/mach-types.h> -#include <asm/irq.h> #include <mach/simpad.h> #include "sa1100_generic.h"
@@ -21,12 +20,10 @@ static int simpad_pcmcia_hw_init(struct soc_pcmcia_socket *skt)simpad_clear_cs3_bit (VCC_3V_EN |VCC_5V_EN |EN0 |EN1 ); - skt->stat[SOC_STAT_CD ].gpio =GPIO_CF_CD ; - skt->stat[SOC_STAT_CD ].name ="CF_CD" ; - skt->stat[SOC_STAT_RDY ].gpio =GPIO_CF_IRQ ; - skt->stat[SOC_STAT_RDY ].name ="CF_RDY" ; + skt->stat[SOC_STAT_CD ].name ="cf-detect" ; + skt->stat[SOC_STAT_RDY ].name ="cf-ready" ; -return 0 ; +return soc_pcmcia_request_gpiods (skt); }static void simpad_pcmcia_hw_shutdown (struct soc_pcmcia_socket *skt)
@@ -42,9 +39,6 @@ simpad_pcmcia_socket_state(struct soc_pcmcia_socket *skt, {long cs3reg =simpad_get_cs3_ro (); -/* the detect signal is inverted - fix that up here */ - state->detect = !state->detect; - state->bvd1 =1 ;/* Might be cs3reg & PCMCIA_BVD1 */ state->bvd2 =1 ;/* Might be cs3reg & PCMCIA_BVD2 */
Signature · 1 line
2.7.4