summaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2/usb-tusb6010.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2023-04-30 22:38:24 +0300
committerLinus Walleij <linus.walleij@linaro.org>2023-05-24 16:01:59 +0300
commit8e0285ab95a9baf374f2c13eb152221c8ecb3f28 (patch)
tree9be96f59d69062f7a08ab1182ef8b34fd0c677cd /arch/arm/mach-omap2/usb-tusb6010.c
parent078dc5194c0ac1b8e2fc088be2168a1104e16f72 (diff)
downloadlinux-8e0285ab95a9baf374f2c13eb152221c8ecb3f28.tar.xz
ARM/musb: omap2: Remove global GPIO numbers from TUSB6010
The TUSB6010 (MUSB) device is picking up some GPIO lines hardcoded by number and passing on to the TUSB6010 device when registering it. Instead of nasty workarounds, provide a GPIO descriptor table and then make the TUSB6010 MUSB glue driver pick up the GPIO lines directly, convert it to an IRQ and pass down to the MUSB driver. OMAP2 is the only system using the TUSB6010. Stash the GPIO descriptors in the glue layer and use then to power up and down the TUSB6010 on-demand, instead of using boardfile callbacks. Since the OMAP2 boards are the only boards using the .set_power() and .board_set_power() callbacks, we can just delete them as the power is now handled directly in the TUSB6010 glue code. Cc: Bin Liu <b-liu@ti.com> Cc: linux-usb@vger.kernel.org Fixes: 92bf78b33b0b ("gpio: omap: use dynamic allocation of base") Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/mach-omap2/usb-tusb6010.c')
-rw-r--r--arch/arm/mach-omap2/usb-tusb6010.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/arch/arm/mach-omap2/usb-tusb6010.c b/arch/arm/mach-omap2/usb-tusb6010.c
index 18fa52f828dc..b46c254c2bc4 100644
--- a/arch/arm/mach-omap2/usb-tusb6010.c
+++ b/arch/arm/mach-omap2/usb-tusb6010.c
@@ -11,12 +11,12 @@
#include <linux/errno.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
-#include <linux/gpio.h>
#include <linux/export.h>
#include <linux/platform_data/usb-omap.h>
#include <linux/usb/musb.h>
+#include "usb-tusb6010.h"
#include "gpmc.h"
static u8 async_cs, sync_cs;
@@ -132,10 +132,6 @@ static struct resource tusb_resources[] = {
{ /* Synchronous access */
.flags = IORESOURCE_MEM,
},
- { /* IRQ */
- .name = "mc",
- .flags = IORESOURCE_IRQ,
- },
};
static u64 tusb_dmamask = ~(u32)0;
@@ -154,9 +150,9 @@ static struct platform_device tusb_device = {
/* this may be called only from board-*.c setup code */
int __init tusb6010_setup_interface(struct musb_hdrc_platform_data *data,
- unsigned ps_refclk, unsigned waitpin,
- unsigned async, unsigned sync,
- unsigned irq, unsigned dmachan)
+ unsigned int ps_refclk, unsigned int waitpin,
+ unsigned int async, unsigned int sync,
+ unsigned int dmachan)
{
int status;
static char error[] __initdata =
@@ -192,14 +188,6 @@ int __init tusb6010_setup_interface(struct musb_hdrc_platform_data *data,
if (status < 0)
return status;
- /* IRQ */
- status = gpio_request_one(irq, GPIOF_IN, "TUSB6010 irq");
- if (status < 0) {
- printk(error, 3, status);
- return status;
- }
- tusb_resources[2].start = gpio_to_irq(irq);
-
/* set up memory timings ... can speed them up later */
if (!ps_refclk) {
printk(error, 4, status);