diff options
author | Lee Jones <lee.jones@linaro.org> | 2012-01-05 14:18:50 +0000 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2012-01-05 14:18:50 +0000 |
commit | cc126c89d9c292016817cad576347500adceba6e (patch) | |
tree | 67730b19ba16f840ff22341db4e87e1568d71285 /arch/arm/mach-ux500 | |
parent | 80caa250766ea8b145cd692e82ec4d6296adef8c (diff) | |
parent | a7004d76d61fa923de40390c49c8d69002fd762f (diff) |
Automatically merging tracking-igloo_kernel-usb into merge-integration-linux-ux500
Conflicting files:
arch/arm/mach-ux500/board-mop500.c
arch/arm/mach-ux500/board-u5500.c
Diffstat (limited to 'arch/arm/mach-ux500')
-rw-r--r-- | arch/arm/mach-ux500/board-mop500.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-ux500/board-u5500.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-ux500/board-ux500-usb.h | 13 | ||||
-rw-r--r-- | arch/arm/mach-ux500/include/mach/usb.h | 10 | ||||
-rw-r--r-- | arch/arm/mach-ux500/usb.c | 48 |
5 files changed, 72 insertions, 6 deletions
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index d39006cac73..ca1677e8b3e 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -78,6 +78,7 @@ #include "board-mop500.h" #include "board-mop500-regulators.h" #include "board-mop500-bm.h" +#include "board-ux500-usb.h" #if defined(CONFIG_CW1200) || defined(CONFIG_CW1200_MODULE) #include "board-mop500-wlan.h" #endif @@ -276,6 +277,7 @@ static struct ab8500_platform_data ab8500_platdata = { .pm_power_off = true, #endif .thermal_time_out = 20, /* seconds */ + .usb = &abx500_usbgpio_plat_data, }; static struct resource ab8500_resources[] = { diff --git a/arch/arm/mach-ux500/board-u5500.c b/arch/arm/mach-ux500/board-u5500.c index 95e0102e653..26a26d09d72 100644 --- a/arch/arm/mach-ux500/board-u5500.c +++ b/arch/arm/mach-ux500/board-u5500.c @@ -46,6 +46,7 @@ #include <mach/db5500-keypad.h> #include <mach/crypto-ux500.h> #include <mach/abx500-accdet.h> +#include <mach/usb.h> #include "pins-db5500.h" #include "pins.h" @@ -53,6 +54,8 @@ #include "board-u5500.h" #include "board-u5500-bm.h" #include "board-u5500-wlan.h" +#include <linux/led-lm3530.h> +#include "board-ux500-usb.h" #ifdef CONFIG_SENSORS_LSM303DLH /* @@ -495,6 +498,8 @@ static struct ab5500_platform_data ab5500_plf_data = { #endif .dev_data[AB5500_DEVID_ONSWA] = &ab5500_ponkey_data, .dev_data_sz[AB5500_DEVID_ONSWA] = sizeof(ab5500_ponkey_data), + .dev_data[AB5500_DEVID_USB] = &abx500_usbgpio_plat_data, + .dev_data_sz[AB5500_DEVID_USB] = sizeof(abx500_usbgpio_plat_data), }; static struct platform_device u5500_ab5500_device = { diff --git a/arch/arm/mach-ux500/board-ux500-usb.h b/arch/arm/mach-ux500/board-ux500-usb.h new file mode 100644 index 00000000000..6b35a181c0a --- /dev/null +++ b/arch/arm/mach-ux500/board-ux500-usb.h @@ -0,0 +1,13 @@ +/* + * Copyright (C) ST-Ericsson SA 2011 + * + * Author: Saketh Ram Bommisetti <sakethram.bommisetti@stericsson.com> + * License terms: GNU General Public License (GPL) version 2 + */ + +#ifndef __BOARD_UX500_USB_H +#define __BOARD_UX500_USB_H + +extern struct abx500_usbgpio_platform_data abx500_usbgpio_plat_data; + +#endif diff --git a/arch/arm/mach-ux500/include/mach/usb.h b/arch/arm/mach-ux500/include/mach/usb.h index d3739d41881..67fbd00e690 100644 --- a/arch/arm/mach-ux500/include/mach/usb.h +++ b/arch/arm/mach-ux500/include/mach/usb.h @@ -22,4 +22,14 @@ struct ux500_musb_board_data { void ux500_add_usb(resource_size_t base, int irq, int *dma_rx_cfg, int *dma_tx_cfg); + +struct abx500_usbgpio_platform_data { + int (*get)(struct device *device); + void (*enable)(void); + void (*disable)(void); + void (*put)(void); + int usb_cs; +}; + +void ux500_restore_context(void); #endif diff --git a/arch/arm/mach-ux500/usb.c b/arch/arm/mach-ux500/usb.c index 0a01cbdfe06..1e7c0cc912e 100644 --- a/arch/arm/mach-ux500/usb.c +++ b/arch/arm/mach-ux500/usb.c @@ -10,6 +10,9 @@ #include <plat/ste_dma40.h> #include <mach/hardware.h> #include <mach/usb.h> +#include <plat/pincfg.h> +#include "pins.h" +#include "board-ux500-usb.h" #define MUSB_DMA40_RX_CH { \ .mode = STEDMA40_MODE_LOGICAL, \ @@ -31,6 +34,8 @@ .dst_info.psize = STEDMA40_PSIZE_LOG_16, \ } +#define USB_OTG_GPIO_CS 76 + static struct stedma40_chan_cfg musb_dma_rx_ch[UX500_MUSB_DMA_NUM_RX_CHANNELS] = { MUSB_DMA40_RX_CH, @@ -85,7 +90,12 @@ static struct ux500_musb_board_data musb_board_data = { .dma_filter = stedma40_filter, }; +#ifdef CONFIG_USB_UX500_DMA static u64 ux500_musb_dmamask = DMA_BIT_MASK(32); +#else +static u64 ux500_musb_dmamask = DMA_BIT_MASK(0); +#endif +static struct ux500_pins *usb_gpio_pins; static struct musb_hdrc_config musb_hdrc_config = { .multipoint = true, @@ -95,13 +105,7 @@ static struct musb_hdrc_config musb_hdrc_config = { }; static struct musb_hdrc_platform_data musb_platform_data = { -#if defined(CONFIG_USB_MUSB_OTG) .mode = MUSB_OTG, -#elif defined(CONFIG_USB_MUSB_PERIPHERAL) - .mode = MUSB_PERIPHERAL, -#else /* defined(CONFIG_USB_MUSB_HOST) */ - .mode = MUSB_HOST, -#endif .config = &musb_hdrc_config, .board_data = &musb_board_data, }; @@ -130,6 +134,38 @@ struct platform_device ux500_musb_device = { .resource = usb_resources, }; +static void enable_gpio(void) +{ + ux500_pins_enable(usb_gpio_pins); +} +static void disable_gpio(void) +{ + ux500_pins_disable(usb_gpio_pins); +} +static int get_gpio(struct device *device) +{ + usb_gpio_pins = ux500_pins_get(dev_name(device)); + + if (usb_gpio_pins == NULL) { + dev_err(device, "Could not get %s:usb_gpio_pins structure\n", + dev_name(device)); + + return PTR_ERR(usb_gpio_pins); + } + return 0; +} +static void put_gpio(void) +{ + ux500_pins_put(usb_gpio_pins); +} +struct abx500_usbgpio_platform_data abx500_usbgpio_plat_data = { + .get = &get_gpio, + .enable = &enable_gpio, + .disable = &disable_gpio, + .put = &put_gpio, + .usb_cs = USB_OTG_GPIO_CS, +}; + static inline void ux500_usb_dma_update_rx_ch_config(int *src_dev_type) { u32 idx; |