[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230814083503.GA3490@varda-linux.qualcomm.com>
Date: Mon, 14 Aug 2023 14:05:04 +0530
From: Varadarajan Narayanan <quic_varada@...cinc.com>
To: Vinod Koul <vkoul@...nel.org>
CC: <agross@...nel.org>, <andersson@...nel.org>,
<konrad.dybcio@...aro.org>, <kishon@...nel.org>,
<robh+dt@...nel.org>, <krzysztof.kozlowski+dt@...aro.org>,
<conor+dt@...nel.org>, <catalin.marinas@....com>,
<will@...nel.org>, <p.zabel@...gutronix.de>, <arnd@...db.de>,
<geert+renesas@...der.be>, <nfraprado@...labora.com>,
<rafal@...ecki.pl>, <peng.fan@....com>,
<quic_srichara@...cinc.com>, <linux-arm-msm@...r.kernel.org>,
<linux-phy@...ts.infradead.org>, <devicetree@...r.kernel.org>,
<linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH v7 2/5] phy: qcom-m31: Introduce qcom,m31 USB phy driver
On Fri, Aug 11, 2023 at 09:30:05AM +0100, Vinod Koul wrote:
> On 10-08-23, 15:26, Varadarajan Narayanan wrote:
> > Add the M31 USB2 phy driver.
> .
> .
> .
> > +#include <linux/kernel.h>
> > +#include <linux/module.h>
> > +#include <linux/of_platform.h>
> > +#include <linux/of.h>
>
> do you need both headers..?
>
> .
> .
> .
> > + #define FREQ_24MHZ (GENMASK(6, 6) | GENMASK(4, 4))
>
> why not use bit :-)
> .
> .
> .
> > +struct m31_phy_regs m31_ipq5332_regs[] = {
> > + { USB_PHY_CFG0, UTMI_PHY_OVERRIDE_EN, 0 },
> > + { USB_PHY_UTMI_CTRL5, POR_EN, 15 },
> > + { USB_PHY_FSEL_SEL, FREQ_SEL, 0 },
> > + { USB_PHY_HS_PHY_CTRL_COMMON0, COMMONONN | FREQ_24MHZ | RETENABLEN, 0 },
> > + { USB_PHY_UTMI_CTRL5, POR_EN, 0 },
> > + { USB_PHY_HS_PHY_CTRL2, USB2_SUSPEND_N_SEL | USB2_SUSPEND_N | USB2_UTMI_CLK_EN, 0 },
> > + { USB2PHY_USB_PHY_M31_XCFGI_11, XCFG_COARSE_TUNE_NUM | XCFG_FINE_TUNE_NUM, 0 },
> > + { USB2PHY_USB_PHY_M31_XCFGI_4, HSTX_SLEW_RATE_565PS | PLL_CHARGING_PUMP_CURRENT_35UA |
> > + ODT_VALUE_38_02_OHM, 0 },
> > + { USB2PHY_USB_PHY_M31_XCFGI_1, USB2_0_TX_ENABLE, 0 },
> > + { USB2PHY_USB_PHY_M31_XCFGI_5, ODT_VALUE_45_02_OHM | HSTX_PRE_EMPHASIS_LEVEL_0_55MA, 4 },
> > + { USB_PHY_UTMI_CTRL5, 0x0, 0 },
> > + { USB_PHY_HS_PHY_CTRL2, USB2_SUSPEND_N | USB2_UTMI_CLK_EN, 0 },
>
> More readable way to code
> USB_PHY_CFG0,
> UTMI_PHY_OVERRIDE_EN,
> 0
>
> and so on, makes a better read and check for errors, one line for off,
> one for val and one for delay
>
> --
> `~Vinod
Have posted a new version addressing these (and Konrad's and Bjorn's) issues.
Please review.
Thanks
Varada
Powered by blists - more mailing lists