[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 05 May 2020 12:52:58 -0700
From: Stephen Boyd <swboyd@...omium.org>
To: Doug Anderson <dianders@...omium.org>
Cc: Andrzej Hajda <a.hajda@...sung.com>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Neil Armstrong <narmstrong@...libre.com>,
Rob Clark <robdclark@...omium.org>,
Sean Paul <seanpaul@...omium.org>,
linux-arm-msm <linux-arm-msm@...r.kernel.org>,
Daniel Vetter <daniel@...ll.ch>,
David Airlie <airlied@...ux.ie>,
Jernej Skrabec <jernej.skrabec@...l.net>,
Jonas Karlman <jonas@...boo.se>,
dri-devel <dri-devel@...ts.freedesktop.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drm/bridge: ti-sn65dsi86: Implement lane reordering + polarity
Quoting Doug Anderson (2020-05-05 11:45:05)
> On Mon, May 4, 2020 at 10:44 PM Stephen Boyd <swboyd@...omium.org> wrote:
> >
> > Quoting Douglas Anderson (2020-05-04 21:36:31)
> > > regmap_update_bits(pdata->regmap, SN_DSI_LANES_REG,
> > > CHA_DSI_LANES_MASK, val);
> > >
> > > + regmap_write(pdata->regmap, SN_LN_ASSIGN_REG, pdata->ln_assign);
> > > + regmap_update_bits(pdata->regmap, SN_ENH_FRAME_REG, LN_POLRS_MASK,
> > > + pdata->ln_polrs << LN_POLRS_OFFSET);
> > > +
> > > /* set dsi clk frequency value */
> > > ti_sn_bridge_set_dsi_rate(pdata);
> > >
> > > @@ -1063,6 +1066,50 @@ static int ti_sn_setup_gpio_controller(struct ti_sn_bridge *pdata)
> > > return ret;
> > > }
> > >
> > > +static void ti_sn_bridge_parse_lanes(struct ti_sn_bridge *pdata,
> > > + struct device_node *np)
> > > +{
> > > + u32 lane_assignments[SN_MAX_DP_LANES] = { 0, 1, 2, 3 };
> > > + u32 lane_polarities[SN_MAX_DP_LANES] = { };
> > > + struct device_node *endpoint;
> > > + u8 ln_assign = 0;
> > > + u8 ln_polrs = 0;
> >
> > Do we need to assign to 0 to start? Seems like no?
>
> Yes. See usage:
>
> ln_assign = ln_assign << LN_ASSIGN_WIDTH | lane_assignments[i];
> ln_polrs = ln_polrs << 1 | lane_polarities[i];
>
> Notably each time we shift a new bit in we base on the old value. If
> you think it'll make it clearer, I can put this initialization at the
> beginning of the loop. It's 2 extra lines of code but if it adds
> clarity I'll do it.
No it doesn't really make it any clearer.
Powered by blists - more mailing lists