Re: [PATCH 3/5] usb: chipidea: Don't access OTG related registers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Svetoslav Neykov <svetoslav@xxxxxxxxxxx> 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 <svetoslav@xxxxxxxxxxx>
> ---
>  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


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux