From: Hans de Goede <hdegoede@redhat.com>
To: Icenowy Zheng <icenowy@aosc.xyz>, Bin Liu <b-liu@ti.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Kishon Vijay Abraham I <kishon@ti.com>
Cc: devicetree <devicetree@vger.kernel.org>,
Chen-Yu Tsai <wens@csie.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
Maxime Ripard <maxime.ripard@free-electrons.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v3 5/7] phy-sun4i-usb: Warn when external vbus is detected
Date: Sun, 21 Aug 2016 17:20:14 +0200 [thread overview]
Message-ID: <fabf206f-7f7a-4f00-dbdf-c3ad24211fef@redhat.com> (raw)
In-Reply-To: <27711471789929@web21g.yandex.ru>
Hi,
On 21-08-16 16:32, Icenowy Zheng wrote:
>
>
> 21.08.2016, 20:22, "Hans de Goede" <hdegoede@redhat.com>:
>> Warn when external vbus is detected when we're trying to enable our
>> own vbus.
>
> Will it lead to a dmesg flood if a not-well-connected USB OTG Charging Hub
> is present?
No, we only try to turn on Vbus once when switching to host-mode.
When using a device which is actually providing power and has an
id pin claiming it wants the port in host mode then this message
will trigger once. I'm actually adding it exactly because of the
USB OTG Charging Hub case. In this case you want to see this
messages once, if you're not seeing it and the hub is sending
power to the micro-usb port then something is wrong.
Note in many cases these hubs will only send power when in
charging mode and in this case the the id-pin is such
that the micro-usb port will be in device mode and will
never try to provide power. In this scenario you will not
get the warning, not will Linux see the hub.
Regards,
Hans
>
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> ---
>> Changes in v2:
>> -No changes
>> Changes in v3:
>> -No changes
>> ---
>> drivers/phy/phy-sun4i-usb.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/phy/phy-sun4i-usb.c b/drivers/phy/phy-sun4i-usb.c
>> index af42f8d..03f030b 100644
>> --- a/drivers/phy/phy-sun4i-usb.c
>> +++ b/drivers/phy/phy-sun4i-usb.c
>> @@ -390,8 +390,10 @@ static int sun4i_usb_phy_power_on(struct phy *_phy)
>>
>> /* For phy0 only turn on Vbus if we don't have an ext. Vbus */
>> if (phy->index == 0 && sun4i_usb_phy0_have_vbus_det(data) &&
>> - data->vbus_det)
>> + data->vbus_det) {
>> + dev_warn(&_phy->dev, "External vbus detected, not enabling our own vbus\n");
>> return 0;
>> + }
>>
>> ret = regulator_enable(phy->vbus);
>> if (ret)
>> --
>> 2.7.4
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2016-08-21 15:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-21 12:16 [PATCH v3 1/7] phy-sun4i-usb: Use bool where appropriate Hans de Goede
[not found] ` <1471781799-10457-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-08-21 12:16 ` [PATCH v3 2/7] phy-sun4i-usb: Refactor forced session ending Hans de Goede
2016-08-21 12:16 ` [PATCH v3 3/7] phy-sun4i-usb: Simplify missing dr_mode handling Hans de Goede
2016-08-21 12:16 ` [PATCH v3 4/7] phy-sun4i-usb: Add support for phy_set_mode Hans de Goede
2016-08-21 12:16 ` [PATCH v3 5/7] phy-sun4i-usb: Warn when external vbus is detected Hans de Goede
2016-08-21 14:32 ` Icenowy Zheng
2016-08-21 15:20 ` Hans de Goede [this message]
2016-08-21 12:16 ` [PATCH v3 6/7] phy-sun4i-usb: Add "allwinner,usb0-usb-a-connector" dt property Hans de Goede
[not found] ` <1471781799-10457-6-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-08-23 18:00 ` Rob Herring
2016-08-23 18:26 ` Hans de Goede
2016-08-21 12:16 ` [PATCH v3 7/7] musb: sunxi: Add support for platform_set_mode Hans de Goede
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fabf206f-7f7a-4f00-dbdf-c3ad24211fef@redhat.com \
--to=hdegoede@redhat.com \
--cc=b-liu@ti.com \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=icenowy@aosc.xyz \
--cc=kishon@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-usb@vger.kernel.org \
--cc=maxime.ripard@free-electrons.com \
--cc=wens@csie.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).