All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: rajeevny@codeaurora.org
To: Doug Anderson <dianders@chromium.org>, Rob Herring <robh@kernel.org>
Cc: dri-devel <dri-devel@lists.freedesktop.org>,
	linux-arm-msm <linux-arm-msm@vger.kernel.org>,
	freedreno <freedreno@lists.freedesktop.org>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
	<devicetree@vger.kernel.org>, LKML <linux-kernel@vger.kernel.org>,
	Rob Clark <robdclark@gmail.com>,
	mkrishn@codeaurora.org, Kalyan Thota <kalyan_t@codeaurora.org>,
	"Kristian H. Kristensen" <hoegsberg@chromium.org>,
	Abhinav Kumar <abhinavk@codeaurora.org>,
	Sean Paul <seanpaul@chromium.org>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	Lyude Paul <lyude@redhat.com>,
	"Lankhorst, Maarten" <maarten.lankhorst@intel.com>
Subject: Re: [v3 1/2] dt-bindings: backlight: add DisplayPort aux backlight
Date: Fri, 30 Apr 2021 20:40:15 +0530	[thread overview]
Message-ID: <78c4bd291bd4a17ae2a1d02d0217de43@codeaurora.org> (raw)
In-Reply-To: <CAD=FV=V-kdySH5Pp-Fb-PRYk60Ha_UOTXJHcvMp+uV3P1oo7Uw@mail.gmail.com>

On 30-04-2021 02:33, Doug Anderson wrote:
> Hi,
> 
> On Thu, Apr 29, 2021 at 11:04 AM Rob Herring <robh@kernel.org> wrote:
>> 
>> On Mon, Apr 26, 2021 at 11:29:15AM +0530, Rajeev Nandan wrote:
>> > Add bindings for DisplayPort aux backlight driver.
>> >
>> > Changes in v2:
>> > - New
>> >
>> > Signed-off-by: Rajeev Nandan <rajeevny@codeaurora.org>
>> > ---
>> >  .../bindings/leds/backlight/dp-aux-backlight.yaml  | 49 ++++++++++++++++++++++
>> >  1 file changed, 49 insertions(+)
>> >  create mode 100644 Documentation/devicetree/bindings/leds/backlight/dp-aux-backlight.yaml
>> >
>> > diff --git a/Documentation/devicetree/bindings/leds/backlight/dp-aux-backlight.yaml b/Documentation/devicetree/bindings/leds/backlight/dp-aux-backlight.yaml
>> > new file mode 100644
>> > index 00000000..0fa8bf0
>> > --- /dev/null
>> > +++ b/Documentation/devicetree/bindings/leds/backlight/dp-aux-backlight.yaml
>> > @@ -0,0 +1,49 @@
>> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> > +%YAML 1.2
>> > +---
>> > +$id: http://devicetree.org/schemas/leds/backlight/dp-aux-backlight.yaml#
>> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> > +
>> > +title: DisplayPort aux backlight driver bindings
>> > +
>> > +maintainers:
>> > +  - Rajeev Nandan <rajeevny@codeaurora.org>
>> > +
>> > +description:
>> > +  Backlight driver to control the brightness over DisplayPort aux channel.
>> > +
>> > +allOf:
>> > +  - $ref: common.yaml#
>> > +
>> > +properties:
>> > +  compatible:
>> > +    const: dp-aux-backlight
>> > +
>> > +  ddc-i2c-bus:
>> > +    $ref: /schemas/types.yaml#/definitions/phandle
>> > +    description:
>> > +      A phandle to the system I2C controller connected to the DDC bus used
>> > +      for the DisplayPort AUX channel.
>> > +
>> > +  enable-gpios:
>> > +    maxItems: 1
>> > +    description: GPIO specifier for backlight enable pin.
>> > +
>> > +  max-brightness: true
>> > +
>> > +required:
>> > +  - compatible
>> > +  - ddc-i2c-bus
>> > +
>> > +additionalProperties: false
>> > +
>> > +examples:
>> > +  - |
>> > +    backlight {
>> > +        compatible = "dp-aux-backlight";
>> > +        ddc-i2c-bus = <&sn65dsi86_bridge>;
>> > +        enable-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>;
>> 
>> So the DDC bus is connected to a backlight and also a panel? This
>> binding is not reflecting the h/w, but rather what you want for some
>> driver.
>> 
>> There's only one thing here and that's an eDP panel which supports
>> backlight control via DP aux channel. You can figure all that out from
>> the panel's compatible and/or reading the EDID.
>> 
>> You might also be interested in this thread:
>> 
>> https://lore.kernel.org/lkml/YIKsDtjcIHGNvW0u@orome.fritz.box/
> 
> I think Rajeev needs to rework everything anyway as per:
> 
> https://lore.kernel.org/r/87zgxl5qar.fsf@intel.com
> 
> ...but you're right that it makes sense not to model the backlight as
> a separate node in the device tree. The panel driver can handle
> setting up the backlight.
> 
> -Doug

It was not a good idea to create a separate backlight driver and use
ddc-i2c-bus to get access to DP aux. I am working to move the code
to the panel driver and to utilize the new DRM helper functions
(drm_edp_backlight_*) Lyude has added [1].

To use these helper functions, the panel driver should have access to 
the
"struct drm_dp_aux *". The simple-panel has a "ddc-i2c-bus" property
to give the panel access to the DDC bus and is currently being used to
get the EDID from the panel. Can I use the same ddc bus i2c_adapter to 
get
the "struct drm_dp_aux *"?

As per the suggestion [2], I get the "struct drm_dp_aux *" from the
i2c_adapter of ddc bus (maybe I didn't understand the suggestion 
correctly),
and, it turned out, the way I have implemented is not the right way [3].
So, I am afraid to use the same method in the panel driver.


[1] https://lore.kernel.org/dri-devel/871rb5bcf9.fsf@intel.com/
[2] https://www.spinics.net/lists/dri-devel/msg295429.html
[3] 
https://lore.kernel.org/dri-devel/20210426111116.4lc3ekxjugjr3oho@maple.lan/

Thanks,
Rajeev

WARNING: multiple messages have this Message-ID (diff)
From: rajeevny@codeaurora.org
To: Doug Anderson <dianders@chromium.org>, Rob Herring <robh@kernel.org>
Cc: "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
	<devicetree@vger.kernel.org>,
	mkrishn@codeaurora.org,
	linux-arm-msm <linux-arm-msm@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Sean Paul <seanpaul@chromium.org>,
	Abhinav Kumar <abhinavk@codeaurora.org>,
	Kalyan Thota <kalyan_t@codeaurora.org>,
	"Kristian H. Kristensen" <hoegsberg@chromium.org>,
	freedreno <freedreno@lists.freedesktop.org>,
	"Lankhorst, Maarten" <maarten.lankhorst@intel.com>
Subject: Re: [v3 1/2] dt-bindings: backlight: add DisplayPort aux backlight
Date: Fri, 30 Apr 2021 20:40:15 +0530	[thread overview]
Message-ID: <78c4bd291bd4a17ae2a1d02d0217de43@codeaurora.org> (raw)
In-Reply-To: <CAD=FV=V-kdySH5Pp-Fb-PRYk60Ha_UOTXJHcvMp+uV3P1oo7Uw@mail.gmail.com>

On 30-04-2021 02:33, Doug Anderson wrote:
> Hi,
> 
> On Thu, Apr 29, 2021 at 11:04 AM Rob Herring <robh@kernel.org> wrote:
>> 
>> On Mon, Apr 26, 2021 at 11:29:15AM +0530, Rajeev Nandan wrote:
>> > Add bindings for DisplayPort aux backlight driver.
>> >
>> > Changes in v2:
>> > - New
>> >
>> > Signed-off-by: Rajeev Nandan <rajeevny@codeaurora.org>
>> > ---
>> >  .../bindings/leds/backlight/dp-aux-backlight.yaml  | 49 ++++++++++++++++++++++
>> >  1 file changed, 49 insertions(+)
>> >  create mode 100644 Documentation/devicetree/bindings/leds/backlight/dp-aux-backlight.yaml
>> >
>> > diff --git a/Documentation/devicetree/bindings/leds/backlight/dp-aux-backlight.yaml b/Documentation/devicetree/bindings/leds/backlight/dp-aux-backlight.yaml
>> > new file mode 100644
>> > index 00000000..0fa8bf0
>> > --- /dev/null
>> > +++ b/Documentation/devicetree/bindings/leds/backlight/dp-aux-backlight.yaml
>> > @@ -0,0 +1,49 @@
>> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> > +%YAML 1.2
>> > +---
>> > +$id: http://devicetree.org/schemas/leds/backlight/dp-aux-backlight.yaml#
>> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> > +
>> > +title: DisplayPort aux backlight driver bindings
>> > +
>> > +maintainers:
>> > +  - Rajeev Nandan <rajeevny@codeaurora.org>
>> > +
>> > +description:
>> > +  Backlight driver to control the brightness over DisplayPort aux channel.
>> > +
>> > +allOf:
>> > +  - $ref: common.yaml#
>> > +
>> > +properties:
>> > +  compatible:
>> > +    const: dp-aux-backlight
>> > +
>> > +  ddc-i2c-bus:
>> > +    $ref: /schemas/types.yaml#/definitions/phandle
>> > +    description:
>> > +      A phandle to the system I2C controller connected to the DDC bus used
>> > +      for the DisplayPort AUX channel.
>> > +
>> > +  enable-gpios:
>> > +    maxItems: 1
>> > +    description: GPIO specifier for backlight enable pin.
>> > +
>> > +  max-brightness: true
>> > +
>> > +required:
>> > +  - compatible
>> > +  - ddc-i2c-bus
>> > +
>> > +additionalProperties: false
>> > +
>> > +examples:
>> > +  - |
>> > +    backlight {
>> > +        compatible = "dp-aux-backlight";
>> > +        ddc-i2c-bus = <&sn65dsi86_bridge>;
>> > +        enable-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>;
>> 
>> So the DDC bus is connected to a backlight and also a panel? This
>> binding is not reflecting the h/w, but rather what you want for some
>> driver.
>> 
>> There's only one thing here and that's an eDP panel which supports
>> backlight control via DP aux channel. You can figure all that out from
>> the panel's compatible and/or reading the EDID.
>> 
>> You might also be interested in this thread:
>> 
>> https://lore.kernel.org/lkml/YIKsDtjcIHGNvW0u@orome.fritz.box/
> 
> I think Rajeev needs to rework everything anyway as per:
> 
> https://lore.kernel.org/r/87zgxl5qar.fsf@intel.com
> 
> ...but you're right that it makes sense not to model the backlight as
> a separate node in the device tree. The panel driver can handle
> setting up the backlight.
> 
> -Doug

It was not a good idea to create a separate backlight driver and use
ddc-i2c-bus to get access to DP aux. I am working to move the code
to the panel driver and to utilize the new DRM helper functions
(drm_edp_backlight_*) Lyude has added [1].

To use these helper functions, the panel driver should have access to 
the
"struct drm_dp_aux *". The simple-panel has a "ddc-i2c-bus" property
to give the panel access to the DDC bus and is currently being used to
get the EDID from the panel. Can I use the same ddc bus i2c_adapter to 
get
the "struct drm_dp_aux *"?

As per the suggestion [2], I get the "struct drm_dp_aux *" from the
i2c_adapter of ddc bus (maybe I didn't understand the suggestion 
correctly),
and, it turned out, the way I have implemented is not the right way [3].
So, I am afraid to use the same method in the panel driver.


[1] https://lore.kernel.org/dri-devel/871rb5bcf9.fsf@intel.com/
[2] https://www.spinics.net/lists/dri-devel/msg295429.html
[3] 
https://lore.kernel.org/dri-devel/20210426111116.4lc3ekxjugjr3oho@maple.lan/

Thanks,
Rajeev
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2021-04-30 15:10 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26  5:59 [v3 0/2] drm: Add support for backlight control of eDP panel on ti-sn65dsi86 bridge Rajeev Nandan
2021-04-26  5:59 ` Rajeev Nandan
2021-04-26  5:59 ` [v3 1/2] dt-bindings: backlight: add DisplayPort aux backlight Rajeev Nandan
2021-04-26  5:59   ` Rajeev Nandan
2021-04-26 21:04   ` Rob Herring
2021-04-26 21:04     ` Rob Herring
2021-04-29 18:04   ` Rob Herring
2021-04-29 18:04     ` Rob Herring
2021-04-29 21:03     ` Doug Anderson
2021-04-29 21:03       ` Doug Anderson
2021-04-30 15:10       ` rajeevny [this message]
2021-04-30 15:10         ` rajeevny
2021-04-30 21:38         ` Doug Anderson
2021-04-30 21:38           ` Doug Anderson
2021-05-11 18:11           ` rajeevny
2021-05-11 18:11             ` rajeevny
2021-05-11 22:33             ` Laurent Pinchart
2021-05-11 22:33               ` Laurent Pinchart
2021-05-11 23:17             ` Doug Anderson
2021-05-11 23:17               ` Doug Anderson
2021-05-17 20:21               ` Doug Anderson
2021-05-17 20:21                 ` Doug Anderson
2021-05-25  8:03                 ` rajeevny
2021-05-25  8:03                   ` rajeevny
2021-04-26  5:59 ` [v3 2/2] backlight: Add DisplayPort aux backlight driver Rajeev Nandan
2021-04-26  5:59   ` Rajeev Nandan
2021-04-26  9:49   ` Jani Nikula
2021-04-26  9:49     ` [Intel-gfx] " Jani Nikula
2021-04-26  9:49     ` Jani Nikula
2021-04-26 14:57     ` rajeevny
2021-04-26 14:57       ` [Intel-gfx] " rajeevny
2021-04-26 14:57       ` rajeevny
2021-04-30 18:48     ` Lyude Paul
2021-04-30 18:48       ` Lyude Paul
2021-04-30 18:48       ` [Intel-gfx] " Lyude Paul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=78c4bd291bd4a17ae2a1d02d0217de43@codeaurora.org \
    --to=rajeevny@codeaurora.org \
    --cc=abhinavk@codeaurora.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=hoegsberg@chromium.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=kalyan_t@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lyude@redhat.com \
    --cc=maarten.lankhorst@intel.com \
    --cc=mkrishn@codeaurora.org \
    --cc=robdclark@gmail.com \
    --cc=robh@kernel.org \
    --cc=seanpaul@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.