dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] drm: Add support for Okaya RH128128T
@ 2020-01-15 12:45 Geert Uytterhoeven
  2020-01-15 12:45 ` [PATCH v2 1/5] dt-bindings: display: sitronix, st7735r: Convert to DT schema Geert Uytterhoeven
                   ` (5 more replies)
  0 siblings, 6 replies; 18+ messages in thread
From: Geert Uytterhoeven @ 2020-01-15 12:45 UTC (permalink / raw)
  To: Noralf Trønnes, David Lechner, David Airlie, Daniel Vetter,
	Maarten Lankhorst, Maxime Ripard, Rob Herring, Mark Rutland
  Cc: devicetree, Geert Uytterhoeven, linux-kernel, dri-devel,
	linux-renesas-soc, Chris Brandt, Kieran Bingham, Sam Ravnborg

	Hi all,

This patch series adds support for the Okaya RH128128T LCD to the
existing ST7735R driver.  This is a 128x128 1.4" TFT display driven by a
Sitronix ST7715R TFT Controller/Driver.  It is used on e.g. the Renesas
YRSK-LCD-PMOD extension board, which is shipped with Renesas RSK+RZA1
development boards[1], and with several other Renesas starter kits, for
RX, Synergy, and RZ/T1 MCUs and SoCs.

Changes compared to v1[2]:
  - Convert DT bindings to DT schema,
  - Add YRSK-LCD-PMOD reference and links,
  - Add Reviewed-by,
  - Split driver preparation and adding actual support in two separate
    patches,
  - Replace st7735r_priv.rgb by a pointer to struct st7735r_cfg,
  - Change prefix of jd_t18003_t01_pipe_enable() and
    jd_t18003_t01_pipe_funcs(),
  - Update Kconfig help text,
  - Improve file comment header.

This has been tested using the r7s72100-rskrza1-pmod-spi.dtso and
r7s72100-rskrza1-pmod2-lcd.dtso DT overlays[3].
Note that for using this on RSK+RZA1, there is a dependency on RSPI
cs-gpios support (now in linux-next).
With DT overlays, this also depends on DT overlays[4] and gpio-hog
overlay support[5].

Thanks!

[1] https://renesasrulz.com/the_vault/f/archive-forum/4981/upgrading-to-the-renesas-rz-a1h
[1] https://lore.kernel.org/dri-devel/20200102141246.370-1-geert+renesas@glider.be/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git/log/?h=topic/renesas-overlays
[4] https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git/log/?h=topic/overlays
[5] "[PATCH/RFC 0/2] gpio: of: Add DT overlay support for GPIO hogs"
    https://lore.kernel.org/lkml/20191230133852.5890-1-geert+renesas@glider.be/

Geert Uytterhoeven (5):
  dt-bindings: display: sitronix,st7735r: Convert to DT schema
  dt-bindings: display: sitronix,st7735r: Add Okaya RH128128T
  drm/mipi_dbi: Add support for display offsets
  drm: tiny: st7735r: Prepare for adding support for more displays
  drm: tiny: st7735r: Add support for Okaya RH128128T

 .../bindings/display/sitronix,st7735r.txt     | 35 ---------
 .../bindings/display/sitronix,st7735r.yaml    | 71 +++++++++++++++++
 MAINTAINERS                                   |  2 +-
 drivers/gpu/drm/drm_mipi_dbi.c                | 30 +++++---
 drivers/gpu/drm/tiny/Kconfig                  |  8 +-
 drivers/gpu/drm/tiny/st7735r.c                | 76 +++++++++++++++----
 include/drm/drm_mipi_dbi.h                    | 12 +++
 7 files changed, 170 insertions(+), 64 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/display/sitronix,st7735r.txt
 create mode 100644 Documentation/devicetree/bindings/display/sitronix,st7735r.yaml

-- 
2.17.1

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
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH v2 1/5] dt-bindings: display: sitronix, st7735r: Convert to DT schema
  2020-01-15 12:45 [PATCH v2 0/5] drm: Add support for Okaya RH128128T Geert Uytterhoeven
@ 2020-01-15 12:45 ` Geert Uytterhoeven
  2020-01-15 21:01   ` [PATCH v2 1/5] dt-bindings: display: sitronix,st7735r: " Sam Ravnborg
  2020-01-20 16:00   ` David Lechner
  2020-01-15 12:45 ` [PATCH v2 2/5] dt-bindings: display: sitronix, st7735r: Add Okaya RH128128T Geert Uytterhoeven
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 18+ messages in thread
From: Geert Uytterhoeven @ 2020-01-15 12:45 UTC (permalink / raw)
  To: Noralf Trønnes, David Lechner, David Airlie, Daniel Vetter,
	Maarten Lankhorst, Maxime Ripard, Rob Herring, Mark Rutland
  Cc: devicetree, Geert Uytterhoeven, linux-kernel, dri-devel,
	linux-renesas-soc, Chris Brandt, Kieran Bingham, Sam Ravnborg

Convert the DT binding documentation for Sitronix ST7735R displays to DT
schema.

Add a reference to the Adafruit 1.8" LCD while at it.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v2:
  - New.
---
 .../bindings/display/sitronix,st7735r.txt     | 35 ----------
 .../bindings/display/sitronix,st7735r.yaml    | 65 +++++++++++++++++++
 MAINTAINERS                                   |  2 +-
 3 files changed, 66 insertions(+), 36 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/display/sitronix,st7735r.txt
 create mode 100644 Documentation/devicetree/bindings/display/sitronix,st7735r.yaml

diff --git a/Documentation/devicetree/bindings/display/sitronix,st7735r.txt b/Documentation/devicetree/bindings/display/sitronix,st7735r.txt
deleted file mode 100644
index cd5c7186890a2be7..0000000000000000
--- a/Documentation/devicetree/bindings/display/sitronix,st7735r.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-Sitronix ST7735R display panels
-
-This binding is for display panels using a Sitronix ST7735R controller in SPI
-mode.
-
-Required properties:
-- compatible:	"jianda,jd-t18003-t01", "sitronix,st7735r"
-- dc-gpios:	Display data/command selection (D/CX)
-- reset-gpios:	Reset signal (RSTX)
-
-The node for this driver must be a child node of a SPI controller, hence
-all mandatory properties described in ../spi/spi-bus.txt must be specified.
-
-Optional properties:
-- rotation:	panel rotation in degrees counter clockwise (0,90,180,270)
-- backlight:	phandle of the backlight device attached to the panel
-
-Example:
-
-	backlight: backlight {
-		compatible = "gpio-backlight";
-		gpios = <&gpio 44 GPIO_ACTIVE_HIGH>;
-	};
-
-	...
-
-	display@0{
-		compatible = "jianda,jd-t18003-t01", "sitronix,st7735r";
-		reg = <0>;
-		spi-max-frequency = <32000000>;
-		dc-gpios = <&gpio 43 GPIO_ACTIVE_HIGH>;
-		reset-gpios = <&gpio 80 GPIO_ACTIVE_HIGH>;
-		rotation = <270>;
-		backlight = &backlight;
-	};
diff --git a/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml b/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
new file mode 100644
index 0000000000000000..21bccc91f74255e1
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
@@ -0,0 +1,65 @@
+# SPDX-License-Identifier: GPL-2.0-only
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/sitronix,st7735r.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Sitronix ST7735R Display Panels Device Tree Bindings
+
+maintainers:
+  - David Lechner <david@lechnology.com>
+
+description:
+  This binding is for display panels using a Sitronix ST7735R controller in
+  SPI mode.
+
+allOf:
+  - $ref: panel/panel-common.yaml#
+
+properties:
+  compatible:
+    oneOf:
+      - description:
+          Adafruit 1.8" 160x128 Color TFT LCD (Product ID 358 or 618)
+        items:
+          - enum:
+              - jianda,jd-t18003-t01
+          - const: sitronix,st7735r
+
+  spi-max-frequency:
+    maximum: 32000000
+
+  dc-gpios:
+    maxItems: 1
+    description: Display data/command selection (D/CX)
+
+required:
+  - compatible
+  - reg
+  - dc-gpios
+  - reset-gpios
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    backlight: backlight {
+            compatible = "gpio-backlight";
+            gpios = <&gpio 44 GPIO_ACTIVE_HIGH>;
+    };
+
+    spi {
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            display@0{
+                    compatible = "jianda,jd-t18003-t01", "sitronix,st7735r";
+                    reg = <0>;
+                    spi-max-frequency = <32000000>;
+                    dc-gpios = <&gpio 43 GPIO_ACTIVE_HIGH>;
+                    reset-gpios = <&gpio 80 GPIO_ACTIVE_HIGH>;
+                    rotation = <270>;
+            };
+    };
+
+...
diff --git a/MAINTAINERS b/MAINTAINERS
index ea8262509bdd21ac..3007f83bd504194a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5382,7 +5382,7 @@ M:	David Lechner <david@lechnology.com>
 T:	git git://anongit.freedesktop.org/drm/drm-misc
 S:	Maintained
 F:	drivers/gpu/drm/tiny/st7735r.c
-F:	Documentation/devicetree/bindings/display/sitronix,st7735r.txt
+F:	Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
 
 DRM DRIVER FOR SONY ACX424AKP PANELS
 M:	Linus Walleij <linus.walleij@linaro.org>
-- 
2.17.1

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

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

* [PATCH v2 2/5] dt-bindings: display: sitronix, st7735r: Add Okaya RH128128T
  2020-01-15 12:45 [PATCH v2 0/5] drm: Add support for Okaya RH128128T Geert Uytterhoeven
  2020-01-15 12:45 ` [PATCH v2 1/5] dt-bindings: display: sitronix, st7735r: Convert to DT schema Geert Uytterhoeven
@ 2020-01-15 12:45 ` Geert Uytterhoeven
  2020-01-15 21:01   ` Sam Ravnborg
  2020-01-15 12:45 ` [PATCH v2 3/5] drm/mipi_dbi: Add support for display offsets Geert Uytterhoeven
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 18+ messages in thread
From: Geert Uytterhoeven @ 2020-01-15 12:45 UTC (permalink / raw)
  To: Noralf Trønnes, David Lechner, David Airlie, Daniel Vetter,
	Maarten Lankhorst, Maxime Ripard, Rob Herring, Mark Rutland
  Cc: devicetree, Geert Uytterhoeven, linux-kernel, dri-devel,
	linux-renesas-soc, Chris Brandt, Kieran Bingham, Sam Ravnborg

Document support for the Okaya RH128128T display, which is a 128x128
1.44" TFT display driven by a Sitronix ST7715R TFT Controller/Driver.
It can be found on e.g. the Renesas YRSK-LCD-PMOD extension board, which
comes with various Renesas development kits (e.g. Renesas Starter Kit+
for RZ/A1H[1]).

ST7715R and ST7735R are very similar.  Their major difference is that
the former is restricted to displays of up to 132x132 pixels, while the
latter supports displays up to 132x162 pixels.

[1] https://renesasrulz.com/the_vault/f/archive-forum/4981/upgrading-to-the-renesas-rz-a1h

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v2:
  - Rebase on top of DT schema conversion,
  - Add YRSK-LCD-PMOD reference and links.
---
 .../devicetree/bindings/display/sitronix,st7735r.yaml  | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml b/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
index 21bccc91f74255e1..8892d79e6e100b79 100644
--- a/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
+++ b/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
@@ -10,8 +10,8 @@ maintainers:
   - David Lechner <david@lechnology.com>
 
 description:
-  This binding is for display panels using a Sitronix ST7735R controller in
-  SPI mode.
+  This binding is for display panels using a Sitronix ST7715R or ST7735R
+  controller in SPI mode.
 
 allOf:
   - $ref: panel/panel-common.yaml#
@@ -25,6 +25,12 @@ properties:
           - enum:
               - jianda,jd-t18003-t01
           - const: sitronix,st7735r
+      - description:
+          Okaya 1.44" 128x128 Color TFT LCD (E.g. Renesas YRSK-LCD-PMOD)
+        items:
+          - enum:
+              - okaya,rh128128t
+          - const: sitronix,st7715r
 
   spi-max-frequency:
     maximum: 32000000
-- 
2.17.1

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

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

* [PATCH v2 3/5] drm/mipi_dbi: Add support for display offsets
  2020-01-15 12:45 [PATCH v2 0/5] drm: Add support for Okaya RH128128T Geert Uytterhoeven
  2020-01-15 12:45 ` [PATCH v2 1/5] dt-bindings: display: sitronix, st7735r: Convert to DT schema Geert Uytterhoeven
  2020-01-15 12:45 ` [PATCH v2 2/5] dt-bindings: display: sitronix, st7735r: Add Okaya RH128128T Geert Uytterhoeven
@ 2020-01-15 12:45 ` Geert Uytterhoeven
  2020-01-17 21:12   ` Sam Ravnborg
  2020-01-19 16:03   ` Noralf Trønnes
  2020-01-15 12:45 ` [PATCH v2 4/5] drm: tiny: st7735r: Prepare for adding support for more displays Geert Uytterhoeven
                   ` (2 subsequent siblings)
  5 siblings, 2 replies; 18+ messages in thread
From: Geert Uytterhoeven @ 2020-01-15 12:45 UTC (permalink / raw)
  To: Noralf Trønnes, David Lechner, David Airlie, Daniel Vetter,
	Maarten Lankhorst, Maxime Ripard, Rob Herring, Mark Rutland
  Cc: devicetree, Geert Uytterhoeven, linux-kernel, dri-devel,
	linux-renesas-soc, Chris Brandt, Kieran Bingham, Sam Ravnborg

If the resolution of the TFT display is smaller than the maximum
resolution supported by the display controller, the display may be
connected to the driver output arrays with a horizontal and/or vertical
offset, leading to a shifted image.

Add support for specifying these offsets.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
---
v2:
  - Add Reviewed-by.
---
 drivers/gpu/drm/drm_mipi_dbi.c | 30 ++++++++++++++++++++----------
 include/drm/drm_mipi_dbi.h     | 12 ++++++++++++
 2 files changed, 32 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c
index 16bff1be4b8ac622..27fe81a53c88e338 100644
--- a/drivers/gpu/drm/drm_mipi_dbi.c
+++ b/drivers/gpu/drm/drm_mipi_dbi.c
@@ -238,6 +238,23 @@ int mipi_dbi_buf_copy(void *dst, struct drm_framebuffer *fb,
 }
 EXPORT_SYMBOL(mipi_dbi_buf_copy);
 
+static void mipi_dbi_set_window_address(struct mipi_dbi_dev *dbidev,
+					unsigned int xs, unsigned int xe,
+					unsigned int ys, unsigned int ye)
+{
+	struct mipi_dbi *dbi = &dbidev->dbi;
+
+	xs += dbidev->left_offset;
+	xe += dbidev->left_offset;
+	ys += dbidev->top_offset;
+	ye += dbidev->top_offset;
+
+	mipi_dbi_command(dbi, MIPI_DCS_SET_COLUMN_ADDRESS, (xs >> 8) & 0xff,
+			 xs & 0xff, (xe >> 8) & 0xff, xe & 0xff);
+	mipi_dbi_command(dbi, MIPI_DCS_SET_PAGE_ADDRESS, (ys >> 8) & 0xff,
+			 ys & 0xff, (ye >> 8) & 0xff, ye & 0xff);
+}
+
 static void mipi_dbi_fb_dirty(struct drm_framebuffer *fb, struct drm_rect *rect)
 {
 	struct drm_gem_object *gem = drm_gem_fb_get_obj(fb, 0);
@@ -271,12 +288,8 @@ static void mipi_dbi_fb_dirty(struct drm_framebuffer *fb, struct drm_rect *rect)
 		tr = cma_obj->vaddr;
 	}
 
-	mipi_dbi_command(dbi, MIPI_DCS_SET_COLUMN_ADDRESS,
-			 (rect->x1 >> 8) & 0xff, rect->x1 & 0xff,
-			 ((rect->x2 - 1) >> 8) & 0xff, (rect->x2 - 1) & 0xff);
-	mipi_dbi_command(dbi, MIPI_DCS_SET_PAGE_ADDRESS,
-			 (rect->y1 >> 8) & 0xff, rect->y1 & 0xff,
-			 ((rect->y2 - 1) >> 8) & 0xff, (rect->y2 - 1) & 0xff);
+	mipi_dbi_set_window_address(dbidev, rect->x1, rect->x2 - 1, rect->y1,
+				    rect->y2 - 1);
 
 	ret = mipi_dbi_command_buf(dbi, MIPI_DCS_WRITE_MEMORY_START, tr,
 				   width * height * 2);
@@ -366,10 +379,7 @@ static void mipi_dbi_blank(struct mipi_dbi_dev *dbidev)
 
 	memset(dbidev->tx_buf, 0, len);
 
-	mipi_dbi_command(dbi, MIPI_DCS_SET_COLUMN_ADDRESS, 0, 0,
-			 ((width - 1) >> 8) & 0xFF, (width - 1) & 0xFF);
-	mipi_dbi_command(dbi, MIPI_DCS_SET_PAGE_ADDRESS, 0, 0,
-			 ((height - 1) >> 8) & 0xFF, (height - 1) & 0xFF);
+	mipi_dbi_set_window_address(dbidev, 0, width - 1, 0, height - 1);
 	mipi_dbi_command_buf(dbi, MIPI_DCS_WRITE_MEMORY_START,
 			     (u8 *)dbidev->tx_buf, len);
 
diff --git a/include/drm/drm_mipi_dbi.h b/include/drm/drm_mipi_dbi.h
index 67c66f5ee591e80f..33f325f5af2b921f 100644
--- a/include/drm/drm_mipi_dbi.h
+++ b/include/drm/drm_mipi_dbi.h
@@ -109,6 +109,18 @@ struct mipi_dbi_dev {
 	 */
 	unsigned int rotation;
 
+	/**
+	 * @left_offset: Horizontal offset of the display relative to the
+	 *               controller's driver array
+	 */
+	unsigned int left_offset;
+
+	/**
+	 * @top_offset: Vertical offset of the display relative to the
+	 *              controller's driver array
+	 */
+	unsigned int top_offset;
+
 	/**
 	 * @backlight: backlight device (optional)
 	 */
-- 
2.17.1

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

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

* [PATCH v2 4/5] drm: tiny: st7735r: Prepare for adding support for more displays
  2020-01-15 12:45 [PATCH v2 0/5] drm: Add support for Okaya RH128128T Geert Uytterhoeven
                   ` (2 preceding siblings ...)
  2020-01-15 12:45 ` [PATCH v2 3/5] drm/mipi_dbi: Add support for display offsets Geert Uytterhoeven
@ 2020-01-15 12:45 ` Geert Uytterhoeven
  2020-01-15 12:45 ` [PATCH v2 5/5] drm: tiny: st7735r: Add support for Okaya RH128128T Geert Uytterhoeven
  2020-01-19 17:15 ` [PATCH v2 0/5] drm: " Sam Ravnborg
  5 siblings, 0 replies; 18+ messages in thread
From: Geert Uytterhoeven @ 2020-01-15 12:45 UTC (permalink / raw)
  To: Noralf Trønnes, David Lechner, David Airlie, Daniel Vetter,
	Maarten Lankhorst, Maxime Ripard, Rob Herring, Mark Rutland
  Cc: devicetree, Geert Uytterhoeven, linux-kernel, dri-devel,
	linux-renesas-soc, Chris Brandt, Kieran Bingham, Sam Ravnborg

Currently the st7735r driver supports only a single display panel.
Prepare for adding support for other display panels by factoring out the
display-specific parameters in struct st7735r_cfg.

For now, the following parameters can be configured:
  - Display resolution,
  - Horizontal/vertical display offsets,
  - Read-write versus read-only controllers,
  - RGB versus BGR color component ordering.

Rename jd_t18003_t01_pipe_enable() and jd_t18003_t01_pipe_funcs() to
st7735r_pipe_enable() resp. st7735r_pipe_funcs(), as they are not really
specific to the Jianda JD-T18003-T01 display anymore.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v2:
  - Split off from "drm: tiny: st7735r: Add support for Okaya
    RH128128T",
  - Replace st7735r_priv.rgb by a pointer to struct st7735r_cfg,
  - Change prefix of jd_t18003_t01_pipe_enable() and
    jd_t18003_t01_pipe_funcs().
---
 drivers/gpu/drm/tiny/st7735r.c | 67 +++++++++++++++++++++++++++-------
 1 file changed, 53 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/tiny/st7735r.c b/drivers/gpu/drm/tiny/st7735r.c
index 3f4487c716848cf8..a838f237c8d82e3d 100644
--- a/drivers/gpu/drm/tiny/st7735r.c
+++ b/drivers/gpu/drm/tiny/st7735r.c
@@ -3,6 +3,7 @@
  * DRM driver for Sitronix ST7735R panels
  *
  * Copyright 2017 David Lechner <david@lechnology.com>
+ * Copyright (C) 2019 Glider bvba
  */
 
 #include <linux/backlight.h>
@@ -10,6 +11,7 @@
 #include <linux/dma-buf.h>
 #include <linux/gpio/consumer.h>
 #include <linux/module.h>
+#include <linux/of_device.h>
 #include <linux/property.h>
 #include <linux/spi/spi.h>
 #include <video/mipi_display.h>
@@ -37,12 +39,28 @@
 #define ST7735R_MY	BIT(7)
 #define ST7735R_MX	BIT(6)
 #define ST7735R_MV	BIT(5)
+#define ST7735R_RGB	BIT(3)
+
+struct st7735r_cfg {
+	const struct drm_display_mode mode;
+	unsigned int left_offset;
+	unsigned int top_offset;
+	unsigned int write_only:1;
+	unsigned int rgb:1;		/* RGB (vs. BGR) */
+};
+
+struct st7735r_priv {
+	struct mipi_dbi_dev dbidev;	/* Must be first for .release() */
+	const struct st7735r_cfg *cfg;
+};
 
-static void jd_t18003_t01_pipe_enable(struct drm_simple_display_pipe *pipe,
-				      struct drm_crtc_state *crtc_state,
-				      struct drm_plane_state *plane_state)
+static void st7735r_pipe_enable(struct drm_simple_display_pipe *pipe,
+				struct drm_crtc_state *crtc_state,
+				struct drm_plane_state *plane_state)
 {
 	struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev);
+	struct st7735r_priv *priv = container_of(dbidev, struct st7735r_priv,
+						 dbidev);
 	struct mipi_dbi *dbi = &dbidev->dbi;
 	int ret, idx;
 	u8 addr_mode;
@@ -87,6 +105,10 @@ static void jd_t18003_t01_pipe_enable(struct drm_simple_display_pipe *pipe,
 		addr_mode = ST7735R_MY | ST7735R_MV;
 		break;
 	}
+
+	if (priv->cfg->rgb)
+		addr_mode |= ST7735R_RGB;
+
 	mipi_dbi_command(dbi, MIPI_DCS_SET_ADDRESS_MODE, addr_mode);
 	mipi_dbi_command(dbi, MIPI_DCS_SET_PIXEL_FORMAT,
 			 MIPI_DCS_PIXEL_FMT_16BIT);
@@ -109,15 +131,19 @@ static void jd_t18003_t01_pipe_enable(struct drm_simple_display_pipe *pipe,
 	drm_dev_exit(idx);
 }
 
-static const struct drm_simple_display_pipe_funcs jd_t18003_t01_pipe_funcs = {
-	.enable		= jd_t18003_t01_pipe_enable,
+static const struct drm_simple_display_pipe_funcs st7735r_pipe_funcs = {
+	.enable		= st7735r_pipe_enable,
 	.disable	= mipi_dbi_pipe_disable,
 	.update		= mipi_dbi_pipe_update,
 	.prepare_fb	= drm_gem_fb_simple_display_pipe_prepare_fb,
 };
 
-static const struct drm_display_mode jd_t18003_t01_mode = {
-	DRM_SIMPLE_MODE(128, 160, 28, 35),
+static const struct st7735r_cfg jd_t18003_t01_cfg = {
+	.mode		= { DRM_SIMPLE_MODE(128, 160, 28, 35) },
+	/* Cannot read from Adafruit 1.8" display via SPI */
+	.write_only	= true,
+};
+
 };
 
 DEFINE_DRM_GEM_CMA_FOPS(st7735r_fops);
@@ -136,13 +162,13 @@ static struct drm_driver st7735r_driver = {
 };
 
 static const struct of_device_id st7735r_of_match[] = {
-	{ .compatible = "jianda,jd-t18003-t01" },
+	{ .compatible = "jianda,jd-t18003-t01", .data = &jd_t18003_t01_cfg },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, st7735r_of_match);
 
 static const struct spi_device_id st7735r_id[] = {
-	{ "jd-t18003-t01", 0 },
+	{ "jd-t18003-t01", (uintptr_t)&jd_t18003_t01_cfg },
 	{ },
 };
 MODULE_DEVICE_TABLE(spi, st7735r_id);
@@ -150,17 +176,26 @@ MODULE_DEVICE_TABLE(spi, st7735r_id);
 static int st7735r_probe(struct spi_device *spi)
 {
 	struct device *dev = &spi->dev;
+	const struct st7735r_cfg *cfg;
 	struct mipi_dbi_dev *dbidev;
+	struct st7735r_priv *priv;
 	struct drm_device *drm;
 	struct mipi_dbi *dbi;
 	struct gpio_desc *dc;
 	u32 rotation = 0;
 	int ret;
 
-	dbidev = kzalloc(sizeof(*dbidev), GFP_KERNEL);
-	if (!dbidev)
+	cfg = of_device_get_match_data(&spi->dev);
+	if (!cfg)
+		cfg = (void *)spi_get_device_id(spi)->driver_data;
+
+	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
+	if (!priv)
 		return -ENOMEM;
 
+	dbidev = &priv->dbidev;
+	priv->cfg = cfg;
+
 	dbi = &dbidev->dbi;
 	drm = &dbidev->drm;
 	ret = devm_drm_dev_init(dev, drm, &st7735r_driver);
@@ -193,10 +228,14 @@ static int st7735r_probe(struct spi_device *spi)
 	if (ret)
 		return ret;
 
-	/* Cannot read from Adafruit 1.8" display via SPI */
-	dbi->read_commands = NULL;
+	if (cfg->write_only)
+		dbi->read_commands = NULL;
+
+	dbidev->left_offset = cfg->left_offset;
+	dbidev->top_offset = cfg->top_offset;
 
-	ret = mipi_dbi_dev_init(dbidev, &jd_t18003_t01_pipe_funcs, &jd_t18003_t01_mode, rotation);
+	ret = mipi_dbi_dev_init(dbidev, &st7735r_pipe_funcs, &cfg->mode,
+				rotation);
 	if (ret)
 		return ret;
 
-- 
2.17.1

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

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

* [PATCH v2 5/5] drm: tiny: st7735r: Add support for Okaya RH128128T
  2020-01-15 12:45 [PATCH v2 0/5] drm: Add support for Okaya RH128128T Geert Uytterhoeven
                   ` (3 preceding siblings ...)
  2020-01-15 12:45 ` [PATCH v2 4/5] drm: tiny: st7735r: Prepare for adding support for more displays Geert Uytterhoeven
@ 2020-01-15 12:45 ` Geert Uytterhoeven
  2020-01-19 17:15 ` [PATCH v2 0/5] drm: " Sam Ravnborg
  5 siblings, 0 replies; 18+ messages in thread
From: Geert Uytterhoeven @ 2020-01-15 12:45 UTC (permalink / raw)
  To: Noralf Trønnes, David Lechner, David Airlie, Daniel Vetter,
	Maarten Lankhorst, Maxime Ripard, Rob Herring, Mark Rutland
  Cc: devicetree, Geert Uytterhoeven, linux-kernel, dri-devel,
	linux-renesas-soc, Chris Brandt, Kieran Bingham, Sam Ravnborg

Add support for the Okaya RH128128T display to the st7735r driver on
DT-enabled systems.

The RH128128T is a 128x128 1.44" TFT display driven by a Sitronix
ST7715R TFT Controller/Driver.  The latter is very similar to the
ST7735R, and can be handled by the existing st7735r driver.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v2:
  - Split in two patches,
  - Update Kconfig help text,
  - Improve file comment header.
---
 drivers/gpu/drm/tiny/Kconfig   | 8 +++++---
 drivers/gpu/drm/tiny/st7735r.c | 9 ++++++++-
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/tiny/Kconfig b/drivers/gpu/drm/tiny/Kconfig
index a46ac284dd5e9211..a8664211123e7025 100644
--- a/drivers/gpu/drm/tiny/Kconfig
+++ b/drivers/gpu/drm/tiny/Kconfig
@@ -85,14 +85,16 @@ config TINYDRM_ST7586
 	  If M is selected the module will be called st7586.
 
 config TINYDRM_ST7735R
-	tristate "DRM support for Sitronix ST7735R display panels"
+	tristate "DRM support for Sitronix ST7715R/ST7735R display panels"
 	depends on DRM && SPI
 	select DRM_KMS_HELPER
 	select DRM_KMS_CMA_HELPER
 	select DRM_MIPI_DBI
 	select BACKLIGHT_CLASS_DEVICE
 	help
-	  DRM driver Sitronix ST7735R with one of the following LCDs:
-	  * JD-T18003-T01 1.8" 128x160 TFT
+	  DRM driver for Sitronix ST7715R/ST7735R with one of the following
+	  LCDs:
+	  * Jianda JD-T18003-T01 1.8" 128x160 TFT
+	  * Okaya RH128128T 1.44" 128x128 TFT
 
 	  If M is selected the module will be called st7735r.
diff --git a/drivers/gpu/drm/tiny/st7735r.c b/drivers/gpu/drm/tiny/st7735r.c
index a838f237c8d82e3d..32574f1b60716390 100644
--- a/drivers/gpu/drm/tiny/st7735r.c
+++ b/drivers/gpu/drm/tiny/st7735r.c
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * DRM driver for Sitronix ST7735R panels
+ * DRM driver for display panels connected to a Sitronix ST7715R or ST7735R
+ * display controller in SPI mode.
  *
  * Copyright 2017 David Lechner <david@lechnology.com>
  * Copyright (C) 2019 Glider bvba
@@ -144,6 +145,11 @@ static const struct st7735r_cfg jd_t18003_t01_cfg = {
 	.write_only	= true,
 };
 
+static const struct st7735r_cfg rh128128t_cfg = {
+	.mode		= { DRM_SIMPLE_MODE(128, 128, 25, 26) },
+	.left_offset	= 2,
+	.top_offset	= 3,
+	.rgb		= true,
 };
 
 DEFINE_DRM_GEM_CMA_FOPS(st7735r_fops);
@@ -163,6 +169,7 @@ static struct drm_driver st7735r_driver = {
 
 static const struct of_device_id st7735r_of_match[] = {
 	{ .compatible = "jianda,jd-t18003-t01", .data = &jd_t18003_t01_cfg },
+	{ .compatible = "okaya,rh128128t", .data = &rh128128t_cfg },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, st7735r_of_match);
-- 
2.17.1

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

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

* Re: [PATCH v2 1/5] dt-bindings: display: sitronix,st7735r: Convert to DT schema
  2020-01-15 12:45 ` [PATCH v2 1/5] dt-bindings: display: sitronix, st7735r: Convert to DT schema Geert Uytterhoeven
@ 2020-01-15 21:01   ` Sam Ravnborg
  2020-01-15 22:06     ` [PATCH v2 1/5] dt-bindings: display: sitronix, st7735r: " Geert Uytterhoeven
  2020-01-20 16:00   ` David Lechner
  1 sibling, 1 reply; 18+ messages in thread
From: Sam Ravnborg @ 2020-01-15 21:01 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Mark Rutland, devicetree, David Lechner, David Airlie,
	Kieran Bingham, linux-kernel, linux-renesas-soc, Rob Herring,
	Chris Brandt, dri-devel

Hi Geert.

Thanks for doing the conversion to meta-schema.

On Wed, Jan 15, 2020 at 01:45:44PM +0100, Geert Uytterhoeven wrote:
> Convert the DT binding documentation for Sitronix ST7735R displays to DT
> schema.
> 
> Add a reference to the Adafruit 1.8" LCD while at it.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---

> diff --git a/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml b/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
> new file mode 100644
> index 0000000000000000..21bccc91f74255e1
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
> @@ -0,0 +1,65 @@
> +# SPDX-License-Identifier: GPL-2.0-only
Use (GPL-2.0-only OR BSD-2-Clause) for new binding files.

> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/display/sitronix,st7735r.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Sitronix ST7735R Display Panels Device Tree Bindings
> +
> +maintainers:
> +  - David Lechner <david@lechnology.com>
> +
> +description:
> +  This binding is for display panels using a Sitronix ST7735R controller in
> +  SPI mode.
> +
> +allOf:
> +  - $ref: panel/panel-common.yaml#

I am no binding expert so I do not know how to add it.
But the old binding described that this MUST be a child of spi.
This is missing here.

Other panels using spi does not have it - so it is probarly OK.

So with the license fixed:
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - description:
> +          Adafruit 1.8" 160x128 Color TFT LCD (Product ID 358 or 618)
> +        items:
> +          - enum:
> +              - jianda,jd-t18003-t01
> +          - const: sitronix,st7735r
> +
> +  spi-max-frequency:
> +    maximum: 32000000
> +
> +  dc-gpios:
> +    maxItems: 1
> +    description: Display data/command selection (D/CX)
> +
> +required:
> +  - compatible
> +  - reg
> +  - dc-gpios
> +  - reset-gpios
> +
> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +
> +    backlight: backlight {
> +            compatible = "gpio-backlight";
> +            gpios = <&gpio 44 GPIO_ACTIVE_HIGH>;
> +    };
> +
> +    spi {
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +
> +            display@0{
> +                    compatible = "jianda,jd-t18003-t01", "sitronix,st7735r";
> +                    reg = <0>;
> +                    spi-max-frequency = <32000000>;
> +                    dc-gpios = <&gpio 43 GPIO_ACTIVE_HIGH>;
> +                    reset-gpios = <&gpio 80 GPIO_ACTIVE_HIGH>;
> +                    rotation = <270>;
> +            };
> +    };
> +
> +...
> diff --git a/MAINTAINERS b/MAINTAINERS
> index ea8262509bdd21ac..3007f83bd504194a 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -5382,7 +5382,7 @@ M:	David Lechner <david@lechnology.com>
>  T:	git git://anongit.freedesktop.org/drm/drm-misc
>  S:	Maintained
>  F:	drivers/gpu/drm/tiny/st7735r.c
> -F:	Documentation/devicetree/bindings/display/sitronix,st7735r.txt
> +F:	Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
>  
>  DRM DRIVER FOR SONY ACX424AKP PANELS
>  M:	Linus Walleij <linus.walleij@linaro.org>
> -- 
> 2.17.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH v2 2/5] dt-bindings: display: sitronix, st7735r: Add Okaya RH128128T
  2020-01-15 12:45 ` [PATCH v2 2/5] dt-bindings: display: sitronix, st7735r: Add Okaya RH128128T Geert Uytterhoeven
@ 2020-01-15 21:01   ` Sam Ravnborg
  0 siblings, 0 replies; 18+ messages in thread
From: Sam Ravnborg @ 2020-01-15 21:01 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Mark Rutland, devicetree, David Lechner, David Airlie,
	Kieran Bingham, linux-kernel, linux-renesas-soc, Rob Herring,
	Chris Brandt, dri-devel

On Wed, Jan 15, 2020 at 01:45:45PM +0100, Geert Uytterhoeven wrote:
> Document support for the Okaya RH128128T display, which is a 128x128
> 1.44" TFT display driven by a Sitronix ST7715R TFT Controller/Driver.
> It can be found on e.g. the Renesas YRSK-LCD-PMOD extension board, which
> comes with various Renesas development kits (e.g. Renesas Starter Kit+
> for RZ/A1H[1]).
> 
> ST7715R and ST7735R are very similar.  Their major difference is that
> the former is restricted to displays of up to 132x132 pixels, while the
> latter supports displays up to 132x162 pixels.
> 
> [1] https://renesasrulz.com/the_vault/f/archive-forum/4981/upgrading-to-the-renesas-rz-a1h
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

> ---
> v2:
>   - Rebase on top of DT schema conversion,
>   - Add YRSK-LCD-PMOD reference and links.
> ---
>  .../devicetree/bindings/display/sitronix,st7735r.yaml  | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml b/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
> index 21bccc91f74255e1..8892d79e6e100b79 100644
> --- a/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
> +++ b/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
> @@ -10,8 +10,8 @@ maintainers:
>    - David Lechner <david@lechnology.com>
>  
>  description:
> -  This binding is for display panels using a Sitronix ST7735R controller in
> -  SPI mode.
> +  This binding is for display panels using a Sitronix ST7715R or ST7735R
> +  controller in SPI mode.
>  
>  allOf:
>    - $ref: panel/panel-common.yaml#
> @@ -25,6 +25,12 @@ properties:
>            - enum:
>                - jianda,jd-t18003-t01
>            - const: sitronix,st7735r
> +      - description:
> +          Okaya 1.44" 128x128 Color TFT LCD (E.g. Renesas YRSK-LCD-PMOD)
> +        items:
> +          - enum:
> +              - okaya,rh128128t
> +          - const: sitronix,st7715r
>  
>    spi-max-frequency:
>      maximum: 32000000
> -- 
> 2.17.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH v2 1/5] dt-bindings: display: sitronix, st7735r: Convert to DT schema
  2020-01-15 21:01   ` [PATCH v2 1/5] dt-bindings: display: sitronix,st7735r: " Sam Ravnborg
@ 2020-01-15 22:06     ` Geert Uytterhoeven
  0 siblings, 0 replies; 18+ messages in thread
From: Geert Uytterhoeven @ 2020-01-15 22:06 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Mark Rutland,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	David Lechner, Geert Uytterhoeven, David Airlie, Kieran Bingham,
	Linux Kernel Mailing List, Linux-Renesas, Rob Herring,
	Chris Brandt, DRI Development

Hi Sam,

On Wed, Jan 15, 2020 at 10:01 PM Sam Ravnborg <sam@ravnborg.org> wrote:
> On Wed, Jan 15, 2020 at 01:45:44PM +0100, Geert Uytterhoeven wrote:
> > Convert the DT binding documentation for Sitronix ST7735R displays to DT
> > schema.
> >
> > Add a reference to the Adafruit 1.8" LCD while at it.
> >
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > ---
>
> > diff --git a/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml b/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
> > new file mode 100644
> > index 0000000000000000..21bccc91f74255e1
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
> > @@ -0,0 +1,65 @@
> > +# SPDX-License-Identifier: GPL-2.0-only
> Use (GPL-2.0-only OR BSD-2-Clause) for new binding files.

I used GPL-2.0-only, as this is a conversion of an existing binding file,
covered by the default GPL-2.0-only of the Linux kernel source tree.

> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/display/sitronix,st7735r.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Sitronix ST7735R Display Panels Device Tree Bindings
> > +
> > +maintainers:
> > +  - David Lechner <david@lechnology.com>
> > +
> > +description:
> > +  This binding is for display panels using a Sitronix ST7735R controller in
> > +  SPI mode.
> > +
> > +allOf:
> > +  - $ref: panel/panel-common.yaml#
>
> I am no binding expert so I do not know how to add it.
> But the old binding described that this MUST be a child of spi.
> This is missing here.
>
> Other panels using spi does not have it - so it is probarly OK.

Yeah, I couldn't find any examples of expressing that requirement in yaml.

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
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH v2 3/5] drm/mipi_dbi: Add support for display offsets
  2020-01-15 12:45 ` [PATCH v2 3/5] drm/mipi_dbi: Add support for display offsets Geert Uytterhoeven
@ 2020-01-17 21:12   ` Sam Ravnborg
  2020-01-19 16:03   ` Noralf Trønnes
  1 sibling, 0 replies; 18+ messages in thread
From: Sam Ravnborg @ 2020-01-17 21:12 UTC (permalink / raw)
  To: Geert Uytterhoeven, Noralf Trønnes
  Cc: Mark Rutland, devicetree, David Lechner, David Airlie,
	Kieran Bingham, linux-kernel, linux-renesas-soc, Rob Herring,
	Chris Brandt, dri-devel

Hi Noralf.

If you could find time to review this patch it would be great.
I am reluctant to apply it until you have acked/reviewed it.

Thanks in advance,

	Sam

On Wed, Jan 15, 2020 at 01:45:46PM +0100, Geert Uytterhoeven wrote:
> If the resolution of the TFT display is smaller than the maximum
> resolution supported by the display controller, the display may be
> connected to the driver output arrays with a horizontal and/or vertical
> offset, leading to a shifted image.
> 
> Add support for specifying these offsets.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
> ---
> v2:
>   - Add Reviewed-by.
> ---
>  drivers/gpu/drm/drm_mipi_dbi.c | 30 ++++++++++++++++++++----------
>  include/drm/drm_mipi_dbi.h     | 12 ++++++++++++
>  2 files changed, 32 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c
> index 16bff1be4b8ac622..27fe81a53c88e338 100644
> --- a/drivers/gpu/drm/drm_mipi_dbi.c
> +++ b/drivers/gpu/drm/drm_mipi_dbi.c
> @@ -238,6 +238,23 @@ int mipi_dbi_buf_copy(void *dst, struct drm_framebuffer *fb,
>  }
>  EXPORT_SYMBOL(mipi_dbi_buf_copy);
>  
> +static void mipi_dbi_set_window_address(struct mipi_dbi_dev *dbidev,
> +					unsigned int xs, unsigned int xe,
> +					unsigned int ys, unsigned int ye)
> +{
> +	struct mipi_dbi *dbi = &dbidev->dbi;
> +
> +	xs += dbidev->left_offset;
> +	xe += dbidev->left_offset;
> +	ys += dbidev->top_offset;
> +	ye += dbidev->top_offset;
> +
> +	mipi_dbi_command(dbi, MIPI_DCS_SET_COLUMN_ADDRESS, (xs >> 8) & 0xff,
> +			 xs & 0xff, (xe >> 8) & 0xff, xe & 0xff);
> +	mipi_dbi_command(dbi, MIPI_DCS_SET_PAGE_ADDRESS, (ys >> 8) & 0xff,
> +			 ys & 0xff, (ye >> 8) & 0xff, ye & 0xff);
> +}
> +
>  static void mipi_dbi_fb_dirty(struct drm_framebuffer *fb, struct drm_rect *rect)
>  {
>  	struct drm_gem_object *gem = drm_gem_fb_get_obj(fb, 0);
> @@ -271,12 +288,8 @@ static void mipi_dbi_fb_dirty(struct drm_framebuffer *fb, struct drm_rect *rect)
>  		tr = cma_obj->vaddr;
>  	}
>  
> -	mipi_dbi_command(dbi, MIPI_DCS_SET_COLUMN_ADDRESS,
> -			 (rect->x1 >> 8) & 0xff, rect->x1 & 0xff,
> -			 ((rect->x2 - 1) >> 8) & 0xff, (rect->x2 - 1) & 0xff);
> -	mipi_dbi_command(dbi, MIPI_DCS_SET_PAGE_ADDRESS,
> -			 (rect->y1 >> 8) & 0xff, rect->y1 & 0xff,
> -			 ((rect->y2 - 1) >> 8) & 0xff, (rect->y2 - 1) & 0xff);
> +	mipi_dbi_set_window_address(dbidev, rect->x1, rect->x2 - 1, rect->y1,
> +				    rect->y2 - 1);
>  
>  	ret = mipi_dbi_command_buf(dbi, MIPI_DCS_WRITE_MEMORY_START, tr,
>  				   width * height * 2);
> @@ -366,10 +379,7 @@ static void mipi_dbi_blank(struct mipi_dbi_dev *dbidev)
>  
>  	memset(dbidev->tx_buf, 0, len);
>  
> -	mipi_dbi_command(dbi, MIPI_DCS_SET_COLUMN_ADDRESS, 0, 0,
> -			 ((width - 1) >> 8) & 0xFF, (width - 1) & 0xFF);
> -	mipi_dbi_command(dbi, MIPI_DCS_SET_PAGE_ADDRESS, 0, 0,
> -			 ((height - 1) >> 8) & 0xFF, (height - 1) & 0xFF);
> +	mipi_dbi_set_window_address(dbidev, 0, width - 1, 0, height - 1);
>  	mipi_dbi_command_buf(dbi, MIPI_DCS_WRITE_MEMORY_START,
>  			     (u8 *)dbidev->tx_buf, len);
>  
> diff --git a/include/drm/drm_mipi_dbi.h b/include/drm/drm_mipi_dbi.h
> index 67c66f5ee591e80f..33f325f5af2b921f 100644
> --- a/include/drm/drm_mipi_dbi.h
> +++ b/include/drm/drm_mipi_dbi.h
> @@ -109,6 +109,18 @@ struct mipi_dbi_dev {
>  	 */
>  	unsigned int rotation;
>  
> +	/**
> +	 * @left_offset: Horizontal offset of the display relative to the
> +	 *               controller's driver array
> +	 */
> +	unsigned int left_offset;
> +
> +	/**
> +	 * @top_offset: Vertical offset of the display relative to the
> +	 *              controller's driver array
> +	 */
> +	unsigned int top_offset;
> +
>  	/**
>  	 * @backlight: backlight device (optional)
>  	 */
> -- 
> 2.17.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH v2 3/5] drm/mipi_dbi: Add support for display offsets
  2020-01-15 12:45 ` [PATCH v2 3/5] drm/mipi_dbi: Add support for display offsets Geert Uytterhoeven
  2020-01-17 21:12   ` Sam Ravnborg
@ 2020-01-19 16:03   ` Noralf Trønnes
  1 sibling, 0 replies; 18+ messages in thread
From: Noralf Trønnes @ 2020-01-19 16:03 UTC (permalink / raw)
  To: Geert Uytterhoeven, David Lechner, David Airlie, Daniel Vetter,
	Maarten Lankhorst, Maxime Ripard, Rob Herring, Mark Rutland
  Cc: devicetree, linux-kernel, dri-devel, linux-renesas-soc,
	Chris Brandt, Kieran Bingham, Sam Ravnborg



Den 15.01.2020 13.45, skrev Geert Uytterhoeven:
> If the resolution of the TFT display is smaller than the maximum
> resolution supported by the display controller, the display may be
> connected to the driver output arrays with a horizontal and/or vertical
> offset, leading to a shifted image.
> 
> Add support for specifying these offsets.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
> ---

Acked-by: Noralf Trønnes <noralf@tronnes.org>

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

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

* Re: [PATCH v2 0/5] drm: Add support for Okaya RH128128T
  2020-01-15 12:45 [PATCH v2 0/5] drm: Add support for Okaya RH128128T Geert Uytterhoeven
                   ` (4 preceding siblings ...)
  2020-01-15 12:45 ` [PATCH v2 5/5] drm: tiny: st7735r: Add support for Okaya RH128128T Geert Uytterhoeven
@ 2020-01-19 17:15 ` Sam Ravnborg
  5 siblings, 0 replies; 18+ messages in thread
From: Sam Ravnborg @ 2020-01-19 17:15 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Mark Rutland, devicetree, David Lechner, David Airlie,
	Kieran Bingham, linux-kernel, linux-renesas-soc, Rob Herring,
	Chris Brandt, dri-devel

Hi Geert.

On Wed, Jan 15, 2020 at 01:45:43PM +0100, Geert Uytterhoeven wrote:
> 	Hi all,
> 
> This patch series adds support for the Okaya RH128128T LCD to the
> existing ST7735R driver.  This is a 128x128 1.4" TFT display driven by a
> Sitronix ST7715R TFT Controller/Driver.  It is used on e.g. the Renesas
> YRSK-LCD-PMOD extension board, which is shipped with Renesas RSK+RZA1
> development boards[1], and with several other Renesas starter kits, for
> RX, Synergy, and RZ/T1 MCUs and SoCs.
> 
> Changes compared to v1[2]:
>   - Convert DT bindings to DT schema,
>   - Add YRSK-LCD-PMOD reference and links,
>   - Add Reviewed-by,
>   - Split driver preparation and adding actual support in two separate
>     patches,
>   - Replace st7735r_priv.rgb by a pointer to struct st7735r_cfg,
>   - Change prefix of jd_t18003_t01_pipe_enable() and
>     jd_t18003_t01_pipe_funcs(),
>   - Update Kconfig help text,
>   - Improve file comment header.
> 
> This has been tested using the r7s72100-rskrza1-pmod-spi.dtso and
> r7s72100-rskrza1-pmod2-lcd.dtso DT overlays[3].
> Note that for using this on RSK+RZA1, there is a dependency on RSPI
> cs-gpios support (now in linux-next).
> With DT overlays, this also depends on DT overlays[4] and gpio-hog
> overlay support[5].
> 
> Thanks!
> 
> [1] https://renesasrulz.com/the_vault/f/archive-forum/4981/upgrading-to-the-renesas-rz-a1h
> [1] https://lore.kernel.org/dri-devel/20200102141246.370-1-geert+renesas@glider.be/
> [2] https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git/log/?h=topic/renesas-overlays
> [4] https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git/log/?h=topic/overlays
> [5] "[PATCH/RFC 0/2] gpio: of: Add DT overlay support for GPIO hogs"
>     https://lore.kernel.org/lkml/20191230133852.5890-1-geert+renesas@glider.be/
> 
> Geert Uytterhoeven (5):
>   dt-bindings: display: sitronix,st7735r: Convert to DT schema
>   dt-bindings: display: sitronix,st7735r: Add Okaya RH128128T
>   drm/mipi_dbi: Add support for display offsets
>   drm: tiny: st7735r: Prepare for adding support for more displays
>   drm: tiny: st7735r: Add support for Okaya RH128128T

Thanks, it ended up with a nice small patch adding support for
another controller/panel combo to this driver.
All 5 patches applied to drm-misc-next.

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

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

* Re: [PATCH v2 1/5] dt-bindings: display: sitronix, st7735r: Convert to DT schema
  2020-01-15 12:45 ` [PATCH v2 1/5] dt-bindings: display: sitronix, st7735r: Convert to DT schema Geert Uytterhoeven
  2020-01-15 21:01   ` [PATCH v2 1/5] dt-bindings: display: sitronix,st7735r: " Sam Ravnborg
@ 2020-01-20 16:00   ` David Lechner
  2020-01-20 19:02     ` [PATCH] dt-bindings: restrict properties for sitronix,st7735r Sam Ravnborg
  1 sibling, 1 reply; 18+ messages in thread
From: David Lechner @ 2020-01-20 16:00 UTC (permalink / raw)
  To: Geert Uytterhoeven, Noralf Trønnes, David Airlie,
	Daniel Vetter, Maarten Lankhorst, Maxime Ripard, Rob Herring,
	Mark Rutland
  Cc: devicetree, linux-kernel, dri-devel, linux-renesas-soc,
	Chris Brandt, Kieran Bingham, Sam Ravnborg

On 1/15/20 6:45 AM, Geert Uytterhoeven wrote:
> Convert the DT binding documentation for Sitronix ST7735R displays to DT
> schema.
> 
> Add a reference to the Adafruit 1.8" LCD while at it.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> v2:
>    - New.
> ---
>   .../bindings/display/sitronix,st7735r.txt     | 35 ----------
>   .../bindings/display/sitronix,st7735r.yaml    | 65 +++++++++++++++++++
>   MAINTAINERS                                   |  2 +-
>   3 files changed, 66 insertions(+), 36 deletions(-)
>   delete mode 100644 Documentation/devicetree/bindings/display/sitronix,st7735r.txt
>   create mode 100644 Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
> 
> diff --git a/Documentation/devicetree/bindings/display/sitronix,st7735r.txt b/Documentation/devicetree/bindings/display/sitronix,st7735r.txt
> deleted file mode 100644
> index cd5c7186890a2be7..0000000000000000
> --- a/Documentation/devicetree/bindings/display/sitronix,st7735r.txt
> +++ /dev/null
> @@ -1,35 +0,0 @@
> -Sitronix ST7735R display panels
> -
> -This binding is for display panels using a Sitronix ST7735R controller in SPI
> -mode.
> -
> -Required properties:
> -- compatible:	"jianda,jd-t18003-t01", "sitronix,st7735r"
> -- dc-gpios:	Display data/command selection (D/CX)
> -- reset-gpios:	Reset signal (RSTX)
> -
> -The node for this driver must be a child node of a SPI controller, hence
> -all mandatory properties described in ../spi/spi-bus.txt must be specified.
> -
> -Optional properties:
> -- rotation:	panel rotation in degrees counter clockwise (0,90,180,270)
> -- backlight:	phandle of the backlight device attached to the panel
> -
> -Example:
> -
> -	backlight: backlight {
> -		compatible = "gpio-backlight";
> -		gpios = <&gpio 44 GPIO_ACTIVE_HIGH>;
> -	};
> -
> -	...
> -
> -	display@0{
> -		compatible = "jianda,jd-t18003-t01", "sitronix,st7735r";
> -		reg = <0>;
> -		spi-max-frequency = <32000000>;
> -		dc-gpios = <&gpio 43 GPIO_ACTIVE_HIGH>;
> -		reset-gpios = <&gpio 80 GPIO_ACTIVE_HIGH>;
> -		rotation = <270>;
> -		backlight = &backlight;
> -	};
> diff --git a/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml b/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
> new file mode 100644
> index 0000000000000000..21bccc91f74255e1
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
> @@ -0,0 +1,65 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/display/sitronix,st7735r.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Sitronix ST7735R Display Panels Device Tree Bindings
> +
> +maintainers:
> +  - David Lechner <david@lechnology.com>
> +
> +description:
> +  This binding is for display panels using a Sitronix ST7735R controller in
> +  SPI mode.
> +
> +allOf:
> +  - $ref: panel/panel-common.yaml#

not all of these properties are applicable.

> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - description:
> +          Adafruit 1.8" 160x128 Color TFT LCD (Product ID 358 or 618)
> +        items:
> +          - enum:
> +              - jianda,jd-t18003-t01
> +          - const: sitronix,st7735r
> +
> +  spi-max-frequency:
> +    maximum: 32000000
> +
> +  dc-gpios:
> +    maxItems: 1
> +    description: Display data/command selection (D/CX)
> +
> +required:
> +  - compatible
> +  - reg
> +  - dc-gpios
> +  - reset-gpios

Missing optional rotation and backlight properties.

> +
> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +
> +    backlight: backlight {
> +            compatible = "gpio-backlight";
> +            gpios = <&gpio 44 GPIO_ACTIVE_HIGH>;
> +    };
> +
> +    spi {
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +
> +            display@0{
> +                    compatible = "jianda,jd-t18003-t01", "sitronix,st7735r";
> +                    reg = <0>;
> +                    spi-max-frequency = <32000000>;
> +                    dc-gpios = <&gpio 43 GPIO_ACTIVE_HIGH>;
> +                    reset-gpios = <&gpio 80 GPIO_ACTIVE_HIGH>;
> +                    rotation = <270>;
> +            };
> +    };
> +
> +...
> diff --git a/MAINTAINERS b/MAINTAINERS
> index ea8262509bdd21ac..3007f83bd504194a 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -5382,7 +5382,7 @@ M:	David Lechner <david@lechnology.com>
>   T:	git git://anongit.freedesktop.org/drm/drm-misc
>   S:	Maintained
>   F:	drivers/gpu/drm/tiny/st7735r.c
> -F:	Documentation/devicetree/bindings/display/sitronix,st7735r.txt
> +F:	Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
>   
>   DRM DRIVER FOR SONY ACX424AKP PANELS
>   M:	Linus Walleij <linus.walleij@linaro.org>
> 

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

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

* [PATCH] dt-bindings: restrict properties for sitronix,st7735r
  2020-01-20 16:00   ` David Lechner
@ 2020-01-20 19:02     ` Sam Ravnborg
  2020-01-23  7:24       ` Sam Ravnborg
                         ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Sam Ravnborg @ 2020-01-20 19:02 UTC (permalink / raw)
  To: David Lechner
  Cc: Mark Rutland, devicetree, Geert Uytterhoeven, David Airlie,
	Kieran Bingham, linux-kernel, linux-renesas-soc, Rob Herring,
	Chris Brandt, dri-devel

Hi David.

> > +allOf:
> > +  - $ref: panel/panel-common.yaml#
> 
> not all of these properties are applicable.
> 

> > +required:
> > +  - compatible
> > +  - reg
> > +  - dc-gpios
> > +  - reset-gpios
> 
> Missing optional rotation and backlight properties.

Thanks for catching this. I have written a little .yaml files
since I applied this - and learned a little more of the syntax.

See attached patch for my attempt to fix this.
Please review.

	Sam

From 6b54fb0a071c0732cd4bd5b88f456b5a85bcf4f2 Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <sam@ravnborg.org>
Date: Mon, 20 Jan 2020 19:55:04 +0100
Subject: [PATCH] dt-bindings: restrict properties for sitronix,st7735r

David Lechner noticed (paraphrased):
- not all properties from panel-common are applicable.
- missing optional rotation and backlight properties

Fix this by listing all allowed properties, and do not allow other properties.

Fixes: abdd9e3705c8 ("dt-bindings: display: sitronix,st7735r: Convert to DT schema")
Reported-by: David Lechner <david@lechnology.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: David Lechner <david@lechnology.com>
Cc: Rob Herring <robh@kernel.org>
Cc: dri-devel@lists.freedesktop.org
---
 .../devicetree/bindings/display/sitronix,st7735r.yaml      | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml b/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
index 8892d79e6e10..0cebaaefda03 100644
--- a/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
+++ b/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
@@ -39,12 +39,19 @@ properties:
     maxItems: 1
     description: Display data/command selection (D/CX)
 
+  backlight: true
+  reg: true
+  reset-gpios: true
+  rotation: true
+
 required:
   - compatible
   - reg
   - dc-gpios
   - reset-gpios
 
+additionalProperties: false
+
 examples:
   - |
     #include <dt-bindings/gpio/gpio.h>
-- 
2.20.1

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

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

* Re: [PATCH] dt-bindings: restrict properties for sitronix,st7735r
  2020-01-20 19:02     ` [PATCH] dt-bindings: restrict properties for sitronix,st7735r Sam Ravnborg
@ 2020-01-23  7:24       ` Sam Ravnborg
  2020-01-23  7:43       ` Geert Uytterhoeven
  2020-01-23 14:41       ` Rob Herring
  2 siblings, 0 replies; 18+ messages in thread
From: Sam Ravnborg @ 2020-01-23  7:24 UTC (permalink / raw)
  To: David Lechner, Geert Uytterhoeven
  Cc: Mark Rutland, devicetree, Geert Uytterhoeven, David Airlie,
	linux-kernel, Rob Herring, linux-renesas-soc, Chris Brandt,
	Kieran Bingham, dri-devel

On Mon, Jan 20, 2020 at 08:02:49PM +0100, Sam Ravnborg wrote:
> Hi David.
> 
> > > +allOf:
> > > +  - $ref: panel/panel-common.yaml#
> > 
> > not all of these properties are applicable.
> > 
> 
> > > +required:
> > > +  - compatible
> > > +  - reg
> > > +  - dc-gpios
> > > +  - reset-gpios
> > 
> > Missing optional rotation and backlight properties.
> 
> Thanks for catching this. I have written a little .yaml files
> since I applied this - and learned a little more of the syntax.
> 
> See attached patch for my attempt to fix this.
> Please review.

Hi David, Geert.

Any feedback on this patch?

	Sam

> 
> 	Sam
> 
> >From 6b54fb0a071c0732cd4bd5b88f456b5a85bcf4f2 Mon Sep 17 00:00:00 2001
> From: Sam Ravnborg <sam@ravnborg.org>
> Date: Mon, 20 Jan 2020 19:55:04 +0100
> Subject: [PATCH] dt-bindings: restrict properties for sitronix,st7735r
> 
> David Lechner noticed (paraphrased):
> - not all properties from panel-common are applicable.
> - missing optional rotation and backlight properties
> 
> Fix this by listing all allowed properties, and do not allow other properties.
> 
> Fixes: abdd9e3705c8 ("dt-bindings: display: sitronix,st7735r: Convert to DT schema")
> Reported-by: David Lechner <david@lechnology.com>
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: David Lechner <david@lechnology.com>
> Cc: Rob Herring <robh@kernel.org>
> Cc: dri-devel@lists.freedesktop.org
> ---
>  .../devicetree/bindings/display/sitronix,st7735r.yaml      | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml b/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
> index 8892d79e6e10..0cebaaefda03 100644
> --- a/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
> +++ b/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
> @@ -39,12 +39,19 @@ properties:
>      maxItems: 1
>      description: Display data/command selection (D/CX)
>  
> +  backlight: true
> +  reg: true
> +  reset-gpios: true
> +  rotation: true
> +
>  required:
>    - compatible
>    - reg
>    - dc-gpios
>    - reset-gpios
>  
> +additionalProperties: false
> +
>  examples:
>    - |
>      #include <dt-bindings/gpio/gpio.h>
> -- 
> 2.20.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] dt-bindings: restrict properties for sitronix,st7735r
  2020-01-20 19:02     ` [PATCH] dt-bindings: restrict properties for sitronix,st7735r Sam Ravnborg
  2020-01-23  7:24       ` Sam Ravnborg
@ 2020-01-23  7:43       ` Geert Uytterhoeven
  2020-01-23 18:19         ` Sam Ravnborg
  2020-01-23 14:41       ` Rob Herring
  2 siblings, 1 reply; 18+ messages in thread
From: Geert Uytterhoeven @ 2020-01-23  7:43 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Mark Rutland,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	David Lechner, Geert Uytterhoeven, David Airlie, Kieran Bingham,
	Linux Kernel Mailing List, Linux-Renesas, Rob Herring,
	Chris Brandt, DRI Development

Hi Sam,

On Mon, Jan 20, 2020 at 8:02 PM Sam Ravnborg <sam@ravnborg.org> wrote:
> From 6b54fb0a071c0732cd4bd5b88f456b5a85bcf4f2 Mon Sep 17 00:00:00 2001
> From: Sam Ravnborg <sam@ravnborg.org>
> Date: Mon, 20 Jan 2020 19:55:04 +0100
> Subject: [PATCH] dt-bindings: restrict properties for sitronix,st7735r
>
> David Lechner noticed (paraphrased):
> - not all properties from panel-common are applicable.
> - missing optional rotation and backlight properties
>
> Fix this by listing all allowed properties, and do not allow other properties.
>
> Fixes: abdd9e3705c8 ("dt-bindings: display: sitronix,st7735r: Convert to DT schema")
> Reported-by: David Lechner <david@lechnology.com>
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

I'm far from a DT yaml expert, but LGTM, so:
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

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
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] dt-bindings: restrict properties for sitronix,st7735r
  2020-01-20 19:02     ` [PATCH] dt-bindings: restrict properties for sitronix,st7735r Sam Ravnborg
  2020-01-23  7:24       ` Sam Ravnborg
  2020-01-23  7:43       ` Geert Uytterhoeven
@ 2020-01-23 14:41       ` Rob Herring
  2 siblings, 0 replies; 18+ messages in thread
From: Rob Herring @ 2020-01-23 14:41 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Mark Rutland, devicetree, David Lechner, Geert Uytterhoeven,
	David Airlie, Kieran Bingham, linux-kernel, linux-renesas-soc,
	Chris Brandt, dri-devel

On Mon, Jan 20, 2020 at 08:02:49PM +0100, Sam Ravnborg wrote:
> Hi David.
> 
> > > +allOf:
> > > +  - $ref: panel/panel-common.yaml#
> > 
> > not all of these properties are applicable.
> > 
> 
> > > +required:
> > > +  - compatible
> > > +  - reg
> > > +  - dc-gpios
> > > +  - reset-gpios
> > 
> > Missing optional rotation and backlight properties.
> 
> Thanks for catching this. I have written a little .yaml files
> since I applied this - and learned a little more of the syntax.
> 
> See attached patch for my attempt to fix this.
> Please review.
> 
> 	Sam
> 
> From 6b54fb0a071c0732cd4bd5b88f456b5a85bcf4f2 Mon Sep 17 00:00:00 2001
> From: Sam Ravnborg <sam@ravnborg.org>
> Date: Mon, 20 Jan 2020 19:55:04 +0100
> Subject: [PATCH] dt-bindings: restrict properties for sitronix,st7735r
> 
> David Lechner noticed (paraphrased):
> - not all properties from panel-common are applicable.
> - missing optional rotation and backlight properties
> 
> Fix this by listing all allowed properties, and do not allow other properties.
> 
> Fixes: abdd9e3705c8 ("dt-bindings: display: sitronix,st7735r: Convert to DT schema")
> Reported-by: David Lechner <david@lechnology.com>
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: David Lechner <david@lechnology.com>
> Cc: Rob Herring <robh@kernel.org>
> Cc: dri-devel@lists.freedesktop.org
> ---
>  .../devicetree/bindings/display/sitronix,st7735r.yaml      | 7 +++++++
>  1 file changed, 7 insertions(+)

Acked-by: Rob Herring <robh@kernel.org>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] dt-bindings: restrict properties for sitronix,st7735r
  2020-01-23  7:43       ` Geert Uytterhoeven
@ 2020-01-23 18:19         ` Sam Ravnborg
  0 siblings, 0 replies; 18+ messages in thread
From: Sam Ravnborg @ 2020-01-23 18:19 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Mark Rutland,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	David Lechner, Geert Uytterhoeven, David Airlie,
	Linux Kernel Mailing List, Rob Herring, Linux-Renesas,
	Chris Brandt, Kieran Bingham, DRI Development

Hi Geert & Rob.

On Thu, Jan 23, 2020 at 08:43:39AM +0100, Geert Uytterhoeven wrote:
> Hi Sam,
> 
> On Mon, Jan 20, 2020 at 8:02 PM Sam Ravnborg <sam@ravnborg.org> wrote:
> > From 6b54fb0a071c0732cd4bd5b88f456b5a85bcf4f2 Mon Sep 17 00:00:00 2001
> > From: Sam Ravnborg <sam@ravnborg.org>
> > Date: Mon, 20 Jan 2020 19:55:04 +0100
> > Subject: [PATCH] dt-bindings: restrict properties for sitronix,st7735r
> >
> > David Lechner noticed (paraphrased):
> > - not all properties from panel-common are applicable.
> > - missing optional rotation and backlight properties
> >
> > Fix this by listing all allowed properties, and do not allow other properties.
> >
> > Fixes: abdd9e3705c8 ("dt-bindings: display: sitronix,st7735r: Convert to DT schema")
> > Reported-by: David Lechner <david@lechnology.com>
> > Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> 
> I'm far from a DT yaml expert, but LGTM, so:
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Thanks, now pushed to drm-misc-next.

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

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

end of thread, other threads:[~2020-01-23 18:19 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-15 12:45 [PATCH v2 0/5] drm: Add support for Okaya RH128128T Geert Uytterhoeven
2020-01-15 12:45 ` [PATCH v2 1/5] dt-bindings: display: sitronix, st7735r: Convert to DT schema Geert Uytterhoeven
2020-01-15 21:01   ` [PATCH v2 1/5] dt-bindings: display: sitronix,st7735r: " Sam Ravnborg
2020-01-15 22:06     ` [PATCH v2 1/5] dt-bindings: display: sitronix, st7735r: " Geert Uytterhoeven
2020-01-20 16:00   ` David Lechner
2020-01-20 19:02     ` [PATCH] dt-bindings: restrict properties for sitronix,st7735r Sam Ravnborg
2020-01-23  7:24       ` Sam Ravnborg
2020-01-23  7:43       ` Geert Uytterhoeven
2020-01-23 18:19         ` Sam Ravnborg
2020-01-23 14:41       ` Rob Herring
2020-01-15 12:45 ` [PATCH v2 2/5] dt-bindings: display: sitronix, st7735r: Add Okaya RH128128T Geert Uytterhoeven
2020-01-15 21:01   ` Sam Ravnborg
2020-01-15 12:45 ` [PATCH v2 3/5] drm/mipi_dbi: Add support for display offsets Geert Uytterhoeven
2020-01-17 21:12   ` Sam Ravnborg
2020-01-19 16:03   ` Noralf Trønnes
2020-01-15 12:45 ` [PATCH v2 4/5] drm: tiny: st7735r: Prepare for adding support for more displays Geert Uytterhoeven
2020-01-15 12:45 ` [PATCH v2 5/5] drm: tiny: st7735r: Add support for Okaya RH128128T Geert Uytterhoeven
2020-01-19 17:15 ` [PATCH v2 0/5] drm: " Sam Ravnborg

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