Commit af6882be authored by Fabio Baltieri's avatar Fabio Baltieri Committed by Felipe Balbi

usb: phy: ab8500-usb: update irq handling code

Update irq handling code to notify all possible link status changes of
AB8500 and AB8505 to the ux500-musb glue driver.  The additional event
codes will be used for pm-runtime implementation, and are defined in a
separate ux500-specific header.

This also modify the irq registration code to use devm_* helpers and
drop all non necessary fail path code.
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarFabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 73f226cb
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/err.h> #include <linux/err.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/usb/musb-ux500.h>
#include "musb_core.h" #include "musb_core.h"
...@@ -107,15 +108,15 @@ static int musb_otg_notifications(struct notifier_block *nb, ...@@ -107,15 +108,15 @@ static int musb_otg_notifications(struct notifier_block *nb,
event, usb_otg_state_string(musb->xceiv->state)); event, usb_otg_state_string(musb->xceiv->state));
switch (event) { switch (event) {
case USB_EVENT_ID: case UX500_MUSB_ID:
dev_dbg(musb->controller, "ID GND\n"); dev_dbg(musb->controller, "ID GND\n");
ux500_musb_set_vbus(musb, 1); ux500_musb_set_vbus(musb, 1);
break; break;
case USB_EVENT_VBUS: case UX500_MUSB_VBUS:
dev_dbg(musb->controller, "VBUS Connect\n"); dev_dbg(musb->controller, "VBUS Connect\n");
ux500_musb_set_vbus(musb, 0); ux500_musb_set_vbus(musb, 0);
break; break;
case USB_EVENT_NONE: case UX500_MUSB_NONE:
dev_dbg(musb->controller, "VBUS Disconnect\n"); dev_dbg(musb->controller, "VBUS Disconnect\n");
if (is_host_active(musb)) if (is_host_active(musb))
ux500_musb_set_vbus(musb, 0); ux500_musb_set_vbus(musb, 0);
......
This diff is collapsed.
/*
* Copyright (C) 2013 ST-Ericsson AB
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __MUSB_UX500_H__
#define __MUSB_UX500_H__
enum ux500_musb_vbus_id_status {
UX500_MUSB_NONE = 0,
UX500_MUSB_VBUS,
UX500_MUSB_ID,
UX500_MUSB_CHARGER,
UX500_MUSB_ENUMERATED,
UX500_MUSB_RIDA,
UX500_MUSB_RIDB,
UX500_MUSB_RIDC,
UX500_MUSB_PREPARE,
UX500_MUSB_CLEAN,
};
#endif /* __MUSB_UX500_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment