Commit c03156d7 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'du-next-20200922' of git://linuxtv.org/pinchartl/media into drm-next



Miscellaneous R-Car display driver changes:

- R8A7742, R8A774E1 and R8A77961 support
- Fixes for pitch of YUV planar formats, non-visible plane handling and
  VSP device reference count
- Kconfig fix to avoid displaying disabled options in .config

Signed-off-by: default avatarDave Airlie <airlied@redhat.com>

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200922111526.GG8290@pendragon.ideasonboard.com
parents b40be05e 2a32dbdc
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -79,6 +79,9 @@ properties:
      The GPIO used to control the power down line of this device.
    maxItems: 1

  power-supply:
    maxItems: 1

required:
  - compatible
  - ports
+3 −1
Original line number Diff line number Diff line
@@ -14,8 +14,10 @@ Required properties:
- compatible : Shall contain one or more of
  - "renesas,r8a774a1-hdmi" for R8A774A1 (RZ/G2M) compatible HDMI TX
  - "renesas,r8a774b1-hdmi" for R8A774B1 (RZ/G2N) compatible HDMI TX
  - "renesas,r8a774e1-hdmi" for R8A774E1 (RZ/G2H) compatible HDMI TX
  - "renesas,r8a7795-hdmi" for R8A7795 (R-Car H3) compatible HDMI TX
  - "renesas,r8a7796-hdmi" for R8A7796 (R-Car M3-W) compatible HDMI TX
  - "renesas,r8a77961-hdmi" for R8A77961 (R-Car M3-W+) compatible HDMI TX
  - "renesas,r8a77965-hdmi" for R8A77965 (R-Car M3-N) compatible HDMI TX
  - "renesas,rcar-gen3-hdmi" for the generic R-Car Gen3 and RZ/G2 compatible
			     HDMI TX
@@ -42,7 +44,7 @@ Optional properties:
Example:

	hdmi0: hdmi@fead0000 {
		compatible = "renesas,r8a7795-dw-hdmi";
		compatible = "renesas,r8a7795-hdmi", "renesas,rcar-gen3-hdmi";
		reg = <0 0xfead0000 0 0x10000>;
		interrupts = <0 389 IRQ_TYPE_LEVEL_HIGH>;
		clocks = <&cpg CPG_CORE R8A7795_CLK_S0D4>, <&cpg CPG_MOD 729>;
+2 −0
Original line number Diff line number Diff line
@@ -16,11 +16,13 @@ description: |
properties:
  compatible:
    enum:
      - renesas,r8a7742-lvds # for RZ/G1H compatible LVDS encoders
      - renesas,r8a7743-lvds # for RZ/G1M compatible LVDS encoders
      - renesas,r8a7744-lvds # for RZ/G1N compatible LVDS encoders
      - renesas,r8a774a1-lvds # for RZ/G2M compatible LVDS encoders
      - renesas,r8a774b1-lvds # for RZ/G2N compatible LVDS encoders
      - renesas,r8a774c0-lvds # for RZ/G2E compatible LVDS encoders
      - renesas,r8a774e1-lvds # for RZ/G2H compatible LVDS encoders
      - renesas,r8a7790-lvds # for R-Car H2 compatible LVDS encoders
      - renesas,r8a7791-lvds # for R-Car M2-W compatible LVDS encoders
      - renesas,r8a7793-lvds # for R-Car M2-N compatible LVDS encoders
+6 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
Required Properties:

  - compatible: must be one of the following.
    - "renesas,du-r8a7742" for R8A7742 (RZ/G1H) compatible DU
    - "renesas,du-r8a7743" for R8A7743 (RZ/G1M) compatible DU
    - "renesas,du-r8a7744" for R8A7744 (RZ/G1N) compatible DU
    - "renesas,du-r8a7745" for R8A7745 (RZ/G1E) compatible DU
@@ -10,6 +11,7 @@ Required Properties:
    - "renesas,du-r8a774a1" for R8A774A1 (RZ/G2M) compatible DU
    - "renesas,du-r8a774b1" for R8A774B1 (RZ/G2N) compatible DU
    - "renesas,du-r8a774c0" for R8A774C0 (RZ/G2E) compatible DU
    - "renesas,du-r8a774e1" for R8A774E1 (RZ/G2H) compatible DU
    - "renesas,du-r8a7779" for R8A7779 (R-Car H1) compatible DU
    - "renesas,du-r8a7790" for R8A7790 (R-Car H2) compatible DU
    - "renesas,du-r8a7791" for R8A7791 (R-Car M2-W) compatible DU
@@ -18,6 +20,7 @@ Required Properties:
    - "renesas,du-r8a7794" for R8A7794 (R-Car E2) compatible DU
    - "renesas,du-r8a7795" for R8A7795 (R-Car H3) compatible DU
    - "renesas,du-r8a7796" for R8A7796 (R-Car M3-W) compatible DU
    - "renesas,du-r8a77961" for R8A77961 (R-Car M3-W+) compatible DU
    - "renesas,du-r8a77965" for R8A77965 (R-Car M3-N) compatible DU
    - "renesas,du-r8a77970" for R8A77970 (R-Car V3M) compatible DU
    - "renesas,du-r8a77980" for R8A77980 (R-Car V3H) compatible DU
@@ -68,6 +71,7 @@ corresponding to each DU output.

                        Port0          Port1          Port2          Port3
-----------------------------------------------------------------------------
 R8A7742 (RZ/G1H)       DPAD 0         LVDS 0         LVDS 1         -
 R8A7743 (RZ/G1M)       DPAD 0         LVDS 0         -              -
 R8A7744 (RZ/G1N)       DPAD 0         LVDS 0         -              -
 R8A7745 (RZ/G1E)       DPAD 0         DPAD 1         -              -
@@ -75,6 +79,7 @@ corresponding to each DU output.
 R8A774A1 (RZ/G2M)      DPAD 0         HDMI 0         LVDS 0         -
 R8A774B1 (RZ/G2N)      DPAD 0         HDMI 0         LVDS 0         -
 R8A774C0 (RZ/G2E)      DPAD 0         LVDS 0         LVDS 1         -
 R8A774E1 (RZ/G2H)      DPAD 0         HDMI 0         LVDS 0         -
 R8A7779 (R-Car H1)     DPAD 0         DPAD 1         -              -
 R8A7790 (R-Car H2)     DPAD 0         LVDS 0         LVDS 1         -
 R8A7791 (R-Car M2-W)   DPAD 0         LVDS 0         -              -
@@ -83,6 +88,7 @@ corresponding to each DU output.
 R8A7794 (R-Car E2)     DPAD 0         DPAD 1         -              -
 R8A7795 (R-Car H3)     DPAD 0         HDMI 0         HDMI 1         LVDS 0
 R8A7796 (R-Car M3-W)   DPAD 0         HDMI 0         LVDS 0         -
 R8A77961 (R-Car M3-W+) DPAD 0         HDMI 0         LVDS 0         -
 R8A77965 (R-Car M3-N)  DPAD 0         HDMI 0         LVDS 0         -
 R8A77970 (R-Car V3M)   DPAD 0         LVDS 0         -              -
 R8A77980 (R-Car V3H)   DPAD 0         LVDS 0         -              -
+29 −0
Original line number Diff line number Diff line
@@ -10,13 +10,16 @@
#include <linux/of_device.h>
#include <linux/of_graph.h>
#include <linux/platform_device.h>
#include <linux/regulator/consumer.h>

#include <drm/drm_bridge.h>
#include <drm/drm_panel.h>

struct lvds_codec {
	struct device *dev;
	struct drm_bridge bridge;
	struct drm_bridge *panel_bridge;
	struct regulator *vcc;
	struct gpio_desc *powerdown_gpio;
	u32 connector_type;
};
@@ -38,6 +41,14 @@ static int lvds_codec_attach(struct drm_bridge *bridge,
static void lvds_codec_enable(struct drm_bridge *bridge)
{
	struct lvds_codec *lvds_codec = to_lvds_codec(bridge);
	int ret;

	ret = regulator_enable(lvds_codec->vcc);
	if (ret) {
		dev_err(lvds_codec->dev,
			"Failed to enable regulator \"vcc\": %d\n", ret);
		return;
	}

	if (lvds_codec->powerdown_gpio)
		gpiod_set_value_cansleep(lvds_codec->powerdown_gpio, 0);
@@ -46,9 +57,15 @@ static void lvds_codec_enable(struct drm_bridge *bridge)
static void lvds_codec_disable(struct drm_bridge *bridge)
{
	struct lvds_codec *lvds_codec = to_lvds_codec(bridge);
	int ret;

	if (lvds_codec->powerdown_gpio)
		gpiod_set_value_cansleep(lvds_codec->powerdown_gpio, 1);

	ret = regulator_disable(lvds_codec->vcc);
	if (ret)
		dev_err(lvds_codec->dev,
			"Failed to disable regulator \"vcc\": %d\n", ret);
}

static const struct drm_bridge_funcs funcs = {
@@ -63,12 +80,24 @@ static int lvds_codec_probe(struct platform_device *pdev)
	struct device_node *panel_node;
	struct drm_panel *panel;
	struct lvds_codec *lvds_codec;
	int ret;

	lvds_codec = devm_kzalloc(dev, sizeof(*lvds_codec), GFP_KERNEL);
	if (!lvds_codec)
		return -ENOMEM;

	lvds_codec->dev = &pdev->dev;
	lvds_codec->connector_type = (uintptr_t)of_device_get_match_data(dev);

	lvds_codec->vcc = devm_regulator_get(lvds_codec->dev, "power");
	if (IS_ERR(lvds_codec->vcc)) {
		ret = PTR_ERR(lvds_codec->vcc);
		if (ret != -EPROBE_DEFER)
			dev_err(lvds_codec->dev,
				"Unable to get \"vcc\" supply: %d\n", ret);
		return ret;
	}

	lvds_codec->powerdown_gpio = devm_gpiod_get_optional(dev, "powerdown",
							     GPIOD_OUT_HIGH);
	if (IS_ERR(lvds_codec->powerdown_gpio))
Loading