* [PATCH 01/13] Balloon3: Disperse MFP config
@ 2010-08-13 4:32 Marek Vasut
2010-08-13 4:32 ` [PATCH 02/13] PXA: Vpac270: Fix gpio_power for MMC Marek Vasut
` (12 more replies)
0 siblings, 13 replies; 20+ messages in thread
From: Marek Vasut @ 2010-08-13 4:32 UTC (permalink / raw)
To: linux-arm-kernel
Move pin config to appropriate places and use it only if needed.
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
arch/arm/mach-pxa/balloon3.c | 104 +++++++++++++++++++++++++++--------------
1 files changed, 68 insertions(+), 36 deletions(-)
diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c
index 9041340..7f62448 100644
--- a/arch/arm/mach-pxa/balloon3.c
+++ b/arch/arm/mach-pxa/balloon3.c
@@ -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 = {
--
1.7.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 02/13] PXA: Vpac270: Fix gpio_power for MMC
2010-08-13 4:32 [PATCH 01/13] Balloon3: Disperse MFP config Marek Vasut
@ 2010-08-13 4:32 ` Marek Vasut
2010-08-13 4:32 ` [PATCH 03/13] PXA: PalmTC: Modularize Palm Tungsten|C Marek Vasut
` (11 subsequent siblings)
12 siblings, 0 replies; 20+ messages in thread
From: Marek Vasut @ 2010-08-13 4:32 UTC (permalink / raw)
To: linux-arm-kernel
GPIO 0 is valid, yet this platform doesn't have any power GPIO for MMC.
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
arch/arm/mach-pxa/vpac270.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c
index c9b747c..37d6173 100644
--- a/arch/arm/mach-pxa/vpac270.c
+++ b/arch/arm/mach-pxa/vpac270.c
@@ -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,
--
1.7.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 03/13] PXA: PalmTC: Modularize Palm Tungsten|C
2010-08-13 4:32 [PATCH 01/13] Balloon3: Disperse MFP config Marek Vasut
2010-08-13 4:32 ` [PATCH 02/13] PXA: Vpac270: Fix gpio_power for MMC Marek Vasut
@ 2010-08-13 4:32 ` Marek Vasut
2010-08-13 4:32 ` [PATCH 04/13] UCB1400: Pass ucb1400-gpio data through ac97 bus Marek Vasut
` (10 subsequent siblings)
12 siblings, 0 replies; 20+ messages in thread
From: Marek Vasut @ 2010-08-13 4:32 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
arch/arm/mach-pxa/palmtc.c | 147 ++++++++++++++++++++++++++++++++++---------
1 files changed, 116 insertions(+), 31 deletions(-)
diff --git a/arch/arm/mach-pxa/palmtc.c b/arch/arm/mach-pxa/palmtc.c
index ce1104d..7f868d4 100644
--- a/arch/arm/mach-pxa/palmtc.c
+++ b/arch/arm/mach-pxa/palmtc.c
@@ -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")
--
1.7.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 04/13] UCB1400: Pass ucb1400-gpio data through ac97 bus
2010-08-13 4:32 [PATCH 01/13] Balloon3: Disperse MFP config Marek Vasut
2010-08-13 4:32 ` [PATCH 02/13] PXA: Vpac270: Fix gpio_power for MMC Marek Vasut
2010-08-13 4:32 ` [PATCH 03/13] PXA: PalmTC: Modularize Palm Tungsten|C Marek Vasut
@ 2010-08-13 4:32 ` Marek Vasut
2010-08-13 4:32 ` [PATCH 05/13] PXA: Vpac270: Correct touch IRQ passing to UCB1400 Marek Vasut
` (9 subsequent siblings)
12 siblings, 0 replies; 20+ messages in thread
From: Marek Vasut @ 2010-08-13 4:32 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
drivers/gpio/ucb1400_gpio.c | 19 ++++++-------------
drivers/mfd/ucb1400_core.c | 5 +++++
include/linux/ucb1400.h | 19 ++++++-------------
3 files changed, 17 insertions(+), 26 deletions(-)
diff --git a/drivers/gpio/ucb1400_gpio.c b/drivers/gpio/ucb1400_gpio.c
index 50e6bd1..fba45a5 100644
--- a/drivers/gpio/ucb1400_gpio.c
+++ b/drivers/gpio/ucb1400_gpio.c
@@ -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);
diff --git a/drivers/mfd/ucb1400_core.c b/drivers/mfd/ucb1400_core.c
index dbe2801..3e24632 100644
--- a/drivers/mfd/ucb1400_core.c
+++ b/drivers/mfd/ucb1400_core.c
@@ -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;
diff --git a/include/linux/ucb1400.h b/include/linux/ucb1400.h
index 1b47909..1a6bfdd 100644
--- a/include/linux/ucb1400.h
+++ b/include/linux/ucb1400.h
@@ -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
--
1.7.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 05/13] PXA: Vpac270: Correct touch IRQ passing to UCB1400
2010-08-13 4:32 [PATCH 01/13] Balloon3: Disperse MFP config Marek Vasut
` (2 preceding siblings ...)
2010-08-13 4:32 ` [PATCH 04/13] UCB1400: Pass ucb1400-gpio data through ac97 bus Marek Vasut
@ 2010-08-13 4:32 ` Marek Vasut
2010-08-13 4:32 ` [PATCH 06/13] PXA: PalmTC: Pass GPIO offset to ucb1400-gpio Marek Vasut
` (8 subsequent siblings)
12 siblings, 0 replies; 20+ messages in thread
From: Marek Vasut @ 2010-08-13 4:32 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
arch/arm/mach-pxa/vpac270.c | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c
index 37d6173..562cf55 100644
--- a/arch/arm/mach-pxa/vpac270.c
+++ b/arch/arm/mach-pxa/vpac270.c
@@ -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)
--
1.7.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 06/13] PXA: PalmTC: Pass GPIO offset to ucb1400-gpio
2010-08-13 4:32 [PATCH 01/13] Balloon3: Disperse MFP config Marek Vasut
` (3 preceding siblings ...)
2010-08-13 4:32 ` [PATCH 05/13] PXA: Vpac270: Correct touch IRQ passing to UCB1400 Marek Vasut
@ 2010-08-13 4:32 ` Marek Vasut
2010-08-13 4:32 ` [PATCH 07/13] PXA: PalmTC: Add gpio-leds and vibrator support Marek Vasut
` (7 subsequent siblings)
12 siblings, 0 replies; 20+ messages in thread
From: Marek Vasut @ 2010-08-13 4:32 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
arch/arm/mach-pxa/palmtc.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-pxa/palmtc.c b/arch/arm/mach-pxa/palmtc.c
index 7f868d4..9c74ce9 100644
--- a/arch/arm/mach-pxa/palmtc.c
+++ b/arch/arm/mach-pxa/palmtc.c
@@ -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
--
1.7.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 07/13] PXA: PalmTC: Add gpio-leds and vibrator support
2010-08-13 4:32 [PATCH 01/13] Balloon3: Disperse MFP config Marek Vasut
` (4 preceding siblings ...)
2010-08-13 4:32 ` [PATCH 06/13] PXA: PalmTC: Pass GPIO offset to ucb1400-gpio Marek Vasut
@ 2010-08-13 4:32 ` Marek Vasut
2010-08-13 4:32 ` [PATCH 08/13] PXA: Colibri: Toradex Colibri PXA270 CF support Marek Vasut
` (6 subsequent siblings)
12 siblings, 0 replies; 20+ messages in thread
From: Marek Vasut @ 2010-08-13 4:32 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
arch/arm/mach-pxa/palmtc.c | 41 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 41 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-pxa/palmtc.c b/arch/arm/mach-pxa/palmtc.c
index 9c74ce9..ccefc4e 100644
--- a/arch/arm/mach-pxa/palmtc.c
+++ b/arch/arm/mach-pxa/palmtc.c
@@ -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")
--
1.7.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 08/13] PXA: Colibri: Toradex Colibri PXA270 CF support
2010-08-13 4:32 [PATCH 01/13] Balloon3: Disperse MFP config Marek Vasut
` (5 preceding siblings ...)
2010-08-13 4:32 ` [PATCH 07/13] PXA: PalmTC: Add gpio-leds and vibrator support Marek Vasut
@ 2010-08-13 4:32 ` Marek Vasut
2010-08-18 11:43 ` Daniel Mack
2010-09-01 7:23 ` Russell King - ARM Linux
2010-08-13 4:32 ` [PATCH 09/13] PXA: Colibri: Push evalboard MFP into module files Marek Vasut
` (5 subsequent siblings)
12 siblings, 2 replies; 20+ messages in thread
From: Marek Vasut @ 2010-08-13 4:32 UTC (permalink / raw)
To: linux-arm-kernel
This driver also contains structures to eventually support PXA320. This is
planned to be added in a later patch.
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
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
diff --git a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
index 0f3b632..6177ff5 100644
--- a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
+++ b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
@@ -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 */
};
/******************************************************************************
diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig
index ef2f659..883623a 100644
--- a/drivers/pcmcia/Kconfig
+++ b/drivers/pcmcia/Kconfig
@@ -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
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile
index 6a60773..0e989a1 100644
--- a/drivers/pcmcia/Makefile
+++ b/drivers/pcmcia/Makefile
@@ -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)
diff --git a/drivers/pcmcia/pxa2xx_colibri.c b/drivers/pcmcia/pxa2xx_colibri.c
new file mode 100644
index 0000000..8373816
--- /dev/null
+++ b/drivers/pcmcia/pxa2xx_colibri.c
@@ -0,0 +1,215 @@
+/*
+ * linux/drivers/pcmcia/pxa2xx_colibri.c
+ *
+ * Driver for Toradex Colibri PXA270 CF socket
+ *
+ * Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com>
+ *
+ * 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 <marek.vasut@gmail.com>");
+MODULE_DESCRIPTION("PCMCIA support for Toradex Colibri PXA270");
+MODULE_ALIAS("platform:pxa2xx-pcmcia");
+MODULE_LICENSE("GPL");
--
1.7.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 09/13] PXA: Colibri: Push evalboard MFP into module files
2010-08-13 4:32 [PATCH 01/13] Balloon3: Disperse MFP config Marek Vasut
` (6 preceding siblings ...)
2010-08-13 4:32 ` [PATCH 08/13] PXA: Colibri: Toradex Colibri PXA270 CF support Marek Vasut
@ 2010-08-13 4:32 ` Marek Vasut
2010-08-13 4:32 ` [PATCH 10/13] PXA: Colibri: Add M41T00 RTC support Marek Vasut
` (4 subsequent siblings)
12 siblings, 0 replies; 20+ messages in thread
From: Marek Vasut @ 2010-08-13 4:32 UTC (permalink / raw)
To: linux-arm-kernel
This 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)
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
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(-)
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 7aefb90..636cb79 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -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
diff --git a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
index 6177ff5..e1a2b52 100644
--- a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
+++ b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
@@ -30,61 +30,28 @@
#include "devices.h"
/******************************************************************************
- * Pin configuration
- ******************************************************************************/
-static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {
- /* MMC */
- GPIO32_MMC_CLK,
- GPIO92_MMC_DAT_0,
- GPIO109_MMC_DAT_1,
- GPIO110_MMC_DAT_2,
- GPIO111_MMC_DAT_3,
- GPIO112_MMC_CMD,
- GPIO0_GPIO, /* SD detect */
-
- /* FFUART */
- GPIO39_FFUART_TXD,
- GPIO34_FFUART_RXD,
-
- /* UHC */
- GPIO88_USBH1_PWR,
- 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 */
-};
-
-/******************************************************************************
* SD/MMC card controller
******************************************************************************/
#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
static struct pxamci_platform_data colibri_pxa270_mci_platform_data = {
.ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
.gpio_power = -1,
- .gpio_card_detect = GPIO0_COLIBRI_PXA270_SD_DETECT,
.gpio_card_ro = -1,
.detect_delay_ms = 200,
};
static void __init colibri_pxa270_mmc_init(void)
{
+ if (machine_is_colibri()) /* PXA270 Colibri */
+ colibri_pxa270_mci_platform_data.gpio_card_detect =
+ GPIO0_COLIBRI_PXA270_SD_DETECT;
+ if (machine_is_colibri300()) /* PXA300 Colibri */
+ colibri_pxa270_mci_platform_data.gpio_card_detect =
+ GPIO39_COLIBRI_PXA300_SD_DETECT;
+ else /* PXA320 Colibri */
+ colibri_pxa270_mci_platform_data.gpio_card_detect =
+ GPIO28_COLIBRI_PXA320_SD_DETECT;
+
pxa_set_mci_info(&colibri_pxa270_mci_platform_data);
}
#else
@@ -103,13 +70,17 @@ static int colibri_pxa270_ohci_init(struct device *dev)
static struct pxaohci_platform_data colibri_pxa270_ohci_info = {
.port_mode = PMM_PERPORT_MODE,
- .flags = ENABLE_PORT1 | ENABLE_PORT2 |
+ .flags = ENABLE_PORT1 |
POWER_CONTROL_LOW | POWER_SENSE_LOW,
.init = colibri_pxa270_ohci_init,
};
static void __init colibri_pxa270_uhc_init(void)
{
+ /* Colibri PXA270 has two usb ports, TBA for 320 */
+ if (machine_is_colibri())
+ colibri_pxa270_ohci_info.flags |= ENABLE_PORT2;
+
pxa_set_ohci_info(&colibri_pxa270_ohci_info);
}
#else
@@ -118,7 +89,6 @@ static inline void colibri_pxa270_uhc_init(void) {}
void __init colibri_pxa270_evalboard_init(void)
{
- pxa2xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa270_evalboard_pin_config));
pxa_set_ffuart_info(NULL);
pxa_set_btuart_info(NULL);
pxa_set_stuart_info(NULL);
@@ -126,4 +96,3 @@ void __init colibri_pxa270_evalboard_init(void)
colibri_pxa270_mmc_init();
colibri_pxa270_uhc_init();
}
-
diff --git a/arch/arm/mach-pxa/colibri-pxa270-income.c b/arch/arm/mach-pxa/colibri-pxa270-income.c
index 37f0f3e..07b62a0 100644
--- a/arch/arm/mach-pxa/colibri-pxa270-income.c
+++ b/arch/arm/mach-pxa/colibri-pxa270-income.c
@@ -46,52 +46,6 @@
#define GPIO113_INCOME_TS_IRQ (113)
/******************************************************************************
- * Pin configuration
- ******************************************************************************/
-static mfp_cfg_t income_pin_config[] __initdata = {
- /* MMC */
- GPIO32_MMC_CLK,
- GPIO92_MMC_DAT_0,
- GPIO109_MMC_DAT_1,
- GPIO110_MMC_DAT_2,
- GPIO111_MMC_DAT_3,
- GPIO112_MMC_CMD,
- GPIO0_GPIO, /* SD detect */
- GPIO1_GPIO, /* SD read-only */
-
- /* FFUART */
- GPIO39_FFUART_TXD,
- GPIO34_FFUART_RXD,
-
- /* BFUART */
- GPIO42_BTUART_RXD,
- GPIO43_BTUART_TXD,
- GPIO45_BTUART_RTS,
-
- /* STUART */
- GPIO46_STUART_RXD,
- GPIO47_STUART_TXD,
-
- /* UHC */
- GPIO88_USBH1_PWR,
- GPIO89_USBH1_PEN,
-
- /* LCD */
- GPIOxx_LCD_TFT_16BPP,
-
- /* PWM */
- GPIO16_PWM0_OUT,
-
- /* I2C */
- GPIO117_I2C_SCL,
- GPIO118_I2C_SDA,
-
- /* LED */
- GPIO54_GPIO, /* LED A */
- GPIO55_GPIO, /* LED B */
-};
-
-/******************************************************************************
* SD/MMC card controller
******************************************************************************/
#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
@@ -257,7 +211,6 @@ static inline void income_pwm_init(void) {}
void __init colibri_pxa270_income_boardinit(void)
{
- pxa2xx_mfp_config(ARRAY_AND_SIZE(income_pin_config));
pxa_set_ffuart_info(NULL);
pxa_set_btuart_info(NULL);
pxa_set_stuart_info(NULL);
diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c
index 98673ac..8488dfe 100644
--- a/arch/arm/mach-pxa/colibri-pxa270.c
+++ b/arch/arm/mach-pxa/colibri-pxa270.c
@@ -33,6 +33,99 @@
#include "generic.h"
/******************************************************************************
+ * Evaluation board MFP
+ ******************************************************************************/
+#ifdef CONFIG_MACH_COLIBRI_PXA270_EVALBOARD
+static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {
+ /* MMC */
+ GPIO32_MMC_CLK,
+ GPIO92_MMC_DAT_0,
+ GPIO109_MMC_DAT_1,
+ GPIO110_MMC_DAT_2,
+ GPIO111_MMC_DAT_3,
+ GPIO112_MMC_CMD,
+ GPIO0_GPIO, /* SD detect */
+
+ /* FFUART */
+ GPIO39_FFUART_TXD,
+ GPIO34_FFUART_RXD,
+
+ /* UHC */
+ GPIO88_USBH1_PWR,
+ 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 */
+};
+#else
+static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {};
+#endif
+
+#ifdef CONFIG_MACH_COLIBRI_PXA270_INCOME
+static mfp_cfg_t income_pin_config[] __initdata = {
+ /* MMC */
+ GPIO32_MMC_CLK,
+ GPIO92_MMC_DAT_0,
+ GPIO109_MMC_DAT_1,
+ GPIO110_MMC_DAT_2,
+ GPIO111_MMC_DAT_3,
+ GPIO112_MMC_CMD,
+ GPIO0_GPIO, /* SD detect */
+ GPIO1_GPIO, /* SD read-only */
+
+ /* FFUART */
+ GPIO39_FFUART_TXD,
+ GPIO34_FFUART_RXD,
+
+ /* BFUART */
+ GPIO42_BTUART_RXD,
+ GPIO43_BTUART_TXD,
+ GPIO45_BTUART_RTS,
+
+ /* STUART */
+ GPIO46_STUART_RXD,
+ GPIO47_STUART_TXD,
+
+ /* UHC */
+ GPIO88_USBH1_PWR,
+ GPIO89_USBH1_PEN,
+
+ /* LCD */
+ GPIOxx_LCD_TFT_16BPP,
+
+ /* PWM */
+ GPIO16_PWM0_OUT,
+
+ /* I2C */
+ GPIO117_I2C_SCL,
+ GPIO118_I2C_SDA,
+
+ /* LED */
+ GPIO54_GPIO, /* LED A */
+ GPIO55_GPIO, /* LED B */
+};
+#else
+static mfp_cfg_t income_pin_config[] __initdata = {};
+#endif
+
+/******************************************************************************
* Pin configuration
******************************************************************************/
static mfp_cfg_t colibri_pxa270_pin_config[] __initdata = {
@@ -185,9 +278,12 @@ static void __init colibri_pxa270_init(void)
switch (colibri_pxa270_baseboard) {
case COLIBRI_PXA270_EVALBOARD:
+ pxa2xx_mfp_config(ARRAY_AND_SIZE(
+ colibri_pxa270_evalboard_pin_config));
colibri_pxa270_evalboard_init();
break;
case COLIBRI_PXA270_INCOME:
+ pxa2xx_mfp_config(ARRAY_AND_SIZE(income_pin_config));
colibri_pxa270_income_boardinit();
break;
default:
diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c
index 45c23fd..080d0e1 100644
--- a/arch/arm/mach-pxa/colibri-pxa300.c
+++ b/arch/arm/mach-pxa/colibri-pxa300.c
@@ -30,9 +30,28 @@
#include "generic.h"
#include "devices.h"
+
+#ifdef CONFIG_MACH_COLIBRI_PXA270_EVALBOARD
+static mfp_cfg_t colibri_pxa300_evalboard_pin_config[] __initdata = {
+ /* MMC */
+ GPIO7_MMC1_CLK,
+ GPIO14_MMC1_CMD,
+ GPIO3_MMC1_DAT0,
+ GPIO4_MMC1_DAT1,
+ GPIO5_MMC1_DAT2,
+ GPIO6_MMC1_DAT3,
+ GPIO39_GPIO, /* SD detect */
+
+ /* UHC */
+ GPIO0_2_USBH_PEN,
+ GPIO1_2_USBH_PWR,
+};
+#else
+static mfp_cfg_t colibri_pxa300_evalboard_pin_config[] __initdata = {};
+#endif
+
#if defined(CONFIG_AX88796)
#define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO26_GPIO)
-
/*
* Asix AX88796 Ethernet
*/
@@ -79,35 +98,6 @@ static void __init colibri_pxa300_init_eth(void)
static inline void __init colibri_pxa300_init_eth(void) {}
#endif /* CONFIG_AX88796 */
-#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
-static mfp_cfg_t colibri_pxa300_usb_pin_config[] __initdata = {
- GPIO0_2_USBH_PEN,
- GPIO1_2_USBH_PWR,
-};
-
-static struct pxaohci_platform_data colibri_pxa300_ohci_info = {
- .port_mode = PMM_GLOBAL_MODE,
- .flags = ENABLE_PORT1 | POWER_CONTROL_LOW | POWER_SENSE_LOW,
-};
-
-void __init colibri_pxa300_init_ohci(void)
-{
- pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_usb_pin_config));
- pxa_set_ohci_info(&colibri_pxa300_ohci_info);
-}
-#else
-static inline void colibri_pxa300_init_ohci(void) {}
-#endif /* CONFIG_USB_OHCI_HCD || CONFIG_USB_OHCI_HCD_MODULE */
-
-static mfp_cfg_t colibri_pxa300_mmc_pin_config[] __initdata = {
- GPIO7_MMC1_CLK,
- GPIO14_MMC1_CMD,
- GPIO3_MMC1_DAT0,
- GPIO4_MMC1_DAT1,
- GPIO5_MMC1_DAT2,
- GPIO6_MMC1_DAT3,
-};
-
#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
static mfp_cfg_t colibri_pxa300_lcd_pin_config[] __initdata = {
GPIO54_LCD_LDD_0,
@@ -170,18 +160,15 @@ static inline void colibri_pxa310_init_ac97(void) {}
void __init colibri_pxa300_init(void)
{
- pxa_set_ffuart_info(NULL);
- pxa_set_btuart_info(NULL);
- pxa_set_stuart_info(NULL);
-
colibri_pxa300_init_eth();
- colibri_pxa300_init_ohci();
colibri_pxa3xx_init_nand();
colibri_pxa300_init_lcd();
colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO39_GPIO));
colibri_pxa310_init_ac97();
- colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa300_mmc_pin_config),
- mfp_to_gpio(MFP_PIN_GPIO13));
+
+ /* Evalboard init */
+ pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_evalboard_pin_config));
+ colibri_pxa270_evalboard_init();
}
MACHINE_START(COLIBRI300, "Toradex Colibri PXA300")
diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c
index 99e850d..e886ab2 100644
--- a/arch/arm/mach-pxa/colibri-pxa320.c
+++ b/arch/arm/mach-pxa/colibri-pxa320.c
@@ -35,9 +35,47 @@
#include "generic.h"
#include "devices.h"
+#ifdef CONFIG_MACH_COLIBRI_PXA270_EVALBOARD
+static mfp_cfg_t colibri_pxa320_evalboard_pin_config[] __initdata = {
+ /* MMC */
+ GPIO22_MMC1_CLK,
+ GPIO23_MMC1_CMD,
+ GPIO18_MMC1_DAT0,
+ GPIO19_MMC1_DAT1,
+ GPIO20_MMC1_DAT2,
+ GPIO21_MMC1_DAT3,
+ GPIO28_GPIO, /* SD detect */
+
+ /* UART 1 configuration (may be set by bootloader) */
+ GPIO99_UART1_CTS,
+ GPIO104_UART1_RTS,
+ GPIO97_UART1_RXD,
+ GPIO98_UART1_TXD,
+ GPIO101_UART1_DTR,
+ GPIO103_UART1_DSR,
+ GPIO100_UART1_DCD,
+ GPIO102_UART1_RI,
+
+ /* UART 2 configuration */
+ GPIO109_UART2_CTS,
+ GPIO112_UART2_RTS,
+ GPIO110_UART2_RXD,
+ GPIO111_UART2_TXD,
+
+ /* UART 3 configuration */
+ GPIO30_UART3_RXD,
+ GPIO31_UART3_TXD,
+
+ /* UHC */
+ GPIO2_2_USBH_PEN,
+ GPIO3_2_USBH_PWR,
+};
+#else
+static mfp_cfg_t colibri_pxa320_evalboard_pin_config[] __initdata = {};
+#endif
+
#if defined(CONFIG_AX88796)
#define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO36_GPIO)
-
/*
* Asix AX88796 Ethernet
*/
@@ -84,26 +122,6 @@ static void __init colibri_pxa320_init_eth(void)
static inline void __init colibri_pxa320_init_eth(void) {}
#endif /* CONFIG_AX88796 */
-#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
-static mfp_cfg_t colibri_pxa320_usb_pin_config[] __initdata = {
- GPIO2_2_USBH_PEN,
- GPIO3_2_USBH_PWR,
-};
-
-static struct pxaohci_platform_data colibri_pxa320_ohci_info = {
- .port_mode = PMM_GLOBAL_MODE,
- .flags = ENABLE_PORT1 | POWER_CONTROL_LOW | POWER_SENSE_LOW,
-};
-
-void __init colibri_pxa320_init_ohci(void)
-{
- pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_usb_pin_config));
- pxa_set_ohci_info(&colibri_pxa320_ohci_info);
-}
-#else
-static inline void colibri_pxa320_init_ohci(void) {}
-#endif /* CONFIG_USB_OHCI_HCD || CONFIG_USB_OHCI_HCD_MODULE */
-
#if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE)
static struct gpio_vbus_mach_info colibri_pxa320_gpio_vbus_info = {
.gpio_vbus = mfp_to_gpio(MFP_PIN_GPIO96),
@@ -140,15 +158,6 @@ static void __init colibri_pxa320_init_udc(void)
static inline void colibri_pxa320_init_udc(void) {}
#endif
-static mfp_cfg_t colibri_pxa320_mmc_pin_config[] __initdata = {
- GPIO22_MMC1_CLK,
- GPIO23_MMC1_CMD,
- GPIO18_MMC1_DAT0,
- GPIO19_MMC1_DAT1,
- GPIO20_MMC1_DAT2,
- GPIO21_MMC1_DAT3
-};
-
#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
static mfp_cfg_t colibri_pxa320_lcd_pin_config[] __initdata = {
GPIO6_2_LCD_LDD_0,
@@ -205,53 +214,18 @@ static inline void __init colibri_pxa320_init_ac97(void)
static inline void colibri_pxa320_init_ac97(void) {}
#endif
-/*
- * The following configuration is verified to work with the Toradex Orchid
- * carrier board
- */
-static mfp_cfg_t colibri_pxa320_uart_pin_config[] __initdata = {
- /* UART 1 configuration (may be set by bootloader) */
- GPIO99_UART1_CTS,
- GPIO104_UART1_RTS,
- GPIO97_UART1_RXD,
- GPIO98_UART1_TXD,
- GPIO101_UART1_DTR,
- GPIO103_UART1_DSR,
- GPIO100_UART1_DCD,
- GPIO102_UART1_RI,
-
- /* UART 2 configuration */
- GPIO109_UART2_CTS,
- GPIO112_UART2_RTS,
- GPIO110_UART2_RXD,
- GPIO111_UART2_TXD,
-
- /* UART 3 configuration */
- GPIO30_UART3_RXD,
- GPIO31_UART3_TXD,
-};
-
-static void __init colibri_pxa320_init_uart(void)
-{
- pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_uart_pin_config));
-}
-
void __init colibri_pxa320_init(void)
{
- pxa_set_ffuart_info(NULL);
- pxa_set_btuart_info(NULL);
- pxa_set_stuart_info(NULL);
-
colibri_pxa320_init_eth();
- colibri_pxa320_init_ohci();
colibri_pxa3xx_init_nand();
colibri_pxa320_init_lcd();
colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO49_GPIO));
colibri_pxa320_init_ac97();
- colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa320_mmc_pin_config),
- mfp_to_gpio(MFP_PIN_GPIO28));
- colibri_pxa320_init_uart();
colibri_pxa320_init_udc();
+
+ /* Evalboard init */
+ pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_evalboard_pin_config));
+ colibri_pxa270_evalboard_init();
}
MACHINE_START(COLIBRI320, "Toradex Colibri PXA320")
diff --git a/arch/arm/mach-pxa/colibri-pxa3xx.c b/arch/arm/mach-pxa/colibri-pxa3xx.c
index 199afa2..96b2d9f 100644
--- a/arch/arm/mach-pxa/colibri-pxa3xx.c
+++ b/arch/arm/mach-pxa/colibri-pxa3xx.c
@@ -64,55 +64,6 @@ void __init colibri_pxa3xx_init_eth(struct ax_plat_data *plat_data)
}
#endif
-#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
-static int mmc_detect_pin;
-
-static int colibri_pxa3xx_mci_init(struct device *dev,
- irq_handler_t colibri_mmc_detect_int,
- void *data)
-{
- int ret;
-
- ret = gpio_request(mmc_detect_pin, "mmc card detect");
- if (ret)
- return ret;
-
- gpio_direction_input(mmc_detect_pin);
- ret = request_irq(gpio_to_irq(mmc_detect_pin), colibri_mmc_detect_int,
- IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
- "MMC card detect", data);
- if (ret) {
- gpio_free(mmc_detect_pin);
- return ret;
- }
-
- return 0;
-}
-
-static void colibri_pxa3xx_mci_exit(struct device *dev, void *data)
-{
- free_irq(mmc_detect_pin, data);
- gpio_free(gpio_to_irq(mmc_detect_pin));
-}
-
-static struct pxamci_platform_data colibri_pxa3xx_mci_platform_data = {
- .detect_delay_ms = 200,
- .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
- .init = colibri_pxa3xx_mci_init,
- .exit = colibri_pxa3xx_mci_exit,
- .gpio_card_detect = -1,
- .gpio_card_ro = -1,
- .gpio_power = -1,
-};
-
-void __init colibri_pxa3xx_init_mmc(mfp_cfg_t *pins, int len, int detect_pin)
-{
- pxa3xx_mfp_config(pins, len);
- mmc_detect_pin = detect_pin;
- pxa_set_mci_info(&colibri_pxa3xx_mci_platform_data);
-}
-#endif /* CONFIG_MMC_PXA || CONFIG_MMC_PXA_MODULE */
-
#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
static int lcd_bl_pin;
diff --git a/arch/arm/mach-pxa/include/mach/colibri.h b/arch/arm/mach-pxa/include/mach/colibri.h
index 58dada1..63a948a 100644
--- a/arch/arm/mach-pxa/include/mach/colibri.h
+++ b/arch/arm/mach-pxa/include/mach/colibri.h
@@ -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_ */
--
1.7.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 10/13] PXA: Colibri: Add M41T00 RTC support
2010-08-13 4:32 [PATCH 01/13] Balloon3: Disperse MFP config Marek Vasut
` (7 preceding siblings ...)
2010-08-13 4:32 ` [PATCH 09/13] PXA: Colibri: Push evalboard MFP into module files Marek Vasut
@ 2010-08-13 4:32 ` Marek Vasut
2010-08-13 4:32 ` [PATCH 11/13] PXA: Colibri: Rename Colibri-evalboard Marek Vasut
` (3 subsequent siblings)
12 siblings, 0 replies; 20+ messages in thread
From: Marek Vasut @ 2010-08-13 4:32 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
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(-)
diff --git a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
index e1a2b52..7f27aec 100644
--- a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
+++ b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
@@ -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();
}
diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c
index 8488dfe..1024da5 100644
--- a/arch/arm/mach-pxa/colibri-pxa270.c
+++ b/arch/arm/mach-pxa/colibri-pxa270.c
@@ -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 = {};
diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c
index 080d0e1..d1cdb98 100644
--- a/arch/arm/mach-pxa/colibri-pxa300.c
+++ b/arch/arm/mach-pxa/colibri-pxa300.c
@@ -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 = {};
diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c
index e886ab2..4257382 100644
--- a/arch/arm/mach-pxa/colibri-pxa320.c
+++ b/arch/arm/mach-pxa/colibri-pxa320.c
@@ -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 = {};
--
1.7.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 11/13] PXA: Colibri: Rename Colibri-evalboard
2010-08-13 4:32 [PATCH 01/13] Balloon3: Disperse MFP config Marek Vasut
` (8 preceding siblings ...)
2010-08-13 4:32 ` [PATCH 10/13] PXA: Colibri: Add M41T00 RTC support Marek Vasut
@ 2010-08-13 4:32 ` Marek Vasut
2010-08-13 4:32 ` [PATCH 12/13] pxa2xx/pcmcia: Prepare for pxa320 Marek Vasut
` (2 subsequent siblings)
12 siblings, 0 replies; 20+ messages in thread
From: Marek Vasut @ 2010-08-13 4:32 UTC (permalink / raw)
To: linux-arm-kernel
Rename colibri-pxa270-evalboard to colibri-evalboard as this board is used with
all Colibri modules.
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
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
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 636cb79..236ef28 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -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
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index 85c7fb3..7fee7fb 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -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
diff --git a/arch/arm/mach-pxa/colibri-evalboard.c b/arch/arm/mach-pxa/colibri-evalboard.c
new file mode 100644
index 0000000..6b2c800
--- /dev/null
+++ b/arch/arm/mach-pxa/colibri-evalboard.c
@@ -0,0 +1,121 @@
+/*
+ * linux/arch/arm/mach-pxa/colibri-evalboard.c
+ *
+ * Support for Toradex Colibri Evaluation Carrier Board
+ * Daniel Mack <daniel@caiaq.de>
+ * Marek Vasut <marek.vasut@gmail.com>
+ *
+ * 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/init.h>
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/sysdev.h>
+#include <linux/interrupt.h>
+#include <linux/gpio.h>
+#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>
+#include <mach/mmc.h>
+#include <mach/ohci.h>
+#include <mach/pxa27x-udc.h>
+
+#include <plat/i2c.h>
+
+#include "generic.h"
+#include "devices.h"
+
+/******************************************************************************
+ * SD/MMC card controller
+ ******************************************************************************/
+#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
+static struct pxamci_platform_data colibri_mci_platform_data = {
+ .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
+ .gpio_power = -1,
+ .gpio_card_ro = -1,
+ .detect_delay_ms = 200,
+};
+
+static void __init colibri_mmc_init(void)
+{
+ if (machine_is_colibri()) /* PXA270 Colibri */
+ colibri_mci_platform_data.gpio_card_detect =
+ GPIO0_COLIBRI_PXA270_SD_DETECT;
+ if (machine_is_colibri300()) /* PXA300 Colibri */
+ colibri_mci_platform_data.gpio_card_detect =
+ GPIO39_COLIBRI_PXA300_SD_DETECT;
+ else /* PXA320 Colibri */
+ colibri_mci_platform_data.gpio_card_detect =
+ GPIO28_COLIBRI_PXA320_SD_DETECT;
+
+ pxa_set_mci_info(&colibri_mci_platform_data);
+}
+#else
+static inline void colibri_mmc_init(void) {}
+#endif
+
+/******************************************************************************
+ * USB Host
+ ******************************************************************************/
+#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
+static int colibri_ohci_init(struct device *dev)
+{
+ UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE;
+ return 0;
+}
+
+static struct pxaohci_platform_data colibri_ohci_info = {
+ .port_mode = PMM_PERPORT_MODE,
+ .flags = ENABLE_PORT1 |
+ POWER_CONTROL_LOW | POWER_SENSE_LOW,
+ .init = colibri_ohci_init,
+};
+
+static void __init colibri_uhc_init(void)
+{
+ /* Colibri PXA270 has two usb ports, TBA for 320 */
+ if (machine_is_colibri())
+ colibri_ohci_info.flags |= ENABLE_PORT2;
+
+ pxa_set_ohci_info(&colibri_ohci_info);
+}
+#else
+static inline void colibri_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_i2c_devs[] = {
+ {
+ I2C_BOARD_INFO("m41t00", 0x68),
+ },
+};
+
+static void __init colibri_rtc_init(void)
+{
+ pxa_set_i2c_info(NULL);
+ i2c_register_board_info(0, ARRAY_AND_SIZE(colibri_i2c_devs));
+}
+#else
+static inline void colibri_rtc_init(void) {}
+#endif
+
+void __init colibri_evalboard_init(void)
+{
+ pxa_set_ffuart_info(NULL);
+ pxa_set_btuart_info(NULL);
+ pxa_set_stuart_info(NULL);
+
+ colibri_mmc_init();
+ colibri_uhc_init();
+ colibri_rtc_init();
+}
diff --git a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
deleted file mode 100644
index 7f27aec..0000000
--- a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * linux/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
- *
- * Support for Toradex PXA270 based Colibri Evaluation Carrier Board
- * Daniel Mack <daniel@caiaq.de>
- * Marek Vasut <marek.vasut@gmail.com>
- *
- * 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/init.h>
-#include <linux/kernel.h>
-#include <linux/platform_device.h>
-#include <linux/sysdev.h>
-#include <linux/interrupt.h>
-#include <linux/gpio.h>
-#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>
-#include <mach/mmc.h>
-#include <mach/ohci.h>
-#include <mach/pxa27x-udc.h>
-
-#include <plat/i2c.h>
-
-#include "generic.h"
-#include "devices.h"
-
-/******************************************************************************
- * SD/MMC card controller
- ******************************************************************************/
-#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
-static struct pxamci_platform_data colibri_pxa270_mci_platform_data = {
- .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
- .gpio_power = -1,
- .gpio_card_ro = -1,
- .detect_delay_ms = 200,
-};
-
-static void __init colibri_pxa270_mmc_init(void)
-{
- if (machine_is_colibri()) /* PXA270 Colibri */
- colibri_pxa270_mci_platform_data.gpio_card_detect =
- GPIO0_COLIBRI_PXA270_SD_DETECT;
- if (machine_is_colibri300()) /* PXA300 Colibri */
- colibri_pxa270_mci_platform_data.gpio_card_detect =
- GPIO39_COLIBRI_PXA300_SD_DETECT;
- else /* PXA320 Colibri */
- colibri_pxa270_mci_platform_data.gpio_card_detect =
- GPIO28_COLIBRI_PXA320_SD_DETECT;
-
- pxa_set_mci_info(&colibri_pxa270_mci_platform_data);
-}
-#else
-static inline void colibri_pxa270_mmc_init(void) {}
-#endif
-
-/******************************************************************************
- * USB Host
- ******************************************************************************/
-#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
-static int colibri_pxa270_ohci_init(struct device *dev)
-{
- UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE;
- return 0;
-}
-
-static struct pxaohci_platform_data colibri_pxa270_ohci_info = {
- .port_mode = PMM_PERPORT_MODE,
- .flags = ENABLE_PORT1 |
- POWER_CONTROL_LOW | POWER_SENSE_LOW,
- .init = colibri_pxa270_ohci_init,
-};
-
-static void __init colibri_pxa270_uhc_init(void)
-{
- /* Colibri PXA270 has two usb ports, TBA for 320 */
- if (machine_is_colibri())
- colibri_pxa270_ohci_info.flags |= ENABLE_PORT2;
-
- pxa_set_ohci_info(&colibri_pxa270_ohci_info);
-}
-#else
-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);
- pxa_set_btuart_info(NULL);
- pxa_set_stuart_info(NULL);
-
- colibri_pxa270_mmc_init();
- colibri_pxa270_uhc_init();
- colibri_pxa270_rtc_init();
-}
diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c
index 1024da5..dc05af4 100644
--- a/arch/arm/mach-pxa/colibri-pxa270.c
+++ b/arch/arm/mach-pxa/colibri-pxa270.c
@@ -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));
diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c
index d1cdb98..87e5397 100644
--- a/arch/arm/mach-pxa/colibri-pxa300.c
+++ b/arch/arm/mach-pxa/colibri-pxa300.c
@@ -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")
diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c
index 4257382..7c003cd 100644
--- a/arch/arm/mach-pxa/colibri-pxa320.c
+++ b/arch/arm/mach-pxa/colibri-pxa320.c
@@ -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")
diff --git a/arch/arm/mach-pxa/include/mach/colibri.h b/arch/arm/mach-pxa/include/mach/colibri.h
index 63a948a..388a96f 100644
--- a/arch/arm/mach-pxa/include/mach/colibri.h
+++ b/arch/arm/mach-pxa/include/mach/colibri.h
@@ -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)
--
1.7.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 12/13] pxa2xx/pcmcia: Prepare for pxa320
2010-08-13 4:32 [PATCH 01/13] Balloon3: Disperse MFP config Marek Vasut
` (9 preceding siblings ...)
2010-08-13 4:32 ` [PATCH 11/13] PXA: Colibri: Rename Colibri-evalboard Marek Vasut
@ 2010-08-13 4:32 ` Marek Vasut
2010-08-13 4:32 ` [PATCH 13/13] PXA: Colibri PXA320 PCMCIA driver Marek Vasut
2010-08-18 4:11 ` [PATCH 01/13] Balloon3: Disperse MFP config Eric Miao
12 siblings, 0 replies; 20+ messages in thread
From: Marek Vasut @ 2010-08-13 4:32 UTC (permalink / raw)
To: linux-arm-kernel
PXA320 also supports PCMCIA/CF interface. This patch generalizes register access
in pxa2xx_pcmcia so the pxa320 is now supported as well.
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
drivers/pcmcia/pxa2xx_base.c | 91 ++++++++++++++++++++++++++++++++----------
1 files changed, 70 insertions(+), 21 deletions(-)
diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c
index df4532e..2088f91 100644
--- a/drivers/pcmcia/pxa2xx_base.c
+++ b/drivers/pcmcia/pxa2xx_base.c
@@ -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;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 13/13] PXA: Colibri PXA320 PCMCIA driver
2010-08-13 4:32 [PATCH 01/13] Balloon3: Disperse MFP config Marek Vasut
` (10 preceding siblings ...)
2010-08-13 4:32 ` [PATCH 12/13] pxa2xx/pcmcia: Prepare for pxa320 Marek Vasut
@ 2010-08-13 4:32 ` Marek Vasut
2010-08-18 4:11 ` [PATCH 01/13] Balloon3: Disperse MFP config Eric Miao
12 siblings, 0 replies; 20+ messages in thread
From: Marek Vasut @ 2010-08-13 4:32 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
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(-)
diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c
index 7c003cd..6cd83fa 100644
--- a/arch/arm/mach-pxa/colibri-pxa320.c
+++ b/arch/arm/mach-pxa/colibri-pxa320.c
@@ -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 = {};
diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig
index 883623a..e89e5c3 100644
--- a/drivers/pcmcia/Kconfig
+++ b/drivers/pcmcia/Kconfig
@@ -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
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile
index 0e989a1..f6f582f 100644
--- a/drivers/pcmcia/Makefile
+++ b/drivers/pcmcia/Makefile
@@ -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)
diff --git a/drivers/pcmcia/pxa2xx_colibri.c b/drivers/pcmcia/pxa2xx_colibri.c
index 8373816..1c57769 100644
--- a/drivers/pcmcia/pxa2xx_colibri.c
+++ b/drivers/pcmcia/pxa2xx_colibri.c
@@ -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 <marek.vasut@gmail.com>");
-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");
--
1.7.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 01/13] Balloon3: Disperse MFP config
2010-08-13 4:32 [PATCH 01/13] Balloon3: Disperse MFP config Marek Vasut
` (11 preceding siblings ...)
2010-08-13 4:32 ` [PATCH 13/13] PXA: Colibri PXA320 PCMCIA driver Marek Vasut
@ 2010-08-18 4:11 ` Eric Miao
2010-08-18 5:05 ` Marek Vasut
12 siblings, 1 reply; 20+ messages in thread
From: Eric Miao @ 2010-08-18 4:11 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Aug 13, 2010 at 12:32 PM, Marek Vasut <marek.vasut@gmail.com> wrote:
> Move pin config to appropriate places and use it only if needed.
>
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
So I suppose this is the successor patch series of the previous
balloon3 one? Better to keep Jonathan's Ack then?
> ---
> ?arch/arm/mach-pxa/balloon3.c | ?104 +++++++++++++++++++++++++++--------------
> ?1 files changed, 68 insertions(+), 36 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c
> index 9041340..7f62448 100644
> --- a/arch/arm/mach-pxa/balloon3.c
> +++ b/arch/arm/mach-pxa/balloon3.c
> @@ -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 = {
> --
> 1.7.1
>
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 01/13] Balloon3: Disperse MFP config
2010-08-18 4:11 ` [PATCH 01/13] Balloon3: Disperse MFP config Eric Miao
@ 2010-08-18 5:05 ` Marek Vasut
0 siblings, 0 replies; 20+ messages in thread
From: Marek Vasut @ 2010-08-18 5:05 UTC (permalink / raw)
To: linux-arm-kernel
Dne St 18. srpna 2010 06:11:51 Eric Miao napsal(a):
> On Fri, Aug 13, 2010 at 12:32 PM, Marek Vasut <marek.vasut@gmail.com> wrote:
> > Move pin config to appropriate places and use it only if needed.
> >
> > Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
>
> 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.
>
> > ---
> > arch/arm/mach-pxa/balloon3.c | 104
> > +++++++++++++++++++++++++++-------------- 1 files changed, 68
> > insertions(+), 36 deletions(-)
> >
> > diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c
> > index 9041340..7f62448 100644
> > --- a/arch/arm/mach-pxa/balloon3.c
> > +++ b/arch/arm/mach-pxa/balloon3.c
> > @@ -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 = {
> > --
> > 1.7.1
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 08/13] PXA: Colibri: Toradex Colibri PXA270 CF support
2010-08-13 4:32 ` [PATCH 08/13] PXA: Colibri: Toradex Colibri PXA270 CF support Marek Vasut
@ 2010-08-18 11:43 ` Daniel Mack
2010-08-21 6:22 ` Marek Vasut
2010-09-01 7:23 ` Russell King - ARM Linux
1 sibling, 1 reply; 20+ messages in thread
From: Daniel Mack @ 2010-08-18 11:43 UTC (permalink / raw)
To: linux-arm-kernel
Hi Marek,
On Fri, Aug 13, 2010 at 06:32:39AM +0200, Marek Vasut wrote:
> This driver also contains structures to eventually support PXA320. This is
> planned to be added in a later patch.
>
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
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 <daniel@caiaq.de>
Thanks,
Daniel
> ---
> 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
>
> diff --git a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
> index 0f3b632..6177ff5 100644
> --- a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
> +++ b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
> @@ -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 */
> };
>
> /******************************************************************************
> diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig
> index ef2f659..883623a 100644
> --- a/drivers/pcmcia/Kconfig
> +++ b/drivers/pcmcia/Kconfig
> @@ -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
> diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile
> index 6a60773..0e989a1 100644
> --- a/drivers/pcmcia/Makefile
> +++ b/drivers/pcmcia/Makefile
> @@ -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)
>
> diff --git a/drivers/pcmcia/pxa2xx_colibri.c b/drivers/pcmcia/pxa2xx_colibri.c
> new file mode 100644
> index 0000000..8373816
> --- /dev/null
> +++ b/drivers/pcmcia/pxa2xx_colibri.c
> @@ -0,0 +1,215 @@
> +/*
> + * linux/drivers/pcmcia/pxa2xx_colibri.c
> + *
> + * Driver for Toradex Colibri PXA270 CF socket
> + *
> + * Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com>
> + *
> + * 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 <marek.vasut@gmail.com>");
> +MODULE_DESCRIPTION("PCMCIA support for Toradex Colibri PXA270");
> +MODULE_ALIAS("platform:pxa2xx-pcmcia");
> +MODULE_LICENSE("GPL");
> --
> 1.7.1
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 08/13] PXA: Colibri: Toradex Colibri PXA270 CF support
2010-08-18 11:43 ` Daniel Mack
@ 2010-08-21 6:22 ` Marek Vasut
2010-08-21 9:33 ` Daniel Mack
0 siblings, 1 reply; 20+ messages in thread
From: Marek Vasut @ 2010-08-21 6:22 UTC (permalink / raw)
To: linux-arm-kernel
Dne St 18. srpna 2010 13:43:26 Daniel Mack napsal(a):
> Hi Marek,
>
> On Fri, Aug 13, 2010 at 06:32:39AM +0200, Marek Vasut wrote:
> > This driver also contains structures to eventually support PXA320. This
> > is planned to be added in a later patch.
> >
> > Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
>
> 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 <daniel@caiaq.de>
Hi Dan,
do I have this for all the colibri patches in the tree? Thanks
>
>
> Thanks,
> Daniel
>
> > ---
> >
> > 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
> >
> > diff --git a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
> > b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c index 0f3b632..6177ff5
> > 100644
> > --- a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
> > +++ b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
> > @@ -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 */
> >
> > };
> >
> > /***********************************************************************
> > *******
> >
> > diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig
> > index ef2f659..883623a 100644
> > --- a/drivers/pcmcia/Kconfig
> > +++ b/drivers/pcmcia/Kconfig
> > @@ -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
> >
> > diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile
> > index 6a60773..0e989a1 100644
> > --- a/drivers/pcmcia/Makefile
> > +++ b/drivers/pcmcia/Makefile
> > @@ -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)
> >
> > diff --git a/drivers/pcmcia/pxa2xx_colibri.c
> > b/drivers/pcmcia/pxa2xx_colibri.c new file mode 100644
> > index 0000000..8373816
> > --- /dev/null
> > +++ b/drivers/pcmcia/pxa2xx_colibri.c
> > @@ -0,0 +1,215 @@
> > +/*
> > + * linux/drivers/pcmcia/pxa2xx_colibri.c
> > + *
> > + * Driver for Toradex Colibri PXA270 CF socket
> > + *
> > + * Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com>
> > + *
> > + * 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 <marek.vasut@gmail.com>");
> > +MODULE_DESCRIPTION("PCMCIA support for Toradex Colibri PXA270");
> > +MODULE_ALIAS("platform:pxa2xx-pcmcia");
> > +MODULE_LICENSE("GPL");
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 08/13] PXA: Colibri: Toradex Colibri PXA270 CF support
2010-08-21 6:22 ` Marek Vasut
@ 2010-08-21 9:33 ` Daniel Mack
0 siblings, 0 replies; 20+ messages in thread
From: Daniel Mack @ 2010-08-21 9:33 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Aug 21, 2010 at 08:22:15AM +0200, Marek Vasut wrote:
> Dne St 18. srpna 2010 13:43:26 Daniel Mack napsal(a):
> > Hi Marek,
> >
> > On Fri, Aug 13, 2010 at 06:32:39AM +0200, Marek Vasut wrote:
> > > This driver also contains structures to eventually support PXA320. This
> > > is planned to be added in a later patch.
> > >
> > > Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> >
> > 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 <daniel@caiaq.de>
>
> 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
> > > ---
> > >
> > > 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
> > >
> > > diff --git a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
> > > b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c index 0f3b632..6177ff5
> > > 100644
> > > --- a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
> > > +++ b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
> > > @@ -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 */
> > >
> > > };
> > >
> > > /***********************************************************************
> > > *******
> > >
> > > diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig
> > > index ef2f659..883623a 100644
> > > --- a/drivers/pcmcia/Kconfig
> > > +++ b/drivers/pcmcia/Kconfig
> > > @@ -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
> > >
> > > diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile
> > > index 6a60773..0e989a1 100644
> > > --- a/drivers/pcmcia/Makefile
> > > +++ b/drivers/pcmcia/Makefile
> > > @@ -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)
> > >
> > > diff --git a/drivers/pcmcia/pxa2xx_colibri.c
> > > b/drivers/pcmcia/pxa2xx_colibri.c new file mode 100644
> > > index 0000000..8373816
> > > --- /dev/null
> > > +++ b/drivers/pcmcia/pxa2xx_colibri.c
> > > @@ -0,0 +1,215 @@
> > > +/*
> > > + * linux/drivers/pcmcia/pxa2xx_colibri.c
> > > + *
> > > + * Driver for Toradex Colibri PXA270 CF socket
> > > + *
> > > + * Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com>
> > > + *
> > > + * 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 <marek.vasut@gmail.com>");
> > > +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
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 08/13] PXA: Colibri: Toradex Colibri PXA270 CF support
2010-08-13 4:32 ` [PATCH 08/13] PXA: Colibri: Toradex Colibri PXA270 CF support Marek Vasut
2010-08-18 11:43 ` Daniel Mack
@ 2010-09-01 7:23 ` Russell King - ARM Linux
2010-09-01 12:39 ` Marek Vasut
1 sibling, 1 reply; 20+ messages in thread
From: Russell King - ARM Linux @ 2010-09-01 7:23 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Aug 13, 2010 at 06:32:39AM +0200, Marek Vasut wrote:
> diff --git a/drivers/pcmcia/pxa2xx_colibri.c b/drivers/pcmcia/pxa2xx_colibri.c
> new file mode 100644
> index 0000000..8373816
> --- /dev/null
> +++ b/drivers/pcmcia/pxa2xx_colibri.c
> @@ -0,0 +1,215 @@
> +/*
> + * linux/drivers/pcmcia/pxa2xx_colibri.c
> + *
> + * Driver for Toradex Colibri PXA270 CF socket
> + *
> + * Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com>
> + *
> + * 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>
linux/gpio.h please.
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 08/13] PXA: Colibri: Toradex Colibri PXA270 CF support
2010-09-01 7:23 ` Russell King - ARM Linux
@ 2010-09-01 12:39 ` Marek Vasut
0 siblings, 0 replies; 20+ messages in thread
From: Marek Vasut @ 2010-09-01 12:39 UTC (permalink / raw)
To: linux-arm-kernel
Dne St 1. z??? 2010 09:23:05 Russell King - ARM Linux napsal(a):
> On Fri, Aug 13, 2010 at 06:32:39AM +0200, Marek Vasut wrote:
> > diff --git a/drivers/pcmcia/pxa2xx_colibri.c
> > b/drivers/pcmcia/pxa2xx_colibri.c new file mode 100644
> > index 0000000..8373816
> > --- /dev/null
> > +++ b/drivers/pcmcia/pxa2xx_colibri.c
> > @@ -0,0 +1,215 @@
> > +/*
> > + * linux/drivers/pcmcia/pxa2xx_colibri.c
> > + *
> > + * Driver for Toradex Colibri PXA270 CF socket
> > + *
> > + * Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com>
> > + *
> > + * 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>
>
> linux/gpio.h please.
Thanks, good catch. I fixed this in my tree.
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2010-09-01 12:39 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-13 4:32 [PATCH 01/13] Balloon3: Disperse MFP config Marek Vasut
2010-08-13 4:32 ` [PATCH 02/13] PXA: Vpac270: Fix gpio_power for MMC Marek Vasut
2010-08-13 4:32 ` [PATCH 03/13] PXA: PalmTC: Modularize Palm Tungsten|C Marek Vasut
2010-08-13 4:32 ` [PATCH 04/13] UCB1400: Pass ucb1400-gpio data through ac97 bus Marek Vasut
2010-08-13 4:32 ` [PATCH 05/13] PXA: Vpac270: Correct touch IRQ passing to UCB1400 Marek Vasut
2010-08-13 4:32 ` [PATCH 06/13] PXA: PalmTC: Pass GPIO offset to ucb1400-gpio Marek Vasut
2010-08-13 4:32 ` [PATCH 07/13] PXA: PalmTC: Add gpio-leds and vibrator support Marek Vasut
2010-08-13 4:32 ` [PATCH 08/13] PXA: Colibri: Toradex Colibri PXA270 CF support Marek Vasut
2010-08-18 11:43 ` Daniel Mack
2010-08-21 6:22 ` Marek Vasut
2010-08-21 9:33 ` Daniel Mack
2010-09-01 7:23 ` Russell King - ARM Linux
2010-09-01 12:39 ` Marek Vasut
2010-08-13 4:32 ` [PATCH 09/13] PXA: Colibri: Push evalboard MFP into module files Marek Vasut
2010-08-13 4:32 ` [PATCH 10/13] PXA: Colibri: Add M41T00 RTC support Marek Vasut
2010-08-13 4:32 ` [PATCH 11/13] PXA: Colibri: Rename Colibri-evalboard Marek Vasut
2010-08-13 4:32 ` [PATCH 12/13] pxa2xx/pcmcia: Prepare for pxa320 Marek Vasut
2010-08-13 4:32 ` [PATCH 13/13] PXA: Colibri PXA320 PCMCIA driver Marek Vasut
2010-08-18 4:11 ` [PATCH 01/13] Balloon3: Disperse MFP config Eric Miao
2010-08-18 5:05 ` Marek Vasut
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.