Balloon3: Disperse MFP config
Subsystems (6)
PATCH 1/13 Balloon3: Disperse MFP config
Move pin config to appropriate places and use it only if needed.
--- arch/arm/mach-pxa/balloon3.c | 104 +++++++++++++++++++++++++++-------------- 1 files changed, 68 insertions(+), 36 deletions(-)
arch/arm/mach-pxa/balloon3.c +68 -36
@@ -68,42 +68,6 @@ static unsigned long balloon3_pin_config[] __initdata = {/* Reset, configured as GPIO wakeup source */ GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH, - -/* LEDs */ -GPIO9_GPIO ,/* NAND activity LED */ -GPIO10_GPIO ,/* Heartbeat LED */ - -/* AC97 */ -GPIO28_AC97_BITCLK , -GPIO29_AC97_SDATA_IN_0 , -GPIO30_AC97_SDATA_OUT , -GPIO31_AC97_SYNC , - GPIO113_AC97_nRESET, -GPIO95_GPIO , - -/* MMC */ -GPIO32_MMC_CLK , -GPIO92_MMC_DAT_0 , -GPIO109_MMC_DAT_1 , -GPIO110_MMC_DAT_2 , -GPIO111_MMC_DAT_3 , -GPIO112_MMC_CMD , - -/* USB Host */ -GPIO88_USBH1_PWR , -GPIO89_USBH1_PEN , - -/* PC Card */ - GPIO48_nPOE, - GPIO49_nPWE, - GPIO50_nPIOR, - GPIO51_nPIOW, - GPIO85_nPCE_1, - GPIO54_nPCE_2, -GPIO79_PSKTSEL , - GPIO55_nPREG, - GPIO56_nPWAIT, - GPIO57_nIOIS16, };/******************************************************************************
@@ -132,6 +96,34 @@ int __init parse_balloon3_features(char *arg)early_param ("balloon3_features" , parse_balloon3_features);/****************************************************************************** +* Compact Flash slot +******************************************************************************/ +#if defined(CONFIG_PCMCIA_PXA2XX ) || defined(CONFIG_PCMCIA_PXA2XX_MODULE ) +static unsigned long balloon3_cf_pin_config[]__initdata = { + GPIO48_nPOE, + GPIO49_nPWE, + GPIO50_nPIOR, + GPIO51_nPIOW, + GPIO85_nPCE_1, + GPIO54_nPCE_2, +GPIO79_PSKTSEL , + GPIO55_nPREG, + GPIO56_nPWAIT, + GPIO57_nIOIS16, +}; + +static void __init balloon3_cf_init (void ) +{ +if (!balloon3_has (BALLOON3_FEATURE_CF )) +return ; + +pxa2xx_mfp_config (ARRAY_AND_SIZE (balloon3_cf_pin_config)); +} +#else +static inline void balloon3_cf_init (void ) {} +#endif + +/****************************************************************************** * NOR Flash ******************************************************************************/ #if defined(CONFIG_MTD_PHYSMAP ) || defined(CONFIG_MTD_PHYSMAP_MODULE )
@@ -179,6 +171,15 @@ static inline void balloon3_nor_init(void) {}******************************************************************************/ #if defined(CONFIG_TOUCHSCREEN_UCB1400 ) || \ defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE ) +static unsigned long balloon3_ac97_pin_config[]__initdata = { +GPIO28_AC97_BITCLK , +GPIO29_AC97_SDATA_IN_0 , +GPIO30_AC97_SDATA_OUT , +GPIO31_AC97_SYNC , + GPIO113_AC97_nRESET, +GPIO95_GPIO , +}; +static struct ucb1400_pdata vpac270_ucb1400_pdata = { .irq =IRQ_GPIO (BALLOON3_GPIO_CODEC_IRQ ), };
@@ -197,6 +198,7 @@ static void __init balloon3_ts_init(void)if (!balloon3_has (BALLOON3_FEATURE_AUDIO ))return ; +pxa2xx_mfp_config (ARRAY_AND_SIZE (balloon3_ac97_pin_config));pxa_set_ac97_info (NULL );platform_device_register (&balloon3_ucb1400_device); }
@@ -208,6 +210,11 @@ static inline void balloon3_ts_init(void) {}* Framebuffer ******************************************************************************/ #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) +static unsigned long balloon3_lcd_pin_config[] __initdata = { + GPIOxx_LCD_TFT_16BPP, + GPIO99_GPIO, +}; + static struct pxafb_mode_info balloon3_lcd_modes[] = { { .pixclock = 38000,
@@ -242,6 +249,8 @@ static void __init balloon3_lcd_init(void)if (!balloon3_has (BALLOON3_FEATURE_TOPPOLY ))return ; +pxa2xx_mfp_config (ARRAY_AND_SIZE (balloon3_lcd_pin_config)); + ret =gpio_request (BALLOON3_GPIO_RUN_BACKLIGHT ,"BKL-ON" );if (ret) {pr_err ("Requesting BKL-ON GPIO failed!\n" );
@@ -271,6 +280,15 @@ static inline void balloon3_lcd_init(void) {}* SD/MMC card controller ******************************************************************************/ #if defined(CONFIG_MMC_PXA ) || defined(CONFIG_MMC_PXA_MODULE ) +static unsigned long balloon3_mmc_pin_config[]__initdata = { +GPIO32_MMC_CLK , +GPIO92_MMC_DAT_0 , +GPIO109_MMC_DAT_1 , +GPIO110_MMC_DAT_2 , +GPIO111_MMC_DAT_3 , +GPIO112_MMC_CMD , +}; +static struct pxamci_platform_data balloon3_mci_platform_data = { .ocr_mask =MMC_VDD_32_33 |MMC_VDD_33_34 , .gpio_card_detect = -1,
@@ -281,6 +299,7 @@ static struct pxamci_platform_data balloon3_mci_platform_data = {static void __init balloon3_mmc_init (void ) { +pxa2xx_mfp_config (ARRAY_AND_SIZE (balloon3_mmc_pin_config));pxa_set_mci_info (&balloon3_mci_platform_data); }#else
@@ -339,6 +358,11 @@ static inline void balloon3_irda_init(void) {}* USB Host ******************************************************************************/ #if defined(CONFIG_USB_OHCI_HCD ) || defined(CONFIG_USB_OHCI_HCD_MODULE ) +static unsigned long balloon3_uhc_pin_config[]__initdata = { +GPIO88_USBH1_PWR , +GPIO89_USBH1_PEN , +}; +static struct pxaohci_platform_data balloon3_ohci_info = { .port_mode =PMM_PERPORT_MODE , .flags = ENABLE_PORT_ALL | POWER_CONTROL_LOW | POWER_SENSE_LOW,
@@ -348,6 +372,7 @@ static void __init balloon3_uhc_init(void) {if (!balloon3_has (BALLOON3_FEATURE_OHCI ))return ; +pxa2xx_mfp_config (ARRAY_AND_SIZE (balloon3_uhc_pin_config));pxa_set_ohci_info (&balloon3_ohci_info); }#else
@@ -358,6 +383,11 @@ static inline void balloon3_uhc_init(void) {}* LEDs ******************************************************************************/ #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) +static unsigned long balloon3_led_pin_config[] __initdata = { + GPIO9_GPIO, /* NAND activity LED */ + GPIO10_GPIO, /* Heartbeat LED */ +}; + struct gpio_led balloon3_gpio_leds[] = { { .name = "balloon3:green:idle",
@@ -436,6 +466,7 @@ static struct platform_device balloon3_pcf_leds = {static void __init balloon3_leds_init (void ) { +pxa2xx_mfp_config (ARRAY_AND_SIZE (balloon3_led_pin_config));platform_device_register (&balloon3_leds);platform_device_register (&balloon3_pcf_leds); }
@@ -757,6 +788,7 @@ static void __init balloon3_init(void)balloon3_ts_init ();balloon3_udc_init ();balloon3_uhc_init (); +balloon3_cf_init (); }static struct map_desc balloon3_io_desc[]__initdata = {
Signature · 1 line
1.7.1
PATCH 2/13 PXA: Vpac270: Fix gpio_power for MMC
GPIO 0 is valid, yet this platform doesn't have any power GPIO for MMC.
--- arch/arm/mach-pxa/vpac270.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/mach-pxa/vpac270.c +1 -0
@@ -240,6 +240,7 @@ static void __init vpac270_onenand_init(void) {}#if defined(CONFIG_MMC_PXA ) || defined(CONFIG_MMC_PXA_MODULE )static struct pxamci_platform_data vpac270_mci_platform_data = { .ocr_mask =MMC_VDD_32_33 |MMC_VDD_33_34 , + .gpio_power =-1 , .gpio_card_detect =GPIO53_VPAC270_SD_DETECT_N , .gpio_card_ro =GPIO52_VPAC270_SD_READONLY , .detect_delay_ms = 200,
Signature · 1 line
1.7.1
PATCH 3/13 PXA: PalmTC: Modularize Palm Tungsten|C
In reply to Marek Vasut--- arch/arm/mach-pxa/palmtc.c | 147 ++++++++++++++++++++++++++++++++++--------- 1 files changed, 116 insertions(+), 31 deletions(-)
arch/arm/mach-pxa/palmtc.c +116 -31
@@ -25,6 +25,7 @@#include <linux/power_supply.h> #include <linux/gpio_keys.h> #include <linux/mtd/physmap.h> +#include <linux/usb/gpio_vbus.h> #include <asm/mach-types.h> #include <asm/mach/arch.h>
@@ -116,6 +117,7 @@ static unsigned long palmtc_pin_config[] __initdata = {/****************************************************************************** * SD/MMC card controller ******************************************************************************/ +#if defined(CONFIG_MMC_PXA ) || defined(CONFIG_MMC_PXA_MODULE )static struct pxamci_platform_data palmtc_mci_platform_data = { .ocr_mask =MMC_VDD_32_33 |MMC_VDD_33_34 , .gpio_power = GPIO_NR_PALMTC_SD_POWER,
@@ -124,9 +126,18 @@ static struct pxamci_platform_data palmtc_mci_platform_data = { .detect_delay_ms = 200, }; +static void __init palmtc_mmc_init (void ) +{ +pxa_set_mci_info (&palmtc_mci_platform_data); +} +#else +static inline void palmtc_mmc_init (void ) {} +#endif +/****************************************************************************** * GPIO keys ******************************************************************************/ +#if defined(CONFIG_KEYBOARD_GPIO ) || defined(CONFIG_KEYBOARD_GPIO_MODULE )static struct gpio_keys_button palmtc_pxa_buttons[] = { {KEY_F8 ,GPIO_NR_PALMTC_HOTSYNC_BUTTON ,1 ,"HotSync Button" ,EV_KEY ,1 }, };
@@ -144,9 +155,18 @@ static struct platform_device palmtc_pxa_keys = { }, }; +static void __init palmtc_keys_init (void ) +{ +platform_device_register (&palmtc_pxa_keys); +} +#else +static inline void palmtc_keys_init (void ) {} +#endif +/****************************************************************************** * Backlight ******************************************************************************/ +#if defined(CONFIG_BACKLIGHT_PWM ) || defined(CONFIG_BACKLIGHT_PWM_MODULE )static int palmtc_backlight_init (struct device *dev) {int ret;
@@ -196,17 +216,35 @@ static struct platform_device palmtc_backlight = { }, }; +static void __init palmtc_pwm_init (void ) +{ +platform_device_register (&palmtc_backlight); +} +#else +static inline void palmtc_pwm_init (void ) {} +#endif +/****************************************************************************** * IrDA ******************************************************************************/ +#if defined(CONFIG_IRDA ) || defined(CONFIG_IRDA_MODULE )static struct pxaficp_platform_data palmtc_ficp_platform_data = { .gpio_pwdown =GPIO_NR_PALMTC_IR_DISABLE , .transceiver_cap =IR_SIRMODE |IR_OFF , }; +static void __init palmtc_irda_init (void ) +{ +pxa_set_ficp_info (&palmtc_ficp_platform_data); +} +#else +static inline void palmtc_irda_init (void ) {} +#endif +/****************************************************************************** * Keyboard ******************************************************************************/ +#if defined(CONFIG_KEYBOARD_MATRIX ) || defined(CONFIG_KEYBOARD_MATRIX_MODULE )static const uint32_t palmtc_matrix_keys[] = {KEY (0 ,0 ,KEY_F1 ), KEY(0, 1, KEY_X),
@@ -290,27 +328,63 @@ static struct platform_device palmtc_keyboard = { .platform_data = &palmtc_keypad_platform_data, }, }; +static void __init palmtc_mkp_init (void ) +{ +platform_device_register (&palmtc_keyboard); +} +#else +static inline void palmtc_mkp_init (void ) {} +#endif /****************************************************************************** * UDC ******************************************************************************/ -static struct pxa2xx_udc_mach_info palmtc_udc_info__initdata = { +#if defined(CONFIG_USB_GADGET_PXA25X )||defined(CONFIG_USB_GADGET_PXA25X_MODULE ) +static struct gpio_vbus_mach_info palmtc_udc_info = { .gpio_vbus =GPIO_NR_PALMTC_USB_DETECT_N , .gpio_vbus_inverted =1 , .gpio_pullup =GPIO_NR_PALMTC_USB_POWER , }; +static struct platform_device palmtc_gpio_vbus = { + .name ="gpio-vbus" , + .id =-1 , + .dev = { + .platform_data = &palmtc_udc_info, + }, +}; + +static void __init palmtc_udc_init (void ) +{ +platform_device_register (&palmtc_gpio_vbus); +}; +#else +static inline void palmtc_udc_init (void ) {} +#endif +/****************************************************************************** * Touchscreen / Battery / GPIO-extender ******************************************************************************/ -static struct platform_device palmtc_ucb1400_core = { +#if defined(CONFIG_TOUCHSCREEN_UCB1400 ) || \ + defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE ) +static struct platform_device palmtc_ucb1400_device = { .name ="ucb1400_core" , .id =-1 , }; +static void __init palmtc_ts_init (void ) +{ +pxa_set_ac97_info (NULL ); +platform_device_register (&palmtc_ucb1400_device); +} +#else +static inline void palmtc_ts_init (void ) {} +#endif +/****************************************************************************** * NOR Flash ******************************************************************************/ +#if defined(CONFIG_MTD_PHYSMAP ) || defined(CONFIG_MTD_PHYSMAP_MODULE )static struct resource palmtc_flash_resource = { .start =PXA_CS0_PHYS , .end = PXA_CS0_PHYS + SZ_16M - 1,
@@ -356,24 +430,33 @@ static struct platform_device palmtc_flash = { }, }; +static void __init palmtc_nor_init (void ) +{ +platform_device_register (&palmtc_flash); +} +#else +static inline void palmtc_nor_init (void ) {} +#endif +/****************************************************************************** * Framebuffer ******************************************************************************/ +#if defined(CONFIG_FB_PXA ) || defined(CONFIG_FB_PXA_MODULE )static struct pxafb_mode_info palmtc_lcd_modes[] = { -{ - .pixclock =115384 , - .xres =320 , - .yres =320 , - .bpp =16 , - - .left_margin =27 , - .right_margin =7 , - .upper_margin =7 , - .lower_margin =8 , - - .hsync_len =6 , - .vsync_len =1 , -}, + { + .pixclock =115384 , + .xres =320 , + .yres =320 , + .bpp =16 , + + .left_margin =27 , + .right_margin =7 , + .upper_margin =7 , + .lower_margin =8 , + + .hsync_len =6 , + .vsync_len =1 , + }, }; static struct pxafb_mach_info palmtc_lcd_screen = {
@@ -382,17 +465,17 @@ static struct pxafb_mach_info palmtc_lcd_screen = { .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, }; +static void __init palmtc_lcd_init (void ) +{ +set_pxa_fb_info (&palmtc_lcd_screen); +} +#else +static inline void palmtc_lcd_init (void ) {} +#endif +/****************************************************************************** * Machine init ******************************************************************************/ -static struct platform_device *devices[]__initdata = { - &palmtc_backlight, - &palmtc_ucb1400_core, - &palmtc_keyboard, - &palmtc_pxa_keys, - &palmtc_flash, -}; -static void __init palmtc_init (void ) {pxa2xx_mfp_config (ARRAY_AND_SIZE (palmtc_pin_config));
@@ -402,13 +485,15 @@ static void __init palmtc_init(void)pxa_set_stuart_info (NULL );pxa_set_hwuart_info (NULL ); -set_pxa_fb_info (&palmtc_lcd_screen); -pxa_set_mci_info (&palmtc_mci_platform_data); -pxa_set_udc_info (&palmtc_udc_info); -pxa_set_ac97_info (NULL ); -pxa_set_ficp_info (&palmtc_ficp_platform_data); - -platform_add_devices (devices,ARRAY_SIZE (devices)); +palmtc_mmc_init (); +palmtc_keys_init (); +palmtc_pwm_init (); +palmtc_irda_init (); +palmtc_mkp_init (); +palmtc_udc_init (); +palmtc_ts_init (); +palmtc_nor_init (); +palmtc_lcd_init (); };MACHINE_START (PALMTC ,"Palm Tungsten|C" )
Signature · 1 line
1.7.1
PATCH 4/13 UCB1400: Pass ucb1400-gpio data through ac97 bus
In reply to Marek Vasut--- drivers/gpio/ucb1400_gpio.c | 19 ++++++------------- drivers/mfd/ucb1400_core.c | 5 +++++ include/linux/ucb1400.h | 19 ++++++------------- 3 files changed, 17 insertions(+), 26 deletions(-)
drivers/gpio/ucb1400_gpio.c +6 -13
@@ -12,8 +12,6 @@#include <linux/module.h> #include <linux/ucb1400.h> -struct ucb1400_gpio_data *ucbdata; -static int ucb1400_gpio_dir_in (struct gpio_chip *gc,unsigned off) {struct ucb1400_gpio *gpio;
@@ -50,7 +48,7 @@ static int ucb1400_gpio_probe(struct platform_device *dev)struct ucb1400_gpio *ucb = dev->dev.platform_data;int err =0 ; -if (!(ucbdata && ucbdata->gpio_offset)) { +if (!(ucb && ucb->gpio_offset)) { err = -EINVAL ; goto err; }
@@ -58,7 +56,7 @@ static int ucb1400_gpio_probe(struct platform_device *dev)platform_set_drvdata (dev, ucb); ucb->gc.label ="ucb1400_gpio" ; - ucb->gc.base = ucbdata->gpio_offset; + ucb->gc.base = ucb->gpio_offset; ucb->gc.ngpio =10 ; ucb->gc.owner =THIS_MODULE ;
@@ -72,8 +70,8 @@ static int ucb1400_gpio_probe(struct platform_device *dev)if (err) goto err; -if (ucbdata && ucbdata->gpio_setup) - err = ucbdata->gpio_setup (&dev->dev, ucb->gc.ngpio); +if (ucb && ucb->gpio_setup) + err = ucb->gpio_setup (&dev->dev, ucb->gc.ngpio); err:return err;
@@ -85,8 +83,8 @@ static int ucb1400_gpio_remove(struct platform_device *dev)int err =0 ;struct ucb1400_gpio *ucb =platform_get_drvdata (dev); -if (ucbdata && ucbdata->gpio_teardown) { - err = ucbdata->gpio_teardown (&dev->dev, ucb->gc.ngpio); +if (ucb && ucb->gpio_teardown) { + err = ucb->gpio_teardown (&dev->dev, ucb->gc.ngpio);if (err)return err; }
@@ -113,11 +111,6 @@ static void __exit ucb1400_gpio_exit(void)platform_driver_unregister (&ucb1400_gpio_driver); } -void __init ucb1400_gpio_set_data (struct ucb1400_gpio_data *data) -{ - ucbdata = data; -} -module_init (ucb1400_gpio_init);module_exit (ucb1400_gpio_exit);
drivers/mfd/ucb1400_core.c +5 -0
@@ -75,6 +75,11 @@ static int ucb1400_core_probe(struct device *dev)/* GPIO */ ucb_gpio.ac97 = ac97; +if (pdata) { + ucb_gpio.gpio_setup = pdata->gpio_setup; + ucb_gpio.gpio_teardown = pdata->gpio_teardown; + ucb_gpio.gpio_offset = pdata->gpio_offset; + } ucb->ucb1400_gpio =platform_device_alloc ("ucb1400_gpio" ,-1 );if (!ucb->ucb1400_gpio) { err = -ENOMEM ;
include/linux/ucb1400.h +6 -13
@@ -83,15 +83,12 @@#define UCB_ID 0x7e#define UCB_ID_1400 0x4304 -struct ucb1400_gpio_data { -int gpio_offset; -int (*gpio_setup)(struct device *dev,int ngpio); -int (*gpio_teardown)(struct device *dev,int ngpio); -}; -struct ucb1400_gpio {struct gpio_chip gc;struct snd_ac97 *ac97; +int gpio_offset; +int (*gpio_setup)(struct device *dev,int ngpio); +int (*gpio_teardown)(struct device *dev,int ngpio); };struct ucb1400_ts {
@@ -112,6 +109,9 @@ struct ucb1400 {struct ucb1400_pdata {int irq; +int gpio_offset; +int (*gpio_setup)(struct device *dev,int ngpio); +int (*gpio_teardown)(struct device *dev,int ngpio); };static inline u16 ucb1400_reg_read (struct snd_ac97 *ac97,u16 reg)
@@ -163,11 +163,4 @@ static inline void ucb1400_adc_disable(struct snd_ac97 *ac97)unsigned int ucb1400_adc_read (struct snd_ac97 *ac97,u16 adc_channel,int adcsync); - -#ifdef CONFIG_GPIO_UCB1400 -void __init ucb1400_gpio_set_data (struct ucb1400_gpio_data *data); -#else -static inline void ucb1400_gpio_set_data (struct ucb1400_gpio_data *data) {} -#endif -#endif
Signature · 1 line
1.7.1
PATCH 5/13 PXA: Vpac270: Correct touch IRQ passing to UCB1400
In reply to Marek Vasut--- arch/arm/mach-pxa/vpac270.c | 12 +++++------- 1 files changed, 5 insertions(+), 7 deletions(-)
arch/arm/mach-pxa/vpac270.c +5 -7
@@ -430,20 +430,18 @@ static inline void vpac270_eth_init(void) {}******************************************************************************/ #if defined(CONFIG_TOUCHSCREEN_UCB1400 ) || \ defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE ) -static pxa2xx_audio_ops_t vpac270_ac97_pdata = { - .reset_gpio =95 , -}; -static struct ucb1400_pdata vpac270_ucb1400_pdata = { .irq =IRQ_GPIO (GPIO113_VPAC270_TS_IRQ ), }; +static pxa2xx_audio_ops_t vpac270_ac97_pdata = { + .reset_gpio =95 , + .codec_pdata = { &vpac270_ucb1400_pdata, }, +}; +static struct platform_device vpac270_ucb1400_device = { .name ="ucb1400_core" , .id =-1 , - .dev = { - .platform_data = &vpac270_ucb1400_pdata, - }, };static void __init vpac270_ts_init (void )
Signature · 1 line
1.7.1
PATCH 6/13 PXA: PalmTC: Pass GPIO offset to ucb1400-gpio
In reply to Marek Vasut--- arch/arm/mach-pxa/palmtc.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-)
arch/arm/mach-pxa/palmtc.c +9 -1
@@ -367,6 +367,14 @@ static inline void palmtc_udc_init(void) {}******************************************************************************/ #if defined(CONFIG_TOUCHSCREEN_UCB1400 ) || \ defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE ) +static struct ucb1400_pdata palmtc_ucb1400_pdata = { + .gpio_offset =PALMTC_UCB1400_GPIO_OFFSET , +}; + +static pxa2xx_audio_ops_t palmtc_ac97_pdata = { + .codec_pdata = { &palmtc_ucb1400_pdata, }, +}; +static struct platform_device palmtc_ucb1400_device = { .name ="ucb1400_core" , .id = -1,
@@ -374,7 +382,7 @@ static struct platform_device palmtc_ucb1400_device = {static void __init palmtc_ts_init (void ) { -pxa_set_ac97_info (NULL ); +pxa_set_ac97_info (&palmtc_ac97_pdata);platform_device_register (&palmtc_ucb1400_device); }#else
Signature · 1 line
1.7.1
PATCH 7/13 PXA: PalmTC: Add gpio-leds and vibrator support
In reply to Marek Vasut--- arch/arm/mach-pxa/palmtc.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 41 insertions(+), 0 deletions(-)
arch/arm/mach-pxa/palmtc.c +41 -0
@@ -390,6 +390,46 @@ static inline void palmtc_ts_init(void) {}#endif /****************************************************************************** +* LEDs +******************************************************************************/ +#if defined(CONFIG_LEDS_GPIO ) || defined(CONFIG_LEDS_GPIO_MODULE ) +struct gpio_led palmtc_gpio_leds[] = { +{ + .name ="palmtc:green:user" , + .default_trigger ="none" , + .gpio =GPIO_NR_PALMTC_LED_POWER , + .active_low =1 , +}, { + .name ="palmtc:vibra:vibra" , + .default_trigger ="none" , + .gpio =GPIO_NR_PALMTC_VIBRA_POWER , + .active_low =1 , +} + +}; + +static struct gpio_led_platform_data palmtc_gpio_led_info = { + .leds = palmtc_gpio_leds, + .num_leds =ARRAY_SIZE (palmtc_gpio_leds), +}; + +static struct platform_device palmtc_leds = { + .name ="leds-gpio" , + .id =-1 , + .dev = { + .platform_data = &palmtc_gpio_led_info, + } +}; + +static void __init palmtc_leds_init (void ) +{ +platform_device_register (&palmtc_leds); +} +#else +static inline void palmtc_leds_init (void ) {} +#endif + +/****************************************************************************** * NOR Flash ******************************************************************************/ #if defined(CONFIG_MTD_PHYSMAP ) || defined(CONFIG_MTD_PHYSMAP_MODULE )
@@ -502,6 +542,7 @@ static void __init palmtc_init(void)palmtc_ts_init ();palmtc_nor_init ();palmtc_lcd_init (); +palmtc_leds_init (); };MACHINE_START (PALMTC ,"Palm Tungsten|C" )
Signature · 1 line
1.7.1
PATCH 8/13 PXA: Colibri: Toradex Colibri PXA270 CF support
In reply to Marek VasutThis driver also contains structures to eventually support PXA320. This is planned to be added in a later patch.
--- arch/arm/mach-pxa/colibri-pxa270-evalboard.c | 18 ++ drivers/pcmcia/Kconfig | 2 +- drivers/pcmcia/Makefile | 1 + drivers/pcmcia/pxa2xx_colibri.c | 215 ++++++++++++++++++++++++++ 4 files changed, 235 insertions(+), 1 deletions(-) create mode 100644 drivers/pcmcia/pxa2xx_colibri.c
arch/arm/mach-pxa/colibri-pxa270-evalboard.c +18 -0
@@ -51,6 +51,24 @@ static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {GPIO89_USBH1_PEN ,GPIO119_USBH2_PWR ,GPIO120_USBH2_PEN , + +/* PCMCIA */ + GPIO85_nPCE_1, + GPIO54_nPCE_2, + GPIO55_nPREG, + GPIO50_nPIOR, + GPIO51_nPIOW, + GPIO49_nPWE, + GPIO48_nPOE, + GPIO57_nIOIS16, + GPIO56_nPWAIT, +GPIO104_PSKTSEL , +GPIO53_GPIO ,/* RESET */ +GPIO83_GPIO ,/* BVD1 */ +GPIO82_GPIO ,/* BVD2 */ +GPIO1_GPIO ,/* READY */ +GPIO84_GPIO ,/* DETECT */ + GPIO107_GPIO, /* PPEN */ };/******************************************************************************
drivers/pcmcia/Kconfig +1 -1
@@ -215,7 +215,7 @@ config PCMCIA_PXA2XX depends on (ARCH_LUBBOCK || MACH_MAINSTONE || PXA_SHARPSL \ || MACH_ARMCORE || ARCH_PXA_PALM || TRIZEPS_PCMCIA \ || ARCOM_PCMCIA || ARCH_PXA_ESERIES || MACH_STARGATE2 \ - || MACH_VPAC270 || MACH_BALLOON3) + || MACH_VPAC270 || MACH_BALLOON3 || MACH_COLIBRI) select PCMCIA_SOC_COMMON help Say Y here to include support for the PXA2xx PCMCIA controller
drivers/pcmcia/Makefile +1 -0
@@ -71,6 +71,7 @@ pxa2xx-obj-$(CONFIG_MACH_E740) += pxa2xx_e740.o pxa2xx-obj-$(CONFIG_MACH_STARGATE2) += pxa2xx_stargate2.o pxa2xx-obj-$(CONFIG_MACH_VPAC270) += pxa2xx_vpac270.o pxa2xx-obj-$(CONFIG_MACH_BALLOON3) += pxa2xx_balloon3.o +pxa2xx-obj-$(CONFIG_MACH_COLIBRI) += pxa2xx_colibri.o obj-$(CONFIG_PCMCIA_PXA2XX) += pxa2xx_base.o $(pxa2xx-obj-y)
drivers/pcmcia/pxa2xx_colibri.c new file +215 -0
215 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH 8/13 PXA: Colibri: Toradex Colibri PXA270 CF support
Hi Marek,
Quoted 4 lines · Marek Vasut
This driver also contains structures to eventually support PXA320. This is planned to be added in a later patch.
Signed-off-by Marek Vasut <[email protected]>
I have currently no access to my Colibri hardware, but the changes to the code look sane and totally make sense to me. You can add my
Thanks,
Daniel
Quoted 286 lines
--- arch/arm/mach-pxa/colibri-pxa270-evalboard.c | 18 ++ drivers/pcmcia/Kconfig | 2 +- drivers/pcmcia/Makefile | 1 + drivers/pcmcia/pxa2xx_colibri.c | 215 ++++++++++++++++++++++++++ 4 files changed, 235 insertions(+), 1 deletions(-) create mode 100644 drivers/pcmcia/pxa2xx_colibri.carch/arm/mach-pxa/colibri-pxa270-evalboard.c +18
-0@@ -51,6 +51,24 @@ static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {GPIO89_USBH1_PEN ,GPIO119_USBH2_PWR ,GPIO120_USBH2_PEN , + +/* PCMCIA */ + GPIO85_nPCE_1, + GPIO54_nPCE_2, + GPIO55_nPREG, + GPIO50_nPIOR, + GPIO51_nPIOW, + GPIO49_nPWE, + GPIO48_nPOE, + GPIO57_nIOIS16, + GPIO56_nPWAIT, +GPIO104_PSKTSEL , +GPIO53_GPIO ,/* RESET */ +GPIO83_GPIO ,/* BVD1 */ +GPIO82_GPIO ,/* BVD2 */ +GPIO1_GPIO ,/* READY */ +GPIO84_GPIO ,/* DETECT */ + GPIO107_GPIO, /* PPEN */ };/****************************************************************************** drivers/pcmcia/Kconfig +1
-1@@ -215,7 +215,7 @@ config PCMCIA_PXA2XX depends on (ARCH_LUBBOCK || MACH_MAINSTONE || PXA_SHARPSL \ || MACH_ARMCORE || ARCH_PXA_PALM || TRIZEPS_PCMCIA \ || ARCOM_PCMCIA || ARCH_PXA_ESERIES || MACH_STARGATE2 \ - || MACH_VPAC270 || MACH_BALLOON3) + || MACH_VPAC270 || MACH_BALLOON3 || MACH_COLIBRI) select PCMCIA_SOC_COMMON help Say Y here to include support for the PXA2xx PCMCIA controllerdrivers/pcmcia/Makefile +1
-0@@ -71,6 +71,7 @@ pxa2xx-obj-$(CONFIG_MACH_E740) += pxa2xx_e740.o pxa2xx-obj-$(CONFIG_MACH_STARGATE2) += pxa2xx_stargate2.o pxa2xx-obj-$(CONFIG_MACH_VPAC270) += pxa2xx_vpac270.o pxa2xx-obj-$(CONFIG_MACH_BALLOON3) += pxa2xx_balloon3.o +pxa2xx-obj-$(CONFIG_MACH_COLIBRI) += pxa2xx_colibri.o obj-$(CONFIG_PCMCIA_PXA2XX) += pxa2xx_base.o $(pxa2xx-obj-y)drivers/pcmcia/pxa2xx_colibri.c new file +215
-0@@ -0,0 +1,215 @@ +/* +* linux/drivers/pcmcia/pxa2xx_colibri.c +* +* Driver for Toradex Colibri PXA270 CF socket +* +* Copyright (C) 2010 Marek Vasut <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +* +*/ + +#include <linux/module.h> +#include <linux/platform_device.h> +#include <linux/delay.h> + +#include <asm/mach-types.h> + +#include <mach/gpio.h> + +#include "soc_common.h" + +#define COLIBRI270_RESET_GPIO 53 +#define COLIBRI270_PPEN_GPIO 107 +#define COLIBRI270_BVD1_GPIO 83 +#define COLIBRI270_BVD2_GPIO 82 +#define COLIBRI270_DETECT_GPIO 84 +#define COLIBRI270_READY_GPIO 1 + +static struct { +int reset_gpio; +int ppen_gpio; +int bvd1_gpio; +int bvd2_gpio; +int detect_gpio; +int ready_gpio; +} colibri_pcmcia_gpio; + +static struct pcmcia_irqs colibri_irqs[] = { + { + .sock =0 , + .str ="PCMCIA CD" + }, +}; + +static int colibri_pcmcia_hw_init (struct soc_pcmcia_socket *skt) +{ +int ret; + + ret =gpio_request (colibri_pcmcia_gpio.detect_gpio,"DETECT" ); +if (ret) + goto err1; + ret =gpio_direction_input (colibri_pcmcia_gpio.detect_gpio); +if (ret) + goto err2; + + ret =gpio_request (colibri_pcmcia_gpio.ready_gpio,"READY" ); +if (ret) + goto err2; + ret =gpio_direction_input (colibri_pcmcia_gpio.ready_gpio); +if (ret) + goto err3; + + ret =gpio_request (colibri_pcmcia_gpio.bvd1_gpio,"BVD1" ); +if (ret) + goto err3; + ret =gpio_direction_input (colibri_pcmcia_gpio.bvd1_gpio); +if (ret) + goto err4; + + ret =gpio_request (colibri_pcmcia_gpio.bvd2_gpio,"BVD2" ); +if (ret) + goto err4; + ret =gpio_direction_input (colibri_pcmcia_gpio.bvd2_gpio); +if (ret) + goto err5; + + ret =gpio_request (colibri_pcmcia_gpio.ppen_gpio,"PPEN" ); +if (ret) + goto err5; + ret =gpio_direction_output (colibri_pcmcia_gpio.ppen_gpio,0 ); +if (ret) + goto err6; + + ret =gpio_request (colibri_pcmcia_gpio.reset_gpio,"RESET" ); +if (ret) + goto err6; + ret =gpio_direction_output (colibri_pcmcia_gpio.reset_gpio,1 ); +if (ret) + goto err7; + + colibri_irqs[0 ].irq =gpio_to_irq (colibri_pcmcia_gpio.detect_gpio); + skt->socket.pci_irq =gpio_to_irq (colibri_pcmcia_gpio.ready_gpio); + +return soc_pcmcia_request_irqs (skt, colibri_irqs, +ARRAY_SIZE (colibri_irqs)); + +err7: +gpio_free (colibri_pcmcia_gpio.detect_gpio); +err6: +gpio_free (colibri_pcmcia_gpio.ready_gpio); +err5: +gpio_free (colibri_pcmcia_gpio.bvd1_gpio); +err4: +gpio_free (colibri_pcmcia_gpio.bvd2_gpio); +err3: +gpio_free (colibri_pcmcia_gpio.reset_gpio); +err2: +gpio_free (colibri_pcmcia_gpio.ppen_gpio); +err1: +return ret; +} + +static void colibri_pcmcia_hw_shutdown (struct soc_pcmcia_socket *skt) +{ +gpio_free (colibri_pcmcia_gpio.detect_gpio); +gpio_free (colibri_pcmcia_gpio.ready_gpio); +gpio_free (colibri_pcmcia_gpio.bvd1_gpio); +gpio_free (colibri_pcmcia_gpio.bvd2_gpio); +gpio_free (colibri_pcmcia_gpio.reset_gpio); +gpio_free (colibri_pcmcia_gpio.ppen_gpio); +} + +static void colibri_pcmcia_socket_state (struct soc_pcmcia_socket *skt, +struct pcmcia_state *state) +{ + + state->detect = !!gpio_get_value (colibri_pcmcia_gpio.detect_gpio); + state->ready = !!gpio_get_value (colibri_pcmcia_gpio.ready_gpio); + state->bvd1 = !!gpio_get_value (colibri_pcmcia_gpio.bvd1_gpio); + state->bvd2 = !!gpio_get_value (colibri_pcmcia_gpio.bvd2_gpio); + state->wrprot =0 ; + state->vs_3v =1 ; + state->vs_Xv =0 ; +} + +static int +colibri_pcmcia_configure_socket (struct soc_pcmcia_socket *skt, +const socket_state_t *state) +{ +gpio_set_value (colibri_pcmcia_gpio.ppen_gpio, + !(state->Vcc ==33 && state->Vpp <50 )); +gpio_set_value (colibri_pcmcia_gpio.reset_gpio, state->flags &SS_RESET ); +return 0 ; +} + +static void colibri_pcmcia_socket_init (struct soc_pcmcia_socket *skt) +{ +} + +static void colibri_pcmcia_socket_suspend (struct soc_pcmcia_socket *skt) +{ +} + +static struct pcmcia_low_level colibri_pcmcia_ops = { + .owner =THIS_MODULE , + + .first =0 , + .nr =1 , + + .hw_init = colibri_pcmcia_hw_init, + .hw_shutdown = colibri_pcmcia_hw_shutdown, + + .socket_state = colibri_pcmcia_socket_state, + .configure_socket = colibri_pcmcia_configure_socket, + + .socket_init = colibri_pcmcia_socket_init, + .socket_suspend = colibri_pcmcia_socket_suspend, +}; + +static struct platform_device *colibri_pcmcia_device; + +static int __init colibri_pcmcia_init (void ) +{ +int ret; + + colibri_pcmcia_device =platform_device_alloc ("pxa2xx-pcmcia" ,-1 ); +if (!colibri_pcmcia_device) +return -ENOMEM ; + +/* Colibri PXA270 */ +if (machine_is_colibri ()) { + colibri_pcmcia_gpio.reset_gpio =COLIBRI270_RESET_GPIO ; + colibri_pcmcia_gpio.ppen_gpio =COLIBRI270_PPEN_GPIO ; + colibri_pcmcia_gpio.bvd1_gpio =COLIBRI270_BVD1_GPIO ; + colibri_pcmcia_gpio.bvd2_gpio =COLIBRI270_BVD2_GPIO ; + colibri_pcmcia_gpio.detect_gpio =COLIBRI270_DETECT_GPIO ; + colibri_pcmcia_gpio.ready_gpio =COLIBRI270_READY_GPIO ; + } + + ret =platform_device_add_data (colibri_pcmcia_device, + &colibri_pcmcia_ops,sizeof (colibri_pcmcia_ops)); + +if (!ret) + ret =platform_device_add (colibri_pcmcia_device); + +if (ret) +platform_device_put (colibri_pcmcia_device); + +return ret; +} + +static void __exit colibri_pcmcia_exit(void) +{ +platform_device_unregister (colibri_pcmcia_device); +} + +module_init (colibri_pcmcia_init); +module_exit (colibri_pcmcia_exit); + +MODULE_AUTHOR ("Marek Vasut <[email protected]>" ); +MODULE_DESCRIPTION ("PCMCIA support for Toradex Colibri PXA270" ); +MODULE_ALIAS ("platform:pxa2xx-pcmcia" ); +MODULE_LICENSE ("GPL" );Signature · 1 line
1.7.1
PATCH 8/13 PXA: Colibri: Toradex Colibri PXA270 CF support
Dne St 18. srpna 2010 13:43:26 Daniel Mack napsal(a):
Quoted 6 lines
Hi Marek,
Quoted 3 lines · Marek Vasut
This driver also contains structures to eventually support PXA320. This is planned to be added in a later patch.
Quoted 6 lines
Quoted 1 line
Signed-off-by Marek Vasut <[email protected]>I have currently no access to my Colibri hardware, but the changes to the code look sane and totally make sense to me. You can add my
Acked-by Daniel Mack <[email protected]>
Hi Dan,
do I have this for all the colibri patches in the tree? Thanks
Quoted 68 lines
Thanks,
DanielQuoted 63 lines
---
arch/arm/mach-pxa/colibri-pxa270-evalboard.c | 18 ++ drivers/pcmcia/Kconfig | 2 +- drivers/pcmcia/Makefile | 1 + drivers/pcmcia/pxa2xx_colibri.c | 215 ++++++++++++++++++++++++++ 4 files changed, 235 insertions(+), 1 deletions(-) create mode 100644 drivers/pcmcia/pxa2xx_colibri.c(quoted diff) +0
-0
b/arch/arm/mach-pxa/colibri-pxa270-evalboard.cindex 0f3b632..6177ff5 100644arch/arm/mach-pxa/colibri-pxa270-evalboard.c +18
-0@@ -51,6 +51,24 @@ static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {GPIO89_USBH1_PEN ,GPIO119_USBH2_PWR ,GPIO120_USBH2_PEN , + +/* PCMCIA */ + GPIO85_nPCE_1, + GPIO54_nPCE_2, + GPIO55_nPREG, + GPIO50_nPIOR, + GPIO51_nPIOW, + GPIO49_nPWE, + GPIO48_nPOE, + GPIO57_nIOIS16, + GPIO56_nPWAIT, +GPIO104_PSKTSEL , +GPIO53_GPIO ,/* RESET */ +GPIO83_GPIO ,/* BVD1 */ +GPIO82_GPIO ,/* BVD2 */ +GPIO1_GPIO ,/* READY */ +GPIO84_GPIO ,/* DETECT */ + GPIO107_GPIO, /* PPEN */};
/***********************************************************************
*******drivers/pcmcia/Kconfig +1
-1@@ -215,7 +215,7 @@ config PCMCIA_PXA2XX depends on (ARCH_LUBBOCK || MACH_MAINSTONE || PXA_SHARPSL \ || MACH_ARMCORE || ARCH_PXA_PALM || TRIZEPS_PCMCIA \ || ARCOM_PCMCIA || ARCH_PXA_ESERIES || MACH_STARGATE2 \ - || MACH_VPAC270 || MACH_BALLOON3) + || MACH_VPAC270 || MACH_BALLOON3 || MACH_COLIBRI)drivers/pcmcia/Kconfig +0
-0select PCMCIA_SOC_COMMON help
Quoted 7 lines
drivers/pcmcia/Makefile pxa2xx-obj-$(CONFIG_MACH_E740) +=
Quoted 7 lines
drivers/pcmcia/Kconfig +0
-0Say Y here to include support for the PXA2xx PCMCIA controllerdrivers/pcmcia/Makefile +0
-0@@ -71,6 +71,7 @@ pxa2xx-obj-$(CONFIG_MACH_E740) +=
pxa2xx_e740.o
Quoted 8 lines
drivers/pcmcia/Makefile pxa2xx-obj-$(CONFIG_MACH_E740) += pxa2xx_e740.o
Quoted 8 lines
drivers/pcmcia/Makefile +1
-0pxa2xx-obj-$(CONFIG_MACH_STARGATE2) += pxa2xx_stargate2.o pxa2xx-obj-$(CONFIG_MACH_VPAC270) += pxa2xx_vpac270.o pxa2xx-obj-$(CONFIG_MACH_BALLOON3) += pxa2xx_balloon3.o +pxa2xx-obj-$(CONFIG_MACH_COLIBRI) += pxa2xx_colibri.o obj-$(CONFIG_PCMCIA_PXA2XX) += pxa2xx_base.o
$(pxa2xx-obj-y)
Quoted 222 lines
Quoted 222 lines
(quoted diff) +0
-0
b/drivers/pcmcia/pxa2xx_colibri.cnew file mode 100644 index 0000000..8373816drivers/pcmcia/pxa2xx_colibri.c new file +144
-0@@ -0,0 +1,215 @@ +/* +* linux/drivers/pcmcia/pxa2xx_colibri.c +* +* Driver for Toradex Colibri PXA270 CF socket +* +* Copyright (C) 2010 Marek Vasut <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +* +*/ + +#include <linux/module.h> +#include <linux/platform_device.h> +#include <linux/delay.h> + +#include <asm/mach-types.h> + +#include <mach/gpio.h> + +#include "soc_common.h" + +#define COLIBRI270_RESET_GPIO 53 +#define COLIBRI270_PPEN_GPIO 107 +#define COLIBRI270_BVD1_GPIO 83 +#define COLIBRI270_BVD2_GPIO 82 +#define COLIBRI270_DETECT_GPIO 84 +#define COLIBRI270_READY_GPIO 1 + +static struct { +int reset_gpio; +int ppen_gpio; +int bvd1_gpio; +int bvd2_gpio; +int detect_gpio; +int ready_gpio; +} colibri_pcmcia_gpio; + +static struct pcmcia_irqs colibri_irqs[] = { + { + .sock =0 , + .str ="PCMCIA CD" + }, +}; + +static int colibri_pcmcia_hw_init (struct soc_pcmcia_socket *skt) +{ +int ret; + + ret =gpio_request (colibri_pcmcia_gpio.detect_gpio,"DETECT" ); +if (ret) + goto err1; + ret =gpio_direction_input (colibri_pcmcia_gpio.detect_gpio); +if (ret) + goto err2; + + ret =gpio_request (colibri_pcmcia_gpio.ready_gpio,"READY" ); +if (ret) + goto err2; + ret =gpio_direction_input (colibri_pcmcia_gpio.ready_gpio); +if (ret) + goto err3; + + ret =gpio_request (colibri_pcmcia_gpio.bvd1_gpio,"BVD1" ); +if (ret) + goto err3; + ret =gpio_direction_input (colibri_pcmcia_gpio.bvd1_gpio); +if (ret) + goto err4; + + ret =gpio_request (colibri_pcmcia_gpio.bvd2_gpio,"BVD2" ); +if (ret) + goto err4; + ret =gpio_direction_input (colibri_pcmcia_gpio.bvd2_gpio); +if (ret) + goto err5; + + ret =gpio_request (colibri_pcmcia_gpio.ppen_gpio,"PPEN" ); +if (ret) + goto err5; + ret =gpio_direction_output (colibri_pcmcia_gpio.ppen_gpio,0 ); +if (ret) + goto err6; + + ret =gpio_request (colibri_pcmcia_gpio.reset_gpio,"RESET" ); +if (ret) + goto err6; + ret =gpio_direction_output (colibri_pcmcia_gpio.reset_gpio,1 ); +if (ret) + goto err7; + + colibri_irqs[0 ].irq =gpio_to_irq (colibri_pcmcia_gpio.detect_gpio); + skt->socket.pci_irq =gpio_to_irq (colibri_pcmcia_gpio.ready_gpio); + +return soc_pcmcia_request_irqs (skt, colibri_irqs, +ARRAY_SIZE (colibri_irqs)); + +err7: +gpio_free (colibri_pcmcia_gpio.detect_gpio); +err6: +gpio_free (colibri_pcmcia_gpio.ready_gpio); +err5: +gpio_free (colibri_pcmcia_gpio.bvd1_gpio); +err4: +gpio_free (colibri_pcmcia_gpio.bvd2_gpio); +err3: +gpio_free (colibri_pcmcia_gpio.reset_gpio); +err2: +gpio_free (colibri_pcmcia_gpio.ppen_gpio); +err1: +return ret; +} + +static void colibri_pcmcia_hw_shutdown (struct soc_pcmcia_socket *skt) +{ +gpio_free (colibri_pcmcia_gpio.detect_gpio); +gpio_free (colibri_pcmcia_gpio.ready_gpio); +gpio_free (colibri_pcmcia_gpio.bvd1_gpio); +gpio_free (colibri_pcmcia_gpio.bvd2_gpio); +gpio_free (colibri_pcmcia_gpio.reset_gpio); +gpio_free (colibri_pcmcia_gpio.ppen_gpio); +} + +static void colibri_pcmcia_socket_state (struct soc_pcmcia_socket *skt, +struct pcmcia_state *state) +{ + + state->detect = !!gpio_get_value (colibri_pcmcia_gpio.detect_gpio); + state->ready = !!gpio_get_value (colibri_pcmcia_gpio.ready_gpio); + state->bvd1 = !!gpio_get_value (colibri_pcmcia_gpio.bvd1_gpio); + state->bvd2 = !!gpio_get_value (colibri_pcmcia_gpio.bvd2_gpio); + state->wrprot =0 ; + state->vs_3v =1 ; + state->vs_Xv =0 ; +} + +static int +colibri_pcmcia_configure_socket (struct soc_pcmcia_socket *skt, +const socket_state_t *state) +{ +gpio_set_value (colibri_pcmcia_gpio.ppen_gpio, + !(state->Vcc ==33 && state->Vpp <50 )); + gpio_set_value(colibri_pcmcia_gpio.reset_gpio, state->flags &
SS_RESET); + return 0;drivers/pcmcia/pxa2xx_colibri.c new file +70
-0+} + +static void colibri_pcmcia_socket_init (struct soc_pcmcia_socket *skt) +{ +} + +static void colibri_pcmcia_socket_suspend (struct soc_pcmcia_socket *skt) +{ +} + +static struct pcmcia_low_level colibri_pcmcia_ops = { + .owner =THIS_MODULE , + + .first =0 , + .nr =1 , + + .hw_init = colibri_pcmcia_hw_init, + .hw_shutdown = colibri_pcmcia_hw_shutdown, + + .socket_state = colibri_pcmcia_socket_state, + .configure_socket = colibri_pcmcia_configure_socket, + + .socket_init = colibri_pcmcia_socket_init, + .socket_suspend = colibri_pcmcia_socket_suspend, +}; + +static struct platform_device *colibri_pcmcia_device; + +static int __init colibri_pcmcia_init (void ) +{ +int ret; + + colibri_pcmcia_device =platform_device_alloc ("pxa2xx-pcmcia" ,-1 ); +if (!colibri_pcmcia_device) +return -ENOMEM ; + +/* Colibri PXA270 */ +if (machine_is_colibri ()) { + colibri_pcmcia_gpio.reset_gpio =COLIBRI270_RESET_GPIO ; + colibri_pcmcia_gpio.ppen_gpio =COLIBRI270_PPEN_GPIO ; + colibri_pcmcia_gpio.bvd1_gpio =COLIBRI270_BVD1_GPIO ; + colibri_pcmcia_gpio.bvd2_gpio =COLIBRI270_BVD2_GPIO ; + colibri_pcmcia_gpio.detect_gpio =COLIBRI270_DETECT_GPIO ; + colibri_pcmcia_gpio.ready_gpio =COLIBRI270_READY_GPIO ; + } + + ret =platform_device_add_data (colibri_pcmcia_device, + &colibri_pcmcia_ops,sizeof (colibri_pcmcia_ops)); + +if (!ret) + ret =platform_device_add (colibri_pcmcia_device); + +if (ret) +platform_device_put (colibri_pcmcia_device); + +return ret; +} + +static void __exit colibri_pcmcia_exit(void) +{ +platform_device_unregister (colibri_pcmcia_device); +} + +module_init (colibri_pcmcia_init); +module_exit (colibri_pcmcia_exit); + +MODULE_AUTHOR ("Marek Vasut <[email protected]>" ); +MODULE_DESCRIPTION ("PCMCIA support for Toradex Colibri PXA270" ); +MODULE_ALIAS ("platform:pxa2xx-pcmcia" ); +MODULE_LICENSE ("GPL" );
PATCH 8/13 PXA: Colibri: Toradex Colibri PXA270 CF support
Quoted 9 lines · Marek Vasut
Dne St 18. srpna 2010 13:43:26 Daniel Mack napsal(a):
Quoted 8 lines
Hi Marek,
Quoted 4 lines · Marek Vasut
This driver also contains structures to eventually support PXA320. This is planned to be added in a later patch.
Signed-off-by Marek Vasut <[email protected]>
Quoted 8 lines
Quoted 4 lines
I have currently no access to my Colibri hardware, but the changes to the code look sane and totally make sense to me. You can add my
Acked-by Daniel Mack <[email protected]>Hi Dan,
do I have this for all the colibri patches in the tree? Thanks
Yes, I think they're fine, so take it :) But as I say - I couldn't test this due to lack of hardware.
Thanks,
Daniel
Quoted 307 lines
Quoted 63 lines
Quoted 63 lines
---
arch/arm/mach-pxa/colibri-pxa270-evalboard.c | 18 ++ drivers/pcmcia/Kconfig | 2 +- drivers/pcmcia/Makefile | 1 + drivers/pcmcia/pxa2xx_colibri.c | 215 ++++++++++++++++++++++++++ 4 files changed, 235 insertions(+), 1 deletions(-) create mode 100644 drivers/pcmcia/pxa2xx_colibri.c(quoted diff) +0
-0
b/arch/arm/mach-pxa/colibri-pxa270-evalboard.cindex 0f3b632..6177ff5 100644arch/arm/mach-pxa/colibri-pxa270-evalboard.c +18
-0@@ -51,6 +51,24 @@ static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {GPIO89_USBH1_PEN ,GPIO119_USBH2_PWR ,GPIO120_USBH2_PEN , + +/* PCMCIA */ + GPIO85_nPCE_1, + GPIO54_nPCE_2, + GPIO55_nPREG, + GPIO50_nPIOR, + GPIO51_nPIOW, + GPIO49_nPWE, + GPIO48_nPOE, + GPIO57_nIOIS16, + GPIO56_nPWAIT, +GPIO104_PSKTSEL , +GPIO53_GPIO ,/* RESET */ +GPIO83_GPIO ,/* BVD1 */ +GPIO82_GPIO ,/* BVD2 */ +GPIO1_GPIO ,/* READY */ +GPIO84_GPIO ,/* DETECT */ + GPIO107_GPIO, /* PPEN */};
/***********************************************************************
*******drivers/pcmcia/Kconfig +1
-1@@ -215,7 +215,7 @@ config PCMCIA_PXA2XX depends on (ARCH_LUBBOCK || MACH_MAINSTONE || PXA_SHARPSL \ || MACH_ARMCORE || ARCH_PXA_PALM || TRIZEPS_PCMCIA \ || ARCOM_PCMCIA || ARCH_PXA_ESERIES || MACH_STARGATE2 \ - || MACH_VPAC270 || MACH_BALLOON3) + || MACH_VPAC270 || MACH_BALLOON3 || MACH_COLIBRI)drivers/pcmcia/Kconfig +0
-0select PCMCIA_SOC_COMMON helpQuoted 7 lines
drivers/pcmcia/Makefile pxa2xx-obj-$(CONFIG_MACH_E740) +=
Quoted 7 lines
drivers/pcmcia/Kconfig +0
-0Say Y here to include support for the PXA2xx PCMCIA controllerdrivers/pcmcia/Makefile +0
-0@@ -71,6 +71,7 @@ pxa2xx-obj-$(CONFIG_MACH_E740) +=pxa2xx_e740.o
Quoted 8 lines
drivers/pcmcia/Makefile pxa2xx-obj-$(CONFIG_MACH_E740) += pxa2xx_e740.o
Quoted 8 lines
drivers/pcmcia/Makefile +1
-0pxa2xx-obj-$(CONFIG_MACH_STARGATE2) += pxa2xx_stargate2.o pxa2xx-obj-$(CONFIG_MACH_VPAC270) += pxa2xx_vpac270.o pxa2xx-obj-$(CONFIG_MACH_BALLOON3) += pxa2xx_balloon3.o +pxa2xx-obj-$(CONFIG_MACH_COLIBRI) += pxa2xx_colibri.o obj-$(CONFIG_PCMCIA_PXA2XX) += pxa2xx_base.o$(pxa2xx-obj-y)
Quoted 214 lines
Quoted 214 lines
(quoted diff) +0
-0
b/drivers/pcmcia/pxa2xx_colibri.cnew file mode 100644 index 0000000..8373816drivers/pcmcia/pxa2xx_colibri.c new file +144
-0@@ -0,0 +1,215 @@ +/* +* linux/drivers/pcmcia/pxa2xx_colibri.c +* +* Driver for Toradex Colibri PXA270 CF socket +* +* Copyright (C) 2010 Marek Vasut <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +* +*/ + +#include <linux/module.h> +#include <linux/platform_device.h> +#include <linux/delay.h> + +#include <asm/mach-types.h> + +#include <mach/gpio.h> + +#include "soc_common.h" + +#define COLIBRI270_RESET_GPIO 53 +#define COLIBRI270_PPEN_GPIO 107 +#define COLIBRI270_BVD1_GPIO 83 +#define COLIBRI270_BVD2_GPIO 82 +#define COLIBRI270_DETECT_GPIO 84 +#define COLIBRI270_READY_GPIO 1 + +static struct { +int reset_gpio; +int ppen_gpio; +int bvd1_gpio; +int bvd2_gpio; +int detect_gpio; +int ready_gpio; +} colibri_pcmcia_gpio; + +static struct pcmcia_irqs colibri_irqs[] = { + { + .sock =0 , + .str ="PCMCIA CD" + }, +}; + +static int colibri_pcmcia_hw_init (struct soc_pcmcia_socket *skt) +{ +int ret; + + ret =gpio_request (colibri_pcmcia_gpio.detect_gpio,"DETECT" ); +if (ret) + goto err1; + ret =gpio_direction_input (colibri_pcmcia_gpio.detect_gpio); +if (ret) + goto err2; + + ret =gpio_request (colibri_pcmcia_gpio.ready_gpio,"READY" ); +if (ret) + goto err2; + ret =gpio_direction_input (colibri_pcmcia_gpio.ready_gpio); +if (ret) + goto err3; + + ret =gpio_request (colibri_pcmcia_gpio.bvd1_gpio,"BVD1" ); +if (ret) + goto err3; + ret =gpio_direction_input (colibri_pcmcia_gpio.bvd1_gpio); +if (ret) + goto err4; + + ret =gpio_request (colibri_pcmcia_gpio.bvd2_gpio,"BVD2" ); +if (ret) + goto err4; + ret =gpio_direction_input (colibri_pcmcia_gpio.bvd2_gpio); +if (ret) + goto err5; + + ret =gpio_request (colibri_pcmcia_gpio.ppen_gpio,"PPEN" ); +if (ret) + goto err5; + ret =gpio_direction_output (colibri_pcmcia_gpio.ppen_gpio,0 ); +if (ret) + goto err6; + + ret =gpio_request (colibri_pcmcia_gpio.reset_gpio,"RESET" ); +if (ret) + goto err6; + ret =gpio_direction_output (colibri_pcmcia_gpio.reset_gpio,1 ); +if (ret) + goto err7; + + colibri_irqs[0 ].irq =gpio_to_irq (colibri_pcmcia_gpio.detect_gpio); + skt->socket.pci_irq =gpio_to_irq (colibri_pcmcia_gpio.ready_gpio); + +return soc_pcmcia_request_irqs (skt, colibri_irqs, +ARRAY_SIZE (colibri_irqs)); + +err7: +gpio_free (colibri_pcmcia_gpio.detect_gpio); +err6: +gpio_free (colibri_pcmcia_gpio.ready_gpio); +err5: +gpio_free (colibri_pcmcia_gpio.bvd1_gpio); +err4: +gpio_free (colibri_pcmcia_gpio.bvd2_gpio); +err3: +gpio_free (colibri_pcmcia_gpio.reset_gpio); +err2: +gpio_free (colibri_pcmcia_gpio.ppen_gpio); +err1: +return ret; +} + +static void colibri_pcmcia_hw_shutdown (struct soc_pcmcia_socket *skt) +{ +gpio_free (colibri_pcmcia_gpio.detect_gpio); +gpio_free (colibri_pcmcia_gpio.ready_gpio); +gpio_free (colibri_pcmcia_gpio.bvd1_gpio); +gpio_free (colibri_pcmcia_gpio.bvd2_gpio); +gpio_free (colibri_pcmcia_gpio.reset_gpio); +gpio_free (colibri_pcmcia_gpio.ppen_gpio); +} + +static void colibri_pcmcia_socket_state (struct soc_pcmcia_socket *skt, +struct pcmcia_state *state) +{ + + state->detect = !!gpio_get_value (colibri_pcmcia_gpio.detect_gpio); + state->ready = !!gpio_get_value (colibri_pcmcia_gpio.ready_gpio); + state->bvd1 = !!gpio_get_value (colibri_pcmcia_gpio.bvd1_gpio); + state->bvd2 = !!gpio_get_value (colibri_pcmcia_gpio.bvd2_gpio); + state->wrprot =0 ; + state->vs_3v =1 ; + state->vs_Xv =0 ; +} + +static int +colibri_pcmcia_configure_socket (struct soc_pcmcia_socket *skt, +const socket_state_t *state) +{ +gpio_set_value (colibri_pcmcia_gpio.ppen_gpio, + !(state->Vcc ==33 && state->Vpp <50 )); + gpio_set_value(colibri_pcmcia_gpio.reset_gpio, state->flags &
SS_RESET); + return 0;drivers/pcmcia/pxa2xx_colibri.c new file +62
-0+} + +static void colibri_pcmcia_socket_init (struct soc_pcmcia_socket *skt) +{ +} + +static void colibri_pcmcia_socket_suspend (struct soc_pcmcia_socket *skt) +{ +} + +static struct pcmcia_low_level colibri_pcmcia_ops = { + .owner =THIS_MODULE , + + .first =0 , + .nr =1 , + + .hw_init = colibri_pcmcia_hw_init, + .hw_shutdown = colibri_pcmcia_hw_shutdown, + + .socket_state = colibri_pcmcia_socket_state, + .configure_socket = colibri_pcmcia_configure_socket, + + .socket_init = colibri_pcmcia_socket_init, + .socket_suspend = colibri_pcmcia_socket_suspend, +}; + +static struct platform_device *colibri_pcmcia_device; + +static int __init colibri_pcmcia_init (void ) +{ +int ret; + + colibri_pcmcia_device =platform_device_alloc ("pxa2xx-pcmcia" ,-1 ); +if (!colibri_pcmcia_device) +return -ENOMEM ; + +/* Colibri PXA270 */ +if (machine_is_colibri ()) { + colibri_pcmcia_gpio.reset_gpio =COLIBRI270_RESET_GPIO ; + colibri_pcmcia_gpio.ppen_gpio =COLIBRI270_PPEN_GPIO ; + colibri_pcmcia_gpio.bvd1_gpio =COLIBRI270_BVD1_GPIO ; + colibri_pcmcia_gpio.bvd2_gpio =COLIBRI270_BVD2_GPIO ; + colibri_pcmcia_gpio.detect_gpio =COLIBRI270_DETECT_GPIO ; + colibri_pcmcia_gpio.ready_gpio =COLIBRI270_READY_GPIO ; + } + + ret =platform_device_add_data (colibri_pcmcia_device, + &colibri_pcmcia_ops,sizeof (colibri_pcmcia_ops)); + +if (!ret) + ret =platform_device_add (colibri_pcmcia_device); + +if (ret) +platform_device_put (colibri_pcmcia_device); + +return ret; +} + +static void __exit colibri_pcmcia_exit(void) +{ +platform_device_unregister (colibri_pcmcia_device); +}Quoted 8 lines
drivers/pcmcia/pxa2xx_colibri.c line 215
Quoted 8 lines
drivers/pcmcia/pxa2xx_colibri.c new file +8
-0+ +module_init (colibri_pcmcia_init); +module_exit (colibri_pcmcia_exit); + +MODULE_AUTHOR ("Marek Vasut <[email protected]>" ); +MODULE_DESCRIPTION ("PCMCIA support for Toradex Colibri PXA270" ); +MODULE_ALIAS ("platform:pxa2xx-pcmcia" ); +MODULE_LICENSE ("GPL" );_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 8/13 PXA: Colibri: Toradex Colibri PXA270 CF support
In reply to Marek VasutQuoted 16 lines · Marek Vasut
drivers/pcmcia/pxa2xx_colibri.c new file +10
-0@@ -0,0 +1,215 @@ +/* +* linux/drivers/pcmcia/pxa2xx_colibri.c +* +* Driver for Toradex Colibri PXA270 CF socket +* +* Copyright (C) 2010 Marek Vasut <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation.
drivers/pcmcia/pxa2xx_colibri.c line 20
Quoted 10 lines
drivers/pcmcia/pxa2xx_colibri.c new file +10
-0+* +*/ + +#include <linux/module.h> +#include <linux/platform_device.h> +#include <linux/delay.h> + +#include <asm/mach-types.h> + +#include <mach/gpio.h>
linux/gpio.h please.
PATCH 8/13 PXA: Colibri: Toradex Colibri PXA270 CF support
Dne St 1. z??? 2010 09:23:05 Russell King - ARM Linux napsal(a):
Quoted 21 lines · Marek Vasut
Quoted 20 lines
(quoted diff) +0
-0
b/drivers/pcmcia/pxa2xx_colibri.cnew file mode 100644 index 0000000..8373816drivers/pcmcia/pxa2xx_colibri.c new file +14
-0@@ -0,0 +1,215 @@ +/* +* linux/drivers/pcmcia/pxa2xx_colibri.c +* +* Driver for Toradex Colibri PXA270 CF socket +* +* Copyright (C) 2010 Marek Vasut <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +* +*/ + +#include <linux/module.h>
Quoted 8 lines
drivers/pcmcia/pxa2xx_colibri.c line 20
Quoted 6 lines
drivers/pcmcia/pxa2xx_colibri.c new file +6
-0+#include <linux/platform_device.h> +#include <linux/delay.h> + +#include <asm/mach-types.h> + +#include <mach/gpio.h>
linux/gpio.hplease.
Thanks, good catch. I fixed this in my tree.
PATCH 9/13 PXA: Colibri: Push evalboard MFP into module files
In reply to Marek VasutThis change -- pushing the MFP configuration back into Module files -- is necessary because some evalboards can be used with multiple modules, where MFP differs from module to module. Therefore MFP isn't board-specific, but module-specific and the module should preconfigure itself for the board.
(And there is also the C preprocesor limitation and conflicting #define-s)
--- arch/arm/mach-pxa/Kconfig | 8 +- arch/arm/mach-pxa/colibri-pxa270-evalboard.c | 61 ++++----------- arch/arm/mach-pxa/colibri-pxa270-income.c | 47 ----------- arch/arm/mach-pxa/colibri-pxa270.c | 96 ++++++++++++++++++++++ arch/arm/mach-pxa/colibri-pxa300.c | 61 ++++++--------- arch/arm/mach-pxa/colibri-pxa320.c | 112 ++++++++++---------------- arch/arm/mach-pxa/colibri-pxa3xx.c | 49 ----------- arch/arm/mach-pxa/include/mach/colibri.h | 6 ++ 8 files changed, 188 insertions(+), 252 deletions(-)
arch/arm/mach-pxa/Kconfig +4 -4
@@ -238,10 +238,6 @@ config MACH_COLIBRI bool "Toradex Colibri PXA270" select PXA27x -config MACH_COLIBRI_PXA270_EVALBOARD - bool "Toradex Colibri Evaluation Carrier Board support (PXA270)" - depends on MACH_COLIBRI - config MACH_COLIBRI_PXA270_INCOME bool "Income s.r.o. PXA270 SBC" depends on MACH_COLIBRI
@@ -260,6 +256,10 @@ config MACH_COLIBRI320 select PXA3xx select CPU_PXA320 +config MACH_COLIBRI_PXA270_EVALBOARD + bool "Toradex Colibri Evaluation Carrier Board support" + depends on MACH_COLIBRI || MACH_COLIBRI300 || MACH_COLIBRI320 + config MACH_VPAC270 bool "Voipac PXA270" select PXA27x
arch/arm/mach-pxa/colibri-pxa270-evalboard.c +15 -46
100 lines not on this page · raw message
arch/arm/mach-pxa/colibri-pxa270-income.c +0 -47
59 lines not on this page · raw message
arch/arm/mach-pxa/colibri-pxa270.c +96 -0
111 lines not on this page · raw message
arch/arm/mach-pxa/colibri-pxa300.c +24 -37
86 lines not on this page · raw message
arch/arm/mach-pxa/colibri-pxa320.c +43 -69
146 lines not on this page · raw message
arch/arm/mach-pxa/colibri-pxa3xx.c +0 -49
55 lines not on this page · raw message
arch/arm/mach-pxa/include/mach/colibri.h +6 -0
@@ -59,5 +59,11 @@ static inline void colibri_pxa3xx_init_nand(void) {}#define GPIO0_COLIBRI_PXA270_SD_DETECT 0#define GPIO113_COLIBRI_PXA270_TS_IRQ 113 +/* GPIO definitions for Colibri PXA300/310 */ +#define GPIO39_COLIBRI_PXA300_SD_DETECT 39 + +/* GPIO definitions for Colibri PXA320 */ +#define GPIO28_COLIBRI_PXA320_SD_DETECT 28 +#endif /* _COLIBRI_H_ */
Signature · 1 line
1.7.1
PATCH 10/13 PXA: Colibri: Add M41T00 RTC support
In reply to Marek Vasut--- arch/arm/mach-pxa/colibri-pxa270-evalboard.c | 23 +++++++++++++++++++++++ arch/arm/mach-pxa/colibri-pxa270.c | 4 ++++ arch/arm/mach-pxa/colibri-pxa300.c | 4 ++++ arch/arm/mach-pxa/colibri-pxa320.c | 4 ++++ 4 files changed, 35 insertions(+), 0 deletions(-)
arch/arm/mach-pxa/colibri-pxa270-evalboard.c +23 -0
@@ -19,6 +19,7 @@#include <asm/mach-types.h> #include <mach/hardware.h> #include <asm/mach/arch.h> +#include <linux/i2c.h> #include <mach/pxa27x.h> #include <mach/colibri.h>
@@ -26,6 +27,8 @@#include <mach/ohci.h> #include <mach/pxa27x-udc.h> +#include <plat/i2c.h> +#include "generic.h" #include "devices.h"
@@ -87,6 +90,25 @@ static void __init colibri_pxa270_uhc_init(void)static inline void colibri_pxa270_uhc_init (void ) {}#endif +/****************************************************************************** +* I2C RTC +******************************************************************************/ +#if defined(CONFIG_RTC_DRV_DS1307 ) || defined(CONFIG_RTC_DRV_DS1307_MODULE ) +static struct i2c_board_info __initdata colibri_pxa270_i2c_devs[] = { + { +I2C_BOARD_INFO ("m41t00" ,0x68 ), + }, +}; + +static void __init colibri_pxa270_rtc_init (void ) +{ +pxa_set_i2c_info (NULL ); +i2c_register_board_info (0 ,ARRAY_AND_SIZE (colibri_pxa270_i2c_devs)); +} +#else +static inline void colibri_pxa270_rtc_init (void ) {} +#endif +void __init colibri_pxa270_evalboard_init (void ) {pxa_set_ffuart_info (NULL );
@@ -95,4 +117,5 @@ void __init colibri_pxa270_evalboard_init(void)colibri_pxa270_mmc_init ();colibri_pxa270_uhc_init (); +colibri_pxa270_rtc_init (); }
arch/arm/mach-pxa/colibri-pxa270.c +4 -0
@@ -73,6 +73,10 @@ static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {GPIO1_GPIO ,/* READY */ GPIO84_GPIO ,/* DETECT */ GPIO107_GPIO ,/* PPEN */ + +/* I2C */ +GPIO117_I2C_SCL , + GPIO118_I2C_SDA, };#else static mfp_cfg_t colibri_pxa270_evalboard_pin_config[]__initdata = {};
arch/arm/mach-pxa/colibri-pxa300.c +4 -0
@@ -45,6 +45,10 @@ static mfp_cfg_t colibri_pxa300_evalboard_pin_config[] __initdata = {/* UHC */ GPIO0_2_USBH_PEN ,GPIO1_2_USBH_PWR , + +/* I2C */ +GPIO21_I2C_SCL , + GPIO22_I2C_SDA, };#else static mfp_cfg_t colibri_pxa300_evalboard_pin_config[]__initdata = {};
arch/arm/mach-pxa/colibri-pxa320.c +4 -0
@@ -69,6 +69,10 @@ static mfp_cfg_t colibri_pxa320_evalboard_pin_config[] __initdata = {/* UHC */ GPIO2_2_USBH_PEN ,GPIO3_2_USBH_PWR , + +/* I2C */ +GPIO32_I2C_SCL , + GPIO33_I2C_SDA, };#else static mfp_cfg_t colibri_pxa320_evalboard_pin_config[]__initdata = {};
Signature · 1 line
1.7.1
PATCH 11/13 PXA: Colibri: Rename Colibri-evalboard
In reply to Marek VasutRename colibri-pxa270-evalboard to colibri-evalboard as this board is used with all Colibri modules.
--- arch/arm/mach-pxa/Kconfig | 2 +- arch/arm/mach-pxa/Makefile | 2 +- arch/arm/mach-pxa/colibri-evalboard.c | 121 ++++++++++++++++++++++++++ arch/arm/mach-pxa/colibri-pxa270-evalboard.c | 121 -------------------------- arch/arm/mach-pxa/colibri-pxa270.c | 6 +- arch/arm/mach-pxa/colibri-pxa300.c | 4 +- arch/arm/mach-pxa/colibri-pxa320.c | 4 +- arch/arm/mach-pxa/include/mach/colibri.h | 8 +- 8 files changed, 134 insertions(+), 134 deletions(-) create mode 100644 arch/arm/mach-pxa/colibri-evalboard.c delete mode 100644 arch/arm/mach-pxa/colibri-pxa270-evalboard.c
arch/arm/mach-pxa/Kconfig +1 -1
@@ -256,7 +256,7 @@ config MACH_COLIBRI320 select PXA3xx select CPU_PXA320 -config MACH_COLIBRI_PXA270_EVALBOARD +config MACH_COLIBRI_EVALBOARD bool "Toradex Colibri Evaluation Carrier Board support" depends on MACH_COLIBRI || MACH_COLIBRI300 || MACH_COLIBRI320
arch/arm/mach-pxa/Makefile +1 -1
@@ -59,7 +59,7 @@ obj-$(CONFIG_MACH_LOGICPD_PXA270) += lpd270.o obj-$(CONFIG_MACH_PCM027) += pcm027.o obj-$(CONFIG_MACH_PCM990_BASEBOARD) += pcm990-baseboard.o obj-$(CONFIG_MACH_COLIBRI) += colibri-pxa270.o -obj-$(CONFIG_MACH_COLIBRI_PXA270_EVALBOARD) += colibri-pxa270-evalboard.o +obj-$(CONFIG_MACH_COLIBRI_EVALBOARD) += colibri-evalboard.o obj-$(CONFIG_MACH_COLIBRI_PXA270_INCOME) += colibri-pxa270-income.o obj-$(CONFIG_MACH_COLIBRI300) += colibri-pxa3xx.o colibri-pxa300.o obj-$(CONFIG_MACH_COLIBRI320) += colibri-pxa3xx.o colibri-pxa320.o
arch/arm/mach-pxa/colibri-evalboard.c new file +121 -0
121 lines not on this page · raw message
arch/arm/mach-pxa/colibri-pxa270-evalboard.c deleted +0 -121
121 lines not on this page · raw message
arch/arm/mach-pxa/colibri-pxa270.c +3 -3
@@ -35,7 +35,7 @@/****************************************************************************** * Evaluation board MFP ******************************************************************************/ -#ifdef CONFIG_MACH_COLIBRI_PXA270_EVALBOARD +#ifdef CONFIG_MACH_COLIBRI_EVALBOARD static mfp_cfg_t colibri_pxa270_evalboard_pin_config[]__initdata = {/* MMC */ GPIO32_MMC_CLK,
@@ -281,10 +281,10 @@ static void __init colibri_pxa270_init(void)colibri_pxa270_tsc_init ();switch (colibri_pxa270_baseboard) { -case COLIBRI_PXA270_EVALBOARD : +case COLIBRI_EVALBOARD :pxa2xx_mfp_config (ARRAY_AND_SIZE ( colibri_pxa270_evalboard_pin_config)); -colibri_pxa270_evalboard_init (); +colibri_evalboard_init ();break ;case COLIBRI_PXA270_INCOME :pxa2xx_mfp_config (ARRAY_AND_SIZE (income_pin_config));
arch/arm/mach-pxa/colibri-pxa300.c +2 -2
@@ -31,7 +31,7 @@#include "devices.h" -#ifdef CONFIG_MACH_COLIBRI_PXA270_EVALBOARD +#ifdef CONFIG_MACH_COLIBRI_EVALBOARD static mfp_cfg_t colibri_pxa300_evalboard_pin_config[]__initdata = {/* MMC */ GPIO7_MMC1_CLK,
@@ -172,7 +172,7 @@ void __init colibri_pxa300_init(void)/* Evalboard init */ pxa3xx_mfp_config (ARRAY_AND_SIZE (colibri_pxa300_evalboard_pin_config)); -colibri_pxa270_evalboard_init (); +colibri_evalboard_init (); }MACHINE_START (COLIBRI300 ,"Toradex Colibri PXA300" )
arch/arm/mach-pxa/colibri-pxa320.c +2 -2
@@ -35,7 +35,7 @@#include "generic.h" #include "devices.h" -#ifdef CONFIG_MACH_COLIBRI_PXA270_EVALBOARD +#ifdef CONFIG_MACH_COLIBRI_EVALBOARD static mfp_cfg_t colibri_pxa320_evalboard_pin_config[]__initdata = {/* MMC */ GPIO22_MMC1_CLK,
@@ -229,7 +229,7 @@ void __init colibri_pxa320_init(void)/* Evalboard init */ pxa3xx_mfp_config (ARRAY_AND_SIZE (colibri_pxa320_evalboard_pin_config)); -colibri_pxa270_evalboard_init (); +colibri_evalboard_init (); }MACHINE_START (COLIBRI320 ,"Toradex Colibri PXA320" )
arch/arm/mach-pxa/include/mach/colibri.h +4 -4
@@ -9,14 +9,14 @@*/ enum { -COLIBRI_PXA270_EVALBOARD =0 , +COLIBRI_EVALBOARD =0 ,COLIBRI_PXA270_INCOME , }; -#if defined(CONFIG_MACH_COLIBRI_PXA270_EVALBOARD ) -extern void colibri_pxa270_evalboard_init (void ); +#if defined(CONFIG_MACH_COLIBRI_EVALBOARD ) +extern void colibri_evalboard_init (void );#else -static inline void colibri_pxa270_evalboard_init (void ) {} +static inline void colibri_evalboard_init (void ) {}#endif #if defined(CONFIG_MACH_COLIBRI_PXA270_INCOME )
Signature · 1 line
1.7.1
PATCH 12/13 pxa2xx/pcmcia: Prepare for pxa320
In reply to Marek VasutPXA320 also supports PCMCIA/CF interface. This patch generalizes register access in pxa2xx_pcmcia so the pxa320 is now supported as well.
--- drivers/pcmcia/pxa2xx_base.c | 91 ++++++++++++++++++++++++++++++++---------- 1 files changed, 70 insertions(+), 21 deletions(-)
drivers/pcmcia/pxa2xx_base.c +70 -21
@@ -85,6 +85,16 @@#define MCXX_ASST_SHIFT (7)#define MCXX_HOLD_SHIFT (14) +#define PXA2XX_SMC_BASE (0x48000000) +#define PXA3XX_SMC_BASE (0x4a000000) +#define MECR_OFFSET (0x14) +#define MCMEM_OFFSET (0x28) +#define MCATT_OFFSET (0x30) +#define MCIO_OFFSET (0x38) +#define MCIO_OFFSET (0x38) + +static void __iomem *base; +static inline u_int pxa2xx_mcxx_hold (u_int pcmcia_cycle_ns,u_int mem_clk_10khz) {
@@ -115,39 +125,57 @@ static inline u_int pxa2xx_pcmcia_cmd_time(u_int mem_clk_10khz,return (300000 * (pcmcia_mcxx_asst +1 ) / mem_clk_10khz); } +static inline void pxa2xx_pcmcia_set_reg (uint32_t reg,uint32_t sock, +uint32_t val ) +{ +writel (val, base + reg + (sock <<4 )); +} +static int pxa2xx_pcmcia_set_mcmem (int sock,int speed,int clock ) { -MCMEM (sock) = ((pxa2xx_mcxx_setup (speed, clock) +uint32_t val; + + val = ((pxa2xx_mcxx_setup (speed, clock) &MCXX_SETUP_MASK ) <<MCXX_SETUP_SHIFT ) | ((pxa2xx_mcxx_asst (speed, clock) &MCXX_ASST_MASK ) <<MCXX_ASST_SHIFT ) | ((pxa2xx_mcxx_hold (speed, clock) &MCXX_HOLD_MASK ) <<MCXX_HOLD_SHIFT ); +pxa2xx_pcmcia_set_reg (MCMEM_OFFSET , sock, val); +return 0 ; }static int pxa2xx_pcmcia_set_mcio (int sock,int speed,int clock ) { -MCIO (sock) = ((pxa2xx_mcxx_setup (speed, clock) +uint32_t val; + + val = ((pxa2xx_mcxx_setup (speed, clock) &MCXX_SETUP_MASK ) <<MCXX_SETUP_SHIFT ) | ((pxa2xx_mcxx_asst (speed, clock) &MCXX_ASST_MASK ) <<MCXX_ASST_SHIFT ) | ((pxa2xx_mcxx_hold (speed, clock) &MCXX_HOLD_MASK ) <<MCXX_HOLD_SHIFT ); +pxa2xx_pcmcia_set_reg (MCIO_OFFSET , sock, val); +return 0 ; }static int pxa2xx_pcmcia_set_mcatt (int sock,int speed,int clock ) { -MCATT (sock) = ((pxa2xx_mcxx_setup (speed, clock) +uint32_t val; + + val = ((pxa2xx_mcxx_setup (speed, clock) &MCXX_SETUP_MASK ) <<MCXX_SETUP_SHIFT ) | ((pxa2xx_mcxx_asst (speed, clock) &MCXX_ASST_MASK ) <<MCXX_ASST_SHIFT ) | ((pxa2xx_mcxx_hold (speed, clock) &MCXX_HOLD_MASK ) <<MCXX_HOLD_SHIFT ); +pxa2xx_pcmcia_set_reg (MCATT_OFFSET , sock, val); +return 0 ; }
@@ -207,19 +235,18 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt,static void pxa2xx_configure_sockets (struct device *dev) {struct pcmcia_low_level *ops = dev->platform_data; -/* * We have at least one socket, so set MECR:CIT * (Card Is There) */ -MECR |=MECR_CIT ; +uint32_t mecr =MECR_CIT ;/* Set MECR:NOS (Number Of Sockets) */ if ((ops->first + ops->nr) >1 ||machine_is_viper () ||machine_is_arcom_zeus ()) -MECR |=MECR_NOS ; -else -MECR &= ~MECR_NOS ; + mecr |=MECR_NOS ; + +pxa2xx_pcmcia_set_reg (MECR_OFFSET ,0 , mecr); }static const char *skt_names[] = {
@@ -272,16 +299,34 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev)struct pcmcia_low_level *ops;struct skt_dev_info *sinfo;struct soc_pcmcia_socket *skt; +uint32_t smc_addr; ops = (struct pcmcia_low_level *)dev->dev.platform_data; -if (!ops) -return -ENODEV ; +if (!ops) { + ret = -ENODEV ; + goto err0; + } + +if (cpu_is_pxa320 () && ops->nr >1 ) { +dev_err (&dev->dev,"pxa320 supports only one pcmcia slot" ); + ret = -EINVAL ; + goto err0; + }pxa2xx_drv_pcmcia_ops (ops); + smc_addr =cpu_is_pxa320 () ?PXA3XX_SMC_BASE :PXA2XX_SMC_BASE ; + base =ioremap (smc_addr,0x100 ); +if (!base) { + ret = -ENOMEM ; + goto err0; + } + sinfo =kzalloc (SKT_DEV_INFO_SIZE (ops->nr),GFP_KERNEL ); -if (!sinfo) -return -ENOMEM ; +if (!sinfo) { + ret = -ENOMEM ; + goto err1; + } sinfo->nskt = ops->nr;
@@ -297,18 +342,21 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev) ret =pxa2xx_drv_pcmcia_add_one (skt);if (ret) -break ; + goto err2; } -if (ret) { -while (--i >=0 ) -soc_pcmcia_remove_one (&sinfo->skt[i]); -kfree (sinfo); - }else { -pxa2xx_configure_sockets (&dev->dev); -dev_set_drvdata (&dev->dev, sinfo); - } +pxa2xx_configure_sockets (&dev->dev); +dev_set_drvdata (&dev->dev, sinfo); + +return 0 ; +err2: +while (--i >=0 ) +soc_pcmcia_remove_one (&sinfo->skt[i]); +kfree (sinfo); +err1: +iounmap (base); +err0:return ret; }
@@ -323,6 +371,7 @@ static int pxa2xx_drv_pcmcia_remove(struct platform_device *dev)soc_pcmcia_remove_one (&sinfo->skt[i]);kfree (sinfo); +iounmap (base);return 0 ; }
Signature · 1 line
1.7.1
PATCH 13/13 PXA: Colibri PXA320 PCMCIA driver
In reply to Marek Vasut--- arch/arm/mach-pxa/colibri-pxa320.c | 21 +++++++++++++++++++++ drivers/pcmcia/Kconfig | 3 ++- drivers/pcmcia/Makefile | 1 + drivers/pcmcia/pxa2xx_colibri.c | 17 ++++++++++++++++- 4 files changed, 40 insertions(+), 2 deletions(-)
arch/arm/mach-pxa/colibri-pxa320.c +21 -0
@@ -73,6 +73,27 @@ static mfp_cfg_t colibri_pxa320_evalboard_pin_config[] __initdata = {/* I2C */ GPIO32_I2C_SCL ,GPIO33_I2C_SDA , + +/* PCMCIA */ +MFP_CFG (GPIO59 ,AF7 ),/* PRST ; AF7 to tristate */ +MFP_CFG (GPIO61 ,AF7 ),/* PCE1 ; AF7 to tristate */ +MFP_CFG (GPIO60 ,AF7 ),/* PCE2 ; AF7 to tristate */ +MFP_CFG (GPIO62 ,AF7 ),/* PCD ; AF7 to tristate */ +MFP_CFG (GPIO56 ,AF7 ),/* PSKTSEL ; AF7 to tristate */ +GPIO27_GPIO ,/* RDnWR ; input/tristate */ +GPIO50_GPIO ,/* PREG ; input/tristate */ +GPIO2_RDY , +GPIO5_NPIOR , +GPIO6_NPIOW , +GPIO7_NPIOS16 , +GPIO8_NPWAIT , +GPIO29_GPIO ,/* PRDY (READY GPIO) */ +GPIO57_GPIO ,/* PPEN (POWER GPIO) */ +GPIO81_GPIO ,/* PCD (DETECT GPIO) */ +GPIO77_GPIO ,/* PRST (RESET GPIO) */ +GPIO53_GPIO ,/* PBVD1 */ +GPIO79_GPIO ,/* PBVD2 */ + GPIO54_GPIO, /* POE */ };#else static mfp_cfg_t colibri_pxa320_evalboard_pin_config[]__initdata = {};
drivers/pcmcia/Kconfig +2 -1
@@ -215,7 +215,8 @@ config PCMCIA_PXA2XX depends on (ARCH_LUBBOCK || MACH_MAINSTONE || PXA_SHARPSL \ || MACH_ARMCORE || ARCH_PXA_PALM || TRIZEPS_PCMCIA \ || ARCOM_PCMCIA || ARCH_PXA_ESERIES || MACH_STARGATE2 \ - || MACH_VPAC270 || MACH_BALLOON3 || MACH_COLIBRI) + || MACH_VPAC270 || MACH_BALLOON3 || MACH_COLIBRI \ + || MACH_COLIBRI320) select PCMCIA_SOC_COMMON help Say Y here to include support for the PXA2xx PCMCIA controller
drivers/pcmcia/Makefile +1 -0
@@ -72,6 +72,7 @@ pxa2xx-obj-$(CONFIG_MACH_STARGATE2) += pxa2xx_stargate2.o pxa2xx-obj-$(CONFIG_MACH_VPAC270) += pxa2xx_vpac270.o pxa2xx-obj-$(CONFIG_MACH_BALLOON3) += pxa2xx_balloon3.o pxa2xx-obj-$(CONFIG_MACH_COLIBRI) += pxa2xx_colibri.o +pxa2xx-obj-$(CONFIG_MACH_COLIBRI320) += pxa2xx_colibri.o obj-$(CONFIG_PCMCIA_PXA2XX) += pxa2xx_base.o $(pxa2xx-obj-y)
drivers/pcmcia/pxa2xx_colibri.c +16 -1
@@ -28,6 +28,13 @@#define COLIBRI270_DETECT_GPIO 84#define COLIBRI270_READY_GPIO 1 +#define COLIBRI320_RESET_GPIO 77 +#define COLIBRI320_PPEN_GPIO 57 +#define COLIBRI320_BVD1_GPIO 53 +#define COLIBRI320_BVD2_GPIO 79 +#define COLIBRI320_DETECT_GPIO 81 +#define COLIBRI320_READY_GPIO 29 + static struct { int reset_gpio; int ppen_gpio;
@@ -187,6 +194,14 @@ static int __init colibri_pcmcia_init(void) colibri_pcmcia_gpio.bvd2_gpio =COLIBRI270_BVD2_GPIO ; colibri_pcmcia_gpio.detect_gpio =COLIBRI270_DETECT_GPIO ; colibri_pcmcia_gpio.ready_gpio =COLIBRI270_READY_GPIO ; +/* Colibri PXA320 */ + }else if (machine_is_colibri320 ()) { + colibri_pcmcia_gpio.reset_gpio =COLIBRI320_RESET_GPIO ; + colibri_pcmcia_gpio.ppen_gpio =COLIBRI320_PPEN_GPIO ; + colibri_pcmcia_gpio.bvd1_gpio =COLIBRI320_BVD1_GPIO ; + colibri_pcmcia_gpio.bvd2_gpio =COLIBRI320_BVD2_GPIO ; + colibri_pcmcia_gpio.detect_gpio =COLIBRI320_DETECT_GPIO ; + colibri_pcmcia_gpio.ready_gpio =COLIBRI320_READY_GPIO ; } ret = platform_device_add_data(colibri_pcmcia_device,
@@ -210,6 +225,6 @@ module_init(colibri_pcmcia_init);module_exit (colibri_pcmcia_exit);MODULE_AUTHOR ("Marek Vasut <[email protected]>" ); -MODULE_DESCRIPTION ("PCMCIA support for Toradex Colibri PXA270" ); +MODULE_DESCRIPTION ("PCMCIA support for Toradex Colibri PXA270/PXA320" );MODULE_ALIAS ("platform:pxa2xx-pcmcia" );MODULE_LICENSE ("GPL" );
Signature · 1 line
1.7.1
PATCH 1/13 Balloon3: Disperse MFP config
In reply to Marek VasutQuoted 3 lines · Marek Vasut
Move pin config to appropriate places and use it only if needed.
Signed-off-by Marek Vasut <[email protected]>
So I suppose this is the successor patch series of the previous balloon3 one? Better to keep Jonathan's Ack then?
Quoted 207 lines
---
?arch/arm/mach-pxa/balloon3.c | ?104 +++++++++++++++++++++++++++-------------- ?1 files changed, 68 insertions(+), 36 deletions(-)arch/arm/mach-pxa/balloon3.c +0
-0@@ -68,42 +68,6 @@ static unsigned long balloon3_pin_config[] __initdata = {? ? ? ?/* Reset, configured as GPIO wakeup source */ ? ? ? ?GPIO1_GPIO |
WAKEUP_ON_EDGE_BOTH,arch/arm/mach-pxa/balloon3.c +0
-36- - ? ? ? /* LEDs */ - ? ? ? GPIO9_GPIO, ? ? /* NAND activity LED */ - ? ? ? GPIO10_GPIO, ? ?/* Heartbeat LED */ - - ? ? ? /* AC97 */ - ? ? ? GPIO28_AC97_BITCLK, - ? ? ? GPIO29_AC97_SDATA_IN_0, - ? ? ? GPIO30_AC97_SDATA_OUT, - ? ? ? GPIO31_AC97_SYNC, - ? ? ? GPIO113_AC97_nRESET, - ? ? ? GPIO95_GPIO, - - ? ? ? /* MMC */ - ? ? ? GPIO32_MMC_CLK, - ? ? ? GPIO92_MMC_DAT_0, - ? ? ? GPIO109_MMC_DAT_1, - ? ? ? GPIO110_MMC_DAT_2, - ? ? ? GPIO111_MMC_DAT_3, - ? ? ? GPIO112_MMC_CMD, - - ? ? ? /* USB Host */ - ? ? ? GPIO88_USBH1_PWR, - ? ? ? GPIO89_USBH1_PEN, - - ? ? ? /* PC Card */ - ? ? ? GPIO48_nPOE, - ? ? ? GPIO49_nPWE, - ? ? ? GPIO50_nPIOR, - ? ? ? GPIO51_nPIOW, - ? ? ? GPIO85_nPCE_1, - ? ? ? GPIO54_nPCE_2, - ? ? ? GPIO79_PSKTSEL, - ? ? ? GPIO55_nPREG, - ? ? ? GPIO56_nPWAIT, - ? ? ? GPIO57_nIOIS16,?};
?/******************************************************************************
arch/arm/mach-pxa/balloon3.c +0
-0@@ -132,6 +96,34 @@ int __init parse_balloon3_features(char *arg) ?early_param("balloon3_features", parse_balloon3_features);?/******************************************************************************
+ * Compact Flash slot
+ ******************************************************************************/arch/arm/mach-pxa/balloon3.c +26
-0+#if ? ?defined(CONFIG_PCMCIA_PXA2XX) || defined(CONFIG_PCMCIA_PXA2XX_MODULE) +static unsigned long balloon3_cf_pin_config[]__initdata = { + ? ? ? GPIO48_nPOE, + ? ? ? GPIO49_nPWE, + ? ? ? GPIO50_nPIOR, + ? ? ? GPIO51_nPIOW, + ? ? ? GPIO85_nPCE_1, + ? ? ? GPIO54_nPCE_2, + ? ? ? GPIO79_PSKTSEL, + ? ? ? GPIO55_nPREG, + ? ? ? GPIO56_nPWAIT, + ? ? ? GPIO57_nIOIS16, +}; + +static void __init balloon3_cf_init (void ) +{ + ? ? ? if (!balloon3_has(BALLOON3_FEATURE_CF)) + ? ? ? ? ? ? ? return; + + ? ? ? pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_cf_pin_config)); +} +#else +static inline void balloon3_cf_init (void ) {} +#endif + +/****************************************************************************** ?* NOR Flash ?******************************************************************************/ ?#if
defined(CONFIG_MTD_PHYSMAP)||defined(CONFIG_MTD_PHYSMAP_MODULE)arch/arm/mach-pxa/balloon3.c +0
-0@@ -179,6 +171,15 @@ static inline void balloon3_nor_init(void) {}?******************************************************************************/ ?#if ? ?defined(CONFIG_TOUCHSCREEN_UCB1400) || \
? ? ? ?defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE)arch/arm/mach-pxa/balloon3.c +9
-0+static unsigned long balloon3_ac97_pin_config[]__initdata = { + ? ? ? GPIO28_AC97_BITCLK, + ? ? ? GPIO29_AC97_SDATA_IN_0, + ? ? ? GPIO30_AC97_SDATA_OUT, + ? ? ? GPIO31_AC97_SYNC, + ? ? ? GPIO113_AC97_nRESET, + ? ? ? GPIO95_GPIO, +}; +?static struct
ucb1400_pdatavpac270_ucb1400_pdata= { ? ? ? ?.irq ? ? ? ? ? ?=IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ), ?};arch/arm/mach-pxa/balloon3.c +1
-0@@ -197,6 +198,7 @@ static void __init balloon3_ts_init(void) ? ? ? ?if (!balloon3_has(BALLOON3_FEATURE_AUDIO)) ? ? ? ? ? ? ? ?return; + ? ? ? pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_ac97_pin_config)); ? ? ? ?pxa_set_ac97_info(NULL); ? ? ? ?platform_device_register(&balloon3_ucb1400_device); ?}@@ -208,6 +210,11 @@ static inline void balloon3_ts_init(void) {}?* Framebuffer ?******************************************************************************/ ?#if
defined(CONFIG_FB_PXA)||defined(CONFIG_FB_PXA_MODULE)arch/arm/mach-pxa/balloon3.c +5
-0+static unsigned long balloon3_lcd_pin_config[]__initdata = { + ? ? ? GPIOxx_LCD_TFT_16BPP, + ? ? ? GPIO99_GPIO, +}; +?static struct
pxafb_mode_infoballoon3_lcd_modes[] = { ? ? ? ?{
? ? ? ? ? ? ? ?.pixclock ? ? ? ? ? ? ? = 38000,arch/arm/mach-pxa/balloon3.c +2
-0@@ -242,6 +249,8 @@ static void __init balloon3_lcd_init(void) ? ? ? ?if (!balloon3_has(BALLOON3_FEATURE_TOPPOLY)) ? ? ? ? ? ? ? ?return; + ? ? ? pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_lcd_pin_config)); + ? ? ? ?ret = gpio_request(BALLOON3_GPIO_RUN_BACKLIGHT, "BKL-ON"); ? ? ? ?if (ret) { ? ? ? ? ? ? ? ?pr_err("Requesting BKL-ON GPIO failed!\n");@@ -271,6 +280,15 @@ static inline void balloon3_lcd_init(void) {}?* SD/MMC card controller ?******************************************************************************/ ?#if
defined(CONFIG_MMC_PXA)||defined(CONFIG_MMC_PXA_MODULE)arch/arm/mach-pxa/balloon3.c +9
-0+static unsigned long balloon3_mmc_pin_config[]__initdata = { + ? ? ? GPIO32_MMC_CLK, + ? ? ? GPIO92_MMC_DAT_0, + ? ? ? GPIO109_MMC_DAT_1, + ? ? ? GPIO110_MMC_DAT_2, + ? ? ? GPIO111_MMC_DAT_3, + ? ? ? GPIO112_MMC_CMD, +}; +?static struct
pxamci_platform_databalloon3_mci_platform_data= { ? ? ? ?.ocr_mask ? ? ? ? ? ? ? =MMC_VDD_32_33|MMC_VDD_33_34, ? ? ? ?.gpio_card_detect ? ? ? = -1,arch/arm/mach-pxa/balloon3.c +1
-0@@ -281,6 +299,7 @@ static struct pxamci_platform_data balloon3_mci_platform_data = { ?static void __init balloon3_mmc_init(void) ?{ + ? ? ? pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_mmc_pin_config)); ? ? ? ?pxa_set_mci_info(&balloon3_mci_platform_data); ?}?#else
arch/arm/mach-pxa/balloon3.c +0
-0@@ -339,6 +358,11 @@ static inline void balloon3_irda_init(void) {}?* USB Host ?******************************************************************************/ ?#if
defined(CONFIG_USB_OHCI_HCD)||defined(CONFIG_USB_OHCI_HCD_MODULE)arch/arm/mach-pxa/balloon3.c +5
-0+static unsigned long balloon3_uhc_pin_config[]__initdata = { + ? ? ? GPIO88_USBH1_PWR, + ? ? ? GPIO89_USBH1_PEN, +}; +?static struct
pxaohci_platform_databalloon3_ohci_info= {
? ? ? ?.port_mode ? ? ?=PMM_PERPORT_MODE,
? ? ? ?.flags ? ? ? ? ?=ENABLE_PORT_ALL|POWER_CONTROL_LOW|POWER_SENSE_LOW,arch/arm/mach-pxa/balloon3.c +1
-0@@ -348,6 +372,7 @@ static void __init balloon3_uhc_init(void) ?{ ? ? ? ?if (!balloon3_has(BALLOON3_FEATURE_OHCI)) ? ? ? ? ? ? ? ?return; + ? ? ? pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_uhc_pin_config)); ? ? ? ?pxa_set_ohci_info(&balloon3_ohci_info); ?}?#else
arch/arm/mach-pxa/balloon3.c +0
-0@@ -358,6 +383,11 @@ static inline void balloon3_uhc_init(void) {}?* LEDs ?******************************************************************************/ ?#if
defined(CONFIG_LEDS_GPIO)||defined(CONFIG_LEDS_GPIO_MODULE)arch/arm/mach-pxa/balloon3.c +5
-0+static unsigned long balloon3_led_pin_config[]__initdata = { + ? ? ? GPIO9_GPIO, ? ? /* NAND activity LED */ + ? ? ? GPIO10_GPIO, ? ?/* Heartbeat LED */ +}; +?struct
gpio_ledballoon3_gpio_leds[] = {
? ? ? ?{
? ? ? ? ? ? ? ?.name ? ? ? ? ? ? ? ? ? = "balloon3:green:idle",arch/arm/mach-pxa/balloon3.c +2
-1@@ -436,6 +466,7 @@ static struct platform_device balloon3_pcf_leds = { ?static void __init balloon3_leds_init(void) ?{ + ? ? ? pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_led_pin_config)); ? ? ? ?platform_device_register(&balloon3_leds); ? ? ? ?platform_device_register(&balloon3_pcf_leds); ?}@@ -757,6 +788,7 @@ static void __init balloon3_init(void) ? ? ? ?balloon3_ts_init(); ? ? ? ?balloon3_udc_init(); ? ? ? ?balloon3_uhc_init(); + ? ? ? balloon3_cf_init(); ?} ?static struct map_desc balloon3_io_desc[] __initdata = { --1.7.1
PATCH 1/13 Balloon3: Disperse MFP config
Dne St 18. srpna 2010 06:11:51 Eric Miao napsal(a):
Quoted 7 lines · Marek Vasut
Quoted 3 lines
Move pin config to appropriate places and use it only if needed.
Signed-off-by Marek Vasut <[email protected]>So I suppose this is the successor patch series of the previous balloon3 one? Better to keep Jonathan's Ack then?
It's in the mail from 10th aug. I'll add hist ack to the patch when sending pull rq.
Quoted 214 lines
Quoted 214 lines
--- arch/arm/mach-pxa/balloon3.c | 104+++++++++++++++++++++++++++-------------- 1 files changed, 68 insertions(+), 36 deletions(-)
arch/arm/mach-pxa/balloon3.c +0
-36@@ -68,42 +68,6 @@ static unsigned long balloon3_pin_config[] __initdata = {/* Reset, configured as GPIO wakeup source */ GPIO1_GPIO |WAKEUP_ON_EDGE_BOTH , - -/* LEDs */ -GPIO9_GPIO ,/* NAND activity LED */ -GPIO10_GPIO ,/* Heartbeat LED */ - -/* AC97 */ -GPIO28_AC97_BITCLK , -GPIO29_AC97_SDATA_IN_0 , -GPIO30_AC97_SDATA_OUT , -GPIO31_AC97_SYNC , - GPIO113_AC97_nRESET, -GPIO95_GPIO , - -/* MMC */ -GPIO32_MMC_CLK , -GPIO92_MMC_DAT_0 , -GPIO109_MMC_DAT_1 , -GPIO110_MMC_DAT_2 , -GPIO111_MMC_DAT_3 , -GPIO112_MMC_CMD , - -/* USB Host */ -GPIO88_USBH1_PWR , -GPIO89_USBH1_PEN , - -/* PC Card */ - GPIO48_nPOE, - GPIO49_nPWE, - GPIO50_nPIOR, - GPIO51_nPIOW, - GPIO85_nPCE_1, - GPIO54_nPCE_2, -GPIO79_PSKTSEL , - GPIO55_nPREG, - GPIO56_nPWAIT, - GPIO57_nIOIS16, };/***********************************************************************
******* @@ -132,6 +96,34 @@ int__initparse_balloon3_features(char *arg)early_param("balloon3_features", parse_balloon3_features);/***********************************************************************
******* + * Compact Flash slot
+
************************************************************************
******/ +#ifdefined(CONFIG_PCMCIA_PXA2XX)||defined(CONFIG_PCMCIA_PXA2XX_MODULE)+static unsigned long balloon3_cf_pin_config[]__initdata= {arch/arm/mach-pxa/balloon3.c +24
-0+ GPIO48_nPOE, + GPIO49_nPWE, + GPIO50_nPIOR, + GPIO51_nPIOW, + GPIO85_nPCE_1, + GPIO54_nPCE_2, +GPIO79_PSKTSEL , + GPIO55_nPREG, + GPIO56_nPWAIT, + GPIO57_nIOIS16, +}; + +static void __init balloon3_cf_init (void ) +{ +if (!balloon3_has (BALLOON3_FEATURE_CF )) +return ; + +pxa2xx_mfp_config (ARRAY_AND_SIZE (balloon3_cf_pin_config)); +} +#else +static inline void balloon3_cf_init (void ) {} +#endif + +/*********************************************************************** ******* * NOR Flash
************************************************************************
******/ #ifdefined(CONFIG_MTD_PHYSMAP)||defined(CONFIG_MTD_PHYSMAP_MODULE)@@ -179,6 +171,15 @@ static inline voidballoon3_nor_init(void){}
************************************************************************
******/ #ifdefined(CONFIG_TOUCHSCREEN_UCB1400)|| \
defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE)arch/arm/mach-pxa/balloon3.c +27
-0+static unsigned long balloon3_ac97_pin_config[]__initdata = { +GPIO28_AC97_BITCLK , +GPIO29_AC97_SDATA_IN_0 , +GPIO30_AC97_SDATA_OUT , +GPIO31_AC97_SYNC , + GPIO113_AC97_nRESET, +GPIO95_GPIO , +}; +static struct ucb1400_pdata vpac270_ucb1400_pdata = { .irq =IRQ_GPIO (BALLOON3_GPIO_CODEC_IRQ ), };@@ -197,6 +198,7 @@ static void __init balloon3_ts_init(void)if (!balloon3_has (BALLOON3_FEATURE_AUDIO ))return ; +pxa2xx_mfp_config (ARRAY_AND_SIZE (balloon3_ac97_pin_config));pxa_set_ac97_info (NULL );platform_device_register (&balloon3_ucb1400_device); }@@ -208,6 +210,11 @@ static inline void balloon3_ts_init(void) {}* Framebuffer ************************************************************************ ******/ #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) +static unsigned long balloon3_lcd_pin_config[] __initdata = { + GPIOxx_LCD_TFT_16BPP, + GPIO99_GPIO, +}; + static struct pxafb_mode_info balloon3_lcd_modes[] = { { .pixclock = 38000,@@ -242,6 +249,8 @@ static void __init balloon3_lcd_init(void)if (!balloon3_has (BALLOON3_FEATURE_TOPPOLY ))return ; +pxa2xx_mfp_config (ARRAY_AND_SIZE (balloon3_lcd_pin_config)); + ret =gpio_request (BALLOON3_GPIO_RUN_BACKLIGHT ,"BKL-ON" );if (ret) {pr_err ("Requesting BKL-ON GPIO failed!\n" );@@ -271,6 +280,15 @@ static inline void balloon3_lcd_init(void) {}* SD/MMC card controller ************************************************************************ ******/ #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) +static unsigned long balloon3_mmc_pin_config[] __initdata = { + GPIO32_MMC_CLK, + GPIO92_MMC_DAT_0, + GPIO109_MMC_DAT_1, + GPIO110_MMC_DAT_2, + GPIO111_MMC_DAT_3, + GPIO112_MMC_CMD, +}; + static struct pxamci_platform_data balloon3_mci_platform_data = { .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, .gpio_card_detect = -1,@@ -281,6 +299,7 @@ static struct pxamci_platform_data balloon3_mci_platform_data = {static void __init balloon3_mmc_init (void ) { +pxa2xx_mfp_config (ARRAY_AND_SIZE (balloon3_mmc_pin_config));pxa_set_mci_info (&balloon3_mci_platform_data); }#else
arch/arm/mach-pxa/balloon3.c +0
-0@@ -339,6 +358,11 @@ static inline void balloon3_irda_init(void) {}* USB Host ************************************************************************ ******/ #if defined(CONFIG_USB_OHCI_HCD) ||
defined(CONFIG_USB_OHCI_HCD_MODULE)+static unsigned long balloon3_uhc_pin_config[]__initdata= {arch/arm/mach-pxa/balloon3.c +4
-0+ GPIO88_USBH1_PWR, + GPIO89_USBH1_PEN, +}; +static struct pxaohci_platform_data balloon3_ohci_info = { .port_mode =PMM_PERPORT_MODE , .flags = ENABLE_PORT_ALL | POWER_CONTROL_LOW |
POWER_SENSE_LOW, @@ -348,6 +372,7 @@ static void__initballoon3_uhc_init(void){ if (!balloon3_has(BALLOON3_FEATURE_OHCI)) return;arch/arm/mach-pxa/balloon3.c +8
-1+pxa2xx_mfp_config (ARRAY_AND_SIZE (balloon3_uhc_pin_config)); pxa_set_ohci_info(&balloon3_ohci_info); }#else @@ -358,6 +383,11 @@ static inline void balloon3_uhc_init(void) {}* LEDs ************************************************************************ ******/ #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) +static unsigned long balloon3_led_pin_config[] __initdata = { + GPIO9_GPIO, /* NAND activity LED */ + GPIO10_GPIO, /* Heartbeat LED */ +}; + struct gpio_led balloon3_gpio_leds[] = { { .name = "balloon3:green:idle",@@ -436,6 +466,7 @@ static struct platform_device balloon3_pcf_leds = {static void __init balloon3_leds_init (void ) { +pxa2xx_mfp_config (ARRAY_AND_SIZE (balloon3_led_pin_config));platform_device_register (&balloon3_leds);platform_device_register (&balloon3_pcf_leds); }@@ -757,6 +788,7 @@ static void __init balloon3_init(void)balloon3_ts_init ();balloon3_udc_init ();balloon3_uhc_init (); +balloon3_cf_init (); }static struct map_desc balloon3_io_desc[]__initdata = { --1.7.1