Messages in this thread | | | Subject | Re: [PATCH v4 1/1] extcon: usb-gpio: Introduce gpio usb extcon driver | From | "Ivan T. Ivanov" <> | Date | Mon, 16 Mar 2015 14:32:29 +0200 |
| |
Hi,
On Mon, 2015-02-02 at 12:21 +0200, Roger Quadros wrote: > This driver observes the USB ID pin connected over a GPIO and > updates the USB cable extcon states accordingly. > > The existing GPIO extcon driver is not suitable for this purpose > as it needs to be taught to understand USB cable states and it > can't handle more than one cable per instance. > > For the USB case we need to handle 2 cable states. > 1) USB (attach/detach) > 2) USB-HOST (attach/detach) > > This driver can be easily updated in the future to handle VBUS > events in case it happens to be available on GPIO for any platform. > > Signed-off-by: Roger Quadros <rogerq@ti.com> > --- > v4: > - got rid of id_irqwake flag. Fail if enable/disable_irq_wake() fails > - changed host cable name to "USB-HOST"
I am sorry that I am getting a bit little late into this.
Isn't supposed that we have to use strings defined in const char extcon_cable_name[][]?
> + > +/* List of detectable cables */ > +enum { > + EXTCON_CABLE_USB = 0, > + EXTCON_CABLE_USB_HOST, > +
Same here: duplicated with enum extcon_cable_name
> + EXTCON_CABLE_END, > +}; > + > +static const char *usb_extcon_cable[] = { > + [EXTCON_CABLE_USB] = "USB", > + [EXTCON_CABLE_USB_HOST] = "USB-HOST", > + NULL, > +}; >
<snip>
> + > +static int usb_extcon_probe(struct platform_device *pdev) > +{ >
<snip>
> + > + ret = devm_request_threaded_irq(dev, info->id_irq, NULL, > + usb_irq_handler, > + IRQF_TRIGGER_RISING | > + IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
Shouldn't triggers be defined in DTS files?
Regards, Ivan
>
| |