All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Lechner <david@lechnology.com>
To: ahaslam@baylibre.com, gregkh@linuxfoundation.org,
	johan@kernel.org, robh+dt@kernel.org, nsekhar@ti.com,
	stern@rowland.harvard.edu, khilman@baylibre.com,
	sshtylyov@ru.mvista.com, broonie@kernel.org,
	abailon@baylibre.com
Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH/RFT v2 12/17] USB: ochi-da8xx: Use a regulator for vbus/overcurrent
Date: Mon, 24 Oct 2016 20:39:23 -0500	[thread overview]
Message-ID: <672c1f1a-58b7-6947-7fb2-acd38fab8597@lechnology.com> (raw)
In-Reply-To: <20161024164634.4330-13-ahaslam@baylibre.com>

On 10/24/2016 11:46 AM, ahaslam@baylibre.com wrote:
> From: Axel Haslam <ahaslam@baylibre.com>
>
> Currently, the da8xx ohci driver uses a set of gpios and callbacks in
> board files to handle vbus and overcurrent irqs form the power supply.
> However, this does not play nice when moving to a DT based boot were
> we wont have board files.
>
> Instead of requesting and handling the gpio, use the regulator framework
> to take care of enabling and disabling vbus power.
> This has the benefit
> that we dont need to pass any more platform data to the driver:
>
> These will be handled by the regulator framework:
> set_power   ->  regulator_enable/regulator_disable
> get_power   ->  regulator_is_enabled
> get_oci     ->  regulator_get_mode
> ocic_notify ->  regulator notification
>
> We can keep the default potpgt and use the regulator start delay instead:
> potpgt      -> regulator startup delay time
>
> The hawk board does not have a GPIO/OVERCURRENT gpio to control vbus,
> (they should not have been decleared/reserved) so, just remove those
> definitions from the hwk board file.
>
> Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
> ---


How do you recover after an overcurrent event?

I have configured a fixed-regulator using device-tree, but similar to 
the configuration in the board files here. However, when I shorted out 
the VBUS and caused an overcurrent event, I see nothing in the kernel 
log saying that there was an overcurrent event and after I remove the 
short, the regulator is never turned back on.



> @@ -163,7 +198,6 @@ static int ohci_da8xx_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
>  				  u16 wIndex, char *buf, u16 wLength)
>  {
>  	struct device *dev		= hcd->self.controller;
> -	struct da8xx_ohci_root_hub *hub	= dev_get_platdata(dev);

nit: unnecessary whitespace change

>  	int temp;
>
>  	switch (typeReq) {

WARNING: multiple messages have this Message-ID (diff)
From: David Lechner <david-nq/r/kbU++upp/zk7JDF2g@public.gmane.org>
To: ahaslam-rdvid1DuHRBWk0Htik3J/w@public.gmane.org,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org,
	johan-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	nsekhar-l0cyMroinI0@public.gmane.org,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org,
	khilman-rdvid1DuHRBWk0Htik3J/w@public.gmane.org,
	sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org,
	broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	abailon-rdvid1DuHRBWk0Htik3J/w@public.gmane.org
Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH/RFT v2 12/17] USB: ochi-da8xx: Use a regulator for vbus/overcurrent
Date: Mon, 24 Oct 2016 20:39:23 -0500	[thread overview]
Message-ID: <672c1f1a-58b7-6947-7fb2-acd38fab8597@lechnology.com> (raw)
In-Reply-To: <20161024164634.4330-13-ahaslam-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>

On 10/24/2016 11:46 AM, ahaslam-rdvid1DuHRBWk0Htik3J/w@public.gmane.org wrote:
> From: Axel Haslam <ahaslam-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>
>
> Currently, the da8xx ohci driver uses a set of gpios and callbacks in
> board files to handle vbus and overcurrent irqs form the power supply.
> However, this does not play nice when moving to a DT based boot were
> we wont have board files.
>
> Instead of requesting and handling the gpio, use the regulator framework
> to take care of enabling and disabling vbus power.
> This has the benefit
> that we dont need to pass any more platform data to the driver:
>
> These will be handled by the regulator framework:
> set_power   ->  regulator_enable/regulator_disable
> get_power   ->  regulator_is_enabled
> get_oci     ->  regulator_get_mode
> ocic_notify ->  regulator notification
>
> We can keep the default potpgt and use the regulator start delay instead:
> potpgt      -> regulator startup delay time
>
> The hawk board does not have a GPIO/OVERCURRENT gpio to control vbus,
> (they should not have been decleared/reserved) so, just remove those
> definitions from the hwk board file.
>
> Signed-off-by: Axel Haslam <ahaslam-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>
> ---


How do you recover after an overcurrent event?

I have configured a fixed-regulator using device-tree, but similar to 
the configuration in the board files here. However, when I shorted out 
the VBUS and caused an overcurrent event, I see nothing in the kernel 
log saying that there was an overcurrent event and after I remove the 
short, the regulator is never turned back on.



> @@ -163,7 +198,6 @@ static int ohci_da8xx_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
>  				  u16 wIndex, char *buf, u16 wLength)
>  {
>  	struct device *dev		= hcd->self.controller;
> -	struct da8xx_ohci_root_hub *hub	= dev_get_platdata(dev);

nit: unnecessary whitespace change

>  	int temp;
>
>  	switch (typeReq) {

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: david@lechnology.com (David Lechner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH/RFT v2 12/17] USB: ochi-da8xx: Use a regulator for vbus/overcurrent
Date: Mon, 24 Oct 2016 20:39:23 -0500	[thread overview]
Message-ID: <672c1f1a-58b7-6947-7fb2-acd38fab8597@lechnology.com> (raw)
In-Reply-To: <20161024164634.4330-13-ahaslam@baylibre.com>

On 10/24/2016 11:46 AM, ahaslam at baylibre.com wrote:
> From: Axel Haslam <ahaslam@baylibre.com>
>
> Currently, the da8xx ohci driver uses a set of gpios and callbacks in
> board files to handle vbus and overcurrent irqs form the power supply.
> However, this does not play nice when moving to a DT based boot were
> we wont have board files.
>
> Instead of requesting and handling the gpio, use the regulator framework
> to take care of enabling and disabling vbus power.
> This has the benefit
> that we dont need to pass any more platform data to the driver:
>
> These will be handled by the regulator framework:
> set_power   ->  regulator_enable/regulator_disable
> get_power   ->  regulator_is_enabled
> get_oci     ->  regulator_get_mode
> ocic_notify ->  regulator notification
>
> We can keep the default potpgt and use the regulator start delay instead:
> potpgt      -> regulator startup delay time
>
> The hawk board does not have a GPIO/OVERCURRENT gpio to control vbus,
> (they should not have been decleared/reserved) so, just remove those
> definitions from the hwk board file.
>
> Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
> ---


How do you recover after an overcurrent event?

I have configured a fixed-regulator using device-tree, but similar to 
the configuration in the board files here. However, when I shorted out 
the VBUS and caused an overcurrent event, I see nothing in the kernel 
log saying that there was an overcurrent event and after I remove the 
short, the regulator is never turned back on.



> @@ -163,7 +198,6 @@ static int ohci_da8xx_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
>  				  u16 wIndex, char *buf, u16 wLength)
>  {
>  	struct device *dev		= hcd->self.controller;
> -	struct da8xx_ohci_root_hub *hub	= dev_get_platdata(dev);

nit: unnecessary whitespace change

>  	int temp;
>
>  	switch (typeReq) {

  reply	other threads:[~2016-10-25  1:39 UTC|newest]

Thread overview: 176+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-24 16:46 [PATCH/RFT v2 00/17] Add DT support for ohci-da8xx ahaslam
2016-10-24 16:46 ` ahaslam at baylibre.com
2016-10-24 16:46 ` [PATCH/RFT v2 01/17] ARM: davinci: da8xx: add usb phy clocks ahaslam
2016-10-24 16:46   ` ahaslam at baylibre.com
2016-10-24 16:46 ` [PATCH/RFT v2 02/17] ARM: davinci: da8xx: Add CFGCHIP syscon platform declaration ahaslam
2016-10-24 16:46   ` ahaslam at baylibre.com
2016-10-24 16:46   ` ahaslam-rdvid1DuHRBWk0Htik3J/w
2016-10-25  8:10   ` Sekhar Nori
2016-10-25  8:10     ` Sekhar Nori
2016-10-25  8:10     ` Sekhar Nori
2016-10-25  9:37     ` Axel Haslam
2016-10-25  9:37       ` Axel Haslam
2016-10-25  9:37       ` Axel Haslam
2016-10-25 10:17       ` Sekhar Nori
2016-10-25 10:17         ` Sekhar Nori
2016-10-25 10:17         ` Sekhar Nori
2016-10-25 15:53         ` David Lechner
2016-10-25 15:53           ` David Lechner
2016-10-25 15:53           ` David Lechner
2016-10-26  8:56           ` Sekhar Nori
2016-10-26  8:56             ` Sekhar Nori
2016-10-26  8:56             ` Sekhar Nori
2016-10-24 16:46 ` [PATCH/RFT v2 03/17] ARM: davinci: da8xx: Add USB PHY " ahaslam
2016-10-24 16:46   ` ahaslam at baylibre.com
2016-10-24 16:46   ` ahaslam-rdvid1DuHRBWk0Htik3J/w
2016-10-25  9:18   ` Sekhar Nori
2016-10-25  9:18     ` Sekhar Nori
2016-10-25  9:18     ` Sekhar Nori
2016-10-25  9:37     ` Axel Haslam
2016-10-25  9:37       ` Axel Haslam
2016-10-25  9:37       ` Axel Haslam
2016-10-24 16:46 ` [PATCH/RFT v2 04/17] ARM: DTS: da850: Add cfgchip syscon node ahaslam
2016-10-24 16:46   ` ahaslam at baylibre.com
2016-10-24 16:46   ` ahaslam
2016-10-24 16:46 ` [PATCH/RFT v2 05/17] ARM: DTS: da850: Add usb phy node ahaslam
2016-10-24 16:46   ` ahaslam at baylibre.com
2016-10-24 16:46   ` ahaslam
2016-10-24 16:46 ` [PATCH/RFT v2 06/17] ARM: davinci: da8xx: Fix some redefined symbol warnings ahaslam
2016-10-24 16:46   ` ahaslam at baylibre.com
2016-10-24 16:46   ` ahaslam-rdvid1DuHRBWk0Htik3J/w
2016-10-25 10:03   ` Sekhar Nori
2016-10-25 10:03     ` Sekhar Nori
2016-10-25 10:03     ` Sekhar Nori
2016-10-25 12:14     ` Alexandre Bailon
2016-10-25 12:14       ` Alexandre Bailon
2016-10-25 12:14       ` Alexandre Bailon
2016-10-24 16:46 ` [PATCH/RFT v2 07/17] ARM: davinci: da8xx: Enable the usb20 "per" clk on phy_clk_enable ahaslam
2016-10-24 16:46   ` ahaslam at baylibre.com
2016-10-24 16:46   ` ahaslam
2016-10-25  2:53   ` David Lechner
2016-10-25  2:53     ` David Lechner
2016-10-25 10:01     ` Axel Haslam
2016-10-25 10:01       ` Axel Haslam
2016-10-25 10:12   ` Sekhar Nori
2016-10-25 10:12     ` Sekhar Nori
2016-10-25 10:12     ` Sekhar Nori
2016-10-25 16:05     ` David Lechner
2016-10-25 16:05       ` David Lechner
2016-10-25 16:05       ` David Lechner
2016-10-26  9:30       ` Sekhar Nori
2016-10-26  9:30         ` Sekhar Nori
2016-10-26  9:30         ` Sekhar Nori
2016-10-24 16:46 ` [PATCH/RFT v2 08/17] ARM: davinci: hawk: add full constraints for ohci plat boot ahaslam
2016-10-24 16:46   ` ahaslam at baylibre.com
2016-10-25 10:28   ` Sekhar Nori
2016-10-25 10:28     ` Sekhar Nori
2016-10-25 10:28     ` Sekhar Nori
2016-10-25 10:31     ` Axel Haslam
2016-10-25 10:31       ` Axel Haslam
2016-10-25 10:31       ` Axel Haslam
2016-10-24 16:46 ` [PATCH/RFT v2 09/17] regulator: fixed: Add over current event ahaslam
2016-10-24 16:46   ` ahaslam at baylibre.com
2016-10-24 16:46   ` ahaslam-rdvid1DuHRBWk0Htik3J/w
2016-10-24 17:43   ` Mark Brown
2016-10-24 17:43     ` Mark Brown
2016-10-24 17:43     ` Mark Brown
2016-10-24 17:53     ` Axel Haslam
2016-10-24 17:53       ` Axel Haslam
2016-10-24 17:53   ` Mark Brown
2016-10-24 17:53     ` Mark Brown
2016-10-24 17:53     ` Mark Brown
2016-10-24 18:11     ` Axel Haslam
2016-10-24 18:11       ` Axel Haslam
2016-10-24 18:11       ` Axel Haslam
2016-10-24 18:19       ` Mark Brown
2016-10-24 18:19         ` Mark Brown
2016-10-25 12:55         ` Axel Haslam
2016-10-25 12:55           ` Axel Haslam
2016-10-25 14:33           ` Mark Brown
2016-10-25 14:33             ` Mark Brown
2016-10-25 14:57             ` Axel Haslam
2016-10-25 14:57               ` Axel Haslam
2016-10-25 15:07               ` Axel Haslam
2016-10-25 15:07                 ` Axel Haslam
2016-10-30 20:42   ` Rob Herring
2016-10-30 20:42     ` Rob Herring
2016-10-24 16:46 ` [PATCH/RFT v2 10/17] USB: da8xx: use flag instead of bitmask for over current change ahaslam
2016-10-24 16:46   ` ahaslam at baylibre.com
2016-10-24 16:46   ` ahaslam-rdvid1DuHRBWk0Htik3J/w
2016-10-24 16:46 ` [PATCH/RFT v2 11/17] USB: OHCI: make ohci-da8xx a separate driver ahaslam
2016-10-24 16:46   ` ahaslam at baylibre.com
2016-10-24 16:46   ` ahaslam-rdvid1DuHRBWk0Htik3J/w
2016-10-25  0:38   ` David Lechner
2016-10-25  0:38     ` David Lechner
2016-10-25  0:38     ` David Lechner
2016-10-25  7:39     ` Axel Haslam
2016-10-25  7:39       ` Axel Haslam
2016-10-25  7:39       ` Axel Haslam
2016-10-25 16:12       ` David Lechner
2016-10-25 16:12         ` David Lechner
2016-10-25 16:12         ` David Lechner
2016-10-25 16:21         ` Axel Haslam
2016-10-25 16:21           ` Axel Haslam
2016-10-25 16:21           ` Axel Haslam
2016-10-25 16:24           ` David Lechner
2016-10-25 16:24             ` David Lechner
2016-10-25 16:24             ` David Lechner
2016-10-24 16:46 ` [PATCH/RFT v2 12/17] USB: ochi-da8xx: Use a regulator for vbus/overcurrent ahaslam
2016-10-24 16:46   ` ahaslam at baylibre.com
2016-10-24 16:46   ` ahaslam-rdvid1DuHRBWk0Htik3J/w
2016-10-25  1:39   ` David Lechner [this message]
2016-10-25  1:39     ` David Lechner
2016-10-25  1:39     ` David Lechner
2016-10-25  8:24     ` Axel Haslam
2016-10-25  8:24       ` Axel Haslam
2016-10-25  8:24       ` Axel Haslam
2016-10-25 16:53       ` David Lechner
2016-10-25 16:53         ` David Lechner
2016-10-25 16:53         ` David Lechner
2016-10-25 17:32         ` Axel Haslam
2016-10-25 17:32           ` Axel Haslam
2016-10-25 10:43   ` Sekhar Nori
2016-10-25 10:43     ` Sekhar Nori
2016-10-25 10:43     ` Sekhar Nori
2016-10-25 10:52     ` Axel Haslam
2016-10-25 10:52       ` Axel Haslam
2016-10-25 10:52       ` Axel Haslam
2016-10-24 16:46 ` [PATCH/RFT v2 13/17] USB: da8xx: use ohci priv data instead of globals ahaslam
2016-10-24 16:46   ` ahaslam at baylibre.com
2016-10-24 16:46   ` ahaslam-rdvid1DuHRBWk0Htik3J/w
2016-10-25  1:12   ` David Lechner
2016-10-25  1:12     ` David Lechner
2016-10-25  1:12     ` David Lechner
2016-10-25  9:56     ` Axel Haslam
2016-10-25  9:56       ` Axel Haslam
2016-10-24 16:46 ` [PATCH/RFT v2 14/17] ARM: davinci: register the usb20_phy clock on the DT file ahaslam
2016-10-24 16:46   ` ahaslam at baylibre.com
2016-10-24 16:46   ` ahaslam-rdvid1DuHRBWk0Htik3J/w
2016-10-24 16:46 ` [PATCH/RFT v2 15/17] usb: host: ohci-da8xx: Add devicetree bindings documentation ahaslam
2016-10-24 16:46   ` ahaslam at baylibre.com
2016-10-24 16:46   ` ahaslam-rdvid1DuHRBWk0Htik3J/w
2016-10-25  1:02   ` David Lechner
2016-10-25  1:02     ` David Lechner
2016-10-25  1:02     ` David Lechner
2016-10-25  9:56     ` Axel Haslam
2016-10-25  9:56       ` Axel Haslam
2016-10-25  9:56       ` Axel Haslam
2016-10-24 16:46 ` [PATCH/RFT v2 16/17] USB: ohci-da8xx: Allow probing from DT ahaslam
2016-10-24 16:46   ` ahaslam at baylibre.com
2016-10-24 16:46   ` ahaslam-rdvid1DuHRBWk0Htik3J/w
2016-10-25  0:53   ` David Lechner
2016-10-25  0:53     ` David Lechner
2016-10-25  0:53     ` David Lechner
2016-10-25  8:10     ` Axel Haslam
2016-10-25  8:10       ` Axel Haslam
2016-10-24 16:46 ` [PATCH/RFT v2 17/17] ARM: dts: da850: add usb device node ahaslam
2016-10-24 16:46   ` ahaslam at baylibre.com
2016-10-25  0:48   ` David Lechner
2016-10-25  0:48     ` David Lechner
2016-10-25  0:48     ` David Lechner
2016-10-25  8:03     ` Axel Haslam
2016-10-25  8:03       ` Axel Haslam
2016-10-25  8:03       ` Axel Haslam
2016-10-25 10:55 ` [PATCH/RFT v2 00/17] Add DT support for ohci-da8xx Sekhar Nori
2016-10-25 10:55   ` Sekhar Nori
2016-10-25 10:55   ` Sekhar Nori

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=672c1f1a-58b7-6947-7fb2-acd38fab8597@lechnology.com \
    --to=david@lechnology.com \
    --cc=abailon@baylibre.com \
    --cc=ahaslam@baylibre.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=khilman@baylibre.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=nsekhar@ti.com \
    --cc=robh+dt@kernel.org \
    --cc=sshtylyov@ru.mvista.com \
    --cc=stern@rowland.harvard.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.