From patchwork Tue Nov 17 15:09:51 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Kumar Gupta X-Patchwork-Id: 60678 Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAHFDkvB023837 for ; Tue, 17 Nov 2009 15:13:47 GMT Received: from dlep35.itg.ti.com ([157.170.170.118]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id nAHFBJ3h023387 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 17 Nov 2009 09:11:19 -0600 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep35.itg.ti.com (8.13.7/8.13.7) with ESMTP id nAHFBIun002582; Tue, 17 Nov 2009 09:11:18 -0600 (CST) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 5D0A780648; Tue, 17 Nov 2009 09:10:51 -0600 (CST) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dbdp31.itg.ti.com (dbdp31.itg.ti.com [172.24.170.98]) by linux.omap.com (Postfix) with ESMTP id 1EA878062E for ; Tue, 17 Nov 2009 09:10:04 -0600 (CST) Received: from psplinux050.india.ti.com (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id nAHF9wKq027838; Tue, 17 Nov 2009 20:39:59 +0530 (IST) Received: from psplinux050.india.ti.com (localhost [127.0.0.1]) by psplinux050.india.ti.com (8.13.1/8.13.1) with ESMTP id nAHF9w5d024386; Tue, 17 Nov 2009 20:39:58 +0530 Received: (from a0393629@localhost) by psplinux050.india.ti.com (8.13.1/8.13.1/Submit) id nAHF9wMQ024383; Tue, 17 Nov 2009 20:39:58 +0530 From: Ajay Kumar Gupta To: linux-usb@vger.kernel.org Subject: [PATCH 3/8] musb: Update musb_init() call for all OMAP3 boards Date: Tue, 17 Nov 2009 20:39:51 +0530 Message-Id: <1258470596-24321-4-git-send-email-ajay.gupta@ti.com> X-Mailer: git-send-email 1.6.2.4 In-Reply-To: <1258470596-24321-3-git-send-email-ajay.gupta@ti.com> References: <1258470596-24321-1-git-send-email-ajay.gupta@ti.com> <1258470596-24321-2-git-send-email-ajay.gupta@ti.com> <1258470596-24321-3-git-send-email-ajay.gupta@ti.com> Cc: davinci-linux-open-source@linux.davincidsp.com, cooloney@kernel.org, felipe.balbi@nokia.com, linux-omap@vger.kernel.org, gadiyar@ti.com X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c index 42217b3..970dcab 100644 --- a/arch/arm/mach-omap2/board-2430sdp.c +++ b/arch/arm/mach-omap2/board-2430sdp.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -194,6 +195,10 @@ static struct twl4030_hsmmc_info mmc[] __initdata = { {} /* Terminator */ }; +static struct musb_hdrc_board_data musb_bdata __initdata = { + .power = 50, +}; + static void __init omap_2430sdp_init(void) { int ret; @@ -203,7 +208,7 @@ static void __init omap_2430sdp_init(void) platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); omap_serial_init(); twl4030_mmc_init(mmc); - usb_musb_init(); + usb_musb_init(&musb_bdata); board_smc91x_init(); /* Turn off secondary LCD backlight */ diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index 0acb556..85cd24f 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -484,6 +485,11 @@ static void enable_board_wakeup_source(void) omap_cfg_reg(AF26_34XX_SYS_NIRQ); /* T2 interrupt line (keypad) */ } +/* musb board specific details */ +static struct musb_hdrc_board_data musb_bdata __initdata = { + .power = 50, +}; + static void __init omap_3430sdp_init(void) { omap3430_i2c_init(); @@ -497,7 +503,7 @@ static void __init omap_3430sdp_init(void) ARRAY_SIZE(sdp3430_spi_board_info)); ads7846_dev_init(); omap_serial_init(); - usb_musb_init(); + usb_musb_init(&musb_bdata); board_smc91x_init(); enable_board_wakeup_source(); } diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index d57ec2f..a8338a4 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -374,6 +375,10 @@ static struct platform_device *ldp_devices[] __initdata = { &ldp_gpio_keys_device, }; +static struct musb_hdrc_board_data musb_bdata __initdata = { + .power = 50, +}; + static void __init omap_ldp_init(void) { omap_i2c_init(); @@ -384,7 +389,7 @@ static void __init omap_ldp_init(void) ARRAY_SIZE(ldp_spi_board_info)); ads7846_dev_init(); omap_serial_init(); - usb_musb_init(); + usb_musb_init(&musb_bdata); twl4030_mmc_init(mmc); /* link regulators to MMC adapters */ diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 08b0816..113bcfe 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -30,6 +30,7 @@ #include #include +#include #include #include @@ -400,6 +401,11 @@ static void __init omap3beagle_flash_init(void) } } +/* musb board specific details */ +static struct musb_hdrc_board_data musb_bdata __initdata = { + .power = 50, +}; + static void __init omap3_beagle_init(void) { omap3_beagle_i2c_init(); @@ -412,7 +418,7 @@ static void __init omap3_beagle_init(void) /* REVISIT leave DVI powered down until it's needed ... */ gpio_direction_output(170, true); - usb_musb_init(); + usb_musb_init(&musb_bdata); omap3beagle_flash_init(); /* Ensure SDRC pins are mux'd for self-refresh */ diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index 4c4d7f8..9e2656a 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -297,6 +298,11 @@ static struct platform_device *omap3_evm_devices[] __initdata = { &omap3evm_smc911x_device, }; +/* musb board specific details */ +static struct musb_hdrc_board_data musb_bdata __initdata = { + .power = 50, +}; + static void __init omap3_evm_init(void) { omap3_evm_i2c_init(); @@ -311,7 +317,7 @@ static void __init omap3_evm_init(void) /* OMAP3EVM uses ISP1504 phy and so register nop transceiver */ usb_nop_xceiv_register(); #endif - usb_musb_init(); + usb_musb_init(&musb_bdata); ads7846_dev_init(); } diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c index 7519edb..9bcd324 100644 --- a/arch/arm/mach-omap2/board-omap3pandora.c +++ b/arch/arm/mach-omap2/board-omap3pandora.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -387,6 +388,11 @@ static struct platform_device *omap3pandora_devices[] __initdata = { &pandora_keys_gpio, }; +/* musb board specific details */ +static struct musb_hdrc_board_data musb_bdata __initdata = { + .power = 50, +}; + static void __init omap3pandora_init(void) { omap3pandora_i2c_init(); @@ -397,7 +403,7 @@ static void __init omap3pandora_init(void) ARRAY_SIZE(omap3pandora_spi_board_info)); omap3pandora_ads7846_init(); pandora_keys_gpio_init(); - usb_musb_init(); + usb_musb_init(&musb_bdata); /* Ensure SDRC pins are mux'd for self-refresh */ omap_cfg_reg(H16_34XX_SDRC_CKE0); diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index 9917d2f..e2acb91 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -384,13 +385,18 @@ static struct platform_device *overo_devices[] __initdata = { &overo_lcd_device, }; +/* musb board specific details */ +static struct musb_hdrc_board_data musb_bdata __initdata = { + .power = 50, +}; + static void __init overo_init(void) { overo_i2c_init(); platform_add_devices(overo_devices, ARRAY_SIZE(overo_devices)); omap_serial_init(); overo_flash_init(); - usb_musb_init(); + usb_musb_init(&musb_bdata); overo_ads7846_init(); overo_init_smsc911x(); diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c index 78869a9..839d7a8 100644 --- a/arch/arm/mach-omap2/board-rx51.c +++ b/arch/arm/mach-omap2/board-rx51.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -53,6 +54,10 @@ static struct omap_board_config_kernel rx51_config[] = { { OMAP_TAG_LCD, &rx51_lcd_config }, }; +static struct musb_hdrc_board_data musb_bdata __initdata = { + .power = 50, +}; + static void __init rx51_init_irq(void) { omap_board_config = rx51_config; @@ -67,7 +72,7 @@ extern void __init rx51_peripherals_init(void); static void __init rx51_init(void) { omap_serial_init(); - usb_musb_init(); + usb_musb_init(&musb_bdata); rx51_peripherals_init(); /* Ensure SDRC pins are mux'd for self-refresh */ diff --git a/arch/arm/mach-omap2/board-zoom2.c b/arch/arm/mach-omap2/board-zoom2.c index ea00486..abe3059 100644 --- a/arch/arm/mach-omap2/board-zoom2.c +++ b/arch/arm/mach-omap2/board-zoom2.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -265,6 +266,11 @@ static int __init omap_i2c_init(void) return 0; } +/* musb board specific details */ +static struct musb_hdrc_board_data musb_bdata __initdata = { + .power = 50, +}; + extern int __init omap_zoom2_debugboard_init(void); static void __init omap_zoom2_init(void) @@ -272,7 +278,7 @@ static void __init omap_zoom2_init(void) omap_i2c_init(); omap_serial_init(); omap_zoom2_debugboard_init(); - usb_musb_init(); + usb_musb_init(&musb_bdata); } static void __init omap_zoom2_map_io(void) diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c index 1145a25..0e9380c 100644 --- a/arch/arm/mach-omap2/usb-musb.c +++ b/arch/arm/mach-omap2/usb-musb.c @@ -124,12 +124,6 @@ static struct musb_hdrc_platform_data musb_plat = { /* .clock is set dynamically */ .set_clock = musb_set_clock, .config = &musb_config, - - /* REVISIT charge pump on TWL4030 can supply up to - * 100 mA ... but this value is board-specific, like - * "mode", and should be passed to usb_musb_init(). - */ - .power = 50, /* up to 100 mA */ }; static u64 musb_dmamask = DMA_BIT_MASK(32); @@ -146,8 +140,11 @@ static struct platform_device musb_device = { .resource = musb_resources, }; -void __init usb_musb_init(void) +void __init usb_musb_init(struct musb_hdrc_board_data *board_data) { + /* get board-specific data */ + musb_plat.board_data = board_data; + if (cpu_is_omap243x()) musb_resources[0].start = OMAP243X_HS_BASE; else @@ -167,7 +164,7 @@ void __init usb_musb_init(void) } #else -void __init usb_musb_init(void) +void __init usb_musb_init(struct musb_hdrc_board_data *board_data) { } #endif /* CONFIG_USB_MUSB_SOC */ diff --git a/arch/arm/plat-omap/include/mach/usb.h b/arch/arm/plat-omap/include/mach/usb.h index f337e17..c64bd8c 100644 --- a/arch/arm/plat-omap/include/mach/usb.h +++ b/arch/arm/plat-omap/include/mach/usb.h @@ -3,6 +3,7 @@ #ifndef __ASM_ARCH_OMAP_USB_H #define __ASM_ARCH_OMAP_USB_H +#include #include /*-------------------------------------------------------------------------*/ @@ -27,7 +28,7 @@ #define UDC_BASE OMAP2_UDC_BASE #define OMAP_OHCI_BASE OMAP2_OHCI_BASE -extern void usb_musb_init(void); +extern void usb_musb_init(struct musb_hdrc_board_data *board_data); #endif