[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YXZXjGG1qpHCgdHc@matsya>
Date: Mon, 25 Oct 2021 12:36:52 +0530
From: Vinod Koul <vkoul@...nel.org>
To: Peter Geis <pgwipeout@...il.com>
Cc: Yifeng Zhao <yifeng.zhao@...k-chips.com>,
Heiko Stuebner <heiko@...ech.de>,
Rob Herring <robh+dt@...nel.org>,
devicetree <devicetree@...r.kernel.org>,
Michael Riesch <michael.riesch@...fvision.net>,
"open list:ARM/Rockchip SoC..." <linux-rockchip@...ts.infradead.org>,
arm-mail-list <linux-arm-kernel@...ts.infradead.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-phy@...ts.infradead.org,
"Kishon Vijay Abraham, I" <kishon@...com>, p.zabel@...gutronix.de
Subject: Re: [PATCH v2 2/3] phy/rockchip: add naneng combo phy for RK3568
On 22-10-21, 07:26, Peter Geis wrote:
> On Fri, Oct 22, 2021 at 6:51 AM Vinod Koul <vkoul@...nel.org> wrote:
> > On 13-10-21, 18:19, Yifeng Zhao wrote:
> > > +#define RK3568_T22_PHYREG6 (0x6 << 2)
> > > +#define T22_PHYREG6_TX_RTERM_MASK GENMASK(7, 4)
> > > +#define T22_PHYREG6_TX_RTERM_SHIFT 4
> > > +#define T22_PHYREG6_TX_RTERM_50OHM 0x8
> > > +#define T22_PHYREG6_RX_RTERM_MASK GENMASK(3, 0)
> > > +#define T22_PHYREG6_RX_RTERM_SHIFT 0
> > > +#define T22_PHYREG6_RX_RTERM_44OHM 0xF
> > > +
> > > +#define RK3568_T22_PHYREG7 (0x7 << 2)
> >
> > Pls use GENMASK for these?
> >
> > > +#define T22_PHYREG7_SSC_EN BIT(4)
> > > +
> > > +#define RK3568_T22_PHYREG10 (0xA << 2)
> > > +#define T22_PHYREG10_SU_TRIM_0_7 0xF0
> > > +
> > > +#define RK3568_T22_PHYREG11 (0xB << 2)
> > > +#define T22_PHYREG11_PLL_LPF_ADJ 0x4
> > > +
> > > +#define RK3568_T22_PHYREG12 (0xC << 2)
> > > +#define T22_PHYREG12_RESISTER_MASK GENMASK(5, 4)
> > > +#define T22_PHYREG12_RESISTER_SHIFT 0x4
> >
> > bitfield.h has nice helpers which can extract/program values and avoid
> > one to define these shifts
>
> They aren't values, they are registers.
Yes!
> This is a remnant from the downstream driver's attempt at obfuscating
> the register it's touching.
> Please define these correctly.
The point of bitfield.h is one defines register bit fields using
BIT/GENMASK, no need to define SHIFT etc and use the helpers to
extract/program values and avoid defining these shifts etc!
--
~Vinod
Powered by blists - more mailing lists