[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CA+zupgwX_zN-Mge01Ye1_J+rwy0yEQdww1+bPo8YFWnfx68n5Q@mail.gmail.com>
Date: Wed, 24 Dec 2025 16:33:21 -0800
From: Roy Luo <royluo@...gle.com>
To: Vinod Koul <vkoul@...nel.org>
Cc: Kishon Vijay Abraham I <kishon@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
Peter Griffin <peter.griffin@...aro.org>, André Draszik <andre.draszik@...aro.org>,
Tudor Ambarus <tudor.ambarus@...aro.org>, Philipp Zabel <p.zabel@...gutronix.de>,
Neil Armstrong <neil.armstrong@...aro.org>, Badhri Jagan Sridharan <badhri@...gle.com>,
Doug Anderson <dianders@...gle.com>, linux-phy@...ts.infradead.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-samsung-soc@...r.kernel.org,
Joy Chakraborty <joychakr@...gle.com>, Naveen Kumar <mnkumar@...gle.com>
Subject: Re: [PATCH v9 2/2] phy: Add Google Tensor SoC USB PHY driver
On Tue, Dec 23, 2025 at 9:30 PM Vinod Koul <vkoul@...nel.org> wrote:
>
> On 23-12-25, 09:53, Roy Luo wrote:
> > On Tue, Dec 23, 2025 at 6:04 AM Vinod Koul <vkoul@...nel.org> wrote:
> > >
> > > On 22-12-25, 21:31, Roy Luo wrote:
>
> > > > +struct google_usb_phy {
> > > > + struct device *dev;
> > > > + struct regmap *usb_cfg_regmap;
> > > > + unsigned int usb2_cfg_offset;
> > > > + void __iomem *usbdp_top_base;
> > > > + struct google_usb_phy_instance insts[GOOGLE_USB_PHY_NUM];
> > >
> > > so you have an array for one phy?
> >
> > While the current patch only supports usb2, I used an array
> > to simplify future support for usb3 and DP. I understand this
> > might seem like over-engineering for now, and we could
> > certainly wait to implement the array until the second phy
> > support is added. I’m happy to move away from array if
> > you’d prefer a simpler approach for this iteration.
>
> Rather than do array, allocate mem as probe based on how many phys will
> be there and use that. That would be a better approach than static
> allocation here
Make sense, will change it in the next version.
Thanks,
Roy
>
> > > > +static int google_usb2_phy_exit(struct phy *_phy)
> > > > +{
> > > > + struct google_usb_phy_instance *inst = phy_get_drvdata(_phy);
> > > > + struct google_usb_phy *gphy = to_google_usb_phy(inst);
> > > > + u32 reg;
> > > > +
> > > > + dev_dbg(gphy->dev, "exiting usb2 phy\n");
> > > > +
> > > > + guard(mutex)(&gphy->phy_mutex);
> > > > +
> > > > + regmap_read(gphy->usb_cfg_regmap, gphy->usb2_cfg_offset + USBCS_USB2PHY_CFG21_OFFSET, ®);
> > > > + reg &= ~USBCS_USB2PHY_CFG21_PHY_ENABLE;
> > > > + regmap_write(gphy->usb_cfg_regmap, gphy->usb2_cfg_offset + USBCS_USB2PHY_CFG21_OFFSET, reg);
> > > > +
> > > > + reset_control_bulk_assert(inst->num_rsts, inst->rsts);
> > > > + clk_bulk_disable_unprepare(inst->num_clks, inst->clks);
> > > > +
> > > > + return 0;
> > > > +}
> > > > +
> > > > +static const struct phy_ops google_usb2_phy_ops = {
> > > > + .init = google_usb2_phy_init,
> > > > + .exit = google_usb2_phy_exit,
> > > > +};
> > >
> > > Only two ops? I would expect more... No power_on/off or set_mode?
> > >
> > > --
> > > ~Vinod
> >
> > No, configuring usb2 phy is pretty straightforward. The hardware
> > does not distinguish between "initialized" and "powered on" states,
> > it also does not distinguish phy mode.
>
> ok
>
> --
> ~Vinod
Powered by blists - more mailing lists