mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sekhar Nori <nsekhar@ti.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Kevin Hilman <khilman@kernel.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	<linux-usb@vger.kernel.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>
Subject: Re: [PATCH 0/3] ARM: davinci: ohci-da8xx: model the vbus GPIO as a fixed regulator
Date: Thu, 28 Mar 2019 15:40:08 +0530	[thread overview]
Message-ID: <3d7f7814-6184-96c6-8087-6373a489ebc0@ti.com> (raw)
In-Reply-To: <CAMRc=McPzhOy9Ebp+hDC1eiSKJBf-q9gCeD_WMF5Wa4SSBR=dg@mail.gmail.com>

On 27/03/19 6:46 PM, Bartosz Golaszewski wrote:
> śr., 27 mar 2019 o 12:37 Sekhar Nori <nsekhar@ti.com> napisał(a):
>>
>> Hi Bart,
>>
>> On 26/03/19 9:27 PM, Bartosz Golaszewski wrote:
>>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>>
>>> Adding the vbus GPIO support to the ohci-da8xx driver isn't really the
>>> optimal solution. Rather: it should be modeled as a fixed regulator
>>> in which case the driver already has support.
>>
>> Can you clarify "driver already has support"? You are introducing
>> support to use the VBUS gpio as regulator as part of 3/3.
>>
> 
> The support is there as in: if the driver can obtain the regulator, it
> will enable it. The overcurrent protection does not work however and
> this is what patch 3 adds. Maybe I should rework the ordering in that
> I'd first add the irq thread disabling the regulator if it exists,
> then the regulator fixups to board files and then remove the vbus
> GPIO.
> 
>> I do see other instances of VBUS regulator being used in USB tree. But
>> we just converted the driver to use VBUS and over-current GPIOs in v5.1.
>> So this is a bit of "churn".
>>
> 
> Yes and it's my fault - I simply converted the legacy code without
> giving it enough consideration. I should have used a fixed regulator
> right away, but now it's upstream and we need a follow-up series.
> 
>> Can you document why the current solution is not optimal? Is it to make
>> future device-tree conversion for these boards easier? Or?
>>
> 
> It's sub-optimal from the HW modeling in SW PoV - it is in fact a
> regulator enabled/disabled by a GPIO. Also: it's code duplication as
> currently we check if the vbus GPIO exists and then use it or check if
> the regulator exists and use this as the second choice. The third
> patch actually shrinks the driver.

I see now that the driver supports controlling the VBUS gpio as
regulator already. Something I should have caught in review last time
around.

I agree this patch is an improvement. Lets see what Alan feels.

Also, reg_enabled member of da8xx_ohci_hcd structure seems to be pretty
useless considering regulator API already has use counting. Can you take
a look and remove that too as an added bonus.

Thanks,
Sekhar

  reply	other threads:[~2019-03-28 10:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-26 15:57 Bartosz Golaszewski
2019-03-26 15:57 ` [PATCH 1/3] ARM: davinci: omapl138-hawk: add a fixed regulator for ohci-da8xx Bartosz Golaszewski
2019-03-26 15:57 ` [PATCH 2/3] ARM: davinci: da830-evm: " Bartosz Golaszewski
2019-03-26 15:57 ` [PATCH 3/3] usb: ohci-da8xx: drop the vbus GPIO Bartosz Golaszewski
2019-03-27 11:37 ` [PATCH 0/3] ARM: davinci: ohci-da8xx: model the vbus GPIO as a fixed regulator Sekhar Nori
2019-03-27 13:16   ` Bartosz Golaszewski
2019-03-28 10:10     ` Sekhar Nori [this message]
2019-03-28 14:11       ` Alan Stern
2019-03-28 14:29         ` Bartosz Golaszewski
2019-03-28 14:38           ` Alan Stern

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=3d7f7814-6184-96c6-8087-6373a489ebc0@ti.com \
    --to=nsekhar@ti.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=brgl@bgdev.pl \
    --cc=gregkh@linuxfoundation.org \
    --cc=khilman@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®