diff mbox

drm/panel: simple: Add Sharp LQ035Q7DB03 panel support

Message ID 20180521232314.5972-1-vz@mleia.com (mailing list archive)
State New, archived
Headers show

Commit Message

Vladimir Zapolskiy May 21, 2018, 11:23 p.m. UTC
The change adds support for Sharp LQ035Q7DB03 3.5" QVGA panel.

Note that this aged panel is already found in the kernel sources,
for instance in board mach files mach-mx21ads.c, mach-mx27ads.c,
mach-pcm043.c, lpd270.c and imx27-phytec-phycore-rdk.dts.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
---
 .../bindings/display/panel/sharp,lq035q7db03.txt   |  7 ++++++
 drivers/gpu/drm/panel/panel-simple.c               | 27 ++++++++++++++++++++++
 2 files changed, 34 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/panel/sharp,lq035q7db03.txt

Comments

Rob Herring May 23, 2018, 6:39 p.m. UTC | #1
On Tue, May 22, 2018 at 02:23:14AM +0300, Vladimir Zapolskiy wrote:
> The change adds support for Sharp LQ035Q7DB03 3.5" QVGA panel.
> 
> Note that this aged panel is already found in the kernel sources,
> for instance in board mach files mach-mx21ads.c, mach-mx27ads.c,
> mach-pcm043.c, lpd270.c and imx27-phytec-phycore-rdk.dts.
> 
> Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
> ---
>  .../bindings/display/panel/sharp,lq035q7db03.txt   |  7 ++++++
>  drivers/gpu/drm/panel/panel-simple.c               | 27 ++++++++++++++++++++++
>  2 files changed, 34 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/display/panel/sharp,lq035q7db03.txt
> 
> diff --git a/Documentation/devicetree/bindings/display/panel/sharp,lq035q7db03.txt b/Documentation/devicetree/bindings/display/panel/sharp,lq035q7db03.txt
> new file mode 100644
> index 0000000..42027e5
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/panel/sharp,lq035q7db03.txt
> @@ -0,0 +1,7 @@
> +Sharp LQ035Q7DB03 3.5" QVGA TFT LCD panel
> +
> +Required properties:
> +- compatible: should be "sharp,lq035q7db03"
> +
> +This binding is compatible with the simple-panel binding, which is specified
> +in simple-panel.txt in this directory.

You need to state which properties from there this panel actually uses.

Rob
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/display/panel/sharp,lq035q7db03.txt b/Documentation/devicetree/bindings/display/panel/sharp,lq035q7db03.txt
new file mode 100644
index 0000000..42027e5
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/sharp,lq035q7db03.txt
@@ -0,0 +1,7 @@ 
+Sharp LQ035Q7DB03 3.5" QVGA TFT LCD panel
+
+Required properties:
+- compatible: should be "sharp,lq035q7db03"
+
+This binding is compatible with the simple-panel binding, which is specified
+in simple-panel.txt in this directory.
diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index cbf1ab4..8970261 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -1764,6 +1764,30 @@  static const struct panel_desc samsung_ltn140at29_301 = {
 	},
 };
 
+static const struct drm_display_mode sharp_lq035q7db03_mode = {
+	.clock = 5500,
+	.hdisplay = 240,
+	.hsync_start = 240 + 16,
+	.hsync_end = 240 + 16 + 7,
+	.htotal = 240 + 16 + 7 + 5,
+	.vdisplay = 320,
+	.vsync_start = 320 + 9,
+	.vsync_end = 320 + 9 + 1,
+	.vtotal = 320 + 9 + 1 + 7,
+	.vrefresh = 60,
+};
+
+static const struct panel_desc sharp_lq035q7db03 = {
+	.modes = &sharp_lq035q7db03_mode,
+	.num_modes = 1,
+	.bpc = 6,
+	.size = {
+		.width = 54,
+		.height = 72,
+	},
+	.bus_format = MEDIA_BUS_FMT_RGB666_1X18,
+};
+
 static const struct display_timing sharp_lq101k1ly04_timing = {
 	.pixelclock = { 60000000, 65000000, 80000000 },
 	.hactive = { 1280, 1280, 1280 },
@@ -2236,6 +2260,9 @@  static const struct of_device_id platform_of_match[] = {
 		.compatible = "samsung,ltn140at29-301",
 		.data = &samsung_ltn140at29_301,
 	}, {
+		.compatible = "sharp,lq035q7db03",
+		.data = &sharp_lq035q7db03,
+	}, {
 		.compatible = "sharp,lq101k1ly04",
 		.data = &sharp_lq101k1ly04,
 	}, {