Svetoslav Neykov <svetos...@neykov.name> writes:

> According to the datasheet the chipidea controller in AR933x doesn't expose 
> OTG and TEST registers.
> If no OTG support is detected don't call functions which access those 
> registers.
>
> Signed-off-by: Svetoslav Neykov <svetos...@neykov.name>
> ---
>  drivers/usb/chipidea/udc.c |   24 ++++++++++++++++--------
>  1 file changed, 16 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
> index 78ac5e5..9fda4d8 100644
> --- a/drivers/usb/chipidea/udc.c
> +++ b/drivers/usb/chipidea/udc.c
> @@ -1395,7 +1395,10 @@ static int ci13xxx_vbus_session(struct usb_gadget 
> *_gadget, int is_active)
>               if (is_active) {
>                       pm_runtime_get_sync(&_gadget->dev);
>                       hw_device_reset(ci, USBMODE_CM_DC);
> -                     hw_enable_vbus_intr(ci);
> +
> +                     if (ci->is_otg)
> +                             hw_enable_vbus_intr(ci);

It might be easier on the eyes if you move the "if (ci->is_otg)" check
inside hw_enable_vbus_intr(). But otherwise looks sensible.

Regards,
--
Alex
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to