linux-mips
[Top] [All Lists]

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

To: Svetoslav Neykov <svetoslav@neykov.name>, Ralf Baechle <ralf@linux-mips.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Gabor Juhos <juhosg@openwrt.org>, John Crispin <blogic@openwrt.org>, Alan Stern <stern@rowland.harvard.edu>, "Luis R. Rodriguez" <mcgrof@qca.qualcomm.com>
Subject: Re: [PATCH 3/5] usb: chipidea: Don't access OTG related registers
From: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Date: Thu, 14 Feb 2013 13:45:26 +0200
Cc: linux-mips@linux-mips.org, linux-usb@vger.kernel.org, Svetoslav Neykov <svetoslav@neykov.name>
In-reply-to: <1360791538-6332-4-git-send-email-svetoslav@neykov.name>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
References: <1360791538-6332-1-git-send-email-svetoslav@neykov.name> <1360791538-6332-4-git-send-email-svetoslav@neykov.name>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Notmuch/0.12+187~ga2502b0 (http://notmuchmail.org) Emacs/23.4.1 (x86_64-pc-linux-gnu)
Svetoslav Neykov <svetoslav@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 <svetoslav@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

<Prev in Thread] Current Thread [Next in Thread>