diff options
author | Dave Airlie <airlied@redhat.com> | 2015-08-17 01:53:05 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2015-08-17 01:53:05 -0400 |
commit | 6406e45cc6f4976ace2b6d23b76bb5f07541e68f (patch) | |
tree | 8443173ef2e33dbff9fdf08ca9bdbb4e1ad480e2 | |
parent | bef2c7bd578e91c9c10983e0c15c4501127b77ca (diff) | |
parent | a33ee95f8f456c241897a4b6153610b8488d009d (diff) |
Merge tag 'drm/panel/for-4.3-rc1' of git://anongit.freedesktop.org/tegra/linux into drm-next
drm/panel: Changes for v4.3-rc1
This introduces support for a couple of new panels and also contains
some work to restructure the directories to get more consistency, to
deal better with more panel and bridge drivers getting added.
* tag 'drm/panel/for-4.3-rc1' of git://anongit.freedesktop.org/tegra/linux:
drm/bridge: Put Kconfig entries in a separate menu
drm/panel: Add support for LG LG4573 480x800 4.3" panel
drm/panel: Add display timing for Okaya RS800480T-7X0GP
of: Add Okaya Electric America vendor prefix
drm/panel: simple: Add support for NEC NL4827HC19-05B 480x272 panel
drm/panel: simple: Add support for AUO B080UAN01
drm/panel: simple: Correct minimum hsync length of the HannStar HSD070PWW1 panel
drm/panel: simple: Add bus format for HannStar HSD070PWW1 LVDS panel
drm/bridge: Add vendor prefixes
drm/panel: Add Samsung prefix to panel drivers
drm/exynos: Remove PTN3460 dependency
19 files changed, 481 insertions, 28 deletions
diff --git a/Documentation/devicetree/bindings/panel/auo,b080uan01.txt b/Documentation/devicetree/bindings/panel/auo,b080uan01.txt new file mode 100644 index 000000000000..bae0e2b51467 --- /dev/null +++ b/Documentation/devicetree/bindings/panel/auo,b080uan01.txt | |||
@@ -0,0 +1,7 @@ | |||
1 | AU Optronics Corporation 8.0" WUXGA TFT LCD panel | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: should be "auo,b101ean01" | ||
5 | |||
6 | This binding is compatible with the simple-panel binding, which is specified | ||
7 | in simple-panel.txt in this directory. | ||
diff --git a/Documentation/devicetree/bindings/panel/lg,lg4573.txt b/Documentation/devicetree/bindings/panel/lg,lg4573.txt new file mode 100644 index 000000000000..824441f4e95a --- /dev/null +++ b/Documentation/devicetree/bindings/panel/lg,lg4573.txt | |||
@@ -0,0 +1,19 @@ | |||
1 | LG LG4573 TFT Liquid Crystal Display with SPI control bus | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: "lg,lg4573" | ||
5 | - reg: address of the panel on the SPI bus | ||
6 | |||
7 | The panel must obey rules for SPI slave device specified in document [1]. | ||
8 | |||
9 | [1]: Documentation/devicetree/bindings/spi/spi-bus.txt | ||
10 | |||
11 | Example: | ||
12 | |||
13 | lcd_panel: display@0 { | ||
14 | #address-cells = <1>; | ||
15 | #size-cells = <1>; | ||
16 | compatible = "lg,lg4573"; | ||
17 | spi-max-frequency = <10000000>; | ||
18 | reg = <0>; | ||
19 | }; | ||
diff --git a/Documentation/devicetree/bindings/panel/nec,nl4827hc19-05b.txt b/Documentation/devicetree/bindings/panel/nec,nl4827hc19-05b.txt new file mode 100644 index 000000000000..8e1914d1edb8 --- /dev/null +++ b/Documentation/devicetree/bindings/panel/nec,nl4827hc19-05b.txt | |||
@@ -0,0 +1,7 @@ | |||
1 | NEC LCD Technologies,Ltd. WQVGA TFT LCD panel | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: should be "nec,nl4827hc19-05b" | ||
5 | |||
6 | This binding is compatible with the simple-panel binding, which is specified | ||
7 | in simple-panel.txt in this directory. | ||
diff --git a/Documentation/devicetree/bindings/panel/okaya,rs800480t-7x0gp.txt b/Documentation/devicetree/bindings/panel/okaya,rs800480t-7x0gp.txt new file mode 100644 index 000000000000..ddf8e211d382 --- /dev/null +++ b/Documentation/devicetree/bindings/panel/okaya,rs800480t-7x0gp.txt | |||
@@ -0,0 +1,7 @@ | |||
1 | OKAYA Electric America, Inc. RS800480T-7X0GP 7" WVGA LCD panel | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: should be "okaya,rs800480t-7x0gp" | ||
5 | |||
6 | This binding is compatible with the simple-panel binding, which is specified | ||
7 | in simple-panel.txt in this directory. | ||
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index d444757c4d9e..bf529e77658d 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt | |||
@@ -148,6 +148,7 @@ nintendo Nintendo | |||
148 | nokia Nokia | 148 | nokia Nokia |
149 | nvidia NVIDIA | 149 | nvidia NVIDIA |
150 | nxp NXP Semiconductors | 150 | nxp NXP Semiconductors |
151 | okaya Okaya Electric America, Inc. | ||
151 | onnn ON Semiconductor Corp. | 152 | onnn ON Semiconductor Corp. |
152 | opencores OpenCores.org | 153 | opencores OpenCores.org |
153 | ortustech Ortus Technology Co., Ltd. | 154 | ortustech Ortus Technology Co., Ltd. |
diff --git a/arch/arm/configs/exynos_defconfig b/arch/arm/configs/exynos_defconfig index 9504e7790288..3eaf8fbaf603 100644 --- a/arch/arm/configs/exynos_defconfig +++ b/arch/arm/configs/exynos_defconfig | |||
@@ -124,14 +124,14 @@ CONFIG_REGULATOR_S2MPS11=y | |||
124 | CONFIG_REGULATOR_S5M8767=y | 124 | CONFIG_REGULATOR_S5M8767=y |
125 | CONFIG_REGULATOR_TPS65090=y | 125 | CONFIG_REGULATOR_TPS65090=y |
126 | CONFIG_DRM=y | 126 | CONFIG_DRM=y |
127 | CONFIG_DRM_PTN3460=y | 127 | CONFIG_DRM_NXP_PTN3460=y |
128 | CONFIG_DRM_PS8622=y | 128 | CONFIG_DRM_PARADE_PS8622=y |
129 | CONFIG_DRM_EXYNOS=y | 129 | CONFIG_DRM_EXYNOS=y |
130 | CONFIG_DRM_EXYNOS_FIMD=y | 130 | CONFIG_DRM_EXYNOS_FIMD=y |
131 | CONFIG_DRM_EXYNOS_DSI=y | 131 | CONFIG_DRM_EXYNOS_DSI=y |
132 | CONFIG_DRM_EXYNOS_HDMI=y | 132 | CONFIG_DRM_EXYNOS_HDMI=y |
133 | CONFIG_DRM_PANEL_SIMPLE=y | 133 | CONFIG_DRM_PANEL_SIMPLE=y |
134 | CONFIG_DRM_PANEL_S6E8AA0=y | 134 | CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0=y |
135 | CONFIG_FB_SIMPLE=y | 135 | CONFIG_FB_SIMPLE=y |
136 | CONFIG_EXYNOS_VIDEO=y | 136 | CONFIG_EXYNOS_VIDEO=y |
137 | CONFIG_EXYNOS_MIPI_DSI=y | 137 | CONFIG_EXYNOS_MIPI_DSI=y |
diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig index 5fd8df6f50ea..6413390212fe 100644 --- a/arch/arm/configs/multi_v7_defconfig +++ b/arch/arm/configs/multi_v7_defconfig | |||
@@ -429,15 +429,15 @@ CONFIG_VIDEO_RENESAS_VSP1=m | |||
429 | CONFIG_VIDEO_ADV7180=m | 429 | CONFIG_VIDEO_ADV7180=m |
430 | CONFIG_VIDEO_ML86V7667=m | 430 | CONFIG_VIDEO_ML86V7667=m |
431 | CONFIG_DRM=y | 431 | CONFIG_DRM=y |
432 | CONFIG_DRM_PTN3460=m | 432 | CONFIG_DRM_NXP_PTN3460=m |
433 | CONFIG_DRM_PS8622=m | 433 | CONFIG_DRM_PARADE_PS8622=m |
434 | CONFIG_DRM_EXYNOS=m | 434 | CONFIG_DRM_EXYNOS=m |
435 | CONFIG_DRM_EXYNOS_DSI=y | 435 | CONFIG_DRM_EXYNOS_DSI=y |
436 | CONFIG_DRM_EXYNOS_FIMD=y | 436 | CONFIG_DRM_EXYNOS_FIMD=y |
437 | CONFIG_DRM_EXYNOS_HDMI=y | 437 | CONFIG_DRM_EXYNOS_HDMI=y |
438 | CONFIG_DRM_RCAR_DU=m | 438 | CONFIG_DRM_RCAR_DU=m |
439 | CONFIG_DRM_TEGRA=y | 439 | CONFIG_DRM_TEGRA=y |
440 | CONFIG_DRM_PANEL_S6E8AA0=m | 440 | CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0=m |
441 | CONFIG_DRM_PANEL_SIMPLE=y | 441 | CONFIG_DRM_PANEL_SIMPLE=y |
442 | CONFIG_FB_ARMCLCD=y | 442 | CONFIG_FB_ARMCLCD=y |
443 | CONFIG_FB_WM8505=y | 443 | CONFIG_FB_WM8505=y |
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index 06ae5008c5ed..86191586340f 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig | |||
@@ -99,8 +99,6 @@ config DRM_KMS_CMA_HELPER | |||
99 | 99 | ||
100 | source "drivers/gpu/drm/i2c/Kconfig" | 100 | source "drivers/gpu/drm/i2c/Kconfig" |
101 | 101 | ||
102 | source "drivers/gpu/drm/bridge/Kconfig" | ||
103 | |||
104 | config DRM_TDFX | 102 | config DRM_TDFX |
105 | tristate "3dfx Banshee/Voodoo3+" | 103 | tristate "3dfx Banshee/Voodoo3+" |
106 | depends on DRM && PCI | 104 | depends on DRM && PCI |
@@ -255,6 +253,8 @@ source "drivers/gpu/drm/tegra/Kconfig" | |||
255 | 253 | ||
256 | source "drivers/gpu/drm/panel/Kconfig" | 254 | source "drivers/gpu/drm/panel/Kconfig" |
257 | 255 | ||
256 | source "drivers/gpu/drm/bridge/Kconfig" | ||
257 | |||
258 | source "drivers/gpu/drm/sti/Kconfig" | 258 | source "drivers/gpu/drm/sti/Kconfig" |
259 | 259 | ||
260 | source "drivers/gpu/drm/amd/amdkfd/Kconfig" | 260 | source "drivers/gpu/drm/amd/amdkfd/Kconfig" |
diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig index acef3223772c..2de52a53a803 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig | |||
@@ -1,24 +1,32 @@ | |||
1 | config DRM_BRIDGE | ||
2 | def_bool y | ||
3 | depends on DRM | ||
4 | help | ||
5 | Bridge registration and lookup framework. | ||
6 | |||
7 | menu "Display Interface Bridges" | ||
8 | depends on DRM && DRM_BRIDGE | ||
9 | |||
1 | config DRM_DW_HDMI | 10 | config DRM_DW_HDMI |
2 | tristate | 11 | tristate |
3 | depends on DRM | ||
4 | select DRM_KMS_HELPER | 12 | select DRM_KMS_HELPER |
5 | 13 | ||
6 | config DRM_PTN3460 | 14 | config DRM_NXP_PTN3460 |
7 | tristate "PTN3460 DP/LVDS bridge" | 15 | tristate "NXP PTN3460 DP/LVDS bridge" |
8 | depends on DRM | ||
9 | depends on OF | 16 | depends on OF |
10 | select DRM_KMS_HELPER | 17 | select DRM_KMS_HELPER |
11 | select DRM_PANEL | 18 | select DRM_PANEL |
12 | ---help--- | 19 | ---help--- |
13 | ptn3460 eDP-LVDS bridge chip driver. | 20 | NXP PTN3460 eDP-LVDS bridge chip driver. |
14 | 21 | ||
15 | config DRM_PS8622 | 22 | config DRM_PARADE_PS8622 |
16 | tristate "Parade eDP/LVDS bridge" | 23 | tristate "Parade eDP/LVDS bridge" |
17 | depends on DRM | ||
18 | depends on OF | 24 | depends on OF |
19 | select DRM_PANEL | 25 | select DRM_PANEL |
20 | select DRM_KMS_HELPER | 26 | select DRM_KMS_HELPER |
21 | select BACKLIGHT_LCD_SUPPORT | 27 | select BACKLIGHT_LCD_SUPPORT |
22 | select BACKLIGHT_CLASS_DEVICE | 28 | select BACKLIGHT_CLASS_DEVICE |
23 | ---help--- | 29 | ---help--- |
24 | parade eDP-LVDS bridge chip driver. | 30 | Parade eDP-LVDS bridge chip driver. |
31 | |||
32 | endmenu | ||
diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile index 8dfebd984370..e2eef1c2f4c3 100644 --- a/drivers/gpu/drm/bridge/Makefile +++ b/drivers/gpu/drm/bridge/Makefile | |||
@@ -1,5 +1,5 @@ | |||
1 | ccflags-y := -Iinclude/drm | 1 | ccflags-y := -Iinclude/drm |
2 | 2 | ||
3 | obj-$(CONFIG_DRM_PS8622) += ps8622.o | ||
4 | obj-$(CONFIG_DRM_PTN3460) += ptn3460.o | ||
5 | obj-$(CONFIG_DRM_DW_HDMI) += dw_hdmi.o | 3 | obj-$(CONFIG_DRM_DW_HDMI) += dw_hdmi.o |
4 | obj-$(CONFIG_DRM_NXP_PTN3460) += nxp-ptn3460.o | ||
5 | obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o | ||
diff --git a/drivers/gpu/drm/bridge/ptn3460.c b/drivers/gpu/drm/bridge/nxp-ptn3460.c index 1b1bf2384815..1b1bf2384815 100644 --- a/drivers/gpu/drm/bridge/ptn3460.c +++ b/drivers/gpu/drm/bridge/nxp-ptn3460.c | |||
diff --git a/drivers/gpu/drm/bridge/ps8622.c b/drivers/gpu/drm/bridge/parade-ps8622.c index 1a6607beb29f..1a6607beb29f 100644 --- a/drivers/gpu/drm/bridge/ps8622.c +++ b/drivers/gpu/drm/bridge/parade-ps8622.c | |||
diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig index 43003c4ad80b..df0b61a60501 100644 --- a/drivers/gpu/drm/exynos/Kconfig +++ b/drivers/gpu/drm/exynos/Kconfig | |||
@@ -56,7 +56,7 @@ config DRM_EXYNOS_DSI | |||
56 | 56 | ||
57 | config DRM_EXYNOS_DP | 57 | config DRM_EXYNOS_DP |
58 | bool "EXYNOS DRM DP driver support" | 58 | bool "EXYNOS DRM DP driver support" |
59 | depends on DRM_EXYNOS && (DRM_EXYNOS_FIMD || DRM_EXYNOS7_DECON) && (DRM_PTN3460=n || DRM_PTN3460=y || DRM_PTN3460=DRM_EXYNOS) | 59 | depends on DRM_EXYNOS && (DRM_EXYNOS_FIMD || DRM_EXYNOS7_DECON) |
60 | default DRM_EXYNOS | 60 | default DRM_EXYNOS |
61 | select DRM_PANEL | 61 | select DRM_PANEL |
62 | help | 62 | help |
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 6d64c7bb908b..7d4704b1292b 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig | |||
@@ -18,13 +18,21 @@ config DRM_PANEL_SIMPLE | |||
18 | that it can be automatically turned off when the panel goes into a | 18 | that it can be automatically turned off when the panel goes into a |
19 | low power state. | 19 | low power state. |
20 | 20 | ||
21 | config DRM_PANEL_LD9040 | 21 | config DRM_PANEL_SAMSUNG_LD9040 |
22 | tristate "LD9040 RGB/SPI panel" | 22 | tristate "Samsung LD9040 RGB/SPI panel" |
23 | depends on OF && SPI | 23 | depends on OF && SPI |
24 | select VIDEOMODE_HELPERS | 24 | select VIDEOMODE_HELPERS |
25 | 25 | ||
26 | config DRM_PANEL_S6E8AA0 | 26 | config DRM_PANEL_LG_LG4573 |
27 | tristate "S6E8AA0 DSI video mode panel" | 27 | tristate "LG4573 RGB/SPI panel" |
28 | depends on OF && SPI | ||
29 | select VIDEOMODE_HELPERS | ||
30 | help | ||
31 | Say Y here if you want to enable support for LG4573 RGB panel. | ||
32 | To compile this driver as a module, choose M here. | ||
33 | |||
34 | config DRM_PANEL_SAMSUNG_S6E8AA0 | ||
35 | tristate "Samsung S6E8AA0 DSI video mode panel" | ||
28 | depends on OF | 36 | depends on OF |
29 | select DRM_MIPI_DSI | 37 | select DRM_MIPI_DSI |
30 | select VIDEOMODE_HELPERS | 38 | select VIDEOMODE_HELPERS |
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 4b2a0430804b..d0f016dd7ddb 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile | |||
@@ -1,4 +1,5 @@ | |||
1 | obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o | 1 | obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o |
2 | obj-$(CONFIG_DRM_PANEL_LD9040) += panel-ld9040.o | 2 | obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o |
3 | obj-$(CONFIG_DRM_PANEL_S6E8AA0) += panel-s6e8aa0.o | 3 | obj-$(CONFIG_DRM_PANEL_SAMSUNG_LD9040) += panel-samsung-ld9040.o |
4 | obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0) += panel-samsung-s6e8aa0.o | ||
4 | obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o | 5 | obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o |
diff --git a/drivers/gpu/drm/panel/panel-lg-lg4573.c b/drivers/gpu/drm/panel/panel-lg-lg4573.c new file mode 100644 index 000000000000..a7b4939cee6d --- /dev/null +++ b/drivers/gpu/drm/panel/panel-lg-lg4573.c | |||
@@ -0,0 +1,298 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2015 Heiko Schocher <hs@denx.de> | ||
3 | * | ||
4 | * from: | ||
5 | * drivers/gpu/drm/panel/panel-ld9040.c | ||
6 | * ld9040 AMOLED LCD drm_panel driver. | ||
7 | * | ||
8 | * Copyright (c) 2014 Samsung Electronics Co., Ltd | ||
9 | * Derived from drivers/video/backlight/ld9040.c | ||
10 | * | ||
11 | * Andrzej Hajda <a.hajda@samsung.com> | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or modify | ||
14 | * it under the terms of the GNU General Public License version 2 as | ||
15 | * published by the Free Software Foundation. | ||
16 | */ | ||
17 | |||
18 | #include <drm/drmP.h> | ||
19 | #include <drm/drm_panel.h> | ||
20 | |||
21 | #include <linux/gpio/consumer.h> | ||
22 | #include <linux/regulator/consumer.h> | ||
23 | #include <linux/spi/spi.h> | ||
24 | |||
25 | #include <video/mipi_display.h> | ||
26 | #include <video/of_videomode.h> | ||
27 | #include <video/videomode.h> | ||
28 | |||
29 | struct lg4573 { | ||
30 | struct drm_panel panel; | ||
31 | struct spi_device *spi; | ||
32 | struct videomode vm; | ||
33 | }; | ||
34 | |||
35 | static inline struct lg4573 *panel_to_lg4573(struct drm_panel *panel) | ||
36 | { | ||
37 | return container_of(panel, struct lg4573, panel); | ||
38 | } | ||
39 | |||
40 | static int lg4573_spi_write_u16(struct lg4573 *ctx, u16 data) | ||
41 | { | ||
42 | struct spi_transfer xfer = { | ||
43 | .len = 2, | ||
44 | }; | ||
45 | u16 temp = cpu_to_be16(data); | ||
46 | struct spi_message msg; | ||
47 | |||
48 | dev_dbg(ctx->panel.dev, "writing data: %x\n", data); | ||
49 | xfer.tx_buf = &temp; | ||
50 | spi_message_init(&msg); | ||
51 | spi_message_add_tail(&xfer, &msg); | ||
52 | |||
53 | return spi_sync(ctx->spi, &msg); | ||
54 | } | ||
55 | |||
56 | static int lg4573_spi_write_u16_array(struct lg4573 *ctx, const u16 *buffer, | ||
57 | unsigned int count) | ||
58 | { | ||
59 | unsigned int i; | ||
60 | int ret; | ||
61 | |||
62 | for (i = 0; i < count; i++) { | ||
63 | ret = lg4573_spi_write_u16(ctx, buffer[i]); | ||
64 | if (ret) | ||
65 | return ret; | ||
66 | } | ||
67 | |||
68 | return 0; | ||
69 | } | ||
70 | |||
71 | static int lg4573_spi_write_dcs(struct lg4573 *ctx, u8 dcs) | ||
72 | { | ||
73 | return lg4573_spi_write_u16(ctx, (0x70 << 8 | dcs)); | ||
74 | } | ||
75 | |||
76 | static int lg4573_display_on(struct lg4573 *ctx) | ||
77 | { | ||
78 | int ret; | ||
79 | |||
80 | ret = lg4573_spi_write_dcs(ctx, MIPI_DCS_EXIT_SLEEP_MODE); | ||
81 | if (ret) | ||
82 | return ret; | ||
83 | |||
84 | msleep(5); | ||
85 | |||
86 | return lg4573_spi_write_dcs(ctx, MIPI_DCS_SET_DISPLAY_ON); | ||
87 | } | ||
88 | |||
89 | static int lg4573_display_off(struct lg4573 *ctx) | ||
90 | { | ||
91 | int ret; | ||
92 | |||
93 | ret = lg4573_spi_write_dcs(ctx, MIPI_DCS_SET_DISPLAY_OFF); | ||
94 | if (ret) | ||
95 | return ret; | ||
96 | |||
97 | msleep(120); | ||
98 | |||
99 | return lg4573_spi_write_dcs(ctx, MIPI_DCS_ENTER_SLEEP_MODE); | ||
100 | } | ||
101 | |||
102 | static int lg4573_display_mode_settings(struct lg4573 *ctx) | ||
103 | { | ||
104 | static const u16 display_mode_settings[] = { | ||
105 | 0x703A, 0x7270, 0x70B1, 0x7208, | ||
106 | 0x723B, 0x720F, 0x70B2, 0x7200, | ||
107 | 0x72C8, 0x70B3, 0x7200, 0x70B4, | ||
108 | 0x7200, 0x70B5, 0x7242, 0x7210, | ||
109 | 0x7210, 0x7200, 0x7220, 0x70B6, | ||
110 | 0x720B, 0x720F, 0x723C, 0x7213, | ||
111 | 0x7213, 0x72E8, 0x70B7, 0x7246, | ||
112 | 0x7206, 0x720C, 0x7200, 0x7200, | ||
113 | }; | ||
114 | |||
115 | dev_dbg(ctx->panel.dev, "transfer display mode settings\n"); | ||
116 | return lg4573_spi_write_u16_array(ctx, display_mode_settings, | ||
117 | ARRAY_SIZE(display_mode_settings)); | ||
118 | } | ||
119 | |||
120 | static int lg4573_power_settings(struct lg4573 *ctx) | ||
121 | { | ||
122 | static const u16 power_settings[] = { | ||
123 | 0x70C0, 0x7201, 0x7211, 0x70C3, | ||
124 | 0x7207, 0x7203, 0x7204, 0x7204, | ||
125 | 0x7204, 0x70C4, 0x7212, 0x7224, | ||
126 | 0x7218, 0x7218, 0x7202, 0x7249, | ||
127 | 0x70C5, 0x726F, 0x70C6, 0x7241, | ||
128 | 0x7263, | ||
129 | }; | ||
130 | |||
131 | dev_dbg(ctx->panel.dev, "transfer power settings\n"); | ||
132 | return lg4573_spi_write_u16_array(ctx, power_settings, | ||
133 | ARRAY_SIZE(power_settings)); | ||
134 | } | ||
135 | |||
136 | static int lg4573_gamma_settings(struct lg4573 *ctx) | ||
137 | { | ||
138 | static const u16 gamma_settings[] = { | ||
139 | 0x70D0, 0x7203, 0x7207, 0x7273, | ||
140 | 0x7235, 0x7200, 0x7201, 0x7220, | ||
141 | 0x7200, 0x7203, 0x70D1, 0x7203, | ||
142 | 0x7207, 0x7273, 0x7235, 0x7200, | ||
143 | 0x7201, 0x7220, 0x7200, 0x7203, | ||
144 | 0x70D2, 0x7203, 0x7207, 0x7273, | ||
145 | 0x7235, 0x7200, 0x7201, 0x7220, | ||
146 | 0x7200, 0x7203, 0x70D3, 0x7203, | ||
147 | 0x7207, 0x7273, 0x7235, 0x7200, | ||
148 | 0x7201, 0x7220, 0x7200, 0x7203, | ||
149 | 0x70D4, 0x7203, 0x7207, 0x7273, | ||
150 | 0x7235, 0x7200, 0x7201, 0x7220, | ||
151 | 0x7200, 0x7203, 0x70D5, 0x7203, | ||
152 | 0x7207, 0x7273, 0x7235, 0x7200, | ||
153 | 0x7201, 0x7220, 0x7200, 0x7203, | ||
154 | }; | ||
155 | |||
156 | dev_dbg(ctx->panel.dev, "transfer gamma settings\n"); | ||
157 | return lg4573_spi_write_u16_array(ctx, gamma_settings, | ||
158 | ARRAY_SIZE(gamma_settings)); | ||
159 | } | ||
160 | |||
161 | static int lg4573_init(struct lg4573 *ctx) | ||
162 | { | ||
163 | int ret; | ||
164 | |||
165 | dev_dbg(ctx->panel.dev, "initializing LCD\n"); | ||
166 | |||
167 | ret = lg4573_display_mode_settings(ctx); | ||
168 | if (ret) | ||
169 | return ret; | ||
170 | |||
171 | ret = lg4573_power_settings(ctx); | ||
172 | if (ret) | ||
173 | return ret; | ||
174 | |||
175 | return lg4573_gamma_settings(ctx); | ||
176 | } | ||
177 | |||
178 | static int lg4573_power_on(struct lg4573 *ctx) | ||
179 | { | ||
180 | return lg4573_display_on(ctx); | ||
181 | } | ||
182 | |||
183 | static int lg4573_disable(struct drm_panel *panel) | ||
184 | { | ||
185 | struct lg4573 *ctx = panel_to_lg4573(panel); | ||
186 | |||
187 | return lg4573_display_off(ctx); | ||
188 | } | ||
189 | |||
190 | static int lg4573_enable(struct drm_panel *panel) | ||
191 | { | ||
192 | struct lg4573 *ctx = panel_to_lg4573(panel); | ||
193 | |||
194 | lg4573_init(ctx); | ||
195 | |||
196 | return lg4573_power_on(ctx); | ||
197 | } | ||
198 | |||
199 | static const struct drm_display_mode default_mode = { | ||
200 | .clock = 27000, | ||
201 | .hdisplay = 480, | ||
202 | .hsync_start = 480 + 10, | ||
203 | .hsync_end = 480 + 10 + 59, | ||
204 | .htotal = 480 + 10 + 59 + 10, | ||
205 | .vdisplay = 800, | ||
206 | .vsync_start = 800 + 15, | ||
207 | .vsync_end = 800 + 15 + 15, | ||
208 | .vtotal = 800 + 15 + 15 + 15, | ||
209 | .vrefresh = 60, | ||
210 | }; | ||
211 | |||
212 | static int lg4573_get_modes(struct drm_panel *panel) | ||
213 | { | ||
214 | struct drm_connector *connector = panel->connector; | ||
215 | struct drm_display_mode *mode; | ||
216 | |||
217 | mode = drm_mode_duplicate(panel->drm, &default_mode); | ||
218 | if (!mode) { | ||
219 | dev_err(panel->drm->dev, "failed to add mode %ux%ux@%u\n", | ||
220 | default_mode.hdisplay, default_mode.vdisplay, | ||
221 | default_mode.vrefresh); | ||
222 | return -ENOMEM; | ||
223 | } | ||
224 | |||
225 | drm_mode_set_name(mode); | ||
226 | |||
227 | mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; | ||
228 | drm_mode_probed_add(connector, mode); | ||
229 | |||
230 | panel->connector->display_info.width_mm = 61; | ||
231 | panel->connector->display_info.height_mm = 103; | ||
232 | |||
233 | return 1; | ||
234 | } | ||
235 | |||
236 | static const struct drm_panel_funcs lg4573_drm_funcs = { | ||
237 | .disable = lg4573_disable, | ||
238 | .enable = lg4573_enable, | ||
239 | .get_modes = lg4573_get_modes, | ||
240 | }; | ||
241 | |||
242 | static int lg4573_probe(struct spi_device *spi) | ||
243 | { | ||
244 | struct lg4573 *ctx; | ||
245 | int ret; | ||
246 | |||
247 | ctx = devm_kzalloc(&spi->dev, sizeof(*ctx), GFP_KERNEL); | ||
248 | if (!ctx) | ||
249 | return -ENOMEM; | ||
250 | |||
251 | ctx->spi = spi; | ||
252 | |||
253 | spi_set_drvdata(spi, ctx); | ||
254 | spi->bits_per_word = 8; | ||
255 | |||
256 | ret = spi_setup(spi); | ||
257 | if (ret < 0) { | ||
258 | dev_err(&spi->dev, "SPI setup failed: %d\n", ret); | ||
259 | return ret; | ||
260 | } | ||
261 | |||
262 | drm_panel_init(&ctx->panel); | ||
263 | ctx->panel.dev = &spi->dev; | ||
264 | ctx->panel.funcs = &lg4573_drm_funcs; | ||
265 | |||
266 | return drm_panel_add(&ctx->panel); | ||
267 | } | ||
268 | |||
269 | static int lg4573_remove(struct spi_device *spi) | ||
270 | { | ||
271 | struct lg4573 *ctx = spi_get_drvdata(spi); | ||
272 | |||
273 | lg4573_display_off(ctx); | ||
274 | drm_panel_remove(&ctx->panel); | ||
275 | |||
276 | return 0; | ||
277 | } | ||
278 | |||
279 | static const struct of_device_id lg4573_of_match[] = { | ||
280 | { .compatible = "lg,lg4573" }, | ||
281 | { } | ||
282 | }; | ||
283 | MODULE_DEVICE_TABLE(of, lg4573_of_match); | ||
284 | |||
285 | static struct spi_driver lg4573_driver = { | ||
286 | .probe = lg4573_probe, | ||
287 | .remove = lg4573_remove, | ||
288 | .driver = { | ||
289 | .name = "lg4573", | ||
290 | .owner = THIS_MODULE, | ||
291 | .of_match_table = lg4573_of_match, | ||
292 | }, | ||
293 | }; | ||
294 | module_spi_driver(lg4573_driver); | ||
295 | |||
296 | MODULE_AUTHOR("Heiko Schocher <hs@denx.de>"); | ||
297 | MODULE_DESCRIPTION("lg4573 LCD Driver"); | ||
298 | MODULE_LICENSE("GPL v2"); | ||
diff --git a/drivers/gpu/drm/panel/panel-ld9040.c b/drivers/gpu/drm/panel/panel-samsung-ld9040.c index 9c27bded4c09..b202377135e7 100644 --- a/drivers/gpu/drm/panel/panel-ld9040.c +++ b/drivers/gpu/drm/panel/panel-samsung-ld9040.c | |||
@@ -377,7 +377,7 @@ static struct spi_driver ld9040_driver = { | |||
377 | .probe = ld9040_probe, | 377 | .probe = ld9040_probe, |
378 | .remove = ld9040_remove, | 378 | .remove = ld9040_remove, |
379 | .driver = { | 379 | .driver = { |
380 | .name = "ld9040", | 380 | .name = "panel-samsung-ld9040", |
381 | .owner = THIS_MODULE, | 381 | .owner = THIS_MODULE, |
382 | .of_match_table = ld9040_of_match, | 382 | .of_match_table = ld9040_of_match, |
383 | }, | 383 | }, |
diff --git a/drivers/gpu/drm/panel/panel-s6e8aa0.c b/drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c index 30051108eec4..a188a3959f1a 100644 --- a/drivers/gpu/drm/panel/panel-s6e8aa0.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c | |||
@@ -1051,7 +1051,7 @@ static struct mipi_dsi_driver s6e8aa0_driver = { | |||
1051 | .probe = s6e8aa0_probe, | 1051 | .probe = s6e8aa0_probe, |
1052 | .remove = s6e8aa0_remove, | 1052 | .remove = s6e8aa0_remove, |
1053 | .driver = { | 1053 | .driver = { |
1054 | .name = "panel_s6e8aa0", | 1054 | .name = "panel-samsung-s6e8aa0", |
1055 | .of_match_table = s6e8aa0_of_match, | 1055 | .of_match_table = s6e8aa0_of_match, |
1056 | }, | 1056 | }, |
1057 | }; | 1057 | }; |
diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index f94201b6e882..f97b73ec4713 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c | |||
@@ -713,7 +713,12 @@ static const struct display_timing hannstar_hsd070pww1_timing = { | |||
713 | .hactive = { 1280, 1280, 1280 }, | 713 | .hactive = { 1280, 1280, 1280 }, |
714 | .hfront_porch = { 1, 1, 10 }, | 714 | .hfront_porch = { 1, 1, 10 }, |
715 | .hback_porch = { 1, 1, 10 }, | 715 | .hback_porch = { 1, 1, 10 }, |
716 | .hsync_len = { 52, 158, 661 }, | 716 | /* |
717 | * According to the data sheet, the minimum horizontal blanking interval | ||
718 | * is 54 clocks (1 + 52 + 1), but tests with a Nitrogen6X have shown the | ||
719 | * minimum working horizontal blanking interval to be 60 clocks. | ||
720 | */ | ||
721 | .hsync_len = { 58, 158, 661 }, | ||
717 | .vactive = { 800, 800, 800 }, | 722 | .vactive = { 800, 800, 800 }, |
718 | .vfront_porch = { 1, 1, 10 }, | 723 | .vfront_porch = { 1, 1, 10 }, |
719 | .vback_porch = { 1, 1, 10 }, | 724 | .vback_porch = { 1, 1, 10 }, |
@@ -729,6 +734,7 @@ static const struct panel_desc hannstar_hsd070pww1 = { | |||
729 | .width = 151, | 734 | .width = 151, |
730 | .height = 94, | 735 | .height = 94, |
731 | }, | 736 | }, |
737 | .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG, | ||
732 | }; | 738 | }; |
733 | 739 | ||
734 | static const struct display_timing hannstar_hsd100pxn1_timing = { | 740 | static const struct display_timing hannstar_hsd100pxn1_timing = { |
@@ -943,6 +949,60 @@ static const struct panel_desc lg_lp129qe = { | |||
943 | }, | 949 | }, |
944 | }; | 950 | }; |
945 | 951 | ||
952 | static const struct drm_display_mode nec_nl4827hc19_05b_mode = { | ||
953 | .clock = 10870, | ||
954 | .hdisplay = 480, | ||
955 | .hsync_start = 480 + 2, | ||
956 | .hsync_end = 480 + 2 + 41, | ||
957 | .htotal = 480 + 2 + 41 + 2, | ||
958 | .vdisplay = 272, | ||
959 | .vsync_start = 272 + 2, | ||
960 | .vsync_end = 272 + 2 + 4, | ||
961 | .vtotal = 272 + 2 + 4 + 2, | ||
962 | .vrefresh = 74, | ||
963 | }; | ||
964 | |||
965 | static const struct panel_desc nec_nl4827hc19_05b = { | ||
966 | .modes = &nec_nl4827hc19_05b_mode, | ||
967 | .num_modes = 1, | ||
968 | .bpc = 8, | ||
969 | .size = { | ||
970 | .width = 95, | ||
971 | .height = 54, | ||
972 | }, | ||
973 | .bus_format = MEDIA_BUS_FMT_RGB888_1X24 | ||
974 | }; | ||
975 | |||
976 | static const struct display_timing okaya_rs800480t_7x0gp_timing = { | ||
977 | .pixelclock = { 30000000, 30000000, 40000000 }, | ||
978 | .hactive = { 800, 800, 800 }, | ||
979 | .hfront_porch = { 40, 40, 40 }, | ||
980 | .hback_porch = { 40, 40, 40 }, | ||
981 | .hsync_len = { 1, 48, 48 }, | ||
982 | .vactive = { 480, 480, 480 }, | ||
983 | .vfront_porch = { 13, 13, 13 }, | ||
984 | .vback_porch = { 29, 29, 29 }, | ||
985 | .vsync_len = { 3, 3, 3 }, | ||
986 | .flags = DISPLAY_FLAGS_DE_HIGH, | ||
987 | }; | ||
988 | |||
989 | static const struct panel_desc okaya_rs800480t_7x0gp = { | ||
990 | .timings = &okaya_rs800480t_7x0gp_timing, | ||
991 | .num_timings = 1, | ||
992 | .bpc = 6, | ||
993 | .size = { | ||
994 | .width = 154, | ||
995 | .height = 87, | ||
996 | }, | ||
997 | .delay = { | ||
998 | .prepare = 41, | ||
999 | .enable = 50, | ||
1000 | .unprepare = 41, | ||
1001 | .disable = 50, | ||
1002 | }, | ||
1003 | .bus_format = MEDIA_BUS_FMT_RGB666_1X18, | ||
1004 | }; | ||
1005 | |||
946 | static const struct drm_display_mode ortustech_com43h4m85ulc_mode = { | 1006 | static const struct drm_display_mode ortustech_com43h4m85ulc_mode = { |
947 | .clock = 25000, | 1007 | .clock = 25000, |
948 | .hdisplay = 480, | 1008 | .hdisplay = 480, |
@@ -1113,6 +1173,12 @@ static const struct of_device_id platform_of_match[] = { | |||
1113 | .compatible = "lg,lp129qe", | 1173 | .compatible = "lg,lp129qe", |
1114 | .data = &lg_lp129qe, | 1174 | .data = &lg_lp129qe, |
1115 | }, { | 1175 | }, { |
1176 | .compatible = "nec,nl4827hc19-05b", | ||
1177 | .data = &nec_nl4827hc19_05b, | ||
1178 | }, { | ||
1179 | .compatible = "okaya,rs800480t-7x0gp", | ||
1180 | .data = &okaya_rs800480t_7x0gp, | ||
1181 | }, { | ||
1116 | .compatible = "ortustech,com43h4m85ulc", | 1182 | .compatible = "ortustech,com43h4m85ulc", |
1117 | .data = &ortustech_com43h4m85ulc, | 1183 | .data = &ortustech_com43h4m85ulc, |
1118 | }, { | 1184 | }, { |
@@ -1169,6 +1235,34 @@ struct panel_desc_dsi { | |||
1169 | unsigned int lanes; | 1235 | unsigned int lanes; |
1170 | }; | 1236 | }; |
1171 | 1237 | ||
1238 | static const struct drm_display_mode auo_b080uan01_mode = { | ||
1239 | .clock = 154500, | ||
1240 | .hdisplay = 1200, | ||
1241 | .hsync_start = 1200 + 62, | ||
1242 | .hsync_end = 1200 + 62 + 4, | ||
1243 | .htotal = 1200 + 62 + 4 + 62, | ||
1244 | .vdisplay = 1920, | ||
1245 | .vsync_start = 1920 + 9, | ||
1246 | .vsync_end = 1920 + 9 + 2, | ||
1247 | .vtotal = 1920 + 9 + 2 + 8, | ||
1248 | .vrefresh = 60, | ||
1249 | }; | ||
1250 | |||
1251 | static const struct panel_desc_dsi auo_b080uan01 = { | ||
1252 | .desc = { | ||
1253 | .modes = &auo_b080uan01_mode, | ||
1254 | .num_modes = 1, | ||
1255 | .bpc = 8, | ||
1256 | .size = { | ||
1257 | .width = 108, | ||
1258 | .height = 272, | ||
1259 | }, | ||
1260 | }, | ||
1261 | .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS, | ||
1262 | .format = MIPI_DSI_FMT_RGB888, | ||
1263 | .lanes = 4, | ||
1264 | }; | ||
1265 | |||
1172 | static const struct drm_display_mode lg_ld070wx3_sl01_mode = { | 1266 | static const struct drm_display_mode lg_ld070wx3_sl01_mode = { |
1173 | .clock = 71000, | 1267 | .clock = 71000, |
1174 | .hdisplay = 800, | 1268 | .hdisplay = 800, |
@@ -1256,6 +1350,9 @@ static const struct panel_desc_dsi panasonic_vvx10f004b00 = { | |||
1256 | 1350 | ||
1257 | static const struct of_device_id dsi_of_match[] = { | 1351 | static const struct of_device_id dsi_of_match[] = { |
1258 | { | 1352 | { |
1353 | .compatible = "auo,b080uan01", | ||
1354 | .data = &auo_b080uan01 | ||
1355 | }, { | ||
1259 | .compatible = "lg,ld070wx3-sl01", | 1356 | .compatible = "lg,ld070wx3-sl01", |
1260 | .data = &lg_ld070wx3_sl01 | 1357 | .data = &lg_ld070wx3_sl01 |
1261 | }, { | 1358 | }, { |