Re: [PATCH 01/12] bus: ti-sysc: Support 16-bit writes too

From: Tony Lindgren
Date: Tue May 28 2019 - 08:30:49 EST


* David Laight <David.Laight@xxxxxxxxxx> [190528 11:06]:
> From: Tony Lindgren
> > Sent: 27 May 2019 13:14
> > We need to also support 16-bit writes for i2c in addition to the reads
> > when we start configuring the sysconfig register for reset and idle modes.
> >
> > Signed-off-by: Tony Lindgren <tony@xxxxxxxxxxx>
> > ---
> > drivers/bus/ti-sysc.c | 7 +++++++
> > 1 file changed, 7 insertions(+)
> >
> > diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
> > --- a/drivers/bus/ti-sysc.c
> > +++ b/drivers/bus/ti-sysc.c
> > @@ -100,6 +100,13 @@ static void sysc_parse_dts_quirks(struct sysc *ddata, struct device_node *np,
> >
> > static void sysc_write(struct sysc *ddata, int offset, u32 value)
> > {
> > + if (ddata->cfg.quirks & SYSC_QUIRK_16BIT) {
> > + writew_relaxed(value & 0xffff, ddata->module_va + offset);
> > + writew_relaxed(value >> 16, ddata->module_va + offset + 4);
>
> Should that be + 2 ???

Well the stride for I2C revision registers is 4. But while checking
that again, I noticed that the other registers do not have HI and LO
registers and should just use a single 16-bit read and write. So far
it's harmless, but should be fixed.

Updated patch below.

Regards,

Tony

8< ----------------