[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFBinCB1rrmJ5=M0tSGS_47BarFcrs2Kz5qFzrHw8+OEYxX3DA@mail.gmail.com>
Date: Fri, 18 Jun 2021 00:16:06 +0200
From: Martin Blumenstingl <martin.blumenstingl@...glemail.com>
To: Anand Moon <linux.amoon@...il.com>
Cc: Kishon Vijay Abraham I <kishon@...com>,
Vinod Koul <vkoul@...nel.org>,
Neil Armstrong <narmstrong@...libre.com>,
Kevin Hilman <khilman@...libre.com>,
Jerome Brunet <jbrunet@...libre.com>,
Philipp Zabel <p.zabel@...gutronix.de>,
linux-phy@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org,
linux-amlogic@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [RFCv1 4/8] phy: amlogic: meson8b-usb2: Use phy set_mode callback function
Hi Anand,
On Thu, Jun 17, 2021 at 9:43 PM Anand Moon <linux.amoon@...il.com> wrote:
>
> Reorder the code for phy set_mode in .set_mode callback function.
> For now configure the phy in host mode.
as mentioned in the cover-letter: to my knowledge these register bits
are "static"
The settings for dr_mode == USB_DR_MODE_HOST mainly apply to the
second PHY (usb1_phy)
[...]
> +static int phy_meson8b_usb2_setmode(struct phy *phy, enum phy_mode mode,
> + int submode)
> {
> struct phy_meson8b_usb2_priv *priv = phy_get_drvdata(phy);
> u32 reg;
>
> + switch (mode) {
> + case PHY_MODE_USB_HOST:
> + if (priv->match->host_enable_aca) {
> + regmap_update_bits(priv->regmap, REG_ADP_BC,
> + REG_ADP_BC_ACA_ENABLE,
> + REG_ADP_BC_ACA_ENABLE);
> +
> + udelay(ACA_ENABLE_COMPLETE_TIME);
> +
> + regmap_read(priv->regmap, REG_ADP_BC, ®);
> + if (reg & REG_ADP_BC_ACA_PIN_FLOAT) {
> + dev_warn(&phy->dev, "USB ID detect failed!\n");
> + return -EINVAL;
> + }
> + }
> + break;
> + default:
> + dev_warn(&phy->dev, "USB ID detect failed to setnode! %d\n", mode);
> + return -EINVAL;
I have tested this driver already with PHY_MODE_USB_DEVICE (on my
Odroid-C1) so I don't see why we should drop support for this
Also if we want runtime mode switching in this driver then we would
need to undo the changes from "case PHY_MODE_USB_HOST" above
I suggest dropping this patch until we know for sure if and which
registers need to be updated based on the DR mode.
Best regards,
Martin
Powered by blists - more mailing lists