From bbdcf516a6187d58639084f1b9f92cde50cc07ad Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Wed, 24 Aug 2016 13:28:39 +0200 Subject: drm/dsi: Order DCS helpers by command code Most of these helpers had been introduced in the correct order, but some were simply appended, which wasn't detected when they were applied. Signed-off-by: Thierry Reding diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index af0d471..8e56228 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -999,47 +999,47 @@ int mipi_dsi_dcs_set_tear_on(struct mipi_dsi_device *dsi, EXPORT_SYMBOL(mipi_dsi_dcs_set_tear_on); /** - * mipi_dsi_dcs_set_tear_scanline() - set the scanline to use as trigger for - * the Tearing Effect output signal of the display module + * mipi_dsi_dcs_set_pixel_format() - sets the pixel format for the RGB image + * data used by the interface * @dsi: DSI peripheral device - * @scanline: scanline to use as trigger + * @format: pixel format * - * Return: 0 on success or a negative error code on failure + * Return: 0 on success or a negative error code on failure. */ -int mipi_dsi_dcs_set_tear_scanline(struct mipi_dsi_device *dsi, u16 scanline) +int mipi_dsi_dcs_set_pixel_format(struct mipi_dsi_device *dsi, u8 format) { - u8 payload[3] = { MIPI_DCS_SET_TEAR_SCANLINE, scanline >> 8, - scanline & 0xff }; ssize_t err; - err = mipi_dsi_generic_write(dsi, payload, sizeof(payload)); + err = mipi_dsi_dcs_write(dsi, MIPI_DCS_SET_PIXEL_FORMAT, &format, + sizeof(format)); if (err < 0) return err; return 0; } -EXPORT_SYMBOL(mipi_dsi_dcs_set_tear_scanline); +EXPORT_SYMBOL(mipi_dsi_dcs_set_pixel_format); /** - * mipi_dsi_dcs_set_pixel_format() - sets the pixel format for the RGB image - * data used by the interface + * mipi_dsi_dcs_set_tear_scanline() - set the scanline to use as trigger for + * the Tearing Effect output signal of the display module * @dsi: DSI peripheral device - * @format: pixel format + * @scanline: scanline to use as trigger * - * Return: 0 on success or a negative error code on failure. + * Return: 0 on success or a negative error code on failure */ -int mipi_dsi_dcs_set_pixel_format(struct mipi_dsi_device *dsi, u8 format) +int mipi_dsi_dcs_set_tear_scanline(struct mipi_dsi_device *dsi, u16 scanline) { + u8 payload[3] = { MIPI_DCS_SET_TEAR_SCANLINE, scanline >> 8, + scanline & 0xff }; ssize_t err; - err = mipi_dsi_dcs_write(dsi, MIPI_DCS_SET_PIXEL_FORMAT, &format, - sizeof(format)); + err = mipi_dsi_generic_write(dsi, payload, sizeof(payload)); if (err < 0) return err; return 0; } -EXPORT_SYMBOL(mipi_dsi_dcs_set_pixel_format); +EXPORT_SYMBOL(mipi_dsi_dcs_set_tear_scanline); static int mipi_dsi_drv_probe(struct device *dev) { diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h index 47ac925..4ba9dfc 100644 --- a/include/drm/drm_mipi_dsi.h +++ b/include/drm/drm_mipi_dsi.h @@ -265,11 +265,11 @@ int mipi_dsi_dcs_set_column_address(struct mipi_dsi_device *dsi, u16 start, u16 end); int mipi_dsi_dcs_set_page_address(struct mipi_dsi_device *dsi, u16 start, u16 end); -int mipi_dsi_dcs_set_tear_scanline(struct mipi_dsi_device *dsi, u16 scanline); int mipi_dsi_dcs_set_tear_off(struct mipi_dsi_device *dsi); int mipi_dsi_dcs_set_tear_on(struct mipi_dsi_device *dsi, enum mipi_dsi_dcs_tear_mode mode); int mipi_dsi_dcs_set_pixel_format(struct mipi_dsi_device *dsi, u8 format); +int mipi_dsi_dcs_set_tear_scanline(struct mipi_dsi_device *dsi, u16 scanline); /** * struct mipi_dsi_driver - DSI driver -- cgit v0.10.2 From 1a9d759331b832c3d667d9473661497faada6df8 Mon Sep 17 00:00:00 2001 From: Vinay Simha BN Date: Sun, 31 Jul 2016 20:45:22 +0530 Subject: drm/dsi: Implement DCS set/get display brightness Provide a small convenience wrapper that set/get the display brightness. Cc: John Stultz Cc: Sumit Semwal Cc: Archit Taneja Cc: Rob Clark Cc: Jani Nikula Cc: Thierry Reding Cc: Emil Velikov Signed-off-by: Vinay Simha BN Reviewed-by: Emil Velikov Signed-off-by: Thierry Reding diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index 8e56228..1160a57 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -1041,6 +1041,55 @@ int mipi_dsi_dcs_set_tear_scanline(struct mipi_dsi_device *dsi, u16 scanline) } EXPORT_SYMBOL(mipi_dsi_dcs_set_tear_scanline); +/** + * mipi_dsi_dcs_set_display_brightness() - sets the brightness value of the + * display + * @dsi: DSI peripheral device + * @brightness: brightness value + * + * Return: 0 on success or a negative error code on failure. + */ +int mipi_dsi_dcs_set_display_brightness(struct mipi_dsi_device *dsi, + u16 brightness) +{ + u8 payload[2] = { brightness & 0xff, brightness >> 8 }; + ssize_t err; + + err = mipi_dsi_dcs_write(dsi, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, + payload, sizeof(payload)); + if (err < 0) + return err; + + return 0; +} +EXPORT_SYMBOL(mipi_dsi_dcs_set_display_brightness); + +/** + * mipi_dsi_dcs_get_display_brightness() - gets the current brightness value + * of the display + * @dsi: DSI peripheral device + * @brightness: brightness value + * + * Return: 0 on success or a negative error code on failure. + */ +int mipi_dsi_dcs_get_display_brightness(struct mipi_dsi_device *dsi, + u16 *brightness) +{ + ssize_t err; + + err = mipi_dsi_dcs_read(dsi, MIPI_DCS_GET_DISPLAY_BRIGHTNESS, + brightness, sizeof(*brightness)); + if (err <= 0) { + if (err == 0) + err = -ENODATA; + + return err; + } + + return 0; +} +EXPORT_SYMBOL(mipi_dsi_dcs_get_display_brightness); + static int mipi_dsi_drv_probe(struct device *dev) { struct mipi_dsi_driver *drv = to_mipi_dsi_driver(dev->driver); diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h index 4ba9dfc..4fef190 100644 --- a/include/drm/drm_mipi_dsi.h +++ b/include/drm/drm_mipi_dsi.h @@ -270,6 +270,10 @@ int mipi_dsi_dcs_set_tear_on(struct mipi_dsi_device *dsi, enum mipi_dsi_dcs_tear_mode mode); int mipi_dsi_dcs_set_pixel_format(struct mipi_dsi_device *dsi, u8 format); int mipi_dsi_dcs_set_tear_scanline(struct mipi_dsi_device *dsi, u16 scanline); +int mipi_dsi_dcs_set_display_brightness(struct mipi_dsi_device *dsi, + u16 brightness); +int mipi_dsi_dcs_get_display_brightness(struct mipi_dsi_device *dsi, + u16 *brightness); /** * struct mipi_dsi_driver - DSI driver -- cgit v0.10.2 From a42f6e3f8f0351abe91a97108e33083e6cfafc34 Mon Sep 17 00:00:00 2001 From: Yakir Yang Date: Thu, 21 Jul 2016 21:14:34 +0800 Subject: drm/panel: simple: Add delay timing for Sharp LQ123P1JX31 According to page 16 of the Sharp LQ123P1JX31 datasheet, we need to add the missing delay timing. Panel prepare time should be t1 (0.5 to 10 ms) plus t3 (0 to 100 ms), panel enable time should equal to t7 (0 to 50 ms) and panel unprepare time should be t11 (1 to 50 ms) plus t12 (500 ms). Signed-off-by: Yakir Yang Reviewed-by: Sean Paul Signed-off-by: Thierry Reding diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 85143d1..f178998 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -1384,6 +1384,11 @@ static const struct panel_desc sharp_lq123p1jx31 = { .width = 259, .height = 173, }, + .delay = { + .prepare = 110, + .enable = 50, + .unprepare = 550, + }, }; static const struct drm_display_mode shelly_sca07010_bfn_lnn_mode = { -- cgit v0.10.2 From 1e29b840af9f280915cb4aae5ada6a8666292c38 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Mon, 15 Aug 2016 14:32:02 +0200 Subject: drm/panel: simple: Add Innolux G101ICE-L01 panel This patch adds support for Innolux Corporation 10.1" G101ICE-L01 WXGA (1280x800) LVDS panel to the simple-panel driver. Signed-off-by: Michael Olbrich Signed-off-by: Lucas Stach Signed-off-by: Thierry Reding diff --git a/Documentation/devicetree/bindings/display/panel/innolux,g101ice-l01.txt b/Documentation/devicetree/bindings/display/panel/innolux,g101ice-l01.txt new file mode 100644 index 0000000..9e75904 --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/innolux,g101ice-l01.txt @@ -0,0 +1,7 @@ +Innolux Corporation 10.1" G101ICE-L01 WXGA (1280x800) LVDS panel + +Required properties: +- compatible: should be "innolux,g101ice-l01" + +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 f178998..69d6987 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -849,6 +849,34 @@ static const struct panel_desc innolux_at070tn92 = { .bus_format = MEDIA_BUS_FMT_RGB888_1X24, }; +static const struct display_timing innolux_g101ice_l01_timing = { + .pixelclock = { 60400000, 71100000, 74700000 }, + .hactive = { 1280, 1280, 1280 }, + .hfront_porch = { 41, 80, 100 }, + .hback_porch = { 40, 79, 99 }, + .hsync_len = { 1, 1, 1 }, + .vactive = { 800, 800, 800 }, + .vfront_porch = { 5, 11, 14 }, + .vback_porch = { 4, 11, 14 }, + .vsync_len = { 1, 1, 1 }, + .flags = DISPLAY_FLAGS_DE_HIGH, +}; + +static const struct panel_desc innolux_g101ice_l01 = { + .timings = &innolux_g101ice_l01_timing, + .num_timings = 1, + .bpc = 8, + .size = { + .width = 217, + .height = 135, + }, + .delay = { + .enable = 200, + .disable = 200, + }, + .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, +}; + static const struct drm_display_mode innolux_g121i1_l01_mode = { .clock = 71000, .hdisplay = 1280, @@ -1580,6 +1608,9 @@ static const struct of_device_id platform_of_match[] = { .compatible = "innolux,at070tn92", .data = &innolux_at070tn92, }, { + .compatible ="innolux,g101ice-l01", + .data = &innolux_g101ice_l01 + }, { .compatible ="innolux,g121i1-l01", .data = &innolux_g121i1_l01 }, { -- cgit v0.10.2 From e0932f9d7ba9a16f99a84943b720f109de8e3e06 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Fri, 26 Aug 2016 18:26:00 +0200 Subject: drm/panel: simple: Fix bus flags for Ortustech com43h4m85ulc This display expects DE pin and data lines to be active high, add the necessary flags. Signed-off-by: Marek Vasut Cc: Philipp Zabel Cc: Thierry Reding Reviewed-by: Philipp Zabel Signed-off-by: Thierry Reding diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 69d6987..a0b1185 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -1273,6 +1273,7 @@ static const struct panel_desc ortustech_com43h4m85ulc = { .height = 93, }, .bus_format = MEDIA_BUS_FMT_RGB888_1X24, + .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE, }; static const struct drm_display_mode qd43003c0_40_mode = { -- cgit v0.10.2 From c46b924bb2c316486a46ba3cfc0c8d28ce79cbd7 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Fri, 26 Aug 2016 14:32:14 -0700 Subject: drm/panel: simple-panel: Add delay timings for Starry KR122EA0SRA Taking our cue from commit a42f6e3f8f03 ("drm/panel: simple: Add delay timing for Sharp LQ123P1JX31"), let's add timings: .prepare = t1 + t3 .enable = t7 .unprepare = t11 + 12 Without this, the panel may not be given enough time to come up. Signed-off-by: Brian Norris Signed-off-by: Thierry Reding diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index a0b1185..11e36d9 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -1464,6 +1464,11 @@ static const struct panel_desc starry_kr122ea0sra = { .width = 263, .height = 164, }, + .delay = { + .prepare = 10 + 200, + .enable = 50, + .unprepare = 10 + 500, + }, }; static const struct drm_display_mode tpk_f07a_0102_mode = { -- cgit v0.10.2 From 5c2a7c6be18c48e95ba49cbb102bb7f93cdc8c17 Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Sun, 11 Sep 2016 20:46:55 +1000 Subject: drm/panel: simple: Fix bus_format for the Olimex LCD-OLinuXino-4.3TS The format is RGB888 not RGB666. Signed-off-by: Jonathan Liu Acked-by: Maxime Ripard Signed-off-by: Thierry Reding diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 11e36d9..113db3c 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -1214,7 +1214,7 @@ static const struct panel_desc olimex_lcd_olinuxino_43ts = { .width = 105, .height = 67, }, - .bus_format = MEDIA_BUS_FMT_RGB666_1X18, + .bus_format = MEDIA_BUS_FMT_RGB888_1X24, }; /* -- cgit v0.10.2 From cc4b13dd6df1cd80c4c8cddc4908532893a26af5 Mon Sep 17 00:00:00 2001 From: Vinay Simha BN Date: Thu, 8 Sep 2016 10:44:22 +0530 Subject: dt-bindings: Add JDI LT070ME05000 panel bindings The JDI LT070ME05000 is a 7" panel with a 1200x1920 (WUXGA) resolution and connected to DSI using four lanes. Cc: Archit Taneja Cc: John Stultz Cc: Thierry Reding Cc: Sumit Semwal Signed-off-by: Vinay Simha BN Acked-by: Rob Herring Signed-off-by: Thierry Reding diff --git a/Documentation/devicetree/bindings/display/panel/jdi,lt070me05000.txt b/Documentation/devicetree/bindings/display/panel/jdi,lt070me05000.txt new file mode 100644 index 0000000..4989c91d --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/jdi,lt070me05000.txt @@ -0,0 +1,31 @@ +JDI model LT070ME05000 1200x1920 7" DSI Panel + +Required properties: +- compatible: should be "jdi,lt070me05000" +- vddp-supply: phandle of the regulator that provides the supply voltage + Power IC supply (3-5V) +- iovcc-supply: phandle of the regulator that provides the supply voltage + IOVCC , power supply for LCM (1.8V) +- enable-gpios: phandle of gpio for enable line + LED_EN, LED backlight enable, High active +- reset-gpios: phandle of gpio for reset line + This should be 8mA, gpio can be configured using mux, pinctrl, pinctrl-names + XRES, Reset, Low active +- dcdc-en-gpios: phandle of the gpio for power ic line + Power IC supply enable, High active + +Example: + + dsi0: qcom,mdss_dsi@4700000 { + panel@0 { + compatible = "jdi,lt070me05000"; + reg = <0>; + + vddp-supply = <&pm8921_l17>; + iovcc-supply = <&pm8921_lvs7>; + + enable-gpios = <&pm8921_gpio 36 GPIO_ACTIVE_HIGH>; + reset-gpios = <&tlmm_pinmux 54 GPIO_ACTIVE_LOW>; + dcdc-en-gpios = <&pm8921_gpio 23 GPIO_ACTIVE_HIGH>; + }; + }; -- cgit v0.10.2 From c96f566273bf086fe18a294ac37edf2d451ff024 Mon Sep 17 00:00:00 2001 From: Vinay Simha BN Date: Fri, 26 Aug 2016 08:07:07 +0530 Subject: drm/panel: Add JDI LT070ME05000 WUXGA DSI Panel Add support for the JDI LT070ME05000 WUXGA DSI panel used in Nexus 7 2013 devices. Programming sequence for the panel is was originally found in the android-msm-flo-3.4-lollipop-release branch from: https://android.googlesource.com/kernel/msm.git And video mode setting is from dsi-panel-jdi-dualmipi1-video.dtsi file in: git://codeaurora.org/kernel/msm-3.10.git LNX.LA.3.6_rb1.27 Cc: Archit Taneja Cc: Rob Clark Cc: Sumit Semwal Cc: John Stultz Cc: Emil Velikov Cc: Thierry Reding Cc: David Airlie Signed-off-by: Sumit Semwal Signed-off-by: John Stultz Signed-off-by: Vinay Simha BN Tested-by: John Stultz Reviewed-by: Emil Velikov Signed-off-by: Thierry Reding diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 1500ab9..62aba97 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -18,6 +18,17 @@ config DRM_PANEL_SIMPLE that it can be automatically turned off when the panel goes into a low power state. +config DRM_PANEL_JDI_LT070ME05000 + tristate "JDI LT070ME05000 WUXGA DSI panel" + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + help + Say Y here if you want to enable support for JDI DSI video mode + panel as found in Google Nexus 7 (2013) devices. + The panel has a 1200(RGB)×1920 (WUXGA) resolution and uses + 24 bit per pixel. + config DRM_PANEL_SAMSUNG_LD9040 tristate "Samsung LD9040 RGB/SPI panel" depends on OF && SPI diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index f277eed..a5c7ec0 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -1,4 +1,5 @@ obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o +obj-$(CONFIG_DRM_PANEL_JDI_LT070ME05000) += panel-jdi-lt070me05000.o obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o obj-$(CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00) += panel-panasonic-vvx10f034n00.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_LD9040) += panel-samsung-ld9040.o diff --git a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c new file mode 100644 index 0000000..5b2340e --- /dev/null +++ b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c @@ -0,0 +1,532 @@ +/* + * Copyright (C) 2016 InforceComputing + * Author: Vinay Simha BN + * + * Copyright (C) 2016 Linaro Ltd + * Author: Sumit Semwal + * + * From internet archives, the panel for Nexus 7 2nd Gen, 2013 model is a + * JDI model LT070ME05000, and its data sheet is at: + * http://panelone.net/en/7-0-inch/JDI_LT070ME05000_7.0_inch-datasheet + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include