linux-pwm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
	devicetree@vger.kernel.org,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	linux-pwm@vger.kernel.org,
	Joshua Henderson <joshua.henderson@microchip.com>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	dri-devel@lists.freedesktop.org,
	Boris Brezillon <boris.brezillon@bootlin.com>,
	Lee Jones <lee.jones@linaro.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC PATCH 0/7] add at91sam9 LCDC DRM driver
Date: Tue, 14 Aug 2018 16:42:52 -0600	[thread overview]
Message-ID: <20180814224252.GA20667@rob-hp-laptop> (raw)
In-Reply-To: <20180814164343.GA13848@ravnborg.org>

On Tue, Aug 14, 2018 at 06:43:43PM +0200, Sam Ravnborg wrote:
> Hi Rob.
> 
> > I don't know that 2 registers for a backlight PWM constitute an MFD. A 
> > single node can be both an LCD controller and a PWM.
> 
> Current suggestion from v1 patchset looks like this:
> 	lcdc0: lcdc@700000 {
> 		compatible = "atmel,at91sam9263-lcdc-mfd";
> 		reg = <0x700000 0x1000>;
> 		interrupts = <26 IRQ_TYPE_LEVEL_HIGH 3>;
> 		clocks = <&lcd_clk>, <&lcd_clk>;
> 		clock-names = "lcdc_clk", "hclk";
> 
> 		lcdc-display-controller {
> 			compatible = "atmel,lcdc-display-controller";
> 			lcd-supply = <&lcdc_reg>;
> 
> 			port@0 {
> 			};
> 		};
> 
> 		lcdc_pwm: lcdc-pwm {
> 			compatible = "atmel,lcdc-pwm";
> 			#pwm-cells = <3>;
> 		};
> 
> 	};
> 
>         backlight: backlight {
>                 compatible = "pwm-backlight";
>                 pwms = <&lcdc_pwm 0 50000 0>;
>         };
> 
> 
> We could have described the full binding in one file, rather than in
> three files like it is done in v1. But the structure was done so it matched
> what was done for hlcdc.
> 
> 
> If I understand the proposal from you correct an example binding would
> look like this:
> 
>        lcdc0: lcdc@700000 {
>                 compatible = "atmel,at91sam9263-lcdc";
>                 reg = <0x700000 0x1000>;
>                 interrupts = <26 IRQ_TYPE_LEVEL_HIGH 3>;
>                 clocks = <&lcd_clk>, <&lcd_clk>;
>                 clock-names = "lcdc_clk", "hclk";
> 
>                 lcd-supply = <&lcdc_reg>;
> 
>                 port@0 {
>                 };
> 
>                 #pwm-cells = <3>;
>         };
> 
>         backlight: backlight {
>                 compatible = "pwm-backlight";
>                 pwms = <&lcd0 0 50000 0>;
>         };
> 
> 
> This is doable, but IMO it is less obvious that the LCDC IP core implements
> two different features - a PWM and a LCD controller.

Features don't equate to nodes. If the sub-blocks can be separately 
instantiated or have their own resources then sub-nodes make sense. 
Otherwise, it's a single device (node) with multiple providers.

> Right now the preference is to stay with the v1 approach:
> - It is a mirror of what we do today for hlcdc, so no suprises

Which BTW doesn't appear to have actually been reviewed.

Do these IP blocks actually share anything? 

Consistency is nice, but keeping compatibility with the existing binding 
by extending things in a backwards compatible way is more important. 
Implementing a new driver is not license to change the binding. Shall I 
let u-boot or *BSD developers change the binding too for their driver?

> - It shows in a nice way that the LCDC IP core implments both an LCD controller and a PWM
> - The pwm functionality is not hiddin inside the lcdc stuff, and it is thus
>   simpler to add good pin-ctrl handles with nice names that matches the usage.
>   (I could always add more pin-ctrl, but it is common to refer to a single pin-ctrl.

Does anyone actually use this for a non-backlight PWM? I'm not sure the 
abstraction is worth it. The driver could just register itself as a 
backlight provider rather than a PWM provider.

> One DT related Q:
> The LCD Controller supports BGR565, but as this is less common some HW implmentations
> exchange R and B, expessed in the old binding as wiring-mode like this:
> 
> 	atmel,lcd-wiring-mode: lcd wiring mode "RGB" or "BRG"
> 
> How can we express this wiring-mode in a generic way, both in DT and in code?
> Is it something that in DRM belongs to the panel, the encoder, the connector, or?
> And can any of the exisitng flags be used?

I thought we had come up with a common definition, but I guess it didn't 
make it upstream. It's definitely needed and I've been rejecting 
anything new that's vendor specific.

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

  reply	other threads:[~2018-08-14 22:42 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-12 18:41 [RFC PATCH 0/7] add at91sam9 LCDC DRM driver Sam Ravnborg
2018-08-12 18:46 ` [PATCH v1 1/7] atmel-hlcdc: renamed directory to drm/atmel/ Sam Ravnborg
2018-08-14  8:39   ` Daniel Vetter
2018-08-14 16:19     ` Sam Ravnborg
2018-08-16  7:41       ` Daniel Vetter
2018-08-22 20:09         ` Sam Ravnborg
2018-08-22 20:22           ` Daniel Vetter
2018-08-24  8:28   ` Boris Brezillon
2018-08-24 15:43     ` Sam Ravnborg
2018-08-12 18:46 ` [PATCH v1 2/7] dt-binding: add bindings for Atmel LCDC mfd Sam Ravnborg
2018-08-24  8:45   ` Boris Brezillon
2018-08-24 15:58     ` Sam Ravnborg
2018-08-12 18:46 ` [PATCH v1 3/7] mfd: add atmel-lcdc driver Sam Ravnborg
2018-08-14 11:09   ` kbuild test robot
2018-08-15  5:24   ` Lee Jones
2018-08-15 20:40     ` Sam Ravnborg
2018-08-16  8:28       ` Nicolas Ferre
2018-08-16  8:42         ` Lee Jones
2018-08-24  8:37         ` Boris Brezillon
2018-08-24  8:15     ` Boris Brezillon
2018-08-24 10:58       ` Lee Jones
2018-08-15  8:11   ` kbuild test robot
2018-08-24  8:48   ` Boris Brezillon
2018-08-12 18:46 ` [PATCH v1 4/7] dt-bindings: add bindings for Atmel LCDC pwm Sam Ravnborg
2018-08-12 18:46 ` [PATCH v1 5/7] pwm: add pwm-atmel-lcdc driver Sam Ravnborg
2018-08-12 18:46 ` [PATCH v1 6/7] dt-bindings: add bindings for Atmel lcdc-display-controller Sam Ravnborg
2018-08-12 18:46 ` [PATCH v1 7/7] drm: add Atmel LCDC display controller support Sam Ravnborg
2018-08-24 12:31   ` Boris Brezillon
2018-08-26 18:41     ` Sam Ravnborg
2018-08-26 14:28   ` Noralf Trønnes
2018-08-26 14:58     ` Sam Ravnborg
2018-08-12 19:55 ` [RFC PATCH 0/7] add at91sam9 LCDC DRM driver Sam Ravnborg
2018-08-13 14:47   ` Nicolas Ferre
2018-08-14  8:41     ` Daniel Vetter
2018-08-22 20:12       ` Sam Ravnborg
2018-08-23  6:16         ` Daniel Vetter
2018-08-13 15:54 ` Nicolas Ferre
2018-08-13 18:18   ` Sam Ravnborg
2018-08-13 22:04     ` Rob Herring
2018-08-14 16:43       ` Sam Ravnborg
2018-08-14 22:42         ` Rob Herring [this message]
2018-08-15  4:48           ` Sam Ravnborg
2018-08-15 14:45             ` Rob Herring
2018-08-15 15:04               ` Daniel Vetter
2018-08-15 15:41                 ` Peter Rosin
2018-08-15 20:48                   ` Sam Ravnborg
2018-08-14 14:36     ` Alexandre Belloni
2018-08-14 16:16       ` Sam Ravnborg
2018-08-24  8:22 ` Boris Brezillon
2018-08-24 15:52   ` Sam Ravnborg

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=20180814224252.GA20667@rob-hp-laptop \
    --to=robh@kernel.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=boris.brezillon@bootlin.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=joshua.henderson@microchip.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=nicolas.ferre@microchip.com \
    --cc=sam@ravnborg.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).