Skip to content

Commit

Permalink
ARM: davinci: da830-evm: remove legacy usb helpers
Browse files Browse the repository at this point in the history
The logic implemented by these routines now lives in the da8xx-ohci
driver. Remove dead code.

Signed-off-by: Bartosz Golaszewski <[email protected]>
Signed-off-by: Sekhar Nori <[email protected]>
  • Loading branch information
brgl authored and nsekhar committed Feb 12, 2019
1 parent 2435854 commit 339850f
Showing 1 changed file with 0 additions and 67 deletions.
67 changes: 0 additions & 67 deletions arch/arm/mach-davinci/board-da830-evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ static const short da830_evm_usb11_pins[] = {
-1
};

static da8xx_ocic_handler_t da830_evm_usb_ocic_handler;

static struct gpiod_lookup_table da830_evm_usb_gpio_lookup = {
.dev_id = "ohci-da8xx",
.table = {
Expand All @@ -62,60 +60,11 @@ static struct gpiod_lookup_table da830_evm_usb_gpio_lookup = {
},
};

static int da830_evm_usb_set_power(unsigned port, int on)
{
gpio_set_value(ON_BD_USB_DRV, on);
return 0;
}

static int da830_evm_usb_get_power(unsigned port)
{
return gpio_get_value(ON_BD_USB_DRV);
}

static int da830_evm_usb_get_oci(unsigned port)
{
return !gpio_get_value(ON_BD_USB_OVC);
}

static irqreturn_t da830_evm_usb_ocic_irq(int, void *);

static int da830_evm_usb_ocic_notify(da8xx_ocic_handler_t handler)
{
int irq = gpio_to_irq(ON_BD_USB_OVC);
int error = 0;

if (handler != NULL) {
da830_evm_usb_ocic_handler = handler;

error = request_irq(irq, da830_evm_usb_ocic_irq,
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
"OHCI over-current indicator", NULL);
if (error)
pr_err("%s: could not request IRQ to watch over-current indicator changes\n",
__func__);
} else
free_irq(irq, NULL);

return error;
}

static struct da8xx_ohci_root_hub da830_evm_usb11_pdata = {
.set_power = da830_evm_usb_set_power,
.get_power = da830_evm_usb_get_power,
.get_oci = da830_evm_usb_get_oci,
.ocic_notify = da830_evm_usb_ocic_notify,

/* TPS2065 switch @ 5V */
.potpgt = (3 + 1) / 2, /* 3 ms max */
};

static irqreturn_t da830_evm_usb_ocic_irq(int irq, void *dev_id)
{
da830_evm_usb_ocic_handler(&da830_evm_usb11_pdata, 1);
return IRQ_HANDLED;
}

static __init void da830_evm_usb_init(void)
{
int ret;
Expand Down Expand Up @@ -150,22 +99,6 @@ static __init void da830_evm_usb_init(void)
return;
}

ret = gpio_request(ON_BD_USB_DRV, "ON_BD_USB_DRV");
if (ret) {
pr_err("%s: failed to request GPIO for USB 1.1 port power control: %d\n",
__func__, ret);
return;
}
gpio_direction_output(ON_BD_USB_DRV, 0);

ret = gpio_request(ON_BD_USB_OVC, "ON_BD_USB_OVC");
if (ret) {
pr_err("%s: failed to request GPIO for USB 1.1 port over-current indicator: %d\n",
__func__, ret);
return;
}
gpio_direction_input(ON_BD_USB_OVC);

gpiod_add_lookup_table(&da830_evm_usb_gpio_lookup);

ret = da8xx_register_usb11(&da830_evm_usb11_pdata);
Expand Down

0 comments on commit 339850f

Please sign in to comment.