Re: [RFC PATCH v2 2/3] phy: qcom-qmp-combo: Add config for SM6350

From: Johan Hovold
Date: Fri Nov 25 2022 - 05:24:39 EST


On Fri, Nov 25, 2022 at 11:14:53AM +0100, Luca Weiss wrote:
> Hi Johan,
>
> On Fri Nov 25, 2022 at 11:01 AM CET, Johan Hovold wrote:
> > On Fri, Nov 25, 2022 at 10:27:48AM +0100, Luca Weiss wrote:
> > > Add the tables and config for the combo phy found on SM6350.
> > >
> > > Signed-off-by: Luca Weiss <luca.weiss@xxxxxxxxxxxxx>
> > > ---
> > > @Johan Hovold, here I've added dp_txa & dp_txb, I believe otherwise
> > > qmp->dp_tx would be wrong. Is this different on sc8280xp or was this a
> > > mistake on your side? I think this should probably be split out to
> > > another patch to not mix things up too much.
> >
> > Yeah, that's a difference in sc8280xp which does not have dedicated TX
> > registers for DP.
>
> Good to know.
>
> >
> > This is probably best handled explicitly when parsing the DT by using
> > dp_txa/b if they are set and otherwise fallback to txa/txb (e.g.
> > instead of hiding it in the v5 table by using the same offset in two
> > places).
>
> Are you thinking about something like this?
>
> if (offs->dp_txa)
> qmp->dp_tx = base + offs->dp_txa
> else
> qmp->dp_tx = base + offs->txa;
>
> if (offs->dp_txb)
> qmp->dp_tx2 = base + offs->dp_txb;
> else
> qmp->dp_tx2 = base + offs->txb;
>
> This wouldn't handle ".dp_txa = 0x0000" but I don't think this should be
> a problem, right?

Yeah, that should be fine. I'd even merge the branches:

if (offs->dp_txa) {
qmp->dp_tx = base + offs->dp_txa;
qmp->dp_tx2 = base + offs->dp_txb;
} else {
qmp->dp_tx = base + offs->txa;
qmp->dp_tx2 = base + offs->txb;
}

Johan