u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: Samuel Holland <samuel@sholland.org>
Cc: "Jagan Teki" <jagan@amarulasolutions.com>,
	"Simon Glass" <sjg@chromium.org>, "Tom Rini" <trini@konsulko.com>,
	u-boot@lists.denx.de, "Milan P . Stanić" <mps@arvanta.net>,
	linux-sunxi@lists.linux.dev
Subject: Re: [PATCH] sunxi: usb: convert PHY GPIO functions to DM
Date: Wed, 8 Jun 2022 10:46:38 +0100	[thread overview]
Message-ID: <20220608104638.27ff5c3b@donnerap.cambridge.arm.com> (raw)
In-Reply-To: <5737809a-f9e2-f325-5168-d222968a02d8@sholland.org>

On Tue, 7 Jun 2022 21:07:59 -0500
Samuel Holland <samuel@sholland.org> wrote:

Hi,

> On 6/7/22 7:06 PM, Andre Przywara wrote:
> > The Allwinner USB PHY driver is still using the legacy GPIO interface,
> > which is now implemented by the DM_GPIO compat functions.
> > Those seem to have some design flaws, as setting the direction, then
> > later setting the value will not work, if the DM_GPIO driver is
> > implementing set_flags.
> > 
> > Fix this by using the dm_ version of the direct GPIO interface, which
> > uses struct gpio_desc structs to handle requested GPIOs, and actually
> > keeps the flags we set earlier.
> > 
> > This fixes USB operation on boards which need to toggle the VBUS supply
> > via a GPIO, like the Teres-I laptop or the BananaPi M2 Berry board.
> > 
> > Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> > Reported-by: Milan P. Stanić <mps@arvanta.net>  
> 
> Reviewed-by: Samuel Holland <samuel@sholland.org>

Thanks!

> 
> It looks like the other users of sunxi_name_to_gpio are unaffected because they
> call only gpio_direction_output (sometimes repeatedly), never gpio_set_value.

Yeah, that's right, I was concerned about SATAPWR and MACPWR too, but they
work, for the very reason you mentioned.
But we should eventually eliminate their usage, together with
CONFIG_USB?_VBUS_PIN, as they are only used in U-Boot proper, where we can
rely on proper DT information now.

Cheers,
Andre

P.S.: I just picked the lowest hanging fruit, and removed
CONFIG_MMC?_CD_PIN, since we can ignore card detect in the same way the
BROM does.

  reply	other threads:[~2022-06-08  9:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-08  0:06 [PATCH] sunxi: usb: convert PHY GPIO functions to DM Andre Przywara
2022-06-08  2:07 ` Samuel Holland
2022-06-08  9:46   ` Andre Przywara [this message]
2022-06-08 13:14     ` Samuel Holland
2022-06-08 13:37       ` Andre Przywara
2022-06-08 10:30 ` Milan P. Stanić
2022-06-27  0:12 ` Andre Przywara

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=20220608104638.27ff5c3b@donnerap.cambridge.arm.com \
    --to=andre.przywara@arm.com \
    --cc=jagan@amarulasolutions.com \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=mps@arvanta.net \
    --cc=samuel@sholland.org \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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).