diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-omap4panda.c')
-rw-r--r-- | arch/arm/mach-omap2/board-omap4panda.c | 62 |
1 files changed, 21 insertions, 41 deletions
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index 7eaad629c4c2..5d7c0a313dc7 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c | |||
@@ -112,6 +112,11 @@ static const struct usbhs_omap_board_data usbhs_bdata __initconst = { | |||
112 | .reset_gpio_port[2] = -EINVAL | 112 | .reset_gpio_port[2] = -EINVAL |
113 | }; | 113 | }; |
114 | 114 | ||
115 | static struct gpio panda_ehci_gpios[] __initdata = { | ||
116 | { GPIO_HUB_POWER, GPIOF_OUT_INIT_LOW, "hub_power" }, | ||
117 | { GPIO_HUB_NRESET, GPIOF_OUT_INIT_LOW, "hub_nreset" }, | ||
118 | }; | ||
119 | |||
115 | static void __init omap4_ehci_init(void) | 120 | static void __init omap4_ehci_init(void) |
116 | { | 121 | { |
117 | int ret; | 122 | int ret; |
@@ -121,44 +126,27 @@ static void __init omap4_ehci_init(void) | |||
121 | phy_ref_clk = clk_get(NULL, "auxclk3_ck"); | 126 | phy_ref_clk = clk_get(NULL, "auxclk3_ck"); |
122 | if (IS_ERR(phy_ref_clk)) { | 127 | if (IS_ERR(phy_ref_clk)) { |
123 | pr_err("Cannot request auxclk3\n"); | 128 | pr_err("Cannot request auxclk3\n"); |
124 | goto error1; | 129 | return; |
125 | } | 130 | } |
126 | clk_set_rate(phy_ref_clk, 19200000); | 131 | clk_set_rate(phy_ref_clk, 19200000); |
127 | clk_enable(phy_ref_clk); | 132 | clk_enable(phy_ref_clk); |
128 | 133 | ||
129 | /* disable the power to the usb hub prior to init */ | 134 | /* disable the power to the usb hub prior to init and reset phy+hub */ |
130 | ret = gpio_request(GPIO_HUB_POWER, "hub_power"); | 135 | ret = gpio_request_array(panda_ehci_gpios, |
136 | ARRAY_SIZE(panda_ehci_gpios)); | ||
131 | if (ret) { | 137 | if (ret) { |
132 | pr_err("Cannot request GPIO %d\n", GPIO_HUB_POWER); | 138 | pr_err("Unable to initialize EHCI power/reset\n"); |
133 | goto error1; | 139 | return; |
134 | } | 140 | } |
135 | gpio_export(GPIO_HUB_POWER, 0); | ||
136 | gpio_direction_output(GPIO_HUB_POWER, 0); | ||
137 | gpio_set_value(GPIO_HUB_POWER, 0); | ||
138 | 141 | ||
139 | /* reset phy+hub */ | 142 | gpio_export(GPIO_HUB_POWER, 0); |
140 | ret = gpio_request(GPIO_HUB_NRESET, "hub_nreset"); | ||
141 | if (ret) { | ||
142 | pr_err("Cannot request GPIO %d\n", GPIO_HUB_NRESET); | ||
143 | goto error2; | ||
144 | } | ||
145 | gpio_export(GPIO_HUB_NRESET, 0); | 143 | gpio_export(GPIO_HUB_NRESET, 0); |
146 | gpio_direction_output(GPIO_HUB_NRESET, 0); | ||
147 | gpio_set_value(GPIO_HUB_NRESET, 0); | ||
148 | gpio_set_value(GPIO_HUB_NRESET, 1); | 144 | gpio_set_value(GPIO_HUB_NRESET, 1); |
149 | 145 | ||
150 | usbhs_init(&usbhs_bdata); | 146 | usbhs_init(&usbhs_bdata); |
151 | 147 | ||
152 | /* enable power to hub */ | 148 | /* enable power to hub */ |
153 | gpio_set_value(GPIO_HUB_POWER, 1); | 149 | gpio_set_value(GPIO_HUB_POWER, 1); |
154 | return; | ||
155 | |||
156 | error2: | ||
157 | gpio_free(GPIO_HUB_POWER); | ||
158 | error1: | ||
159 | pr_err("Unable to initialize EHCI power/reset\n"); | ||
160 | return; | ||
161 | |||
162 | } | 150 | } |
163 | 151 | ||
164 | static struct omap_musb_board_data musb_board_data = { | 152 | static struct omap_musb_board_data musb_board_data = { |
@@ -638,27 +626,19 @@ static void omap4_panda_hdmi_mux_init(void) | |||
638 | OMAP_PIN_INPUT_PULLUP); | 626 | OMAP_PIN_INPUT_PULLUP); |
639 | } | 627 | } |
640 | 628 | ||
629 | static struct gpio panda_hdmi_gpios[] = { | ||
630 | { HDMI_GPIO_HPD, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_hpd" }, | ||
631 | { HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ls_oe" }, | ||
632 | }; | ||
633 | |||
641 | static int omap4_panda_panel_enable_hdmi(struct omap_dss_device *dssdev) | 634 | static int omap4_panda_panel_enable_hdmi(struct omap_dss_device *dssdev) |
642 | { | 635 | { |
643 | int status; | 636 | int status; |
644 | 637 | ||
645 | status = gpio_request_one(HDMI_GPIO_HPD, GPIOF_OUT_INIT_HIGH, | 638 | status = gpio_request_array(panda_hdmi_gpios, |
646 | "hdmi_gpio_hpd"); | 639 | ARRAY_SIZE(panda_hdmi_gpios)); |
647 | if (status) { | 640 | if (status) |
648 | pr_err("Cannot request GPIO %d\n", HDMI_GPIO_HPD); | 641 | pr_err("Cannot request HDMI GPIOs\n"); |
649 | return status; | ||
650 | } | ||
651 | status = gpio_request_one(HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH, | ||
652 | "hdmi_gpio_ls_oe"); | ||
653 | if (status) { | ||
654 | pr_err("Cannot request GPIO %d\n", HDMI_GPIO_LS_OE); | ||
655 | goto error1; | ||
656 | } | ||
657 | |||
658 | return 0; | ||
659 | |||
660 | error1: | ||
661 | gpio_free(HDMI_GPIO_HPD); | ||
662 | 642 | ||
663 | return status; | 643 | return status; |
664 | } | 644 | } |