devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/12] Renesas R-Car DU HDMI support
@ 2014-09-24 20:04 Laurent Pinchart
  2014-09-24 20:04 ` [PATCH 10/12] video: Add ADV751[13] DT bindings documentation Laurent Pinchart
  2014-09-25 13:09 ` [PATCH 00/12] Renesas R-Car DU HDMI support Philipp Zabel
  0 siblings, 2 replies; 8+ messages in thread
From: Laurent Pinchart @ 2014-09-24 20:04 UTC (permalink / raw)
  To: dri-devel; +Cc: devicetree, linux-sh

Hello,

This patch set adds support for the HDMI output port present on the Renesas
Koelsch board. Doing so requires two components, a driver for the external
ADV7511W HDMI encoder, and support for HDMI encoders in the DU driver.

The HDMI encoder drivers uses the DRM slave encoder framework and the
component framework to communicate with the DU driver. The DT bindings are
based on the OF graph bindings to link the display controller and encoder.

The first two patches have been taken from Philipp Zabel's "[PATCH v3 0/8]
Add of-graph helpers to loop over endpoints and find ports by id" series.
Philipp, I don't see that series in linux-next, what's the merge status ?

The R-Car DU patches start with a bit of refactoring, to finally add HDMI
support in patch 08/12.

The new adv7511 driver (patch 11/12) depends on decoupling EDID parsing from
the DDC I2C adapter (patch 09/12). It supports DT instantiation only (bindings
are documented in patch 10/12) for now. Platform data support could be added
later if needed. The code is based on Lars-Peter Clausen's adv7511 driver,
with heavy modifications.

The last patch instantiates the HDMI encoder in the Koelsch board DT file and
connects it to the DU output.

The patch series depends on R-Car DU DT support (scheduled for merge in
v3.18-rc1) and on Koelsch DU DT enablement (hopefully scheduled for merge in
v3.19-rc1). For ease of testing and review I've pushed this series and its
dependencies to a git branch on

	git://linuxtv.org/pinchartl/fbdev.git drm/du/adv7511

Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: devicetree@vger.kernel.org

Lars-Peter Clausen (2):
  drm: Decouple EDID parsing from I2C adapter
  drm: Add adv7511 encoder driver

Laurent Pinchart (8):
  drm: rcar-du: Remove platform data support
  drm: rcar-du: Use for_each_endpoint_of_node()
  drm: rcar-du: Pass the encoder DT node to rcar_du_encoder_init()
  drm: rcar-du: Replace direct DRM encoder access with cast macro
  drm: rcar-du: Replace drm_encoder with drm_slave_encoder
  drm: rcar-du: Add HDMI encoder and connector support
  video: Add ADV751[13] DT bindings documentation
  ARM: shmobile: koelsch: Add DU HDMI output support

Philipp Zabel (2):
  of: Decrement refcount of previous endpoint in
    of_graph_get_next_endpoint
  of: Add for_each_endpoint_of_node helper macro

 .../devicetree/bindings/video/adi,adv7511.txt      |   87 ++
 arch/arm/boot/dts/r8a7791-koelsch.dts              |   50 +-
 drivers/gpu/drm/drm_edid.c                         |   26 +-
 drivers/gpu/drm/i2c/Kconfig                        |    6 +
 drivers/gpu/drm/i2c/Makefile                       |    2 +
 drivers/gpu/drm/i2c/adv7511.c                      | 1007 ++++++++++++++++++++
 drivers/gpu/drm/i2c/adv7511.h                      |  289 ++++++
 drivers/gpu/drm/rcar-du/Kconfig                    |   11 +-
 drivers/gpu/drm/rcar-du/Makefile                   |    2 +
 drivers/gpu/drm/rcar-du/rcar_du_crtc.h             |   10 +-
 drivers/gpu/drm/rcar-du/rcar_du_drv.c              |    4 +-
 drivers/gpu/drm/rcar-du/rcar_du_drv.h              |    2 -
 drivers/gpu/drm/rcar-du/rcar_du_encoder.c          |   45 +-
 drivers/gpu/drm/rcar-du/rcar_du_encoder.h          |   23 +-
 drivers/gpu/drm/rcar-du/rcar_du_hdmicon.c          |  118 +++
 drivers/gpu/drm/rcar-du/rcar_du_hdmicon.h          |   31 +
 drivers/gpu/drm/rcar-du/rcar_du_hdmienc.c          |  151 +++
 drivers/gpu/drm/rcar-du/rcar_du_hdmienc.h          |   35 +
 drivers/gpu/drm/rcar-du/rcar_du_kms.c              |   65 +-
 drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c          |   31 +-
 drivers/gpu/drm/rcar-du/rcar_du_lvdscon.h          |    2 -
 drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.h          |    1 -
 drivers/gpu/drm/rcar-du/rcar_du_vgacon.c           |    5 +-
 drivers/of/base.c                                  |    9 +-
 include/drm/drm_edid.h                             |    4 +
 include/linux/of_graph.h                           |   11 +
 include/linux/platform_data/rcar-du.h              |   74 --
 27 files changed, 1902 insertions(+), 199 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/video/adi,adv7511.txt
 create mode 100644 drivers/gpu/drm/i2c/adv7511.c
 create mode 100644 drivers/gpu/drm/i2c/adv7511.h
 create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_hdmicon.c
 create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_hdmicon.h
 create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_hdmienc.c
 create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_hdmienc.h
 delete mode 100644 include/linux/platform_data/rcar-du.h

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 10/12] video: Add ADV751[13] DT bindings documentation
  2014-09-24 20:04 [PATCH 00/12] Renesas R-Car DU HDMI support Laurent Pinchart
@ 2014-09-24 20:04 ` Laurent Pinchart
  2014-09-25  7:06   ` Geert Uytterhoeven
  2014-09-25 13:09 ` [PATCH 00/12] Renesas R-Car DU HDMI support Philipp Zabel
  1 sibling, 1 reply; 8+ messages in thread
From: Laurent Pinchart @ 2014-09-24 20:04 UTC (permalink / raw)
  To: dri-devel; +Cc: devicetree, linux-sh

The ADV7511, ADV7511W and ADV7513 are HDMI audio and video transmitters
compatible with HDMI 1.4 and DVI 1.0. They're described in DT using the
OF graph bindings and a list of custom properties pertaining to the
input video bus configuration.

Cc: devicetree@vger.kernel.org
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 .../devicetree/bindings/video/adi,adv7511.txt      | 87 ++++++++++++++++++++++
 1 file changed, 87 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/adi,adv7511.txt

diff --git a/Documentation/devicetree/bindings/video/adi,adv7511.txt b/Documentation/devicetree/bindings/video/adi,adv7511.txt
new file mode 100644
index 0000000..aa41d9a
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/adi,adv7511.txt
@@ -0,0 +1,87 @@
+Analog Device ADV7511(W)/13 HDMI Encoders
+-----------------------------------------
+
+The ADV7511, ADV7511W and ADV7513 are HDMI audio and video transmitters
+compatible with HDMI 1.4 and DVI 1.0. They support color space conversion,
+S/PDIF, CEC and HDCP.
+
+Required properties:
+
+- compatible: Should be one of "adi,adv7511", "adi,adv7511w" or "adi,adv7513"
+- reg: I2C slave address
+
+The ADV7511 supports a large number of input data formats that differ by their
+color depth, color format, clock mode, bit justification and random
+arrangement of components on the data bus. The combination of the following
+properties describe the input and map directly to the video input tables of the
+ADV7511 datasheet that document all the supported combinations.
+
+- adi,input-depth: Number of bits per color component at the input (8, 10 or
+  12).
+- adi,input-colorspace: The input color space, one of "rgb", "yuv422" or
+  "yuv444".
+- adi,input-clock: The input clock type, one of "1x" (one clock cycle per
+  pixel), "2x" (two clock cycles per pixel), "ddr" (one clock cycle per pixel,
+  data driven on both edges).
+
+The following input format properties are required except in "rgb 1x" and
+"yuv444 1x" modes, in which case they must not be specified.
+
+- adi,input-style: The input components arrangement variant (1, 2 or 3).
+- adi,input-justification: The input bit justification ("left", "evenly",
+  "right").
+
+Optional properties:
+
+- interrupts: Specifier for the ADV7511 interrupt
+- pd-gpios: Specifier for the GPIO connected to the power down signal
+
+- adi,clock-delay: Video data clock delay relative to the pixel clock, in ps
+  (-1200 ps .. 1600 ps). Defaults to no delay.
+- adi,embedded-sync: The input uses synchronization signals embedded in the
+  data stream (similar to BT.656). Defaults to separate H/V synchronization
+  signals.
+
+Required nodes:
+
+The ADV7511 has two video ports. Their connections are modeled using the OF
+graph bindings specified in Documentation/devicetree/bindings/graph.txt.
+
+- Video port 0 for the RGB or YUV input
+- Video port 1 for the HDMI output
+
+
+Example
+-------
+
+	adv7511w: hdmi@39 {
+		compatible = "adi,adv7511w";
+		reg = <39>;
+		interrupt-parent = <&gpio3>;
+		interrupts = <29 IRQ_TYPE_EDGE_FALLING>;
+
+		adi,input-depth = <8>;
+		adi,input-colorspace = "rgb";
+		adi,input-clock = "1x";
+		adi,input-style = <1>;
+		adi,input-justification = "evenly";
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+				adv7511w_in: endpoint {
+					remote-endpoint = <&dpi_out>;
+				};
+			};
+
+			port@1 {
+				reg = <1>;
+				adv7511_out: endpoint {
+					remote-endpoint = <&hdmi_connector_in>;
+				};
+			};
+		};
+	};
-- 
1.8.5.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 10/12] video: Add ADV751[13] DT bindings documentation
  2014-09-24 20:04 ` [PATCH 10/12] video: Add ADV751[13] DT bindings documentation Laurent Pinchart
@ 2014-09-25  7:06   ` Geert Uytterhoeven
  2014-09-25  9:57     ` Laurent Pinchart
  0 siblings, 1 reply; 8+ messages in thread
From: Geert Uytterhoeven @ 2014-09-25  7:06 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: devicetree@vger.kernel.org, DRI Development, Linux-sh list

Hi Laurent,

On Wed, Sep 24, 2014 at 10:04 PM, Laurent Pinchart
<laurent.pinchart+renesas@ideasonboard.com> wrote:
> +- adi,input-style: The input components arrangement variant (1, 2 or 3).

What's the meaning of the numerical values 1, 2, and 3?

I found this code in "[PATCH 11/12] drm: Add adv7511 encoder driver":

+       input_style = config->input_style == 1 ? 2
+                   : (config->input_style == 2 ? 1 : 3);

which didn't really help much ;-)

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 10/12] video: Add ADV751[13] DT bindings documentation
  2014-09-25  7:06   ` Geert Uytterhoeven
@ 2014-09-25  9:57     ` Laurent Pinchart
  2014-09-25 10:10       ` Geert Uytterhoeven
  0 siblings, 1 reply; 8+ messages in thread
From: Laurent Pinchart @ 2014-09-25  9:57 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: devicetree@vger.kernel.org, Laurent Pinchart, DRI Development,
	Linux-sh list

Hi Geert,

On Thursday 25 September 2014 09:06:46 Geert Uytterhoeven wrote:
> Hi Laurent,
> 
> On Wed, Sep 24, 2014 at 10:04 PM, Laurent Pinchart
> 
> <laurent.pinchart+renesas@ideasonboard.com> wrote:
> > +- adi,input-style: The input components arrangement variant (1, 2 or 3).
> 
> What's the meaning of the numerical values 1, 2, and 3?
> 
> I found this code in "[PATCH 11/12] drm: Add adv7511 encoder driver":
> 
> +       input_style = config->input_style == 1 ? 2
> +                   : (config->input_style == 2 ? 1 : 3);
> 
> which didn't really help much ;-)

:-)

The ADV751[13]W? datasheets document all the supported input formats. They're 
split in categories, each of them having multiple variants called styles. The 
styles are just numbered 1, 2 and 3 in the tables that describe the formats, 
and there's a register field used to select a style. For some reason style 1 
maps to register value 2, style 2 to register value 1, and style 3 to register 
value 3. Go figure...

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 10/12] video: Add ADV751[13] DT bindings documentation
  2014-09-25  9:57     ` Laurent Pinchart
@ 2014-09-25 10:10       ` Geert Uytterhoeven
  2014-09-26 12:30         ` Laurent Pinchart
  0 siblings, 1 reply; 8+ messages in thread
From: Geert Uytterhoeven @ 2014-09-25 10:10 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Laurent Pinchart, DRI Development, Linux-sh list,
	devicetree@vger.kernel.org

Hi Laurent,

On Thu, Sep 25, 2014 at 11:57 AM, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> On Thursday 25 September 2014 09:06:46 Geert Uytterhoeven wrote:
>> On Wed, Sep 24, 2014 at 10:04 PM, Laurent Pinchart
>> <laurent.pinchart+renesas@ideasonboard.com> wrote:
>> > +- adi,input-style: The input components arrangement variant (1, 2 or 3).
>>
>> What's the meaning of the numerical values 1, 2, and 3?
>>
>> I found this code in "[PATCH 11/12] drm: Add adv7511 encoder driver":
>>
>> +       input_style = config->input_style == 1 ? 2
>> +                   : (config->input_style == 2 ? 1 : 3);
>>
>> which didn't really help much ;-)
>
> :-)
>
> The ADV751[13]W? datasheets document all the supported input formats. They're
> split in categories, each of them having multiple variants called styles. The
> styles are just numbered 1, 2 and 3 in the tables that describe the formats,
> and there's a register field used to select a style. For some reason style 1
> maps to register value 2, style 2 to register value 1, and style 3 to register
> value 3. Go figure...

Thanks, that explains it.

Then I suggest to reflect this in the binding:

    - adi,input-style: The input components arrangement variant (1, 2 or 3),
           as listed in the datasheet.

and in the code, e.g. by translating the values using a mapping array?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 00/12] Renesas R-Car DU HDMI support
  2014-09-24 20:04 [PATCH 00/12] Renesas R-Car DU HDMI support Laurent Pinchart
  2014-09-24 20:04 ` [PATCH 10/12] video: Add ADV751[13] DT bindings documentation Laurent Pinchart
@ 2014-09-25 13:09 ` Philipp Zabel
  2014-09-26 11:35   ` Laurent Pinchart
  1 sibling, 1 reply; 8+ messages in thread
From: Philipp Zabel @ 2014-09-25 13:09 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: devicetree, dri-devel, linux-sh

Hi Laurent,

Am Mittwoch, den 24.09.2014, 23:04 +0300 schrieb Laurent Pinchart:
> Hello,
> 
> This patch set adds support for the HDMI output port present on the Renesas
> Koelsch board. Doing so requires two components, a driver for the external
> ADV7511W HDMI encoder, and support for HDMI encoders in the DU driver.
> 
> The HDMI encoder drivers uses the DRM slave encoder framework and the
> component framework to communicate with the DU driver. The DT bindings are
> based on the OF graph bindings to link the display controller and encoder.
> 
> The first two patches have been taken from Philipp Zabel's "[PATCH v3 0/8]
> Add of-graph helpers to loop over endpoints and find ports by id" series.
> Philipp, I don't see that series in linux-next, what's the merge status ?

There is a remaining comment by Guennadi on the soc_camera patch.

regards
Philipp

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 00/12] Renesas R-Car DU HDMI support
  2014-09-25 13:09 ` [PATCH 00/12] Renesas R-Car DU HDMI support Philipp Zabel
@ 2014-09-26 11:35   ` Laurent Pinchart
  0 siblings, 0 replies; 8+ messages in thread
From: Laurent Pinchart @ 2014-09-26 11:35 UTC (permalink / raw)
  To: Philipp Zabel; +Cc: Laurent Pinchart, dri-devel, linux-sh, devicetree

Hi Philipp,

On Thursday 25 September 2014 15:09:13 Philipp Zabel wrote:
> Am Mittwoch, den 24.09.2014, 23:04 +0300 schrieb Laurent Pinchart:
> > Hello,
> > 
> > This patch set adds support for the HDMI output port present on the
> > Renesas Koelsch board. Doing so requires two components, a driver for the
> > external ADV7511W HDMI encoder, and support for HDMI encoders in the DU
> > driver.
> > 
> > The HDMI encoder drivers uses the DRM slave encoder framework and the
> > component framework to communicate with the DU driver. The DT bindings are
> > based on the OF graph bindings to link the display controller and encoder.
> > 
> > The first two patches have been taken from Philipp Zabel's "[PATCH v3 0/8]
> > Add of-graph helpers to loop over endpoints and find ports by id" series.
> > Philipp, I don't see that series in linux-next, what's the merge status ?
> 
> There is a remaining comment by Guennadi on the soc_camera patch.

I've seen that, it shouldn't be too hard to sort out.

I'll probably drop the dependency for now and implement a manual loop in the 
rcar-du-drm driver for now, and switch to your helpers when this series hit 
mainling. Which tree do you plan to send it through ?

-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 10/12] video: Add ADV751[13] DT bindings documentation
  2014-09-25 10:10       ` Geert Uytterhoeven
@ 2014-09-26 12:30         ` Laurent Pinchart
  0 siblings, 0 replies; 8+ messages in thread
From: Laurent Pinchart @ 2014-09-26 12:30 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: devicetree@vger.kernel.org, Laurent Pinchart, DRI Development,
	Linux-sh list

Hi Geert,

On Thursday 25 September 2014 12:10:59 Geert Uytterhoeven wrote:
> On Thu, Sep 25, 2014 at 11:57 AM, Laurent Pinchart wrote:
> > On Thursday 25 September 2014 09:06:46 Geert Uytterhoeven wrote:
> >> On Wed, Sep 24, 2014 at 10:04 PM, Laurent Pinchart
> >> 
> >> <laurent.pinchart+renesas@ideasonboard.com> wrote:
> >> > +- adi,input-style: The input components arrangement variant (1, 2 or
> >> > 3).
> >> 
> >> What's the meaning of the numerical values 1, 2, and 3?
> >> 
> >> I found this code in "[PATCH 11/12] drm: Add adv7511 encoder driver":
> >> 
> >> +       input_style = config->input_style == 1 ? 2
> >> +                   : (config->input_style == 2 ? 1 : 3);
> >> 
> >> which didn't really help much ;-)
> >> 
> > :-)
> > 
> > The ADV751[13]W? datasheets document all the supported input formats.
> > They're split in categories, each of them having multiple variants called
> > styles. The styles are just numbered 1, 2 and 3 in the tables that
> > describe the formats, and there's a register field used to select a
> > style. For some reason style 1 maps to register value 2, style 2 to
> > register value 1, and style 3 to register value 3. Go figure...
> 
> Thanks, that explains it.
> 
> Then I suggest to reflect this in the binding:
> 
>     - adi,input-style: The input components arrangement variant (1, 2 or 3),
> as listed in the datasheet.
> 
> and in the code, e.g. by translating the values using a mapping array?

I'll document the property as

- adi,input-style: The input components arrangement variant (1, 2 or 3), as
  listed in the input format tables in the datasheet.

and modify the code to use an array as in

    /*
     * The input style values documented in the datasheet don't match the
     * hardware register field values :-(
     */
    static const unsigned int input_styles[4] = { 0, 2, 1, 3 };

    ...
    regmap_update_bits(adv7511->regmap, ADV7511_REG_VIDEO_INPUT_CFG1, 0x7e,
                       (color_depth << 4) |
                       (input_styles[config->input_style] << 2));

(config->input_style is validated when parsing DT).

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-09-26 12:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-24 20:04 [PATCH 00/12] Renesas R-Car DU HDMI support Laurent Pinchart
2014-09-24 20:04 ` [PATCH 10/12] video: Add ADV751[13] DT bindings documentation Laurent Pinchart
2014-09-25  7:06   ` Geert Uytterhoeven
2014-09-25  9:57     ` Laurent Pinchart
2014-09-25 10:10       ` Geert Uytterhoeven
2014-09-26 12:30         ` Laurent Pinchart
2014-09-25 13:09 ` [PATCH 00/12] Renesas R-Car DU HDMI support Philipp Zabel
2014-09-26 11:35   ` Laurent Pinchart

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).