aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHema HK <hemahk@ti.com>2010-12-10 07:39:52 -0500
committerFelipe Balbi <balbi@ti.com>2010-12-10 07:46:51 -0500
commite70357e35c522776d9f56f6800af4ed7a5bdbaaf (patch)
treebb002bfcf01d284e036535e4476e616102d604c3
parent4c42fbc99fc8656efc7d2b5e92be0d430ccefdc6 (diff)
mfd: TWL6030: OMAP4: Registering the TWL6030-usb device
Registering the twl6030-usb transceiver device as a child to twl6030 core. Removed the NOP transceiver init call from board file. Populated twl4030_usb_data platform data structure with the function pointers for OMAP4430 internal PHY operation to be used by twl630-usb driver. Signed-off-by: Hema HK <hemahk@ti.com> Cc: Samuel Ortiz <sameo@linux.intel.com> Cc: Tony Lindgren <tony@atomide.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--arch/arm/mach-omap2/board-4430sdp.c11
-rw-r--r--arch/arm/mach-omap2/board-omap4panda.c8
-rw-r--r--drivers/mfd/twl-core.c44
-rw-r--r--include/linux/i2c/twl.h7
4 files changed, 62 insertions, 8 deletions
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index 288ff4415757..95bdea82ece6 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -242,6 +242,13 @@ static struct omap_musb_board_data musb_board_data = {
242 .power = 100, 242 .power = 100,
243}; 243};
244 244
245static struct twl4030_usb_data omap4_usbphy_data = {
246 .phy_init = omap4430_phy_init,
247 .phy_exit = omap4430_phy_exit,
248 .phy_power = omap4430_phy_power,
249 .phy_set_clock = omap4430_phy_set_clk,
250};
251
245static struct omap2_hsmmc_info mmc[] = { 252static struct omap2_hsmmc_info mmc[] = {
246 { 253 {
247 .mmc = 1, 254 .mmc = 1,
@@ -461,6 +468,7 @@ static struct twl4030_platform_data sdp4430_twldata = {
461 .vaux1 = &sdp4430_vaux1, 468 .vaux1 = &sdp4430_vaux1,
462 .vaux2 = &sdp4430_vaux2, 469 .vaux2 = &sdp4430_vaux2,
463 .vaux3 = &sdp4430_vaux3, 470 .vaux3 = &sdp4430_vaux3,
471 .usb = &omap4_usbphy_data
464}; 472};
465 473
466static struct i2c_board_info __initdata sdp4430_i2c_boardinfo[] = { 474static struct i2c_board_info __initdata sdp4430_i2c_boardinfo[] = {
@@ -533,9 +541,6 @@ static void __init omap_4430sdp_init(void)
533 gpio_direction_output(OMAP4SDP_MDM_PWR_EN_GPIO, 1); 541 gpio_direction_output(OMAP4SDP_MDM_PWR_EN_GPIO, 1);
534 } 542 }
535 usb_ehci_init(&ehci_pdata); 543 usb_ehci_init(&ehci_pdata);
536
537 /* OMAP4 SDP uses internal transceiver so register nop transceiver */
538 usb_nop_xceiv_register();
539 usb_musb_init(&musb_board_data); 544 usb_musb_init(&musb_board_data);
540 545
541 status = omap_ethernet_init(); 546 status = omap_ethernet_init();
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index 3bf644deb8b8..585b2e387341 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -137,6 +137,13 @@ static struct omap_musb_board_data musb_board_data = {
137 .power = 100, 137 .power = 100,
138}; 138};
139 139
140static struct twl4030_usb_data omap4_usbphy_data = {
141 .phy_init = omap4430_phy_init,
142 .phy_exit = omap4430_phy_exit,
143 .phy_power = omap4430_phy_power,
144 .phy_set_clock = omap4430_phy_set_clk,
145};
146
140static struct omap2_hsmmc_info mmc[] = { 147static struct omap2_hsmmc_info mmc[] = {
141 { 148 {
142 .mmc = 1, 149 .mmc = 1,
@@ -345,6 +352,7 @@ static struct twl4030_platform_data omap4_panda_twldata = {
345 .vaux1 = &omap4_panda_vaux1, 352 .vaux1 = &omap4_panda_vaux1,
346 .vaux2 = &omap4_panda_vaux2, 353 .vaux2 = &omap4_panda_vaux2,
347 .vaux3 = &omap4_panda_vaux3, 354 .vaux3 = &omap4_panda_vaux3,
355 .usb = &omap4_usbphy_data,
348}; 356};
349 357
350static struct i2c_board_info __initdata omap4_panda_i2c_boardinfo[] = { 358static struct i2c_board_info __initdata omap4_panda_i2c_boardinfo[] = {
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index 35275ba7096f..12abd5b924b3 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -95,7 +95,8 @@
95#define twl_has_rtc() false 95#define twl_has_rtc() false
96#endif 96#endif
97 97
98#if defined(CONFIG_TWL4030_USB) || defined(CONFIG_TWL4030_USB_MODULE) 98#if defined(CONFIG_TWL4030_USB) || defined(CONFIG_TWL4030_USB_MODULE) ||\
99 defined(CONFIG_TWL6030_USB) || defined(CONFIG_TWL6030_USB_MODULE)
99#define twl_has_usb() true 100#define twl_has_usb() true
100#else 101#else
101#define twl_has_usb() false 102#define twl_has_usb() false
@@ -682,6 +683,43 @@ add_children(struct twl4030_platform_data *pdata, unsigned long features)
682 usb3v1.dev = child; 683 usb3v1.dev = child;
683 } 684 }
684 } 685 }
686 if (twl_has_usb() && pdata->usb && twl_class_is_6030()) {
687
688 static struct regulator_consumer_supply usb3v3 = {
689 .supply = "vusb",
690 };
691
692 if (twl_has_regulator()) {
693 /* this is a template that gets copied */
694 struct regulator_init_data usb_fixed = {
695 .constraints.valid_modes_mask =
696 REGULATOR_MODE_NORMAL
697 | REGULATOR_MODE_STANDBY,
698 .constraints.valid_ops_mask =
699 REGULATOR_CHANGE_MODE
700 | REGULATOR_CHANGE_STATUS,
701 };
702
703 child = add_regulator_linked(TWL6030_REG_VUSB,
704 &usb_fixed, &usb3v3, 1);
705 if (IS_ERR(child))
706 return PTR_ERR(child);
707 }
708
709 child = add_child(0, "twl6030_usb",
710 pdata->usb, sizeof(*pdata->usb),
711 true,
712 /* irq1 = VBUS_PRES, irq0 = USB ID */
713 pdata->irq_base + USBOTG_INTR_OFFSET,
714 pdata->irq_base + USB_PRES_INTR_OFFSET);
715
716 if (IS_ERR(child))
717 return PTR_ERR(child);
718 /* we need to connect regulators to this transceiver */
719 if (twl_has_regulator() && child)
720 usb3v3.dev = child;
721
722 }
685 723
686 if (twl_has_watchdog()) { 724 if (twl_has_watchdog()) {
687 child = add_child(0, "twl4030_wdt", NULL, 0, false, 0, 0); 725 child = add_child(0, "twl4030_wdt", NULL, 0, false, 0, 0);
@@ -815,10 +853,6 @@ add_children(struct twl4030_platform_data *pdata, unsigned long features)
815 if (IS_ERR(child)) 853 if (IS_ERR(child))
816 return PTR_ERR(child); 854 return PTR_ERR(child);
817 855
818 child = add_regulator(TWL6030_REG_VUSB, pdata->vusb);
819 if (IS_ERR(child))
820 return PTR_ERR(child);
821
822 child = add_regulator(TWL6030_REG_VAUX1_6030, pdata->vaux1); 856 child = add_regulator(TWL6030_REG_VAUX1_6030, pdata->vaux1);
823 if (IS_ERR(child)) 857 if (IS_ERR(child))
824 return PTR_ERR(child); 858 return PTR_ERR(child);
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index c760991b354a..61b9609e55f2 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -593,6 +593,13 @@ enum twl4030_usb_mode {
593 593
594struct twl4030_usb_data { 594struct twl4030_usb_data {
595 enum twl4030_usb_mode usb_mode; 595 enum twl4030_usb_mode usb_mode;
596
597 int (*phy_init)(struct device *dev);
598 int (*phy_exit)(struct device *dev);
599 /* Power on/off the PHY */
600 int (*phy_power)(struct device *dev, int iD, int on);
601 /* enable/disable phy clocks */
602 int (*phy_set_clock)(struct device *dev, int on);
596}; 603};
597 604
598struct twl4030_ins { 605struct twl4030_ins {