Re: [PATCH v3 08/11] drm/panel: simple: Add BOE HB140WX1-501 panel support

2019-02-16 Thread Vasily Khoruzhick via dri-devel
On Sat, Feb 16, 2019 at 12:43 PM Sam Ravnborg  wrote:
>
> Hi Vasily.

Hi Sam,

> On Thu, Feb 14, 2019 at 09:09:54PM -0800, Vasily Khoruzhick via dri-devel 
> wrote:
> > This commit adds support for the BOE HB140WX1-501 14" WXGA TFT LCD
> > panel.
> >
> > Signed-off-by: Vasily Khoruzhick 
> > ---
> >  .../display/panel/boe,hb140wx1-501.txt|  7 +
> >  drivers/gpu/drm/panel/panel-simple.c  | 26 +++
> >  2 files changed, 33 insertions(+)
> >  create mode 100644 
> > Documentation/devicetree/bindings/display/panel/boe,hb140wx1-501.txt
> >
> > diff --git 
> > a/Documentation/devicetree/bindings/display/panel/boe,hb140wx1-501.txt 
> > b/Documentation/devicetree/bindings/display/panel/boe,hb140wx1-501.txt
> > new file mode 100644
> > index ..fc6f085eb8d1
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/display/panel/boe,hb140wx1-501.txt
> > @@ -0,0 +1,7 @@
> > +BOE HB140WX1-501 14" WXGA (1366x768) TFT LCD panel
> > +
> > +Required properties:
> > +- compatible: should be "boe,hb140wx1-501"
> > +
> > +This binding is compatible with the simple-panel binding, which is 
> > specified
> > +in simple-panel.txt in this directory.
>
> boe must be added to vendor-prefixes.txt
> (It is not present in the file I checked, but I may have been added later)

It's been there for quite a while, it's added in 27d23b30a561b which
was included
in 4.5.

> It is usual practice to split the patch in a dt-bindings: patch and a driver 
> patch.
> And for the dt-bindings patch follow the submission rules laid out
> in Documentation/devicetree/bindings/submitting-patches.txt

I checked git log for drivers/gpu/drm/panel/panel-simple.c and looks
like recent commits
for this file added binding and timings in a single commit. I can
split it into separate file
if maintainers insist though.

> > diff --git a/drivers/gpu/drm/panel/panel-simple.c 
> > b/drivers/gpu/drm/panel/panel-simple.c
> > index 9c69e739a524..9a4c9dd02c6c 100644
> > --- a/drivers/gpu/drm/panel/panel-simple.c
> > +++ b/drivers/gpu/drm/panel/panel-simple.c
> > @@ -828,6 +828,29 @@ static const struct panel_desc bananapi_s070wv20_ct16 
> > = {
> >   },
> >  };
> >
> > +static const struct drm_display_mode boe_hb140wx1_mode = {
> > + .clock = 72300,
> > + .hdisplay = 1366,
> > + .hsync_start = 1366 + 48,
> > + .hsync_end = 1366 + 48 + 32,
> > + .htotal = 1366 + 48 + 32 + 80,
> > + .vdisplay = 768,
> > + .vsync_start = 768 + 3,
> > + .vsync_end = 768 + 3 + 6,
> > + .vtotal = 768 + 3 + 6 + 13,
> > + .vrefresh = 60,
> > + .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC,
>
> +1 for specifying .flags.
>
> > +};
> > +
> > +static const struct panel_desc boe_hb140wx1 = {
> > + .modes = _hb140wx1_mode,
> > + .num_modes = 1,
> > + .size = {
> > + .width = 310,
> > + .height = 170,
> > + },
> > +};
> No .bus_format and no .bus_flags specified.
> Are they not used by this panel or are you lucky and the default works?

This is eDP panel, it doesn't need bus_format or bus_flags.

> > +
> >  static const struct drm_display_mode boe_hv070wsa_mode = {
> >   .clock = 42105,
> >   .hdisplay = 1024,
> > @@ -2541,6 +2564,9 @@ static const struct of_device_id platform_of_match[] 
> > = {
> >   }, {
> >   .compatible = "bananapi,s070wv20-ct16",
> >   .data = _s070wv20_ct16,
> > + }, {
> > + .compatible = "boe,hb140wx1-501",
> > + .data = _hb140wx1
> It is common practice to end the line with a "," so one do not need to modify
> this line if an extra line is required.

OK, will do.

>
> With the comments addressed you can add my:
> Reviewed-by: Sam Ravnborg 
>
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [linux-sunxi] [PATCH v3 05/11] drm/bridge: Add Analogix anx6345 support

2019-02-16 Thread Vasily Khoruzhick via dri-devel
On Fri, Feb 15, 2019 at 12:23 AM Priit Laes  wrote:

> > + err = anx6345_tx_initialization(anx6345);
> > + if (err) {
> > + DRM_ERROR("Failed transmitter initialization: %d\n", err);
> > + goto err_poweroff;
>
> You can move the whole err_poweroff section from below here and drop the goto.

Thanks, will do.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH v3 05/11] drm/bridge: Add Analogix anx6345 support

2019-02-16 Thread Vasily Khoruzhick via dri-devel
On Fri, Feb 15, 2019 at 1:13 AM Andrzej Hajda  wrote:

Hi Andrzej,

Thanks for review!

> > +#include 
> Do you need this header?

I'll drop it.

> > +#include 
>
> drmP.h is/should be deprecated.

Same here

> > +struct anx6345_platform_data {
> > + struct regulator *dvdd12;
> > + struct regulator *dvdd25;
> > + struct gpio_desc *gpiod_reset;
> > +};
>
> Why do you need this struct, why just do not embed it's fields directly
> into struct anx6345 ?

OK, I'll embed it into struct anx6345

> > + if (WARN_ON(anx6345->powered))
> > + return;
>
> It should not happen, you can remove this warn.

OK

> > + if (pdata->dvdd12) {
>
> If regulators are required this will be never null.

Right, and regulator subsystem will return dummy regulator if it's
missing in dts.
I'll remove redundant checks.

> > +
> > + if (pdata->dvdd25) {
>
> ditto

OK

> > +
> > + if (anx6345->panel)
> > + drm_panel_prepare(anx6345->panel);
>
> again, here and below: panel is never null, check can be removed.

That's not true, panel is optional. It can be DP connector, not a panel.

> > +
> > + gpiod_set_value_cansleep(pdata->gpiod_reset, 0);
> > + usleep_range(1000, 2000);
> > +
> > + gpiod_set_value_cansleep(pdata->gpiod_reset, 1);
>
>
> Start/stop sequence seems odd regarding reset gpio:
>
> 1. In probe reset is set to low, in poweroff to high - incosistent.
>
> 2. If in case of disabled device reset should be 0, there is no point to
> set it again to 0 three lines above.
>
> 3. I suspect in dts reset gpio should be declared as active_low, and the
> logic in the driver should be reverted, in power off it should be set to
> high, in power on it should be lowered (logically).

OK, I'll look into it.

> > +err_poweroff:
> > + DRM_ERROR("Failed DisplayPort transmitter initialization: %d\n", err);
>
> redundant message

OK, will drop.

> > + DRM_ERROR("Get sink count failed %d\n", err);
>
> The rule of thumb I heard is that if you start message capitalized you
> should end with dot. Since I do not know if it is enforced in kernel I
> leave the decision up to you.

I grepped DRM_ERROR in driver/gpu/drm and they do exactly the same as here.
So I'll just keep it as is for consistency.

> > +static bool anx6345_bridge_mode_fixup(struct drm_bridge *bridge,
> > +   const struct drm_display_mode *mode,
> > +   struct drm_display_mode *adjusted_mode)
> > +{
> > + if (mode->flags & DRM_MODE_FLAG_INTERLACE)
> > + return false;
> > +
> > + /* Max 1200p at 5.4 Ghz, one lane */
> > + if (mode->clock > 154000)
> > + return false;
>
> These checks should be in mode_valid callback.

OK

> > + /* Map slave addresses of ANX6345 */
> > + for (i = 0; i < I2C_NUM_ADDRESSES; i++) {
> > + if (anx6345_i2c_addresses[i] >> 1 != client->addr)
> > + anx6345->i2c_clients[i] = 
> > i2c_new_dummy(client->adapter,
> > + anx6345_i2c_addresses[i] >> 
> > 1);
> > + else
> > + anx6345->i2c_clients[i] = client;
>
>
> I see this contredanse is copy/pasted from anx78*, but it looks quite
> complicated. As I understand there are two i2c addresses, why we cannot
> assume one address is for control interfaces and another  is dummy? It would
> simplify the code here and in other places.

Sorry, I don't get you, could you elaborate? Note that anx6345 uses
both addresses,
i2c_new_dummy() just registers new i2c device bound to a dummy driver and it's
supposed to be used for devices that consume more than one i2c address.

> > + if (!found) {
> > + DRM_ERROR("ANX%x (ver. %d) not supported by this driver\n",
> > +   anx6345->chipid, version);
> > + err = -ENODEV;
> > + goto err_poweroff;
> > + }
>
>
> As I see chip becomes powered forever, is it OK? Usually it should be
> powered only when pipeline starts, and powered-off after pipeline stops.

I'll look into how hard it would be to implement but personally I
think it's OK for now.
We can add more sophisticated power management once this driver is merged.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH v3 09/11] dt-bindings: Add Guangdong Neweast Optoelectronics CO. LTD vendor prefix

2019-02-16 Thread Vasily Khoruzhick via dri-devel
Add vendor prefix for Guangdong Neweast Optoelectronics CO. LTD

Signed-off-by: Vasily Khoruzhick 
---
 Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt 
b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 389508584f48..15cfc265b644 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -267,6 +267,7 @@ netron-dy   Netron DY
 netxeonShenzhen Netxeon Technology CO., LTD
 nexbox Nexbox
 nextthing  Next Thing Co.
+neweastGuangdong Neweast Optoelectronics CO., LTD
 newhaven   Newhaven Display International
 ni National Instruments
 nintendo   Nintendo
-- 
2.20.1

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

[PATCH v3 02/11] drm/bridge: split some definitions of ANX78xx to dedicated headers

2019-02-16 Thread Vasily Khoruzhick via dri-devel
From: Icenowy Zheng 

Some definitions currently in analogix-anx78xx.h are not restricted to
the ANX78xx series, but also applicable to other DisplayPort
transmitters by Analogix.

Split out them to dedicated headers, and make analogix-anx78xx.h include
them.

Signed-off-by: Icenowy Zheng 
Signed-off-by: Vasily Khoruzhick 
---
 .../drm/bridge/analogix/analogix-anx78xx.h| 464 +-
 .../drm/bridge/analogix/analogix-i2c-dptx.h   | 248 ++
 .../bridge/analogix/analogix-i2c-txcommon.h   | 237 +
 3 files changed, 490 insertions(+), 459 deletions(-)
 create mode 100644 drivers/gpu/drm/bridge/analogix/analogix-i2c-dptx.h
 create mode 100644 drivers/gpu/drm/bridge/analogix/analogix-i2c-txcommon.h

diff --git a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.h 
b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.h
index 38753c870137..8aa1eca306d3 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.h
+++ b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.h
@@ -15,9 +15,12 @@
 #ifndef __ANX78xx_H
 #define __ANX78xx_H
 
-#define TX_P0  0x70
+#include "analogix-i2c-dptx.h"
+#include "analogix-i2c-txcommon.h"
+
+#define TX_P0  ANALOGIX_I2C_DPTX
 #define TX_P1  0x7a
-#define TX_P2  0x72
+#define TX_P2  ANALOGIX_I2C_TXCOMMON
 
 #define RX_P0  0x7e
 #define RX_P1  0x80
@@ -225,463 +228,6 @@
 #define SP_CLEAR_AVMUTEBIT(4)
 #define SP_SET_AVMUTE  BIT(0)
 
-/***/
-/* Register definition of device address 0x70  */
-/***/
-
-/* HDCP Status Register */
-#define SP_TX_HDCP_STATUS_REG  0x00
-#define SP_AUTH_FAIL   BIT(5)
-#define SP_AUTHEN_PASS BIT(1)
-
-/* HDCP Control Register 0 */
-#define SP_HDCP_CTRL0_REG  0x01
-#define SP_RX_REPEATER BIT(6)
-#define SP_RE_AUTH BIT(5)
-#define SP_SW_AUTH_OK  BIT(4)
-#define SP_HARD_AUTH_ENBIT(3)
-#define SP_HDCP_ENC_EN BIT(2)
-#define SP_BKSV_SRM_PASS   BIT(1)
-#define SP_KSVLIST_VLD BIT(0)
-/* HDCP Function Enabled */
-#define SP_HDCP_FUNCTION_ENABLED   (BIT(0) | BIT(1) | BIT(2) | BIT(3))
-
-/* HDCP Receiver BSTATUS Register 0 */
-#defineSP_HDCP_RX_BSTATUS0_REG 0x1b
-/* HDCP Receiver BSTATUS Register 1 */
-#defineSP_HDCP_RX_BSTATUS1_REG 0x1c
-
-/* HDCP Embedded "Blue Screen" Content Registers */
-#define SP_HDCP_VID0_BLUE_SCREEN_REG   0x2c
-#define SP_HDCP_VID1_BLUE_SCREEN_REG   0x2d
-#define SP_HDCP_VID2_BLUE_SCREEN_REG   0x2e
-
-/* HDCP Wait R0 Timing Register */
-#define SP_HDCP_WAIT_R0_TIME_REG   0x40
-
-/* HDCP Link Integrity Check Timer Register */
-#define SP_HDCP_LINK_CHECK_TIMER_REG   0x41
-
-/* HDCP Repeater Ready Wait Timer Register */
-#define SP_HDCP_RPTR_RDY_WAIT_TIME_REG 0x42
-
-/* HDCP Auto Timer Register */
-#define SP_HDCP_AUTO_TIMER_REG 0x51
-
-/* HDCP Key Status Register */
-#define SP_HDCP_KEY_STATUS_REG 0x5e
-
-/* HDCP Key Command Register */
-#define SP_HDCP_KEY_COMMAND_REG0x5f
-#define SP_DISABLE_SYNC_HDCP   BIT(2)
-
-/* OTP Memory Key Protection Registers */
-#define SP_OTP_KEY_PROTECT1_REG0x60
-#define SP_OTP_KEY_PROTECT2_REG0x61
-#define SP_OTP_KEY_PROTECT3_REG0x62
-#define SP_OTP_PSW10xa2
-#define SP_OTP_PSW20x7e
-#define SP_OTP_PSW30xc6
-
-/* DP System Control Registers */
-#define SP_DP_SYSTEM_CTRL_BASE (0x80 - 1)
-/* Bits for DP System Control Register 2 */
-#define SP_CHA_STA BIT(2)
-/* Bits for DP System Control Register 3 */
-#define SP_HPD_STATUS  BIT(6)
-#define SP_STRM_VALID  BIT(2)
-/* Bits for DP System Control Register 4 */
-#define SP_ENHANCED_MODE   BIT(3)
-
-/* DP Video Control Register */
-#define SP_DP_VIDEO_CTRL_REG   0x84
-#define SP_COLOR_F_MASK0x06
-#define SP_COLOR_F_SHIFT   1
-#define SP_BPC_MASK0xe0
-#define SP_BPC_SHIFT   5
-#  define SP_BPC_6BITS 0x00
-#  define SP_BPC_8BITS 0x01
-#  define SP_BPC_10BITS0x02
-#  define SP_BPC_12BITS0x03
-
-/* DP Audio Control Register */
-#define SP_DP_AUDIO_CTRL_REG   0x87
-#define SP_AUD_EN  BIT(0)
-
-/* 10us Pulse Generate Timer Registers */
-#define SP_I2C_GEN_10US_TIMER0_REG 0x88
-#define SP_I2C_GEN_10US_TIMER1_REG 0x89
-
-/* Packet Send Control Register */
-#define SP_PACKET_SEND_CTRL_REG

[PATCH v3 08/11] drm/panel: simple: Add BOE HB140WX1-501 panel support

2019-02-16 Thread Vasily Khoruzhick via dri-devel
This commit adds support for the BOE HB140WX1-501 14" WXGA TFT LCD
panel.

Signed-off-by: Vasily Khoruzhick 
---
 .../display/panel/boe,hb140wx1-501.txt|  7 +
 drivers/gpu/drm/panel/panel-simple.c  | 26 +++
 2 files changed, 33 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/boe,hb140wx1-501.txt

diff --git 
a/Documentation/devicetree/bindings/display/panel/boe,hb140wx1-501.txt 
b/Documentation/devicetree/bindings/display/panel/boe,hb140wx1-501.txt
new file mode 100644
index ..fc6f085eb8d1
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/boe,hb140wx1-501.txt
@@ -0,0 +1,7 @@
+BOE HB140WX1-501 14" WXGA (1366x768) TFT LCD panel
+
+Required properties:
+- compatible: should be "boe,hb140wx1-501"
+
+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 9c69e739a524..9a4c9dd02c6c 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -828,6 +828,29 @@ static const struct panel_desc bananapi_s070wv20_ct16 = {
},
 };
 
+static const struct drm_display_mode boe_hb140wx1_mode = {
+   .clock = 72300,
+   .hdisplay = 1366,
+   .hsync_start = 1366 + 48,
+   .hsync_end = 1366 + 48 + 32,
+   .htotal = 1366 + 48 + 32 + 80,
+   .vdisplay = 768,
+   .vsync_start = 768 + 3,
+   .vsync_end = 768 + 3 + 6,
+   .vtotal = 768 + 3 + 6 + 13,
+   .vrefresh = 60,
+   .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC,
+};
+
+static const struct panel_desc boe_hb140wx1 = {
+   .modes = _hb140wx1_mode,
+   .num_modes = 1,
+   .size = {
+   .width = 310,
+   .height = 170,
+   },
+};
+
 static const struct drm_display_mode boe_hv070wsa_mode = {
.clock = 42105,
.hdisplay = 1024,
@@ -2541,6 +2564,9 @@ static const struct of_device_id platform_of_match[] = {
}, {
.compatible = "bananapi,s070wv20-ct16",
.data = _s070wv20_ct16,
+   }, {
+   .compatible = "boe,hb140wx1-501",
+   .data = _hb140wx1
}, {
.compatible = "boe,hv070wsa-100",
.data = _hv070wsa
-- 
2.20.1

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

[PATCH v3 01/11] drm/bridge: move ANA78xx driver to analogix subdirectory

2019-02-16 Thread Vasily Khoruzhick via dri-devel
From: Icenowy Zheng 

As ANA78xx chips are designed and produced by Analogix Semiconductor,
Inc, move their driver codes into analogix subdirectory.

Signed-off-by: Icenowy Zheng 
Signed-off-by: Vasily Khoruzhick 
Reviewed-by: Laurent Pinchart 
---
 drivers/gpu/drm/bridge/Kconfig | 10 --
 drivers/gpu/drm/bridge/Makefile|  4 ++--
 drivers/gpu/drm/bridge/analogix/Kconfig| 10 ++
 drivers/gpu/drm/bridge/analogix/Makefile   |  1 +
 .../gpu/drm/bridge/{ => analogix}/analogix-anx78xx.c   |  0
 .../gpu/drm/bridge/{ => analogix}/analogix-anx78xx.h   |  0
 6 files changed, 13 insertions(+), 12 deletions(-)
 rename drivers/gpu/drm/bridge/{ => analogix}/analogix-anx78xx.c (100%)
 rename drivers/gpu/drm/bridge/{ => analogix}/analogix-anx78xx.h (100%)

diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig
index 2fee47b0d50b..4922c1ceffef 100644
--- a/drivers/gpu/drm/bridge/Kconfig
+++ b/drivers/gpu/drm/bridge/Kconfig
@@ -15,16 +15,6 @@ config DRM_PANEL_BRIDGE
 menu "Display Interface Bridges"
depends on DRM && DRM_BRIDGE
 
-config DRM_ANALOGIX_ANX78XX
-   tristate "Analogix ANX78XX bridge"
-   select DRM_KMS_HELPER
-   select REGMAP_I2C
-   ---help---
- ANX78XX is an ultra-low Full-HD SlimPort transmitter
- designed for portable devices. The ANX78XX transforms
- the HDMI output of an application processor to MyDP
- or DisplayPort.
-
 config DRM_CDNS_DSI
tristate "Cadence DPI/DSI bridge"
select DRM_KMS_HELPER
diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile
index 4934fcf5a6f8..a6c7dd7727ea 100644
--- a/drivers/gpu/drm/bridge/Makefile
+++ b/drivers/gpu/drm/bridge/Makefile
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_DRM_ANALOGIX_ANX78XX) += analogix-anx78xx.o
 obj-$(CONFIG_DRM_CDNS_DSI) += cdns-dsi.o
 obj-$(CONFIG_DRM_DUMB_VGA_DAC) += dumb-vga-dac.o
 obj-$(CONFIG_DRM_LVDS_ENCODER) += lvds-encoder.o
@@ -12,8 +11,9 @@ obj-$(CONFIG_DRM_SII9234) += sii9234.o
 obj-$(CONFIG_DRM_THINE_THC63LVD1024) += thc63lvd1024.o
 obj-$(CONFIG_DRM_TOSHIBA_TC358764) += tc358764.o
 obj-$(CONFIG_DRM_TOSHIBA_TC358767) += tc358767.o
-obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix/
 obj-$(CONFIG_DRM_I2C_ADV7511) += adv7511/
 obj-$(CONFIG_DRM_TI_SN65DSI86) += ti-sn65dsi86.o
 obj-$(CONFIG_DRM_TI_TFP410) += ti-tfp410.o
+
+obj-y += analogix/
 obj-y += synopsys/
diff --git a/drivers/gpu/drm/bridge/analogix/Kconfig 
b/drivers/gpu/drm/bridge/analogix/Kconfig
index 80f286fa3a69..c4d343a2f04d 100644
--- a/drivers/gpu/drm/bridge/analogix/Kconfig
+++ b/drivers/gpu/drm/bridge/analogix/Kconfig
@@ -1,3 +1,13 @@
+config DRM_ANALOGIX_ANX78XX
+   tristate "Analogix ANX78XX bridge"
+   select DRM_KMS_HELPER
+   select REGMAP_I2C
+   help
+ ANX78XX is an ultra-low Full-HD SlimPort transmitter
+ designed for portable devices. The ANX78XX transforms
+ the HDMI output of an application processor to MyDP
+ or DisplayPort.
+
 config DRM_ANALOGIX_DP
tristate
depends on DRM
diff --git a/drivers/gpu/drm/bridge/analogix/Makefile 
b/drivers/gpu/drm/bridge/analogix/Makefile
index cd4010ba6890..ce1687e60975 100644
--- a/drivers/gpu/drm/bridge/analogix/Makefile
+++ b/drivers/gpu/drm/bridge/analogix/Makefile
@@ -1,2 +1,3 @@
 analogix_dp-objs := analogix_dp_core.o analogix_dp_reg.o
+obj-$(CONFIG_DRM_ANALOGIX_ANX78XX) += analogix-anx78xx.o
 obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix_dp.o
diff --git a/drivers/gpu/drm/bridge/analogix-anx78xx.c 
b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
similarity index 100%
rename from drivers/gpu/drm/bridge/analogix-anx78xx.c
rename to drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
diff --git a/drivers/gpu/drm/bridge/analogix-anx78xx.h 
b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.h
similarity index 100%
rename from drivers/gpu/drm/bridge/analogix-anx78xx.h
rename to drivers/gpu/drm/bridge/analogix/analogix-anx78xx.h
-- 
2.20.1

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

[PATCH v3 07/11] arm64: allwinner: a64: add pinmux for RGB666 LCD

2019-02-16 Thread Vasily Khoruzhick via dri-devel
From: Icenowy Zheng 

Allwinner A64's TCON0 can output RGB666 LCD signal.

Add its pinmux.

Signed-off-by: Icenowy Zheng 
Signed-off-by: Vasily Khoruzhick 
---
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 9 +
 1 file changed, 9 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi 
b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index 2abb335145a6..a8bbee84e7da 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -559,6 +559,15 @@
function = "i2c1";
};
 
+   lcd_rgb666_pins: lcd-rgb666 {
+   pins = "PD0", "PD1", "PD2", "PD3", "PD4",
+  "PD5", "PD6", "PD7", "PD8", "PD9",
+  "PD10", "PD11", "PD12", "PD13",
+  "PD14", "PD15", "PD16", "PD17",
+  "PD18", "PD19", "PD20", "PD21";
+   function = "lcd0";
+   };
+
mmc0_pins: mmc0-pins {
pins = "PF0", "PF1", "PF2", "PF3",
   "PF4", "PF5";
-- 
2.20.1

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

[PATCH v3 00/11] Analogix ANX6345 RGB-(e)DP bridge support

2019-02-16 Thread Vasily Khoruzhick via dri-devel
This patchset brings support for Analogix ANX6345 RGB-(e)DP bridge, which
is used by some Allwinner A64 laptops, such as Pinebook and Olimex
TERES-I.

It reuses some definitions from ANX78xx driver that already exists in the
kernel tree, but the driver code itself is rewritten due to significant
difference between ANX6345 and ANX78xx.

This patchset also adds support for LCD panels used in Pinebook, dt
property to disable strict dot clock check in sun4i drm driver and adds
nodes necessary for LCD support into Pinebook dts.

v2: - sort Kconfig and Makefile entries alphabetically
- remove panel supply from anx6345
- add support for panels into anx6345 driver
- add compatible and binding for generic eDP panel
- replace patch that adds 5% tolerance for dotclock check in sun4i
  driver for panel and bridges with patch that adds 1% tolerance
  in case if bridge is connected.
v3: - replace 1% tolerance patch with patch that adds dt property to
  disable strict dot clock check
- add support for LCD panels used in Pinebook
- drop generic eDP panel driver
- drop Teres-I changes, I don't have hardware to test them anyway.

Icenowy Zheng (7):
  drm/bridge: move ANA78xx driver to analogix subdirectory
  drm/bridge: split some definitions of ANX78xx to dedicated headers
  drm/bridge: extract some Analogix I2C DP common code
  dt-bindings: Add ANX6345 DP/eDP transmitter binding
  drm/bridge: Add Analogix anx6345 support
  arm64: allwinner: a64: add pinmux for RGB666 LCD
  arm64: allwinner: a64: enable LCD-related hardware for Pinebook

Vasily Khoruzhick (4):
  drm/sun4i: rgb: Add DT property to disable strict clock rate check
  drm/panel: simple: Add BOE HB140WX1-501 panel support
  dt-bindings: Add Guangdong Neweast Optoelectronics CO. LTD vendor
prefix
  drm/panel: simple: Add NewEast Optoelectronics CO., LTD WJFH116008A
panel support

 .../bindings/display/bridge/anx6345.txt   |  56 ++
 .../display/panel/boe,hb140wx1-501.txt|   7 +
 .../display/panel/neweast,wjfh116008a.txt |   7 +
 .../bindings/display/sunxi/sun4i-drm.txt  |   2 +
 .../devicetree/bindings/vendor-prefixes.txt   |   1 +
 .../dts/allwinner/sun50i-a64-pinebook.dts |  76 ++
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi |   9 +
 drivers/gpu/drm/bridge/Kconfig|  10 -
 drivers/gpu/drm/bridge/Makefile   |   4 +-
 drivers/gpu/drm/bridge/analogix-anx78xx.h | 719 ---
 drivers/gpu/drm/bridge/analogix/Kconfig   |  25 +
 drivers/gpu/drm/bridge/analogix/Makefile  |   4 +
 .../drm/bridge/analogix/analogix-anx6345.c| 845 ++
 .../bridge/{ => analogix}/analogix-anx78xx.c  | 146 +--
 .../drm/bridge/analogix/analogix-anx78xx.h| 265 ++
 .../drm/bridge/analogix/analogix-i2c-dptx.c   | 169 
 .../drm/bridge/analogix/analogix-i2c-dptx.h   | 258 ++
 .../bridge/analogix/analogix-i2c-txcommon.h   | 240 +
 drivers/gpu/drm/panel/panel-simple.c  |  65 ++
 drivers/gpu/drm/sun4i/sun4i_rgb.c |   5 +
 drivers/gpu/drm/sun4i/sun4i_tcon.c|   3 +
 drivers/gpu/drm/sun4i/sun4i_tcon.h|   1 +
 22 files changed, 2041 insertions(+), 876 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/anx6345.txt
 create mode 100644 
Documentation/devicetree/bindings/display/panel/boe,hb140wx1-501.txt
 create mode 100644 
Documentation/devicetree/bindings/display/panel/neweast,wjfh116008a.txt
 delete mode 100644 drivers/gpu/drm/bridge/analogix-anx78xx.h
 create mode 100644 drivers/gpu/drm/bridge/analogix/analogix-anx6345.c
 rename drivers/gpu/drm/bridge/{ => analogix}/analogix-anx78xx.c (90%)
 create mode 100644 drivers/gpu/drm/bridge/analogix/analogix-anx78xx.h
 create mode 100644 drivers/gpu/drm/bridge/analogix/analogix-i2c-dptx.c
 create mode 100644 drivers/gpu/drm/bridge/analogix/analogix-i2c-dptx.h
 create mode 100644 drivers/gpu/drm/bridge/analogix/analogix-i2c-txcommon.h

-- 
2.20.1

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

Re: [PATCH RESEND v2 08/12] dt-bindings: add binding for generic eDP panel

2019-02-16 Thread Vasily Khoruzhick via dri-devel
On Thu, Feb 14, 2019 at 12:38 PM Rob Herring  wrote:
>
> On Thu, Feb 14, 2019 at 2:04 PM Vasily Khoruzhick  wrote:
> >
> > On Tue, Feb 5, 2019 at 2:24 AM Thierry Reding  
> > wrote:
> > >
> > > On Tue, Feb 05, 2019 at 09:57:37AM +0100, Daniel Vetter wrote:
> > > > On Mon, Feb 04, 2019 at 05:22:58PM +0100, Thierry Reding wrote:
> > > > > On Mon, Feb 04, 2019 at 04:59:09PM +0100, Daniel Vetter wrote:
> > > > > > On Mon, Feb 04, 2019 at 12:22:18PM +0100, Thierry Reding wrote:
> > > > > > > On Mon, Feb 04, 2019 at 10:40:12AM +0100, Daniel Vetter wrote:
> > > > > > > > On Mon, Feb 04, 2019 at 09:23:59AM +0100, Thierry Reding wrote:
> > > > > > > > > On Mon, Feb 04, 2019 at 12:13:55AM -0800, Vasily Khoruzhick 
> > > > > > > > > wrote:
> > > > > > > > > > On Sun, Feb 3, 2019 at 11:43 PM Thierry Reding 
> > > > > > > > > >  wrote:
> > > > > > > > > > >
> > > > > > > > > > > On Sun, Feb 03, 2019 at 10:54:57AM -0800, Vasily 
> > > > > > > > > > > Khoruzhick wrote:
> > > > > > > > > > > > eDP panels usually have EDID EEPROM, so there's no need 
> > > > > > > > > > > > to define panel
> > > > > > > > > > > > width/height or any modes/timings in dts. But this 
> > > > > > > > > > > > panel still may have
> > > > > > > > > > > > regulator and/or backlight.
> > > > > > > > > > > >
> > > > > > > > > > > > Signed-off-by: Vasily Khoruzhick 
> > > > > > > > > > > > ---
> > > > > > > > > > > >  .../devicetree/bindings/display/panel/panel-edp.txt
> > > > > > > > > > > > | 7 +++
> > > > > > > > > > > >  1 file changed, 7 insertions(+)
> > > > > > > > > > > >  create mode 100644 
> > > > > > > > > > > > Documentation/devicetree/bindings/display/panel/panel-edp.txt
> > > > > > > > > > >
> > > > > > > > > > > Please don't try to make panels look more generic than 
> > > > > > > > > > > they really are.
> > > > > > > > > > > You're going to have to provide a compatible string for 
> > > > > > > > > > > your device that
> > > > > > > > > > > is more specific than "panel-edp". You claim that you 
> > > > > > > > > > > don't need any
> > > > > > > > > > > extra information that is panel specific, but you don't 
> > > > > > > > > > > know that now.
> > > > > > > > > > > We have in the past thought that we didn't need things 
> > > > > > > > > > > like prepare
> > > > > > > > > > > delay, but then we ran into situations where we did need 
> > > > > > > > > > > them.
> > > > > > > > > > >
> > > > > > > > > > > Just do what everybody else does. Provide a specific 
> > > > > > > > > > > compatible string
> > > > > > > > > > > and match on that in the panel-simple driver. Even if you 
> > > > > > > > > > > can read all
> > > > > > > > > > > the video timings from an EDID EEPROM, you can still 
> > > > > > > > > > > provide a mode in
> > > > > > > > > > > the panel descriptor to serve as a fallback if for 
> > > > > > > > > > > example the EEPROM
> > > > > > > > > > > is faulty on some device.
> > > > > > > > > >
> > > > > > > > > > Pinebook used several 768p panels that have slightly 
> > > > > > > > > > different timings
> > > > > > > > > > and recent batch uses 1080p panel.
> > > > > > > > > >
> > > > > > > > > > What panel descriptor should I use as fallback?
> > > > > > > > >
> > > > > > > > > You don't use panel descriptors as fallback. The simple-panel 
> > > > > > > > > driver
> > > > > > > > > will bind to a panel device and use the corresponding 
> > > > > > > > > descriptor. If
> > > > > > > > > your device tree contains the correct information, the 
> > > > > > > > > descriptor is
> > > > > > > > > correct for the panel you have.
> > > > > > > > >
> > > > > > > > > In other words you need to ensure that you have the correct 
> > > > > > > > > panel in
> > > > > > > > > device tree for the board that you're using. This is exactly 
> > > > > > > > > the same
> > > > > > > > > thing as for other devices.
> > > > > > > > >
> > > > > > > > > One way to to this is to have separate device trees for each 
> > > > > > > > > variant
> > > > > > > > > of the board that you want to support. Another variant may be 
> > > > > > > > > to have
> > > > > > > > > a common device tree and then have some early firmware update 
> > > > > > > > > the DTB
> > > > > > > > > with the correct panel information.
> > > > > > > >
> > > > > > > > This would defeat the point of edp, which is to standardize the 
> > > > > > > > mess of
> > > > > > > > panels (at least somewhat) and avoid having to change the 
> > > > > > > > DT/ACPI
> > > > > > > > tables/firmware for every board you ship. Also, we do have DP 
> > > > > > > > quirking
> > > > > > > > infrastructure already (using the OUI), I think if there's 
> > > > > > > > something that
> > > > > > > > doesn't work then we should quirk it there.
> > > > > > >
> > > > > > > The problem is that while the attempt may have been to 
> > > > > > > standardize, it
> > > > > > > failed. It doesn't take into account any of the details such as 
> > > > > > > timing
> > > > > > > between things like 

[PATCH v3 05/11] drm/bridge: Add Analogix anx6345 support

2019-02-16 Thread Vasily Khoruzhick via dri-devel
From: Icenowy Zheng 

The ANX6345 is an ultra-low power DisplayPower/eDP transmitter designed
for portable devices. This driver adds initial support for RGB to eDP
mode, without HPD and interrupts.

This is a configuration usually seen in eDP applications.

Signed-off-by: Icenowy Zheng 
Signed-off-by: Vasily Khoruzhick 
---
 drivers/gpu/drm/bridge/analogix/Kconfig   |  11 +
 drivers/gpu/drm/bridge/analogix/Makefile  |   1 +
 .../drm/bridge/analogix/analogix-anx6345.c| 845 ++
 .../drm/bridge/analogix/analogix-i2c-dptx.c   |   2 +-
 .../drm/bridge/analogix/analogix-i2c-dptx.h   |   8 +
 .../bridge/analogix/analogix-i2c-txcommon.h   |   3 +
 6 files changed, 869 insertions(+), 1 deletion(-)
 create mode 100644 drivers/gpu/drm/bridge/analogix/analogix-anx6345.c

diff --git a/drivers/gpu/drm/bridge/analogix/Kconfig 
b/drivers/gpu/drm/bridge/analogix/Kconfig
index ed2d05c12546..3c6ec535d361 100644
--- a/drivers/gpu/drm/bridge/analogix/Kconfig
+++ b/drivers/gpu/drm/bridge/analogix/Kconfig
@@ -1,3 +1,14 @@
+config DRM_ANALOGIX_ANX6345
+   tristate "Analogix ANX6345 bridge"
+   select DRM_ANALOGIX_DP_I2C
+   select DRM_KMS_HELPER
+   select REGMAP_I2C
+   help
+ ANX6345 is an ultra-low Full-HD DisplayPort/eDP
+ transmitter designed for portable devices. The
+ ANX6345 transforms the LVTTL RGB output of an
+ application processor to eDP or DisplayPort.
+
 config DRM_ANALOGIX_ANX78XX
tristate "Analogix ANX78XX bridge"
select DRM_ANALOGIX_DP_I2C
diff --git a/drivers/gpu/drm/bridge/analogix/Makefile 
b/drivers/gpu/drm/bridge/analogix/Makefile
index 2d523b67487d..12fed7b04e1e 100644
--- a/drivers/gpu/drm/bridge/analogix/Makefile
+++ b/drivers/gpu/drm/bridge/analogix/Makefile
@@ -1,5 +1,6 @@
 analogix_dp-objs := analogix_dp_core.o analogix_dp_reg.o
 analogix_dp_i2c-objs := analogix-i2c-dptx.o
+obj-$(CONFIG_DRM_ANALOGIX_ANX6345) += analogix-anx6345.o
 obj-$(CONFIG_DRM_ANALOGIX_ANX78XX) += analogix-anx78xx.o
 obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix_dp.o
 obj-$(CONFIG_DRM_ANALOGIX_DP_I2C) += analogix_dp_i2c.o
diff --git a/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c 
b/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c
new file mode 100644
index ..6098e245e074
--- /dev/null
+++ b/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c
@@ -0,0 +1,845 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright(c) Icenowy Zheng 
+ * Based on analogix-anx6345.c, which is:
+ *   Copyright(c) 2016, Analogix Semiconductor.
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "analogix-i2c-dptx.h"
+#include "analogix-i2c-txcommon.h"
+
+#define I2C_NUM_ADDRESSES  2
+#define I2C_IDX_DPTX   0
+#define I2C_IDX_TXCOM  1
+
+#define XTAL_CLK   270 /* 27M */
+
+#define POLL_DELAY 5 /* us */
+#define POLL_TIMEOUT   500 /* us */
+
+static const u8 anx6345_i2c_addresses[] = {
+   [I2C_IDX_DPTX]  = ANALOGIX_I2C_DPTX,
+   [I2C_IDX_TXCOM] = ANALOGIX_I2C_TXCOMMON,
+};
+
+struct anx6345_platform_data {
+   struct regulator *dvdd12;
+   struct regulator *dvdd25;
+   struct gpio_desc *gpiod_reset;
+};
+
+struct anx6345 {
+   struct drm_dp_aux aux;
+   struct drm_bridge bridge;
+   struct i2c_client *client;
+   struct edid *edid;
+   struct drm_connector connector;
+   struct drm_dp_link link;
+   struct drm_panel *panel;
+   struct anx6345_platform_data pdata;
+   struct mutex lock;
+
+   /*
+* I2C Slave addresses of ANX6345 are mapped as DPTX and SYS
+*/
+   struct i2c_client *i2c_clients[I2C_NUM_ADDRESSES];
+   struct regmap *map[I2C_NUM_ADDRESSES];
+
+   u16 chipid;
+   u8 dpcd[DP_RECEIVER_CAP_SIZE];
+
+   bool powered;
+};
+
+static inline struct anx6345 *connector_to_anx6345(struct drm_connector *c)
+{
+   return container_of(c, struct anx6345, connector);
+}
+
+static inline struct anx6345 *bridge_to_anx6345(struct drm_bridge *bridge)
+{
+   return container_of(bridge, struct anx6345, bridge);
+}
+
+static int anx6345_set_bits(struct regmap *map, u8 reg, u8 mask)
+{
+   return regmap_update_bits(map, reg, mask, mask);
+}
+
+static int anx6345_clear_bits(struct regmap *map, u8 reg, u8 mask)
+{
+   return regmap_update_bits(map, reg, mask, 0);
+}
+
+static ssize_t anx6345_aux_transfer(struct drm_dp_aux *aux,
+   struct drm_dp_aux_msg *msg)
+{
+   struct anx6345 *anx6345 = container_of(aux, struct anx6345, aux);
+
+   return anx_aux_transfer(anx6345->map[I2C_IDX_DPTX], msg);
+}
+
+static int anx6345_dp_link_training(struct anx6345 *anx6345)
+{
+   unsigned int value;
+   u8 dp_bw;
+   int err;
+
+   err = 

[PATCH v3 10/11] drm/panel: simple: Add NewEast Optoelectronics CO., LTD WJFH116008A panel support

2019-02-16 Thread Vasily Khoruzhick via dri-devel
This commit adds support for the NewEast Optoelectronics CO., LTD
WJFH116008A 11.6" 1920x1080 TFT LCD panel.

Signed-off-by: Vasily Khoruzhick 
---
 .../display/panel/neweast,wjfh116008a.txt |  7 
 drivers/gpu/drm/panel/panel-simple.c  | 39 +++
 2 files changed, 46 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/neweast,wjfh116008a.txt

diff --git 
a/Documentation/devicetree/bindings/display/panel/neweast,wjfh116008a.txt 
b/Documentation/devicetree/bindings/display/panel/neweast,wjfh116008a.txt
new file mode 100644
index ..d76579f9f55e
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/neweast,wjfh116008a.txt
@@ -0,0 +1,7 @@
+NewEast Optoelectronics CO., LTD WJFH116008A 11.6" 1920x1080 TFT LCD panel
+
+Required properties:
+- compatible: should be "neweast,wjfh116008a"
+
+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 9a4c9dd02c6c..3edc77e49d8f 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -1843,6 +1843,42 @@ static const struct panel_desc netron_dy_e231732 = {
.bus_format = MEDIA_BUS_FMT_RGB666_1X18,
 };
 
+static const struct drm_display_mode neweast_wjfh116008a_modes[] = {
+{
+   .clock = 138500,
+   .hdisplay = 1920,
+   .hsync_start = 1920 + 48,
+   .hsync_end = 1920 + 48 + 32,
+   .htotal = 1920 + 48 + 32 + 80,
+   .vdisplay = 1080,
+   .vsync_start = 1080 + 3,
+   .vsync_end = 1080 + 3 + 5,
+   .vtotal = 1080 + 3 + 5 + 23,
+   .vrefresh = 60,
+   .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
+}, {
+   .clock = 110920,
+   .hdisplay = 1920,
+   .hsync_start = 1920 + 48,
+   .hsync_end = 1920 + 48 + 32,
+   .htotal = 1920 + 48 + 32 + 80,
+   .vdisplay = 1080,
+   .vsync_start = 1080 + 3,
+   .vsync_end = 1080 + 3 + 5,
+   .vtotal = 1080 + 3 + 5 + 23,
+   .vrefresh = 48,
+   .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
+} };
+
+static const struct panel_desc neweast_wjfh116008a = {
+   .modes = neweast_wjfh116008a_modes,
+   .num_modes = 2,
+   .size = {
+   .width = 260,
+   .height = 150,
+   },
+};
+
 static const struct drm_display_mode newhaven_nhd_43_480272ef_atxl_mode = {
.clock = 9000,
.hdisplay = 480,
@@ -2690,6 +2726,9 @@ static const struct of_device_id platform_of_match[] = {
}, {
.compatible = "netron-dy,e231732",
.data = _dy_e231732,
+   }, {
+   .compatible = "neweast,wjfh116008a",
+   .data = _wjfh116008a,
}, {
.compatible = "newhaven,nhd-4.3-480272ef-atxl",
.data = _nhd_43_480272ef_atxl,
-- 
2.20.1

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

[PATCH v3 04/11] dt-bindings: Add ANX6345 DP/eDP transmitter binding

2019-02-16 Thread Vasily Khoruzhick via dri-devel
From: Icenowy Zheng 

The ANX6345 is an ultra-low power DisplayPort/eDP transmitter designed
for portable devices.

Add a binding document for it.

Signed-off-by: Icenowy Zheng 
Signed-off-by: Vasily Khoruzhick 
---
 .../bindings/display/bridge/anx6345.txt   | 56 +++
 1 file changed, 56 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/anx6345.txt

diff --git a/Documentation/devicetree/bindings/display/bridge/anx6345.txt 
b/Documentation/devicetree/bindings/display/bridge/anx6345.txt
new file mode 100644
index ..e79a11348d11
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/bridge/anx6345.txt
@@ -0,0 +1,56 @@
+Analogix ANX6345 eDP Transmitter
+
+
+The ANX6345 is an ultra-low power Full-HD eDP transmitter designed for
+portable devices.
+
+Required properties:
+
+ - compatible  : "analogix,anx6345"
+ - reg : I2C address of the device
+ - reset-gpios : Which GPIO to use for reset
+
+Optional properties:
+
+ - dvdd12-supply   : Regulator for 1.2V digital core power.
+ - dvdd25-supply   : Regulator for 2.5V digital core power.
+ - Video ports for RGB input and eDP output using the DT bindings
+   defined in [1]
+
+[1]: Documentation/devicetree/bindings/media/video-interfaces.txt
+
+Example:
+
+anx6345: anx6345@38 {
+   compatible = "analogix,anx6345";
+   reg = <0x38>;
+   reset-gpios = < 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */
+   dvdd25-supply = <_dldo2>;
+   dvdd12-supply = <_fldo1>;
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   anx6345_in: port@0 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   reg = <0>;
+   anx6345_in_tcon0: endpoint@0 {
+   reg = <0>;
+   remote-endpoint = <_out_anx6345>;
+   };
+   };
+
+   anx6345_out: port@1 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   reg = <1>;
+
+   anx6345_out_panel: endpoint@0 {
+   reg = <0>;
+   remote-endpoint = <_in_edp>;
+   };
+   };
+   };
+};
-- 
2.20.1

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

[PATCH v3 03/11] drm/bridge: extract some Analogix I2C DP common code

2019-02-16 Thread Vasily Khoruzhick via dri-devel
From: Icenowy Zheng 

Some code can be shared within different DP bridges by Analogix.

Extract them to a new module.

Signed-off-by: Icenowy Zheng 
Signed-off-by: Vasily Khoruzhick 
---
 drivers/gpu/drm/bridge/analogix/Kconfig   |   4 +
 drivers/gpu/drm/bridge/analogix/Makefile  |   2 +
 .../drm/bridge/analogix/analogix-anx78xx.c| 146 +--
 .../drm/bridge/analogix/analogix-i2c-dptx.c   | 169 ++
 .../drm/bridge/analogix/analogix-i2c-dptx.h   |   2 +
 5 files changed, 178 insertions(+), 145 deletions(-)
 create mode 100644 drivers/gpu/drm/bridge/analogix/analogix-i2c-dptx.c

diff --git a/drivers/gpu/drm/bridge/analogix/Kconfig 
b/drivers/gpu/drm/bridge/analogix/Kconfig
index c4d343a2f04d..ed2d05c12546 100644
--- a/drivers/gpu/drm/bridge/analogix/Kconfig
+++ b/drivers/gpu/drm/bridge/analogix/Kconfig
@@ -1,5 +1,6 @@
 config DRM_ANALOGIX_ANX78XX
tristate "Analogix ANX78XX bridge"
+   select DRM_ANALOGIX_DP_I2C
select DRM_KMS_HELPER
select REGMAP_I2C
help
@@ -11,3 +12,6 @@ config DRM_ANALOGIX_ANX78XX
 config DRM_ANALOGIX_DP
tristate
depends on DRM
+
+config DRM_ANALOGIX_DP_I2C
+   tristate
diff --git a/drivers/gpu/drm/bridge/analogix/Makefile 
b/drivers/gpu/drm/bridge/analogix/Makefile
index ce1687e60975..2d523b67487d 100644
--- a/drivers/gpu/drm/bridge/analogix/Makefile
+++ b/drivers/gpu/drm/bridge/analogix/Makefile
@@ -1,3 +1,5 @@
 analogix_dp-objs := analogix_dp_core.o analogix_dp_reg.o
+analogix_dp_i2c-objs := analogix-i2c-dptx.o
 obj-$(CONFIG_DRM_ANALOGIX_ANX78XX) += analogix-anx78xx.o
 obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix_dp.o
+obj-$(CONFIG_DRM_ANALOGIX_DP_I2C) += analogix_dp_i2c.o
diff --git a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c 
b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
index f8433c93f463..bf8291d0ddd0 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
@@ -45,8 +45,6 @@
 #define I2C_IDX_RX_P1  4
 
 #define XTAL_CLK   270 /* 27M */
-#define AUX_CH_BUFFER_SIZE 16
-#define AUX_WAIT_TIMEOUT_MS15
 
 static const u8 anx78xx_i2c_addresses[] = {
[I2C_IDX_TX_P0] = TX_P0,
@@ -109,153 +107,11 @@ static int anx78xx_clear_bits(struct regmap *map, u8 
reg, u8 mask)
return regmap_update_bits(map, reg, mask, 0);
 }
 
-static bool anx78xx_aux_op_finished(struct anx78xx *anx78xx)
-{
-   unsigned int value;
-   int err;
-
-   err = regmap_read(anx78xx->map[I2C_IDX_TX_P0], SP_DP_AUX_CH_CTRL2_REG,
- );
-   if (err < 0)
-   return false;
-
-   return (value & SP_AUX_EN) == 0;
-}
-
-static int anx78xx_aux_wait(struct anx78xx *anx78xx)
-{
-   unsigned long timeout;
-   unsigned int status;
-   int err;
-
-   timeout = jiffies + msecs_to_jiffies(AUX_WAIT_TIMEOUT_MS) + 1;
-
-   while (!anx78xx_aux_op_finished(anx78xx)) {
-   if (time_after(jiffies, timeout)) {
-   if (!anx78xx_aux_op_finished(anx78xx)) {
-   DRM_ERROR("Timed out waiting AUX to finish\n");
-   return -ETIMEDOUT;
-   }
-
-   break;
-   }
-
-   usleep_range(1000, 2000);
-   }
-
-   /* Read the AUX channel access status */
-   err = regmap_read(anx78xx->map[I2C_IDX_TX_P0], SP_AUX_CH_STATUS_REG,
- );
-   if (err < 0) {
-   DRM_ERROR("Failed to read from AUX channel: %d\n", err);
-   return err;
-   }
-
-   if (status & SP_AUX_STATUS) {
-   DRM_ERROR("Failed to wait for AUX channel (status: %02x)\n",
- status);
-   return -ETIMEDOUT;
-   }
-
-   return 0;
-}
-
-static int anx78xx_aux_address(struct anx78xx *anx78xx, unsigned int addr)
-{
-   int err;
-
-   err = regmap_write(anx78xx->map[I2C_IDX_TX_P0], SP_AUX_ADDR_7_0_REG,
-  addr & 0xff);
-   if (err)
-   return err;
-
-   err = regmap_write(anx78xx->map[I2C_IDX_TX_P0], SP_AUX_ADDR_15_8_REG,
-  (addr & 0xff00) >> 8);
-   if (err)
-   return err;
-
-   /*
-* DP AUX CH Address Register #2, only update bits[3:0]
-* [7:4] RESERVED
-* [3:0] AUX_ADDR[19:16], Register control AUX CH address.
-*/
-   err = regmap_update_bits(anx78xx->map[I2C_IDX_TX_P0],
-SP_AUX_ADDR_19_16_REG,
-SP_AUX_ADDR_19_16_MASK,
-(addr & 0xf) >> 16);
-
-   if (err)
-   return err;
-
-   return 0;
-}
-
 static ssize_t anx78xx_aux_transfer(struct drm_dp_aux *aux,
struct drm_dp_aux_msg *msg)
 {
struct anx78xx *anx78xx = container_of(aux, struct anx78xx, aux);
-   u8 ctrl1 = 

[PATCH v3 06/11] drm/sun4i: rgb: Add DT property to disable strict clock rate check

2019-02-16 Thread Vasily Khoruzhick via dri-devel
Clock rate check that was added in commit bb43d40d7c83 ("drm/sun4i: rgb:
Validate the clock rate") prevents some panel and bridges from working with
sun4i driver.

Unfortunately, dotclock frequency for some modes are not achievable on
sunxi hardware, and there's a slight deviation in rate returned by
clk_round_rate(), so they fail this check.

Experiments show that panels and bridges work fine with this slight
deviation, e.g. Pinebook that uses ANX6345 bridge with 768p eDP panel
requests 73 MHz, gets 72.296MHz instead (0.96% difference) and works just
fine.

This patch adds DT property to disable strict clock rate check

Signed-off-by: Vasily Khoruzhick 
---
 .../devicetree/bindings/display/sunxi/sun4i-drm.txt  | 2 ++
 drivers/gpu/drm/sun4i/sun4i_rgb.c| 5 +
 drivers/gpu/drm/sun4i/sun4i_tcon.c   | 3 +++
 drivers/gpu/drm/sun4i/sun4i_tcon.h   | 1 +
 4 files changed, 11 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt 
b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
index f426bdb42f18..18c8b053a28d 100644
--- a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
+++ b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
@@ -63,6 +63,8 @@ Required properties:
 Documentation/devicetree/bindings/media/video-interfaces.txt. The
 first port should be the input endpoint. The second should be the
 output, usually to an HDMI connector.
+  - no-strict-clock-check: don't reject timings if exact dot clock can't be
+reached.
 
 DWC HDMI TX Encoder
 ---
diff --git a/drivers/gpu/drm/sun4i/sun4i_rgb.c 
b/drivers/gpu/drm/sun4i/sun4i_rgb.c
index f4a22689eb54..b392d4b1ebd3 100644
--- a/drivers/gpu/drm/sun4i/sun4i_rgb.c
+++ b/drivers/gpu/drm/sun4i/sun4i_rgb.c
@@ -94,7 +94,12 @@ static enum drm_mode_status sun4i_rgb_mode_valid(struct 
drm_encoder *crtc,
 
tcon->dclk_min_div = 6;
tcon->dclk_max_div = 127;
+
+   if (tcon->no_strict_clock_check)
+   return MODE_OK;
+
rounded_rate = clk_round_rate(tcon->dclk, rate);
+
if (rounded_rate < rate)
return MODE_CLOCK_LOW;
 
diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c 
b/drivers/gpu/drm/sun4i/sun4i_tcon.c
index cf45d0f940f9..f5f7f479332b 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
@@ -1108,6 +1108,9 @@ static int sun4i_tcon_bind(struct device *dev, struct 
device *master,
tcon->id = engine->id;
tcon->quirks = of_device_get_match_data(dev);
 
+   tcon->no_strict_clock_check = of_property_read_bool(dev->of_node,
+   "no-strict-clock-check");
+
tcon->lcd_rst = devm_reset_control_get(dev, "lcd");
if (IS_ERR(tcon->lcd_rst)) {
dev_err(dev, "Couldn't get our reset line\n");
diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.h 
b/drivers/gpu/drm/sun4i/sun4i_tcon.h
index b5214d71610f..ab510b80004a 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.h
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.h
@@ -258,6 +258,7 @@ struct sun4i_tcon {
struct reset_control*lvds_rst;
 
struct drm_panel*panel;
+   boolno_strict_clock_check;
 
/* Platform adjustments */
const struct sun4i_tcon_quirks  *quirks;
-- 
2.20.1

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

[PATCH v3 11/11] arm64: allwinner: a64: enable LCD-related hardware for Pinebook

2019-02-16 Thread Vasily Khoruzhick via dri-devel
From: Icenowy Zheng 

Pinebook has an ANX6345 bridge connected to the RGB666 LCD output and
eDP panel input. The bridge is controlled via I2C that's connected to
R_I2C bus.

There're pinebooks with 3 different panels in the wild, all 3 with
different timings. Add all the compatibles to panel node and hope that
we can get correct timings from EDID. If reading EDID fails it's up to
firmware to fixup compatible string.

Enable all this hardware in device tree.

Signed-off-by: Icenowy Zheng 
Signed-off-by: Vasily Khoruzhick 
---
 .../dts/allwinner/sun50i-a64-pinebook.dts | 76 +++
 1 file changed, 76 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts 
b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
index d22736a62481..0d9280bafc12 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
@@ -63,6 +63,19 @@
};
};
 
+   edp_panel: edp-panel {
+   compatible = "boe,hb140wx1-501", "innolux,n116bge",
+"neweast,wjfh116008a", "simple-panel";
+   backlight = <>;
+   power-supply = <_dc1sw>;
+
+   port {
+   panel_in_edp: endpoint {
+   remote-endpoint = <_out_panel>;
+   };
+   };
+   };
+
reg_vcc3v3: vcc3v3 {
compatible = "regulator-fixed";
regulator-name = "vcc3v3";
@@ -102,6 +115,10 @@
status = "okay";
 };
 
+ {
+   status = "okay";
+};
+
  {
phys = < 0>;
phy-names = "usb";
@@ -112,6 +129,10 @@
status = "okay";
 };
 
+ {
+   status = "okay";
+};
+
  {
pinctrl-names = "default";
pinctrl-0 = <_pins>;
@@ -163,6 +184,46 @@
status = "okay";
 };
 
+_i2c {
+   pinctrl-names = "default";
+   pinctrl-0 = <_i2c_pins_a>;
+   status = "okay";
+
+   anx6345: anx6345@38 {
+   compatible = "analogix,anx6345";
+   reg = <0x38>;
+   reset-gpios = < 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */
+   dvdd25-supply = <_dldo2>;
+   dvdd12-supply = <_fldo1>;
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   anx6345_in: port@0 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   reg = <0>;
+   anx6345_in_tcon0: endpoint@0 {
+   reg = <0>;
+   remote-endpoint = <_out_anx6345>;
+   };
+   };
+
+   anx6345_out: port@1 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   reg = <1>;
+
+   anx6345_out_panel: endpoint@0 {
+   reg = <0>;
+   remote-endpoint = <_in_edp>;
+   };
+   };
+   };
+   };
+};
+
 _rsb {
status = "okay";
 
@@ -334,6 +395,21 @@
"MIC2", "Internal Microphone Right";
 };
 
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_rgb666_pins>;
+   no-strict-clock-check;
+
+   status = "okay";
+};
+
+_out {
+   tcon0_out_anx6345: endpoint@0 {
+   reg = <0>;
+   remote-endpoint = <_in_tcon0>;
+   };
+};
+
  {
pinctrl-names = "default";
pinctrl-0 = <_pb_pins>;
-- 
2.20.1

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

Re: [PATCH RESEND v2 08/12] dt-bindings: add binding for generic eDP panel

2019-02-15 Thread Vasily Khoruzhick via dri-devel
On Tue, Feb 5, 2019 at 8:36 AM Daniel Vetter  wrote:
>
> On Tue, Feb 05, 2019 at 11:24:19AM +0100, Thierry Reding wrote:
> > On Tue, Feb 05, 2019 at 09:57:37AM +0100, Daniel Vetter wrote:
> > > On Mon, Feb 04, 2019 at 05:22:58PM +0100, Thierry Reding wrote:
> > > > On Mon, Feb 04, 2019 at 04:59:09PM +0100, Daniel Vetter wrote:
> > > > > On Mon, Feb 04, 2019 at 12:22:18PM +0100, Thierry Reding wrote:
> > > > > > On Mon, Feb 04, 2019 at 10:40:12AM +0100, Daniel Vetter wrote:
> > > > > > > On Mon, Feb 04, 2019 at 09:23:59AM +0100, Thierry Reding wrote:
> > > > > > > > On Mon, Feb 04, 2019 at 12:13:55AM -0800, Vasily Khoruzhick 
> > > > > > > > wrote:
> > > > > > > > > On Sun, Feb 3, 2019 at 11:43 PM Thierry Reding 
> > > > > > > > >  wrote:
> > > > > > > > > >
> > > > > > > > > > On Sun, Feb 03, 2019 at 10:54:57AM -0800, Vasily Khoruzhick 
> > > > > > > > > > wrote:
> > > > > > > > > > > eDP panels usually have EDID EEPROM, so there's no need 
> > > > > > > > > > > to define panel
> > > > > > > > > > > width/height or any modes/timings in dts. But this panel 
> > > > > > > > > > > still may have
> > > > > > > > > > > regulator and/or backlight.
> > > > > > > > > > >
> > > > > > > > > > > Signed-off-by: Vasily Khoruzhick 
> > > > > > > > > > > ---
> > > > > > > > > > >  .../devicetree/bindings/display/panel/panel-edp.txt  
> > > > > > > > > > >   | 7 +++
> > > > > > > > > > >  1 file changed, 7 insertions(+)
> > > > > > > > > > >  create mode 100644 
> > > > > > > > > > > Documentation/devicetree/bindings/display/panel/panel-edp.txt
> > > > > > > > > >
> > > > > > > > > > Please don't try to make panels look more generic than they 
> > > > > > > > > > really are.
> > > > > > > > > > You're going to have to provide a compatible string for 
> > > > > > > > > > your device that
> > > > > > > > > > is more specific than "panel-edp". You claim that you don't 
> > > > > > > > > > need any
> > > > > > > > > > extra information that is panel specific, but you don't 
> > > > > > > > > > know that now.
> > > > > > > > > > We have in the past thought that we didn't need things like 
> > > > > > > > > > prepare
> > > > > > > > > > delay, but then we ran into situations where we did need 
> > > > > > > > > > them.
> > > > > > > > > >
> > > > > > > > > > Just do what everybody else does. Provide a specific 
> > > > > > > > > > compatible string
> > > > > > > > > > and match on that in the panel-simple driver. Even if you 
> > > > > > > > > > can read all
> > > > > > > > > > the video timings from an EDID EEPROM, you can still 
> > > > > > > > > > provide a mode in
> > > > > > > > > > the panel descriptor to serve as a fallback if for example 
> > > > > > > > > > the EEPROM
> > > > > > > > > > is faulty on some device.
> > > > > > > > >
> > > > > > > > > Pinebook used several 768p panels that have slightly 
> > > > > > > > > different timings
> > > > > > > > > and recent batch uses 1080p panel.
> > > > > > > > >
> > > > > > > > > What panel descriptor should I use as fallback?
> > > > > > > >
> > > > > > > > You don't use panel descriptors as fallback. The simple-panel 
> > > > > > > > driver
> > > > > > > > will bind to a panel device and use the corresponding 
> > > > > > > > descriptor. If
> > > > > > > > your device tree contains the correct information, the 
> > > > > > > > descriptor is
> > > > > > > > correct for the panel you have.
> > > > > > > >
> > > > > > > > In other words you need to ensure that you have the correct 
> > > > > > > > panel in
> > > > > > > > device tree for the board that you're using. This is exactly 
> > > > > > > > the same
> > > > > > > > thing as for other devices.
> > > > > > > >
> > > > > > > > One way to to this is to have separate device trees for each 
> > > > > > > > variant
> > > > > > > > of the board that you want to support. Another variant may be 
> > > > > > > > to have
> > > > > > > > a common device tree and then have some early firmware update 
> > > > > > > > the DTB
> > > > > > > > with the correct panel information.
> > > > > > >
> > > > > > > This would defeat the point of edp, which is to standardize the 
> > > > > > > mess of
> > > > > > > panels (at least somewhat) and avoid having to change the DT/ACPI
> > > > > > > tables/firmware for every board you ship. Also, we do have DP 
> > > > > > > quirking
> > > > > > > infrastructure already (using the OUI), I think if there's 
> > > > > > > something that
> > > > > > > doesn't work then we should quirk it there.
> > > > > >
> > > > > > The problem is that while the attempt may have been to standardize, 
> > > > > > it
> > > > > > failed. It doesn't take into account any of the details such as 
> > > > > > timing
> > > > > > between things like powering up the display and enabling the 
> > > > > > backlight
> > > > > > or similar. I don't know how you'd want to "quirk" those kinds of
> > > > > > requirements because they are highly panel specific.
> > > > >
> > > > > Hm right, we get these from some firmware 

Re: [PATCH RESEND v2 08/12] dt-bindings: add binding for generic eDP panel

2019-02-15 Thread Vasily Khoruzhick via dri-devel
On Tue, Feb 5, 2019 at 2:24 AM Thierry Reding  wrote:
>
> On Tue, Feb 05, 2019 at 09:57:37AM +0100, Daniel Vetter wrote:
> > On Mon, Feb 04, 2019 at 05:22:58PM +0100, Thierry Reding wrote:
> > > On Mon, Feb 04, 2019 at 04:59:09PM +0100, Daniel Vetter wrote:
> > > > On Mon, Feb 04, 2019 at 12:22:18PM +0100, Thierry Reding wrote:
> > > > > On Mon, Feb 04, 2019 at 10:40:12AM +0100, Daniel Vetter wrote:
> > > > > > On Mon, Feb 04, 2019 at 09:23:59AM +0100, Thierry Reding wrote:
> > > > > > > On Mon, Feb 04, 2019 at 12:13:55AM -0800, Vasily Khoruzhick wrote:
> > > > > > > > On Sun, Feb 3, 2019 at 11:43 PM Thierry Reding 
> > > > > > > >  wrote:
> > > > > > > > >
> > > > > > > > > On Sun, Feb 03, 2019 at 10:54:57AM -0800, Vasily Khoruzhick 
> > > > > > > > > wrote:
> > > > > > > > > > eDP panels usually have EDID EEPROM, so there's no need to 
> > > > > > > > > > define panel
> > > > > > > > > > width/height or any modes/timings in dts. But this panel 
> > > > > > > > > > still may have
> > > > > > > > > > regulator and/or backlight.
> > > > > > > > > >
> > > > > > > > > > Signed-off-by: Vasily Khoruzhick 
> > > > > > > > > > ---
> > > > > > > > > >  .../devicetree/bindings/display/panel/panel-edp.txt
> > > > > > > > > > | 7 +++
> > > > > > > > > >  1 file changed, 7 insertions(+)
> > > > > > > > > >  create mode 100644 
> > > > > > > > > > Documentation/devicetree/bindings/display/panel/panel-edp.txt
> > > > > > > > >
> > > > > > > > > Please don't try to make panels look more generic than they 
> > > > > > > > > really are.
> > > > > > > > > You're going to have to provide a compatible string for your 
> > > > > > > > > device that
> > > > > > > > > is more specific than "panel-edp". You claim that you don't 
> > > > > > > > > need any
> > > > > > > > > extra information that is panel specific, but you don't know 
> > > > > > > > > that now.
> > > > > > > > > We have in the past thought that we didn't need things like 
> > > > > > > > > prepare
> > > > > > > > > delay, but then we ran into situations where we did need them.
> > > > > > > > >
> > > > > > > > > Just do what everybody else does. Provide a specific 
> > > > > > > > > compatible string
> > > > > > > > > and match on that in the panel-simple driver. Even if you can 
> > > > > > > > > read all
> > > > > > > > > the video timings from an EDID EEPROM, you can still provide 
> > > > > > > > > a mode in
> > > > > > > > > the panel descriptor to serve as a fallback if for example 
> > > > > > > > > the EEPROM
> > > > > > > > > is faulty on some device.
> > > > > > > >
> > > > > > > > Pinebook used several 768p panels that have slightly different 
> > > > > > > > timings
> > > > > > > > and recent batch uses 1080p panel.
> > > > > > > >
> > > > > > > > What panel descriptor should I use as fallback?
> > > > > > >
> > > > > > > You don't use panel descriptors as fallback. The simple-panel 
> > > > > > > driver
> > > > > > > will bind to a panel device and use the corresponding descriptor. 
> > > > > > > If
> > > > > > > your device tree contains the correct information, the descriptor 
> > > > > > > is
> > > > > > > correct for the panel you have.
> > > > > > >
> > > > > > > In other words you need to ensure that you have the correct panel 
> > > > > > > in
> > > > > > > device tree for the board that you're using. This is exactly the 
> > > > > > > same
> > > > > > > thing as for other devices.
> > > > > > >
> > > > > > > One way to to this is to have separate device trees for each 
> > > > > > > variant
> > > > > > > of the board that you want to support. Another variant may be to 
> > > > > > > have
> > > > > > > a common device tree and then have some early firmware update the 
> > > > > > > DTB
> > > > > > > with the correct panel information.
> > > > > >
> > > > > > This would defeat the point of edp, which is to standardize the 
> > > > > > mess of
> > > > > > panels (at least somewhat) and avoid having to change the DT/ACPI
> > > > > > tables/firmware for every board you ship. Also, we do have DP 
> > > > > > quirking
> > > > > > infrastructure already (using the OUI), I think if there's 
> > > > > > something that
> > > > > > doesn't work then we should quirk it there.
> > > > >
> > > > > The problem is that while the attempt may have been to standardize, it
> > > > > failed. It doesn't take into account any of the details such as timing
> > > > > between things like powering up the display and enabling the backlight
> > > > > or similar. I don't know how you'd want to "quirk" those kinds of
> > > > > requirements because they are highly panel specific.
> > > >
> > > > Hm right, we get these from some firmware tables (and mix them with the
> > > > spec one, since some of the firmware values are nonsense). I don't even
> > > > know whether we can read the timings over dp aux somehow (you can power 
> > > > up
> > > > the panel with some pessimistic values to figure those out, and you only
> > > > need dp aux to work, which is much