Re: [PATCH v1 16/36] dt-bindings: display: convert lg,lg4573 to DT Schema

2020-03-15 Thread Heiko Schocher

Hello Sam,

Am 15.03.2020 um 14:43 schrieb Sam Ravnborg:

Signed-off-by: Sam Ravnborg 
Cc: Heiko Schocher 
Cc: Thierry Reding 
Cc: Sam Ravnborg 
---
  .../bindings/display/panel/lg,lg4573.txt  | 19 -
  .../bindings/display/panel/lg,lg4573.yaml | 41 +++
  2 files changed, 41 insertions(+), 19 deletions(-)
  delete mode 100644 
Documentation/devicetree/bindings/display/panel/lg,lg4573.txt
  create mode 100644 
Documentation/devicetree/bindings/display/panel/lg,lg4573.yaml


Reviewed-by: Heiko Schocher 

Thanks!

bye,
Heiko
--
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: h...@denx.de
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 06/33] drm/panel-lg-lg4573: Fix dotclock

2020-03-02 Thread Heiko Schocher

Hello Ville Syrjala,

Am 02.03.2020 um 21:34 schrieb Ville Syrjala:

From: Ville Syrjälä 

The currently listed dotclock disagrees with the currently
listed vrefresh rate. Change the dotclock to match the vrefresh.

Someone tell me which (if either) of the dotclock or vreresh is
correct?


Your clock fix is correct, thanks!



Cc: Heiko Schocher 
Cc: Thierry Reding 
Signed-off-by: Ville Syrjälä 
---
  drivers/gpu/drm/panel/panel-lg-lg4573.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)


Reviewed-by: Heiko Schocher 

bye,
Heiko
--
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: h...@denx.de
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[v2] drm/imx: Match imx-ipuv3-crtc components using device node in platform data

2016-05-20 Thread Heiko Schocher
Hello Philipp,

Am 18.05.2016 um 14:56 schrieb Philipp Zabel:
> The component master driver imx-drm-core matches component devices using
> their of_node. Since commit 950b410dd1ab ("gpu: ipu-v3: Fix imx-ipuv3-crtc
> module autoloading"), the imx-ipuv3-crtc dev->of_node is not set during
> probing. Before that, of_node was set and caused an of: modalias to be
> used instead of the platform: modalias, which broke module autoloading.
>
> On the other hand, if dev->of_node is not set yet when the imx-ipuv3-crtc
> probe function calls component_add, component matching in imx-drm-core
> fails. While dev->of_node will be set once the next component tries to
> bring up the component master, imx-drm-core component binding will never
> succeed if one of the crtc devices is probed last.
>
> Add of_node to the component platform data and match against the
> pdata->of_node instead of dev->of_node in imx-drm-core to work around
> this problem.
>
> Cc:  # 4.4.x
> Fixes: 950b410dd1ab ("gpu: ipu-v3: Fix imx-ipuv3-crtc module autoloading")
> Signed-off-by: Philipp Zabel 
> Tested-by: Fabio Estevam 
> ---
> Changes since v1:
>   - Also set the crtc->port to the of_node from platform data
> ---
>   drivers/gpu/drm/imx/imx-drm-core.c | 8 
>   drivers/gpu/drm/imx/ipuv3-crtc.c   | 2 +-
>   drivers/gpu/ipu-v3/ipu-common.c| 5 +++--
>   include/video/imx-ipu-v3.h | 2 ++
>   4 files changed, 14 insertions(+), 3 deletions(-)

Thanks! This fixes the aristainetos2 board, see log:
http://xeidos.ddns.net/buildbot/builders/ari_lx/builds/0/steps/shell/logs/tbotlog

so:

Tested-by: Heiko Schocher 

bye,
Heiko

-- 
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany


[PATCH] gpu: ipu-v3: display support on the aristainetos2 board broken

2016-05-20 Thread Heiko Schocher
Hello Fabio,

Am 20.05.2016 um 13:40 schrieb Fabio Estevam:
> Hi Heiko,
>
> On Fri, May 20, 2016 at 8:15 AM, Heiko Schocher  wrote:
>> commit 503fe87bd0a8 ("gpu: ipu-v3: Fix imx-ipuv3-crtc module autoloading")
>> breaks the aristainetos2 board with the "lg,lg4573" panel.
>>
>> This reverts the above commit.
>>
>> Signed-off-by: Heiko Schocher 
>>
>> ---
>> Any hint, how to bring back the display on the aristainetos2
>> board without reverting this commit would be appreciated.
>
> Philipp sent the following patch that fixes the issue:
> http://www.spinics.net/lists/dri-devel/msg107524.html

Thanks for the hint! This patch fixes the issue see log:
http://xeidos.ddns.net/buildbot/builders/ari_lx/builds/0/steps/shell/logs/tbotlog

bye,
Heiko
-- 
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany


[PATCH] gpu: ipu-v3: display support on the aristainetos2 board broken

2016-05-20 Thread Heiko Schocher
commit 503fe87bd0a8 ("gpu: ipu-v3: Fix imx-ipuv3-crtc module autoloading")
breaks the aristainetos2 board with the "lg,lg4573" panel.

This reverts the above commit.

Signed-off-by: Heiko Schocher 

---
Any hint, how to bring back the display on the aristainetos2
board without reverting this commit would be appreciated.

Board DTS:
arch/arm/boot/dts/imx6qdl-aristainetos2.dtsi
arch/arm/boot/dts/imx6dl-aristainetos2_4.dts

see the log of a full automated "git bisect" session with tbot testcase:
https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_aristainetos2_linux_bisect.py
here:
http://xeidos.ddns.net/buildbot/builders/ari_lx_bi/builds/3/steps/shell/logs/tbotlog
for details.

 drivers/gpu/ipu-v3/ipu-common.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c
index abb98c7..e00db3f 100644
--- a/drivers/gpu/ipu-v3/ipu-common.c
+++ b/drivers/gpu/ipu-v3/ipu-common.c
@@ -1068,6 +1068,7 @@ static int ipu_add_client_devices(struct ipu_soc *ipu, 
unsigned long ipu_base)
goto err_register;
}

+   pdev->dev.of_node = of_node;
pdev->dev.parent = dev;

ret = platform_device_add_data(pdev, >pdata,
@@ -1078,12 +1079,6 @@ static int ipu_add_client_devices(struct ipu_soc *ipu, 
unsigned long ipu_base)
platform_device_put(pdev);
goto err_register;
}
-
-   /*
-* Set of_node only after calling platform_device_add. Otherwise
-* the platform:imx-ipuv3-crtc modalias won't be used.
-*/
-   pdev->dev.of_node = of_node;
}

return 0;
-- 
2.5.5



[PATCH v2] drm/panel: add lg4573 driver

2015-08-14 Thread Heiko Schocher
Hello Thierry,

Am 13.08.2015 um 14:59 schrieb Thierry Reding:
> On Tue, Jun 09, 2015 at 07:51:22AM +0200, Heiko Schocher wrote:
>> Add support for LG LG4573 480x800 4,3" panel. the LG4573
>> is used on the LG LCD LB043WV2-SD01, an industrial 4.3" TFT
>> panel with SPI control interface.
>>
>> Signed-off-by: Heiko Schocher 
>>
>> ---
>>
>> Changes in v2:
>> - add comments from Thierry Reding:
>>- fix some spelling issues
>>- remove "power-on-delay"
>>- remove display timings usage from DT, instead specify the
>>  timing in the driver.
>>- change config symbol to DRM_PANEL_LG_LG4573
>>- change filename to panel-lg-lg4573.c
>>- get rid of power_on_delay
>>- use cpu_to_be16()
>>- rework lg4573_spi_write_u16_array()
>>- introduce lg4573_spi_write_dcs()
>>- reworked error reporting
>>
>>   .../devicetree/bindings/panel/lg,lg4573.txt|  19 +
>>   drivers/gpu/drm/panel/Kconfig  |   8 +
>>   drivers/gpu/drm/panel/Makefile |   1 +
>>   drivers/gpu/drm/panel/panel-lg-lg4573.c| 382 
>> +
>>   4 files changed, 410 insertions(+)
>>   create mode 100644 Documentation/devicetree/bindings/panel/lg,lg4573.txt
>>   create mode 100644 drivers/gpu/drm/panel/panel-lg-lg4573.c
>
> There were a couple of review comments that you missed, but I've

Hups ... It seems I missed them :-(

> addressed them while applying. Might be good to give it[0] a spin just
> to make sure I didn't accidentally break anything.

Uh, thank you! Just tested it on the aristainetos2 board, works fine.

bye,
Heiko
>
> Thierry
>
> [0]: git://anongit.freedesktop.org/tegra/linux#drm/panel/for-next
>

-- 
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany


[PATCH v2] drm/panel: add lg4573 driver

2015-06-09 Thread Heiko Schocher
Add support for LG LG4573 480x800 4,3" panel. the LG4573
is used on the LG LCD LB043WV2-SD01, an industrial 4.3" TFT
panel with SPI control interface.

Signed-off-by: Heiko Schocher 

---

Changes in v2:
- add comments from Thierry Reding:
  - fix some spelling issues
  - remove "power-on-delay"
  - remove display timings usage from DT, instead specify the
timing in the driver.
  - change config symbol to DRM_PANEL_LG_LG4573
  - change filename to panel-lg-lg4573.c
  - get rid of power_on_delay
  - use cpu_to_be16()
  - rework lg4573_spi_write_u16_array()
  - introduce lg4573_spi_write_dcs()
  - reworked error reporting

 .../devicetree/bindings/panel/lg,lg4573.txt|  19 +
 drivers/gpu/drm/panel/Kconfig  |   8 +
 drivers/gpu/drm/panel/Makefile |   1 +
 drivers/gpu/drm/panel/panel-lg-lg4573.c| 382 +
 4 files changed, 410 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/panel/lg,lg4573.txt
 create mode 100644 drivers/gpu/drm/panel/panel-lg-lg4573.c

diff --git a/Documentation/devicetree/bindings/panel/lg,lg4573.txt 
b/Documentation/devicetree/bindings/panel/lg,lg4573.txt
new file mode 100644
index 000..824441f
--- /dev/null
+++ b/Documentation/devicetree/bindings/panel/lg,lg4573.txt
@@ -0,0 +1,19 @@
+LG LG4573 TFT Liquid Crystal Display with SPI control bus
+
+Required properties:
+  - compatible: "lg,lg4573"
+  - reg: address of the panel on the SPI bus
+
+The panel must obey rules for SPI slave device specified in document [1].
+
+[1]: Documentation/devicetree/bindings/spi/spi-bus.txt
+
+Example:
+
+   lcd_panel: display at 0 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "lg,lg4573";
+   spi-max-frequency = <1000>;
+   reg = <0>;
+   };
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 6d64c7b..e7a4d16 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -23,6 +23,14 @@ config DRM_PANEL_LD9040
depends on OF && SPI
select VIDEOMODE_HELPERS

+config DRM_PANEL_LG_LG4573
+   tristate "LG4573 RGB/SPI panel"
+   depends on OF && SPI
+   select VIDEOMODE_HELPERS
+   help
+ Say Y here if you want to enable support for LG4573 RGB panel.
+ To compile this driver as a module, choose M here.
+
 config DRM_PANEL_S6E8AA0
tristate "S6E8AA0 DSI video mode panel"
depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 4b2a043..437e8bf 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -1,4 +1,5 @@
 obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
 obj-$(CONFIG_DRM_PANEL_LD9040) += panel-ld9040.o
+obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o
 obj-$(CONFIG_DRM_PANEL_S6E8AA0) += panel-s6e8aa0.o
 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 000..9fbe646
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-lg-lg4573.c
@@ -0,0 +1,382 @@
+/*
+ *
+ * Copyright (C) 2015 Heiko Schocher 
+ *
+ * from:
+ * drivers/gpu/drm/panel/panel-ld9040.c
+ * ld9040 AMOLED LCD drm_panel driver.
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd
+ * Derived from drivers/video/backlight/ld9040.c
+ *
+ * Andrzej Hajda 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+struct lg4573 {
+   struct drm_panel panel;
+   struct device *dev;
+   struct videomode vm;
+};
+
+static inline struct lg4573 *panel_to_lg4573(struct drm_panel *panel)
+{
+   return container_of(panel, struct lg4573, panel);
+}
+
+static int lg4573_spi_write_u16(struct lg4573 *ctx, u16 data)
+{
+   struct spi_device *spi = to_spi_device(ctx->dev);
+   struct spi_transfer xfer = {
+   .len = 2,
+   };
+   struct spi_message msg;
+   u16 temp = cpu_to_be16(data);
+
+   dev_dbg(ctx->dev, "writing data: %x\n", data);
+   xfer.tx_buf = 
+   spi_message_init();
+   spi_message_add_tail(, );
+
+   return spi_sync(spi, );
+}
+
+static int lg4573_spi_write_u16_array(struct lg4573 *ctx, u16 *buf, int cnt)
+{
+   int i;
+   int ret;
+
+   for (i = 0; i < cnt; i++) {
+   ret = lg4573_spi_write_u16(ctx, buf[i]);
+   if (ret)
+   return ret;
+   }
+   return 0;
+}
+
+static int lg4573_spi_write_dcs(struct lg4573 *ctx, u8 dcs)
+{
+   return lg4573_spi_writ

[PATCH] drm/panel: add lg4573 driver

2015-06-08 Thread Heiko Schocher
Hello Thierry,

Am 05.06.2015 14:19, schrieb Thierry Reding:
> On Wed, May 06, 2015 at 09:49:33AM +0200, Heiko Schocher wrote:
>> The patch adds LG4573 parallel RGB panel driver with SPI control interface.
>> The driver uses drm_panel framework.
>
> This should be obvious by the location of the driver. Can you instead
> provide information about the type or resolution of the panel?
>
>>   .../devicetree/bindings/panel/lg,lg4573.txt|  42 +++
>>   drivers/gpu/drm/panel/Kconfig  |   8 +
>>   drivers/gpu/drm/panel/Makefile |   1 +
>>   drivers/gpu/drm/panel/panel-lg4573.c   | 367 
>> +
>>   4 files changed, 418 insertions(+)
>>   create mode 100644 Documentation/devicetree/bindings/panel/lg,lg4573.txt
>>   create mode 100644 drivers/gpu/drm/panel/panel-lg4573.c
>>
>> diff --git a/Documentation/devicetree/bindings/panel/lg,lg4573.txt 
>> b/Documentation/devicetree/bindings/panel/lg,lg4573.txt
>> new file mode 100644
>> index 000..55f495d
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/panel/lg,lg4573.txt
>> @@ -0,0 +1,42 @@
>> +LG LG4573 TFT liquid crystal display with SPI control bus
>
> Please capitalize "Liquid Crystal Display".

done.

>> +
>> +Required properties:
>> +  - compatible: "lg4573"
>
> This is missing the vendor prefix.

fixed.

>> +  - reg: address of the panel on SPI bus
>
> "on the"

fixed.

>> +  - display-timings: timings for the connected panel according to [1]
>
> The timings are already implied by the compatible value, so there's no
> need to list them in DT.

I look into it ... is there an example for a panel driver with fixed
timings? Should I do it like it is done in the
drivers/gpu/drm/panel/panel-simple.c driver?

>> +The panel must obey rules for SPI slave device specified in document [2].
>> +
>> +Optional properties:
>> +  - power-on-delay: delay after turning regulators on [ms]
>
> How is this a board-specific property? I'd assume that the same panel
> always requires the same delay. Perhaps if this is board-specific it
> really should be in the corresponding regulator's
> regulator-enable-ramp-delay? Then again the binding doesn't describe any
> regulators, so what exactly is this delay used for?

I rework this, and drop it.

>> +
>> +[1]: Documentation/devicetree/bindings/video/display-timing.txt
>> +[2]: Documentation/devicetree/bindings/spi/spi-bus.txt
>> +
>> +Example:
>> +
>> +lcd_panel: display at 0 {
>> +#address-cells = <1>;
>> +#size-cells = <1>;
>> +compatible = "lg,lg4573";
>> +spi-max-frequency = <1000>;
>> +reset-gpios = < 11 0>;
>
> This isn't documented above.

removed.

>> +reg = <0>;
>> +power-on-delay = <10>;
>> +display-timings {
>> +480x800p57 {
>> +native-mode;
>> +clock-frequency = <2727>;
>> +hactive = <480>;
>> +vactive = <800>;
>> +hfront-porch = <10>;
>> +hback-porch = <59>;
>> +hsync-len = <10>;
>> +vback-porch = <15>;
>> +vfront-porch = <15>;
>> +vsync-len = <15>;
>> +hsync-active = <1>;
>> +vsync-active = <1>;
>> +};
>> +};
>> +};
>> diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
>> index 6d64c7b..29c3407 100644
>> --- a/drivers/gpu/drm/panel/Kconfig
>> +++ b/drivers/gpu/drm/panel/Kconfig
>> @@ -23,6 +23,14 @@ config DRM_PANEL_LD9040
>>  depends on OF && SPI
>>  select VIDEOMODE_HELPERS
>>
>> +config DRM_PANEL_LG4573
>> +tristate "LG4573 RGB/SPI panel"
>
> I'd like to get into the habit of prefixing the panels with a vendor
> prefix, so this should become something like:
>
>   config DRM_PANEL_LG_LG4573
>   tristate "LG LG4573 RGB/SPI panel"
>
> I have a local patch that converts existing boards, so with this
> conversion it'd fit right it.

done.

>> diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
>> 

[PATCH] drm/panel: add lg4573 driver

2015-05-28 Thread Heiko Schocher
Hello,

Am 06.05.2015 09:49, schrieb Heiko Schocher:
> The patch adds LG4573 parallel RGB panel driver with SPI control interface.
> The driver uses drm_panel framework.
>
> Signed-off-by: Heiko Schocher 
>
> ---
>
>   .../devicetree/bindings/panel/lg,lg4573.txt|  42 +++
>   drivers/gpu/drm/panel/Kconfig  |   8 +
>   drivers/gpu/drm/panel/Makefile |   1 +
>   drivers/gpu/drm/panel/panel-lg4573.c   | 367 
> +
>   4 files changed, 418 insertions(+)
>   create mode 100644 Documentation/devicetree/bindings/panel/lg,lg4573.txt
>   create mode 100644 drivers/gpu/drm/panel/panel-lg4573.c

ping...

bye,
Heiko
>
> diff --git a/Documentation/devicetree/bindings/panel/lg,lg4573.txt 
> b/Documentation/devicetree/bindings/panel/lg,lg4573.txt
> new file mode 100644
> index 000..55f495d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/panel/lg,lg4573.txt
> @@ -0,0 +1,42 @@
> +LG LG4573 TFT liquid crystal display with SPI control bus
> +
> +Required properties:
> +  - compatible: "lg4573"
> +  - reg: address of the panel on SPI bus
> +  - display-timings: timings for the connected panel according to [1]
> +
> +The panel must obey rules for SPI slave device specified in document [2].
> +
> +Optional properties:
> +  - power-on-delay: delay after turning regulators on [ms]
> +
> +[1]: Documentation/devicetree/bindings/video/display-timing.txt
> +[2]: Documentation/devicetree/bindings/spi/spi-bus.txt
> +
> +Example:
> +
> + lcd_panel: display at 0 {
> + #address-cells = <1>;
> + #size-cells = <1>;
> + compatible = "lg,lg4573";
> + spi-max-frequency = <1000>;
> + reset-gpios = < 11 0>;
> + reg = <0>;
> + power-on-delay = <10>;
> + display-timings {
> + 480x800p57 {
> + native-mode;
> + clock-frequency = <2727>;
> + hactive = <480>;
> + vactive = <800>;
> + hfront-porch = <10>;
> + hback-porch = <59>;
> + hsync-len = <10>;
> + vback-porch = <15>;
> + vfront-porch = <15>;
> + vsync-len = <15>;
> + hsync-active = <1>;
> + vsync-active = <1>;
> + };
> + };
> + };
> diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
> index 6d64c7b..29c3407 100644
> --- a/drivers/gpu/drm/panel/Kconfig
> +++ b/drivers/gpu/drm/panel/Kconfig
> @@ -23,6 +23,14 @@ config DRM_PANEL_LD9040
>   depends on OF && SPI
>   select VIDEOMODE_HELPERS
>
> +config DRM_PANEL_LG4573
> + tristate "LG4573 RGB/SPI panel"
> + depends on OF && SPI
> + select VIDEOMODE_HELPERS
> + help
> +   Say Y here if you want to enable support for LG4573 RGB panel.
> +   To compile this driver as a module, choose M here.
> +
>   config DRM_PANEL_S6E8AA0
>   tristate "S6E8AA0 DSI video mode panel"
>   depends on OF
> diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
> index 4b2a043..715b95d 100644
> --- a/drivers/gpu/drm/panel/Makefile
> +++ b/drivers/gpu/drm/panel/Makefile
> @@ -1,4 +1,5 @@
>   obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
>   obj-$(CONFIG_DRM_PANEL_LD9040) += panel-ld9040.o
> +obj-$(CONFIG_DRM_PANEL_LG4573) += panel-lg4573.o
>   obj-$(CONFIG_DRM_PANEL_S6E8AA0) += panel-s6e8aa0.o
>   obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o
> diff --git a/drivers/gpu/drm/panel/panel-lg4573.c 
> b/drivers/gpu/drm/panel/panel-lg4573.c
> new file mode 100644
> index 000..9d5e5a5
> --- /dev/null
> +++ b/drivers/gpu/drm/panel/panel-lg4573.c
> @@ -0,0 +1,367 @@
> +/*
> + *
> + * Copyright (C) 2015 Heiko Schocher 
> + *
> + * from:
> + * drivers/gpu/drm/panel/panel-ld9040.c
> + * ld9040 AMOLED LCD drm_panel driver.
> + *
> + * Copyright (c) 2014 Samsung Electronics Co., Ltd
> + * Derived from drivers/video/backlight/ld9040.c
> + *
> + * Andrzej Hajda 
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> +*/
> +
> +#include 
&

[PATCH v4 1/2] arm, imx6, dts: add DT for aristainetos2 board

2015-05-22 Thread Heiko Schocher
Hello Philipp,

Am 22.05.2015 11:14, schrieb Philipp Zabel:
> Hi Heiko,
>
> Am Freitag, den 22.05.2015, 10:25 +0200 schrieb Heiko Schocher:
> [...]
>> diff --git a/arch/arm/boot/dts/imx6dl-aristainetos2_4.dts 
>> b/arch/arm/boot/dts/imx6dl-aristainetos2_4.dts
>> new file mode 100644
>> index 000..ae50c8b
>> --- /dev/null
>> +++ b/arch/arm/boot/dts/imx6dl-aristainetos2_4.dts
>> @@ -0,0 +1,158 @@
>> +/*
>> + * Copyright (C) 2014 Rabeeh Khoury (rabeeh at solid-run.com)
>> + * Based on dt work by Russell King
>
> This is new. Copy & paste error?

Argh... Good catch! I fix this .. but wait a while before posting v5
to get some more comments.

> With proper copyright information restored,
> Reviewed-by: Philipp Zabel 

Thanks!

bye,
Heiko
-- 
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany


[PATCH v4 2/2] drm/panel: Add support for LG LB070WV8 800x480 7" panel

2015-05-22 Thread Heiko Schocher
This adds support for the LG LB070WV8 7" 800x480 panel to the
DRM simple panel driver.

Signed-off-by: Heiko Schocher 
---

Changes in v4:
- new in version 4, as Philipp Zabel suggested to use
  simple panel driver

Changes in v3: None
Changes in v2: None

 .../devicetree/bindings/panel/lg,lb070wv8.txt  |  7 ++
 drivers/gpu/drm/panel/panel-simple.c   | 27 ++
 2 files changed, 34 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/panel/lg,lb070wv8.txt

diff --git a/Documentation/devicetree/bindings/panel/lg,lb070wv8.txt 
b/Documentation/devicetree/bindings/panel/lg,lb070wv8.txt
new file mode 100644
index 000..a7588e5
--- /dev/null
+++ b/Documentation/devicetree/bindings/panel/lg,lb070wv8.txt
@@ -0,0 +1,7 @@
+LG 7" (800x480 pixels) TFT LCD panel
+
+Required properties:
+- compatible: should be "lg,lb070wv8"
+
+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 30904a9..a06d9d3 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -872,6 +872,30 @@ static const struct panel_desc innolux_zj070na_01p = {
},
 };

+static const struct drm_display_mode lg_lb070wv8_mode = {
+   .clock = 33246,
+   .hdisplay = 800,
+   .hsync_start = 800 + 88,
+   .hsync_end = 800 + 88 + 80,
+   .htotal = 800 + 88 + 80 + 88,
+   .vdisplay = 480,
+   .vsync_start = 480 + 10,
+   .vsync_end = 480 + 10 + 25,
+   .vtotal = 480 + 10 + 25 + 10,
+   .vrefresh = 60,
+};
+
+static const struct panel_desc lg_lb070wv8 = {
+   .modes = _lb070wv8_mode,
+   .num_modes = 1,
+   .bpc = 16,
+   .size = {
+   .width = 151,
+   .height = 91,
+   },
+   .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
+};
+
 static const struct drm_display_mode lg_lp129qe_mode = {
.clock = 285250,
.hdisplay = 2560,
@@ -1056,6 +1080,9 @@ static const struct of_device_id platform_of_match[] = {
.compatible = "innolux,zj070na-01p",
.data = _zj070na_01p,
}, {
+   .compatible = "lg,lb070wv8",
+   .data = _lb070wv8,
+   }, {
.compatible = "lg,lp129qe",
.data = _lp129qe,
}, {
-- 
2.1.0



[PATCH v4 1/2] arm, imx6, dts: add DT for aristainetos2 board

2015-05-22 Thread Heiko Schocher
This patch add support for the imx6dl based aristainetos2 board
with following configuration:

CPU:   Freescale i.MX6DL rev1.1 at 792 MHz
MReset cause: POR
MBoard: aristaitenos2
DRAM:  1 GiB
NAND:  1024 MiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
SF: Detected N25Q128A with page size 256 Bytes, erase size 64 KiB, total 16 MiB
Display: lb07wv8 (800x480)

As this board can used with 2 different display types, the
differences between them are extracted into 2 DTS files, and
the common settings are collected in a common file.

Signed-off-by: Heiko Schocher 
---

Changes in v4:
- add comments from Philipp Zabel:
  - fix some typos
  - fix license text
  - fix pmic compatible name to "dlg,da9063"
  - remove clocks property from i2c4 node
  - use simple panel driver, so remove the fsl,data-mapping
and fsl,data-width properties and the display-timings node.
need patch: "drm/panel: Add support for LG LB070WV8 800x480 7" panel"

Changes in v3:
- add comments from Shawn Guo
  - change license to GPL/X11 dual licence
  - rename touch node name to "touch"
  - add DTB in Makefile
  - remove "status = "okay"" from backlight node
  - rename "pinctrl_ipu1_1_80Ohm_clk" to "pinctrl_ipu_disp"
  - remove "status = "okay"" from "display at di0" node
  - remove "dma-names;" in ecspix nodes
  - use macro for clock ID and gpio
  - move iomuxc to the bottom of the file
  - configure pinctrl_backlight in the device node, not from
the hog group
  - provide a proper pad configuration value rather than 0x800.
  - in the iomuxc node, save one level of the sub-node
needs patch:
LinusW queued patch 5fcdf6a7ed95 ("pinctrl: imx: Allow
parsing DT without function nodes")
- add comments from Philipp Zabel
  - get rid of "fsl,panel" to connect a drm_panel to the parallel-display
instead switch to the common of-graph bindings.
need patch: "drm/imx: parallel-display: fix drm_panel support"
from Philipp Zabel

Changes in v2:
- add comments from Sascha Hauer:
  - remove "clock-frequency" property in i2c nodes
  - correct indentation in some pinctrl nodes
  - move pin settings out of "gpiogrp" where it was possible
led pins not moved, as they used through sysfs

 arch/arm/boot/dts/Makefile   |   2 +
 arch/arm/boot/dts/imx6dl-aristainetos2_4.dts | 158 +++
 arch/arm/boot/dts/imx6dl-aristainetos2_7.dts |  97 
 arch/arm/boot/dts/imx6qdl-aristainetos2.dtsi | 632 +++
 4 files changed, 889 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx6dl-aristainetos2_4.dts
 create mode 100644 arch/arm/boot/dts/imx6dl-aristainetos2_7.dts
 create mode 100644 arch/arm/boot/dts/imx6qdl-aristainetos2.dtsi

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 86217db..583fbeb 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -256,6 +256,8 @@ dtb-$(CONFIG_SOC_IMX53) += \
 dtb-$(CONFIG_SOC_IMX6Q) += \
imx6dl-aristainetos_4.dtb \
imx6dl-aristainetos_7.dtb \
+   imx6dl-aristainetos2_4.dtb \
+   imx6dl-aristainetos2_7.dtb \
imx6dl-cubox-i.dtb \
imx6dl-dfi-fs700-m60.dtb \
imx6dl-gw51xx.dtb \
diff --git a/arch/arm/boot/dts/imx6dl-aristainetos2_4.dts 
b/arch/arm/boot/dts/imx6dl-aristainetos2_4.dts
new file mode 100644
index 000..ae50c8b
--- /dev/null
+++ b/arch/arm/boot/dts/imx6dl-aristainetos2_4.dts
@@ -0,0 +1,158 @@
+/*
+ * Copyright (C) 2014 Rabeeh Khoury (rabeeh at solid-run.com)
+ * Based on dt work by Russell King
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This file is distributed in the hope that it will be useful
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * Or, alternatively
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included i

[PATCH] drm/panel: add lg4573 driver

2015-05-06 Thread Heiko Schocher
The patch adds LG4573 parallel RGB panel driver with SPI control interface.
The driver uses drm_panel framework.

Signed-off-by: Heiko Schocher 

---

 .../devicetree/bindings/panel/lg,lg4573.txt|  42 +++
 drivers/gpu/drm/panel/Kconfig  |   8 +
 drivers/gpu/drm/panel/Makefile |   1 +
 drivers/gpu/drm/panel/panel-lg4573.c   | 367 +
 4 files changed, 418 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/panel/lg,lg4573.txt
 create mode 100644 drivers/gpu/drm/panel/panel-lg4573.c

diff --git a/Documentation/devicetree/bindings/panel/lg,lg4573.txt 
b/Documentation/devicetree/bindings/panel/lg,lg4573.txt
new file mode 100644
index 000..55f495d
--- /dev/null
+++ b/Documentation/devicetree/bindings/panel/lg,lg4573.txt
@@ -0,0 +1,42 @@
+LG LG4573 TFT liquid crystal display with SPI control bus
+
+Required properties:
+  - compatible: "lg4573"
+  - reg: address of the panel on SPI bus
+  - display-timings: timings for the connected panel according to [1]
+
+The panel must obey rules for SPI slave device specified in document [2].
+
+Optional properties:
+  - power-on-delay: delay after turning regulators on [ms]
+
+[1]: Documentation/devicetree/bindings/video/display-timing.txt
+[2]: Documentation/devicetree/bindings/spi/spi-bus.txt
+
+Example:
+
+   lcd_panel: display at 0 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "lg,lg4573";
+   spi-max-frequency = <1000>;
+   reset-gpios = < 11 0>;
+   reg = <0>;
+   power-on-delay = <10>;
+   display-timings {
+   480x800p57 {
+   native-mode;
+   clock-frequency = <2727>;
+   hactive = <480>;
+   vactive = <800>;
+   hfront-porch = <10>;
+   hback-porch = <59>;
+   hsync-len = <10>;
+   vback-porch = <15>;
+   vfront-porch = <15>;
+   vsync-len = <15>;
+   hsync-active = <1>;
+   vsync-active = <1>;
+   };
+   };
+   };
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 6d64c7b..29c3407 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -23,6 +23,14 @@ config DRM_PANEL_LD9040
depends on OF && SPI
select VIDEOMODE_HELPERS

+config DRM_PANEL_LG4573
+   tristate "LG4573 RGB/SPI panel"
+   depends on OF && SPI
+   select VIDEOMODE_HELPERS
+   help
+ Say Y here if you want to enable support for LG4573 RGB panel.
+ To compile this driver as a module, choose M here.
+
 config DRM_PANEL_S6E8AA0
tristate "S6E8AA0 DSI video mode panel"
depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 4b2a043..715b95d 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -1,4 +1,5 @@
 obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
 obj-$(CONFIG_DRM_PANEL_LD9040) += panel-ld9040.o
+obj-$(CONFIG_DRM_PANEL_LG4573) += panel-lg4573.o
 obj-$(CONFIG_DRM_PANEL_S6E8AA0) += panel-s6e8aa0.o
 obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o
diff --git a/drivers/gpu/drm/panel/panel-lg4573.c 
b/drivers/gpu/drm/panel/panel-lg4573.c
new file mode 100644
index 000..9d5e5a5
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-lg4573.c
@@ -0,0 +1,367 @@
+/*
+ *
+ * Copyright (C) 2015 Heiko Schocher 
+ *
+ * from:
+ * drivers/gpu/drm/panel/panel-ld9040.c
+ * ld9040 AMOLED LCD drm_panel driver.
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd
+ * Derived from drivers/video/backlight/ld9040.c
+ *
+ * Andrzej Hajda 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+struct lg4573 {
+   struct device *dev;
+   struct drm_panel panel;
+   u32 power_on_delay;
+   struct videomode vm;
+};
+
+static inline struct lg4573 *panel_to_lg4573(struct drm_panel *panel)
+{
+   return container_of(panel, struct lg4573, panel);
+}
+
+static int lg4573_spi_write_u16(struct lg4573 *ctx, u16 data)
+{
+   struct spi_device *spi = to_spi_device(ctx->dev);
+   struct spi_transfer xfer = {
+   .len= 2,
+   };
+   struct spi_message msg;
+  

[PATCH] gpu:drm:tilcdc: backlight node never found

2014-02-13 Thread Heiko Schocher
In panel_probe() the backlight node is never found, correct this.

Signed-off-by: Heiko Schocher 
Cc: Anatolij Gustschin 
Cc: Benoit Parrot 
Cc: Rob Clark 
Cc: David Airlie 
Cc: Grant Likely 
Cc: Rob Herring <robh+dt at kernel.org>
Cc: Tomi Valkeinen 
Cc: Sachin Kamat 
Cc: dri-devel at lists.freedesktop.org
Cc: linux-kernel at vger.kernel.org
Cc: devicetree at vger.kernel.org
---
 drivers/gpu/drm/tilcdc/tilcdc_panel.c | 13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c 
b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
index 86c6732..0b97cf4 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
@@ -356,6 +356,7 @@ static struct of_device_id panel_of_match[];
 static int panel_probe(struct platform_device *pdev)
 {
struct device_node *node = pdev->dev.of_node;
+   struct device_node *backlight_node;
struct panel_module *panel_mod;
struct tilcdc_module *mod;
struct pinctrl *pinctrl;
@@ -395,9 +396,15 @@ static int panel_probe(struct platform_device *pdev)

mod->preferred_bpp = panel_mod->info->bpp;

-   panel_mod->backlight = of_find_backlight_by_node(node);
-   if (panel_mod->backlight)
-   dev_info(>dev, "found backlight\n");
+   backlight_node = of_parse_phandle(pdev->dev.of_node, "backlight", 0);
+   if (backlight_node) {
+   panel_mod->backlight =
+   of_find_backlight_by_node(backlight_node);
+   if (panel_mod->backlight)
+   dev_info(>dev, "found backlight\n");
+   } else {
+   dev_warn(>dev, "backlight node missing...\n");
+   }

return 0;

-- 
1.8.3.1