[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210426111116.4lc3ekxjugjr3oho@maple.lan>
Date: Mon, 26 Apr 2021 12:11:16 +0100
From: Daniel Thompson <daniel.thompson@...aro.org>
To: Rajeev Nandan <rajeevny@...eaurora.org>
Cc: dri-devel@...ts.freedesktop.org, linux-arm-msm@...r.kernel.org,
freedreno@...ts.freedesktop.org, devicetree@...r.kernel.org,
mkrishn@...eaurora.org, linux-kernel@...r.kernel.org,
abhinavk@...eaurora.org, dianders@...omium.org,
seanpaul@...omium.org, kalyan_t@...eaurora.org,
hoegsberg@...omium.org, Lyude Paul <lyude@...hat.com>,
Jani Nikula <jani.nikula@...ux.intel.com>
Subject: Re: [v2 2/2] backlight: Add DisplayPort aux backlight driver
On Sat, Apr 24, 2021 at 03:25:04AM +0530, Rajeev Nandan wrote:
> Add backlight driver for the panels supporting backlight control
> using DPCD registers on the DisplayPort aux channel.
>
> Changes in v2:
> - New (most of the code reused from drm_dp_aux_backlight.c of v1)
Did you respond to Jani's feedback on the v1 posting (asking you to
coordinate with Lyude's work on refactoring the i915 eDP helpers[1])?
I can't find anything showing the outcome of that.
[1]: https://www.spinics.net/lists/dri-devel/msg295602.html
> +static struct drm_dp_aux *i2c_to_aux(struct i2c_adapter *i2c)
> +{
> + return container_of(i2c, struct drm_dp_aux, ddc);
> +}
[...]
> + np = of_parse_phandle(pdev->dev.of_node, "ddc-i2c-bus", 0);
> + if (!np) {
> + dev_err(&pdev->dev, "failed to get aux ddc I2C bus\n");
> + return -ENODEV;
> + }
> +
> + ddc = of_find_i2c_adapter_by_node(np);
> + of_node_put(np);
> + if (!ddc)
> + return -EPROBE_DEFER;
> +
> + aux_bl->aux = i2c_to_aux(ddc);
> + dev_dbg(&pdev->dev, "using dp aux %s\n", aux_bl->aux->name);
It looks like this code "just knows" that the I2C controller it has
looked up is a special one. That seems a little odd to me.
If we "just know" this then I'd hope that is could either be modelled
in the devicetree or that it would be possible for the backlight driver
to be registered (possibly using helpers) by whatever it is that is
setting up struct drm_dp_aux in the first place.
Daniel.
Powered by blists - more mailing lists