[PATCH v4 2/2] drm/panel: Add driver for Samsung S6E63M0 panel

2019-02-25 Thread Paweł Chmiel
This patch adds Samsung S6E63M0 AMOLED LCD panel driver, connected over
spi. It's based on already removed, non dt s6e63m0 driver and
panel-samsung-ld9040. It can be found for example in some of Samsung
Aries based phones.

Signed-off-by: Paweł Chmiel 
Reviewed-by: Sam Ravnborg 
Reviewed-by: Andrzej Hajda 
---
Changes from v3:
  - Squash s6e63m0_brightness_set into s6e63m0_set_brightness
  - In power_on assert reset gpio after regulators,
like it was done in vendor sources
  - In power_off assert reset gpio before regulators,
like it was done in vendor sources
  - Add reviewed by
  - Match MCS command names (taken from other samsung panels)

Changes from v2:
  - VIDEOMODE_HELPERS is not needed in Kconfig
  - Added help text to Kconfig
  - Remove unneeded videomode includes/fields
  - Add sentinel comment in s6e63m0_of_match struct
  - Handle errors during registration of backlight device. We shouldn't
register panel if we fail to register backlight device
  - Added Reviewed-by

Changes from v1:
  - Correct order of Kconfig/Makefile entry
  - Fix SPDX tag, so it matches value of MODULE_LICENSE
  - Remove inclusion of drmP.h
  - Fix code formatting
  - Use DRM_DEV_ERROR/DEBUG
  - Extract hardcoded values
  - Remove possibility to change gamma through sysfs, leaving only one
gamma table values
  - Fix reset_gpio handling, so it'll be asserted in power_on and
deasserted in power_off. Also do it before turning voltage on.
  - Disable backlight and enter sleep mode in disable callback.
Previously it was done in unprepare
  - Enable display and backlight in enable callback. Previously it was
done in prepare
  - Hardcode display timings and delays. Previously they were readed
from device tree
  - We're using SPDX, so we don't need to have license body
  - Use MIPI_DCS_EXIT_SLEEP_MODE and MIPI_DCS_SET_DISPLAY_ON
  - Rename MAX_GAMMA_LEVEL to NUM_GAMMA_LEVELS
  - Ommit get_brightness callback
  - Use backlight_enable/disable API, like it's done in other panel
drivers (for example panel-simple)
  - Make set_brightness called only from backlight api, like it's done
in other panel drivers (for example panel-simple).
  - Reset gpio should be set to GPIOD_OUT_HIGH. It's declared as active
low in device tree
  - Don't call power_off in remove callback
---
 drivers/gpu/drm/panel/Kconfig |   9 +
 drivers/gpu/drm/panel/Makefile|   1 +
 drivers/gpu/drm/panel/panel-samsung-s6e63m0.c | 514 ++
 3 files changed, 524 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-samsung-s6e63m0.c

diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 3f3537719beb..45e9ab4b7857 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -158,6 +158,15 @@ config DRM_PANEL_SAMSUNG_S6E63J0X03
depends on BACKLIGHT_CLASS_DEVICE
select VIDEOMODE_HELPERS
 
+config DRM_PANEL_SAMSUNG_S6E63M0
+   tristate "Samsung S6E63M0 RGB/SPI panel"
+   depends on OF
+   depends on SPI
+   depends on BACKLIGHT_CLASS_DEVICE
+   help
+ Say Y here if you want to enable support for Samsung s6e63m0
+ AMOLED LCD panel.
+
 config DRM_PANEL_SAMSUNG_S6E8AA0
tristate "Samsung S6E8AA0 DSI video mode panel"
depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 4396658a7996..4507a2d253ac 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -16,6 +16,7 @@ obj-$(CONFIG_DRM_PANEL_SAMSUNG_LD9040) += 
panel-samsung-ld9040.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6D16D0) += panel-samsung-s6d16d0.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HA2) += panel-samsung-s6e3ha2.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03) += panel-samsung-s6e63j0x03.o
+obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0) += panel-samsung-s6e63m0.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0) += panel-samsung-s6e8aa0.o
 obj-$(CONFIG_DRM_PANEL_SEIKO_43WVF1G) += panel-seiko-43wvf1g.o
 obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o
diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c 
b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c
new file mode 100644
index ..142d395ea512
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c
@@ -0,0 +1,514 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * S6E63M0 AMOLED LCD drm_panel driver.
+ *
+ * Copyright (C) 2019 Paweł Chmiel 
+ * Derived from drivers/gpu/drm/panel-samsung-ld9040.c
+ *
+ * Andrzej Hajda 
+ */
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+/* Manufacturer Command Set */
+#define MCS_ELVSS_ON0xb1
+#define MCS_MIECTL10xc0
+#define MCS_BCMODE  0xc1
+#define MCS_DISCTL   0xf2
+#define MCS_SRCCTL   0xf6
+#define MCS_IFCTL   0xf7
+#define MCS_PANELCTL 0xF8
+#

[PATCH v4 1/2] dt-bindings: drm: panel: Add Samsung s6e63m0 panel documentation

2019-02-25 Thread Paweł Chmiel
From: Jonathan Bakker 

This commit adds documentation for Samsung s6e63m0 AMOLED LCD panel
driver.

Signed-off-by: Jonathan Bakker 
Signed-off-by: Paweł Chmiel 
Reviewed-by: Rob Herring 
---
Changes from v2:
  - Added Reviewed-by

Changes from v1:
  - Add missing subject prefix
  - Rename reset-gpio to reset-gpios
  - Add link to spi properites documentation. They're required
for driver to work
  - Removed delay properties, which are now hardcoded in driver
  - Removed display timings, which are now hardcoded in driver
---
 .../display/panel/samsung,s6e63m0.txt | 33 +++
 1 file changed, 33 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/samsung,s6e63m0.txt

diff --git 
a/Documentation/devicetree/bindings/display/panel/samsung,s6e63m0.txt 
b/Documentation/devicetree/bindings/display/panel/samsung,s6e63m0.txt
new file mode 100644
index ..9fb9ebeef8e4
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/samsung,s6e63m0.txt
@@ -0,0 +1,33 @@
+Samsung s6e63m0 AMOLED LCD panel
+
+Required properties:
+  - compatible: "samsung,s6e63m0"
+  - reset-gpios: GPIO spec for reset pin
+  - vdd3-supply: VDD regulator
+  - vci-supply: VCI regulator
+
+The panel must obey rules for SPI slave device specified in document [1].
+
+The device node can contain one 'port' child node with one child
+'endpoint' node, according to the bindings defined in [2]. This
+node should describe panel's video bus.
+
+[1]: Documentation/devicetree/bindings/spi/spi-bus.txt
+[2]: Documentation/devicetree/bindings/media/video-interfaces.txt
+
+Example:
+
+   s6e63m0: display@0 {
+   compatible = "samsung,s6e63m0";
+   reg = <0>;
+   reset-gpio = < 5 1>;
+   vdd3-supply = <_reg>;
+   vci-supply = <_reg>;
+   spi-max-frequency = <120>;
+
+   port {
+   lcd_ep: endpoint {
+   remote-endpoint = <_ep>;
+   };
+   };
+   };
-- 
2.17.1

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

Re: [PATCH v3 2/2] drm/panel: Add driver for Samsung S6E63M0 panel

2019-02-12 Thread Paweł Chmiel
On poniedziałek, 11 lutego 2019 16:35:19 CET Andrzej Hajda wrote:
> On 02.02.2019 15:27, Paweł Chmiel wrote:
> > This patch adds Samsung S6E63M0 AMOLED LCD panel driver, connected over
> > spi. It's based on already removed, non dt s6e63m0 driver and
> > panel-samsung-ld9040. It can be found for example in some of Samsung
> > Aries based phones.
> >
> > Signed-off-by: Paweł Chmiel 
> > Reviewed-by: Sam Ravnborg 
> > ---
> > Changes from v2:
> >   - VIDEOMODE_HELPERS is not needed in Kconfig
> >   - Added help text to Kconfig
> >   - Remove unneeded videomode includes/fields
> >   - Add sentinel comment in s6e63m0_of_match struct
> >   - Handle errors during registration of backlight device. We shouldn't
> > register panel if we fail to register backlight device
> >   - Added Reviewed-by
> >
> > Changes from v1:
> >   - Correct order of Kconfig/Makefile entry
> >   - Fix SPDX tag, so it matches value of MODULE_LICENSE
> >   - Remove inclusion of drmP.h
> >   - Fix code formatting
> >   - Use DRM_DEV_ERROR/DEBUG
> >   - Extract hardcoded values
> >   - Remove possibility to change gamma through sysfs, leaving only one
> > gamma table values
> >   - Fix reset_gpio handling, so it'll be asserted in power_on and
> > deasserted in power_off. Also do it before turning voltage on.
> >   - Disable backlight and enter sleep mode in disable callback.
> > Previously it was done in unprepare
> >   - Enable display and backlight in enable callback. Previously it was
> > done in prepare
> >   - Hardcode display timings and delays. Previously they were readed
> > from device tree
> >   - We're using SPDX, so we don't need to have license body
> >   - Use MIPI_DCS_EXIT_SLEEP_MODE and MIPI_DCS_SET_DISPLAY_ON
> >   - Rename MAX_GAMMA_LEVEL to NUM_GAMMA_LEVELS
> >   - Ommit get_brightness callback
> >   - Use backlight_enable/disable API, like it's done in other panel
> > drivers (for example panel-simple)
> >   - Make set_brightness called only from backlight api, like it's done
> > in other panel drivers (for example panel-simple).
> >   - Reset gpio should be set to GPIOD_OUT_HIGH. It's declared as active
> > low in device tree
> >   - Don't call power_off in remove callback
> > ---
> >  drivers/gpu/drm/panel/Kconfig |   9 +
> >  drivers/gpu/drm/panel/Makefile|   1 +
> >  drivers/gpu/drm/panel/panel-samsung-s6e63m0.c | 517 ++
> >  3 files changed, 527 insertions(+)
> >  create mode 100644 drivers/gpu/drm/panel/panel-samsung-s6e63m0.c
> >
> > diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
> > index 3f3537719beb..45e9ab4b7857 100644
> > --- a/drivers/gpu/drm/panel/Kconfig
> > +++ b/drivers/gpu/drm/panel/Kconfig
> > @@ -158,6 +158,15 @@ config DRM_PANEL_SAMSUNG_S6E63J0X03
> > depends on BACKLIGHT_CLASS_DEVICE
> > select VIDEOMODE_HELPERS
> >  
> > +config DRM_PANEL_SAMSUNG_S6E63M0
> > +   tristate "Samsung S6E63M0 RGB/SPI panel"
> > +   depends on OF
> > +   depends on SPI
> > +   depends on BACKLIGHT_CLASS_DEVICE
> > +   help
> > + Say Y here if you want to enable support for Samsung s6e63m0
> > + AMOLED LCD panel.
> > +
> >  config DRM_PANEL_SAMSUNG_S6E8AA0
> > tristate "Samsung S6E8AA0 DSI video mode panel"
> > depends on OF
> > diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
> > index 4396658a7996..4507a2d253ac 100644
> > --- a/drivers/gpu/drm/panel/Makefile
> > +++ b/drivers/gpu/drm/panel/Makefile
> > @@ -16,6 +16,7 @@ obj-$(CONFIG_DRM_PANEL_SAMSUNG_LD9040) += 
> > panel-samsung-ld9040.o
> >  obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6D16D0) += panel-samsung-s6d16d0.o
> >  obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HA2) += panel-samsung-s6e3ha2.o
> >  obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03) += panel-samsung-s6e63j0x03.o
> > +obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0) += panel-samsung-s6e63m0.o
> >  obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0) += panel-samsung-s6e8aa0.o
> >  obj-$(CONFIG_DRM_PANEL_SEIKO_43WVF1G) += panel-seiko-43wvf1g.o
> >  obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o
> > diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c 
> > b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c
> > new file mode 100644
> > index ..4312aa3e4386
> > --- /dev/null
> > +++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c
> > @@ -0,0 +1,517 @@
> > +// SPDX-Licen

Re: [PATCH v2 2/2] drm/panel: Add driver for Samsung S6E63M0 panel

2019-02-03 Thread Paweł Chmiel
On piątek, 1 lutego 2019 22:36:07 CET Sam Ravnborg wrote:
> Hi Paweł
> 
> Looks good, thanks for addressing all the review feedback.
> 
> On Fri, Feb 01, 2019 at 06:28:52PM +0100, Paweł Chmiel wrote:
> > This patch adds Samsung S6E63M0 AMOLED LCD panel driver, connected over
> > spi. It's based on already removed, non dt s6e63m0 driver and
> > panel-samsung-ld9040. It can be found for example in some of Samsung
> > Aries based phones.
> > 
> > Signed-off-by: Paweł Chmiel 
> If you consider (do not change unless you think it better) the
> following nits than you can add my:
> 
> Reviewed-by: Sam Ravnborg 
> 
>   Sam
> 
> > diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
> > index 3f3537719beb..be05ed5218eb 100644
> > --- a/drivers/gpu/drm/panel/Kconfig
> > +++ b/drivers/gpu/drm/panel/Kconfig
> > @@ -158,6 +158,13 @@ config DRM_PANEL_SAMSUNG_S6E63J0X03
> > depends on BACKLIGHT_CLASS_DEVICE
> > select VIDEOMODE_HELPERS
> >  
> > +config DRM_PANEL_SAMSUNG_S6E63M0
> > +   tristate "Samsung S6E63M0 RGB/SPI panel"
> > +   depends on OF
> > +   depends on SPI
> > +   depends on BACKLIGHT_CLASS_DEVICE
> > +   select VIDEOMODE_HELPERS
> With the use of display_mode the above "select VIDEOMODE_HELPERS"
> is likely no longer required. Please check.
Confirmed that it's not needed now.
> 
> A help text would be nice.
Simple help text added.
> 
> > +
> >  config DRM_PANEL_SAMSUNG_S6E8AA0
> > tristate "Samsung S6E8AA0 DSI video mode panel"
> > depends on OF
> 
> 
> > +#include 
> > +#include 
> Please check if these two files are required.
Removed.
> 
> > +struct s6e63m0 {
> > +   struct device *dev;
> > +   struct drm_panel panel;
> > +   struct backlight_device *bl_dev;
> > +
> > +   struct regulator_bulk_data supplies[2];
> > +   struct gpio_desc *reset_gpio;
> > +   struct videomode vm;
> vm is no longer used - delete it.
Removed.
> 
> > +
> > +   bool prepared;
> > +   bool enabled;
> > +
> > +   /*
> > +* This field is tested by functions directly accessing bus before
> > +* transfer, transfer is skipped if it is set. In case of transfer
> > +* failure or unexpected response the field is set to error value.
> > +* Such construct allows to eliminate many checks in higher level
> > +* functions.
> > +*/
> > +   int error;
> > +};
> > +
> 
> > +static int s6e63m0_get_modes(struct drm_panel *panel)
> > +{
> > +   struct drm_connector *connector = panel->connector;
> > +   struct drm_display_mode *mode;
> > +
> > +   mode = drm_mode_duplicate(panel->drm, _mode);
> > +   if (!mode) {
> > +   DRM_ERROR("failed to add mode %ux%ux@%u\n",
> > + default_mode.hdisplay, default_mode.vdisplay,
> > + default_mode.vrefresh);
> I recall I have seen a generic way to print the above,
> but I have failed to find it.
> Maybe it is just my memory that fools me.
> 
> The above is fine.
> 
> > +
> > +   s6e63m0_backlight_register(ctx);
> 
> Is it correct that we continue even if we fail to register backlight?
Fixed, now errors are handled and it's called before adding drm panel, 
so we won't do this if there will be any error during backlight setup.
> 
> 
> > +
> > +   return 0;
> > +}
> > +
> > +
> > +static const struct of_device_id s6e63m0_of_match[] = {
> > +   { .compatible = "samsung,s6e63m0" },
> > +   { }
> 
> Add /* sentinel */ comment?
Added
> 
> > +};
> 
> 
I'll be sending v3 version with all issues fixed. It would be nice to have this 
tested on Samsung Goni.
Thanks for all comments



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


[PATCH v3 1/2] dt-bindings: drm: panel: Add Samsung s6e63m0 panel documentation

2019-02-03 Thread Paweł Chmiel
From: Jonathan Bakker 

This commit adds documentation for Samsung s6e63m0 AMOLED LCD panel
driver.

Signed-off-by: Jonathan Bakker 
Signed-off-by: Paweł Chmiel 
---
Changes from v1:
  - Add missing subject prefix
  - Rename reset-gpio to reset-gpios
  - Add link to spi properites documentation. They're required
for driver to work
  - Removed delay properties, which are now hardcoded in driver
  - Removed display timings, which are now hardcoded in driver
---
 .../display/panel/samsung,s6e63m0.txt | 33 +++
 1 file changed, 33 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/samsung,s6e63m0.txt

diff --git 
a/Documentation/devicetree/bindings/display/panel/samsung,s6e63m0.txt 
b/Documentation/devicetree/bindings/display/panel/samsung,s6e63m0.txt
new file mode 100644
index ..9fb9ebeef8e4
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/samsung,s6e63m0.txt
@@ -0,0 +1,33 @@
+Samsung s6e63m0 AMOLED LCD panel
+
+Required properties:
+  - compatible: "samsung,s6e63m0"
+  - reset-gpios: GPIO spec for reset pin
+  - vdd3-supply: VDD regulator
+  - vci-supply: VCI regulator
+
+The panel must obey rules for SPI slave device specified in document [1].
+
+The device node can contain one 'port' child node with one child
+'endpoint' node, according to the bindings defined in [2]. This
+node should describe panel's video bus.
+
+[1]: Documentation/devicetree/bindings/spi/spi-bus.txt
+[2]: Documentation/devicetree/bindings/media/video-interfaces.txt
+
+Example:
+
+   s6e63m0: display@0 {
+   compatible = "samsung,s6e63m0";
+   reg = <0>;
+   reset-gpio = < 5 1>;
+   vdd3-supply = <_reg>;
+   vci-supply = <_reg>;
+   spi-max-frequency = <120>;
+
+   port {
+   lcd_ep: endpoint {
+   remote-endpoint = <_ep>;
+   };
+   };
+   };
-- 
2.17.1

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


[PATCH v3 2/2] drm/panel: Add driver for Samsung S6E63M0 panel

2019-02-03 Thread Paweł Chmiel
This patch adds Samsung S6E63M0 AMOLED LCD panel driver, connected over
spi. It's based on already removed, non dt s6e63m0 driver and
panel-samsung-ld9040. It can be found for example in some of Samsung
Aries based phones.

Signed-off-by: Paweł Chmiel 
Reviewed-by: Sam Ravnborg 
---
Changes from v2:
  - VIDEOMODE_HELPERS is not needed in Kconfig
  - Added help text to Kconfig
  - Remove unneeded videomode includes/fields
  - Add sentinel comment in s6e63m0_of_match struct
  - Handle errors during registration of backlight device. We shouldn't
register panel if we fail to register backlight device
  - Added Reviewed-by

Changes from v1:
  - Correct order of Kconfig/Makefile entry
  - Fix SPDX tag, so it matches value of MODULE_LICENSE
  - Remove inclusion of drmP.h
  - Fix code formatting
  - Use DRM_DEV_ERROR/DEBUG
  - Extract hardcoded values
  - Remove possibility to change gamma through sysfs, leaving only one
gamma table values
  - Fix reset_gpio handling, so it'll be asserted in power_on and
deasserted in power_off. Also do it before turning voltage on.
  - Disable backlight and enter sleep mode in disable callback.
Previously it was done in unprepare
  - Enable display and backlight in enable callback. Previously it was
done in prepare
  - Hardcode display timings and delays. Previously they were readed
from device tree
  - We're using SPDX, so we don't need to have license body
  - Use MIPI_DCS_EXIT_SLEEP_MODE and MIPI_DCS_SET_DISPLAY_ON
  - Rename MAX_GAMMA_LEVEL to NUM_GAMMA_LEVELS
  - Ommit get_brightness callback
  - Use backlight_enable/disable API, like it's done in other panel
drivers (for example panel-simple)
  - Make set_brightness called only from backlight api, like it's done
in other panel drivers (for example panel-simple).
  - Reset gpio should be set to GPIOD_OUT_HIGH. It's declared as active
low in device tree
  - Don't call power_off in remove callback
---
 drivers/gpu/drm/panel/Kconfig |   9 +
 drivers/gpu/drm/panel/Makefile|   1 +
 drivers/gpu/drm/panel/panel-samsung-s6e63m0.c | 517 ++
 3 files changed, 527 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-samsung-s6e63m0.c

diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 3f3537719beb..45e9ab4b7857 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -158,6 +158,15 @@ config DRM_PANEL_SAMSUNG_S6E63J0X03
depends on BACKLIGHT_CLASS_DEVICE
select VIDEOMODE_HELPERS
 
+config DRM_PANEL_SAMSUNG_S6E63M0
+   tristate "Samsung S6E63M0 RGB/SPI panel"
+   depends on OF
+   depends on SPI
+   depends on BACKLIGHT_CLASS_DEVICE
+   help
+ Say Y here if you want to enable support for Samsung s6e63m0
+ AMOLED LCD panel.
+
 config DRM_PANEL_SAMSUNG_S6E8AA0
tristate "Samsung S6E8AA0 DSI video mode panel"
depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 4396658a7996..4507a2d253ac 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -16,6 +16,7 @@ obj-$(CONFIG_DRM_PANEL_SAMSUNG_LD9040) += 
panel-samsung-ld9040.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6D16D0) += panel-samsung-s6d16d0.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HA2) += panel-samsung-s6e3ha2.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03) += panel-samsung-s6e63j0x03.o
+obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0) += panel-samsung-s6e63m0.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0) += panel-samsung-s6e8aa0.o
 obj-$(CONFIG_DRM_PANEL_SEIKO_43WVF1G) += panel-seiko-43wvf1g.o
 obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o
diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c 
b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c
new file mode 100644
index ..4312aa3e4386
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c
@@ -0,0 +1,517 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * S6E63M0 AMOLED LCD drm_panel driver.
+ *
+ * Copyright (C) 2019 Paweł Chmiel 
+ * Derived from drivers/gpu/drm/panel-samsung-ld9040.c
+ *
+ * Andrzej Hajda 
+ */
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+/* Manufacturer Command Set */
+#define MCS_ELVSS_ON0xb1
+#define MCS_ACL_CTRL0xc0
+#define MCS_DISPLAY_CONDITION   0xf2
+#define MCS_ETC_CONDITION   0xf6
+#define MCS_PANEL_CONDITION 0xF8
+#define MCS_GAMMA_CTRL  0xfa
+
+#define NUM_GAMMA_LEVELS 11
+#define GAMMA_TABLE_COUNT   23
+
+#define DATA_MASK   0x100
+
+#define MAX_BRIGHTNESS  (NUM_GAMMA_LEVELS - 1)
+
+/* array of gamma tables for gamma value 2.2 */
+static u8 const s6e63m0_gamma_22[NUM_GAMMA_LEVELS][GAMMA_TABLE_COUNT] = {
+   { MCS_GAMMA_CTRL, 0x00,
+ 0x18, 0x08, 0x24, 0x78, 0xEC, 0x3D, 

[PATCH v2 2/2] drm/panel: Add driver for Samsung S6E63M0 panel

2019-02-01 Thread Paweł Chmiel
This patch adds Samsung S6E63M0 AMOLED LCD panel driver, connected over
spi. It's based on already removed, non dt s6e63m0 driver and
panel-samsung-ld9040. It can be found for example in some of Samsung
Aries based phones.

Signed-off-by: Paweł Chmiel 
---
Changes from v1:
  - Correct order of Kconfig/Makefile entry
  - Fix SPDX tag, so it matches value of MODULE_LICENSE
  - Remove inclusion of drmP.h
  - Fix code formatting
  - Use DRM_DEV_ERROR/DEBUG
  - Extract hardcoded values
  - Remove possibility to change gamma through sysfs, leaving only one
gamma table values
  - Fix reset_gpio handling, so it'll be asserted in power_on and
deasserted in power_off. Also do it before turning voltage on.
  - Disable backlight and enter sleep mode in disable callback.
Previously it was done in unprepare
  - Enable display and backlight in enable callback. Previously it was
done in prepare
  - Hardcode display timings and delays. Previously they were readed
from device tree
  - We're using SPDX, so we don't need to have license body
  - Use MIPI_DCS_EXIT_SLEEP_MODE and MIPI_DCS_SET_DISPLAY_ON
  - Rename MAX_GAMMA_LEVEL to NUM_GAMMA_LEVELS
  - Ommit get_brightness callback
  - Use backlight_enable/disable API, like it's done in other panel
drivers (for example panel-simple)
  - Make set_brightness called only from backlight api, like it's done
in other panel drivers (for example panel-simple).
  - Reset gpio should be set to GPIOD_OUT_HIGH. It's declared as active
low in device tree
  - Don't call power_off in remove callback
---
 drivers/gpu/drm/panel/Kconfig |   7 +
 drivers/gpu/drm/panel/Makefile|   1 +
 drivers/gpu/drm/panel/panel-samsung-s6e63m0.c | 517 ++
 3 files changed, 525 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-samsung-s6e63m0.c

diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 3f3537719beb..be05ed5218eb 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -158,6 +158,13 @@ config DRM_PANEL_SAMSUNG_S6E63J0X03
depends on BACKLIGHT_CLASS_DEVICE
select VIDEOMODE_HELPERS
 
+config DRM_PANEL_SAMSUNG_S6E63M0
+   tristate "Samsung S6E63M0 RGB/SPI panel"
+   depends on OF
+   depends on SPI
+   depends on BACKLIGHT_CLASS_DEVICE
+   select VIDEOMODE_HELPERS
+
 config DRM_PANEL_SAMSUNG_S6E8AA0
tristate "Samsung S6E8AA0 DSI video mode panel"
depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 4396658a7996..4507a2d253ac 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -16,6 +16,7 @@ obj-$(CONFIG_DRM_PANEL_SAMSUNG_LD9040) += 
panel-samsung-ld9040.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6D16D0) += panel-samsung-s6d16d0.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HA2) += panel-samsung-s6e3ha2.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03) += panel-samsung-s6e63j0x03.o
+obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0) += panel-samsung-s6e63m0.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0) += panel-samsung-s6e8aa0.o
 obj-$(CONFIG_DRM_PANEL_SEIKO_43WVF1G) += panel-seiko-43wvf1g.o
 obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o
diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c 
b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c
new file mode 100644
index ..7658bd993088
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c
@@ -0,0 +1,517 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * S6E63M0 AMOLED LCD drm_panel driver.
+ *
+ * Copyright (C) 2019 Paweł Chmiel 
+ * Derived from drivers/gpu/drm/panel-samsung-ld9040.c
+ *
+ * Andrzej Hajda 
+ */
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+/* Manufacturer Command Set */
+#define MCS_ELVSS_ON0xb1
+#define MCS_ACL_CTRL0xc0
+#define MCS_DISPLAY_CONDITION   0xf2
+#define MCS_ETC_CONDITION   0xf6
+#define MCS_PANEL_CONDITION 0xF8
+#define MCS_GAMMA_CTRL  0xfa
+
+#define NUM_GAMMA_LEVELS 11
+#define GAMMA_TABLE_COUNT   23
+
+#define DATA_MASK   0x100
+
+#define MAX_BRIGHTNESS  (NUM_GAMMA_LEVELS - 1)
+
+/* array of gamma tables for gamma value 2.2 */
+static u8 const s6e63m0_gamma_22[NUM_GAMMA_LEVELS][GAMMA_TABLE_COUNT] = {
+   { MCS_GAMMA_CTRL, 0x00,
+ 0x18, 0x08, 0x24, 0x78, 0xEC, 0x3D, 0xC8,
+ 0xC2, 0xB6, 0xC4, 0xC7, 0xB6, 0xD5, 0xD7,
+ 0xCC, 0x00, 0x39, 0x00, 0x36, 0x00, 0x51 },
+   { MCS_GAMMA_CTRL, 0x00,
+ 0x18, 0x08, 0x24, 0x73, 0x4A, 0x3D, 0xC0,
+ 0xC2, 0xB1, 0xBB, 0xBE, 0xAC, 0xCE, 0xCF,
+ 0xC5, 0x00, 0x5D, 0x00, 0x5E, 0x00, 0x82 },
+   { MCS_GAMMA_CTRL, 0x00,
+ 0x18, 0x08, 0x24, 0x70, 0x51, 0x3E, 0xBF,
+ 0xC1, 0xAF, 0xB9, 0xBC, 0xAB, 0xCC, 

[PATCH v2 1/2] dt-bindings: drm: panel: Add Samsung s6e63m0 panel documentation

2019-02-01 Thread Paweł Chmiel
From: Jonathan Bakker 

This commit adds documentation for Samsung s6e63m0 AMOLED LCD panel
driver.

Signed-off-by: Jonathan Bakker 
Signed-off-by: Paweł Chmiel 
---
Changes from v1:
  - Add missing subject prefix
  - Rename reset-gpio to reset-gpios
  - Add link to spi properites documentation. They're required
for driver to work
  - Removed delay properties, which are now hardcoded in driver
  - Removed display timings, which are now hardcoded in driver
---
 .../display/panel/samsung,s6e63m0.txt | 33 +++
 1 file changed, 33 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/samsung,s6e63m0.txt

diff --git 
a/Documentation/devicetree/bindings/display/panel/samsung,s6e63m0.txt 
b/Documentation/devicetree/bindings/display/panel/samsung,s6e63m0.txt
new file mode 100644
index ..9fb9ebeef8e4
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/samsung,s6e63m0.txt
@@ -0,0 +1,33 @@
+Samsung s6e63m0 AMOLED LCD panel
+
+Required properties:
+  - compatible: "samsung,s6e63m0"
+  - reset-gpios: GPIO spec for reset pin
+  - vdd3-supply: VDD regulator
+  - vci-supply: VCI regulator
+
+The panel must obey rules for SPI slave device specified in document [1].
+
+The device node can contain one 'port' child node with one child
+'endpoint' node, according to the bindings defined in [2]. This
+node should describe panel's video bus.
+
+[1]: Documentation/devicetree/bindings/spi/spi-bus.txt
+[2]: Documentation/devicetree/bindings/media/video-interfaces.txt
+
+Example:
+
+   s6e63m0: display@0 {
+   compatible = "samsung,s6e63m0";
+   reg = <0>;
+   reset-gpio = < 5 1>;
+   vdd3-supply = <_reg>;
+   vci-supply = <_reg>;
+   spi-max-frequency = <120>;
+
+   port {
+   lcd_ep: endpoint {
+   remote-endpoint = <_ep>;
+   };
+   };
+   };
-- 
2.17.1

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


Re: [PATCH 2/2] drm/panel: Add driver for Samsung S6E63M0 panel

2019-01-29 Thread Paweł Chmiel
On poniedziałek, 28 stycznia 2019 14:47:41 CET Andrzej Hajda wrote:
> Hi Paweł,
> 
> Nice work.
> 
> I agree with most Sam's comments (maybe expect DRM_DEV_* logging - I am
> not sure if we need concurrent logging facility).
> 
> I'd like to add few more comments:
> 
> 
> 
> On 25.01.2019 17:46, Paweł Chmiel wrote:
> > This patch adds Samsung S6E63M0 AMOLED LCD panel driver, connected over
> > spi. It's based on already removed, non dt s6e63m0 driver and
> > panel-samsung-ld9040. There is possibility to choose one from 3
> > different gamma tables.
> > It can be found for example in some of Samsung Aries based phones.
> >
> > Signed-off-by: Paweł Chmiel 
> > ---
> >  drivers/gpu/drm/panel/Kconfig |   7 +
> >  drivers/gpu/drm/panel/Makefile|   1 +
> >  drivers/gpu/drm/panel/panel-samsung-s6e63m0.c | 712 ++
> >  3 files changed, 720 insertions(+)
> >  create mode 100644 drivers/gpu/drm/panel/panel-samsung-s6e63m0.c
> >
> > diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
> > index 3f3537719beb..4a4b64f74e70 100644
> > --- a/drivers/gpu/drm/panel/Kconfig
> > +++ b/drivers/gpu/drm/panel/Kconfig
> > @@ -82,6 +82,13 @@ config DRM_PANEL_SAMSUNG_LD9040
> > depends on OF && SPI
> > select VIDEOMODE_HELPERS
> >  
> > +config DRM_PANEL_SAMSUNG_S6E63M0
> > +   tristate "Samsung S6E63M0 RGB/SPI panel"
> > +   depends on OF
> > +   depends on SPI
> > +   depends on BACKLIGHT_CLASS_DEVICE
> > +   select VIDEOMODE_HELPERS
> > +
> >  config DRM_PANEL_LG_LG4573
> > tristate "LG4573 RGB/SPI panel"
> > depends on OF && SPI
> > diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
> > index 4396658a7996..3e5d53fdee47 100644
> > --- a/drivers/gpu/drm/panel/Makefile
> > +++ b/drivers/gpu/drm/panel/Makefile
> > @@ -14,6 +14,7 @@ obj-$(CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN) += 
> > panel-raspberrypi-touchscreen
> >  obj-$(CONFIG_DRM_PANEL_RAYDIUM_RM68200) += panel-raydium-rm68200.o
> >  obj-$(CONFIG_DRM_PANEL_SAMSUNG_LD9040) += panel-samsung-ld9040.o
> >  obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6D16D0) += panel-samsung-s6d16d0.o
> > +obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0) += panel-samsung-s6e63m0.o
> >  obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HA2) += panel-samsung-s6e3ha2.o
> >  obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03) += panel-samsung-s6e63j0x03.o
> >  obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0) += panel-samsung-s6e8aa0.o
> > diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c 
> > b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c
> > new file mode 100644
> > index ..cb5c090621ad
> > --- /dev/null
> > +++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c
> > @@ -0,0 +1,712 @@
> > +// SPDX-License-Identifier: GPL-2.0+
> > +/*
> > + * S6E63M0 AMOLED LCD drm_panel driver.
> > + *
> > + * Copyright (C) 2019 Paweł Chmiel 
> > + * Derived from drivers/gpu/drm/panel-samsung-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.
> 
> 
> You do not need license 'body' if SPDX is in use.
> 
> 
> > + */
> > +
> > +#include 
> > +#include 
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +#include 
> > +#include 
> > +#include 
> > +
> > +/* Manufacturer Command Set */
> > +#define MCS_STAND_BY_OFF0x11
> 
> MIPI_DCS_EXIT_SLEEP_MODE
> 
> > +#define MCS_DISPLAY_ON  0x29
> MIPI_DCS_SET_DISPLAY_ON
> > +#define MCS_ELVSS_ON0xb1
> > +#define MCS_ACL_CTRL0xc0
> > +#define MCS_DISPLAY_CONDITION   0xf2
> > +#define MCS_ETC_CONDITION   0xf6
> > +#define MCS_PANEL_CONDITION 0xF8
> > +#define MCS_GAMMA_CTRL  0xfa
> > +
> > +#define MAX_GAMMA_LEVEL 11
> 
> 
> GAMMA_LEVEL_COUNT or NUM_GAMMA_LEVELS ?
Ok, NUM_GAMMA_LEVELS looks better.
> 
> 
> > +#define GAMMA_TABLE_COUNT   23
> > +
> > +#define MAX_BRIGHTNESS  (MAX_GAMMA_LEVEL - 1)
> > +#define GAMMA_MODE_22   0
> > +#define GAMMA_MODE_19   1
> > +#define GAMMA_MODE_17   2
> > +
> > +/* array of gamma tables for gamma value 2.2 *

Re: [PATCH 1/2] drm: panel: Add Samsung s6e63m0 panel documentation

2019-01-28 Thread Paweł Chmiel
On sobota, 26 stycznia 2019 21:55:01 CET Sam Ravnborg wrote:
Hi
> Hi Pawel.
> 
> Thanks for the patch, some comments follows.
> Please judge what comments you chose to follow, see this as suggestions.
> 
> According to Documentation/devicetree/bindings/submitting-patches.rst:
> 
>   The preferred subject prefix for binding patches is:
>   "dt-bindings: : ..."
> 
> It would be a good idea to follow this practice in next revision.
I don't know how I forgot about this (will be fixed in next version).
> 
> On Fri, Jan 25, 2019 at 05:46:44PM +0100, Paweł Chmiel wrote:
> > From: Jonathan Bakker 
> > 
> > This commit adds documentation for Samsung s6e63m0 AMOLED LCD panel
> > driver.
> > 
> > Signed-off-by: Jonathan Bakker 
> > Signed-off-by: Paweł Chmiel 
> > ---
> >  .../display/panel/samsung,s6e63m0.txt | 60 +++
> >  1 file changed, 60 insertions(+)
> >  create mode 100644 
> > Documentation/devicetree/bindings/display/panel/samsung,s6e63m0.txt
> > 
> > diff --git 
> > a/Documentation/devicetree/bindings/display/panel/samsung,s6e63m0.txt 
> > b/Documentation/devicetree/bindings/display/panel/samsung,s6e63m0.txt
> > new file mode 100644
> > index ..4979200e2dd2
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/display/panel/samsung,s6e63m0.txt
> > @@ -0,0 +1,60 @@
> > +Samsung s6e63m0 AMOLED LCD panel
> > +
> > +Required properties:
> > +  - compatible: "samsung,s6e63m0"
> > +  - reset-gpio: GPIO spec for reset pin
> The preferred name is reset-gpios (added 's')
Right, will be fixed.
> 
> > +  - vdd3-supply: VDD regulator
> > +  - vci-supply: VCI regulator
> > +  - display-timings: timings for the connected panel as described by [1]
> Today, as is my best understanding, it is encouraged to specify the timing
> in the actual driver and not in DT,
Ok, will hardcode them in driver. Currently those timings (which i had added to 
my device dts) were taken from original kernel sources.
Need to check if there are other devices (not only using mainline kernel) using 
this panel and what timings are they using (hope they're the same).
> 
> The example include a spi-max-frequency which is not mentioned?
spi-max-frequency shouldn't be here and will be removed.
> 
> > +
> > +Optional properties:
> > +  - reset-delay: Delay in ms after adjusting reset-gpio, default 120ms
> > +  - power-on-delay: Delay in ms after powering on, default 25ms
> > +  - power-off-delay: Delay in ms before powering off, default 200ms
> > +  - panel-width-mm: physical panel width in mm
> > +  - panel-height-mm: physical panel height in mm
> Likewise these delays are also properties that today are included in the 
> driver.
> 
Need to check delays also (like timings).
> I cannot explain the background for this, this is just how things are done.
> 
> > +
> > +The device node can contain one 'port' child node with one child
> > +'endpoint' node, according to the bindings defined in [2]. This
> > +node should describe panel's video bus.
> > +
> > +[1]: Documentation/devicetree/bindings/display/panel/display-timing.txt
> > +[2]: Documentation/devicetree/bindings/media/video-interfaces.txt
> > +
> > +Example:
> > +
> > +   s6e63m0: display@0 {
> > +   compatible = "samsung,s6e63m0";
> > +   reg = <0>;
> > +   reset-gpio = < 5 1>;
> > +   vdd3-supply = <_reg>;
> > +   vci-supply = <_reg>;
> > +   spi-max-frequency = <100>;
> > +
> > +   power-on-delay = <0>;
> > +   power-off-delay = <0>;
> > +   reset-delay = <10>;
> > +   panel-width-mm = <53>;
> > +   panel-height-mm = <89>;
> > +
> > +   display-timings {
> > +   timing-0 {
> > +   /* 480x800@60Hz */
> > +   clock-frequency = <25628040>;
> > +   hactive = <480>;
> > +   vactive = <800>;
> > +   hfront-porch = <16>;
> > +   hback-porch = <16>;
> > +   hsync-len = <2>;
> > +   vfront-porch = <28>;
> > +   vback-porch = <1>;
> > +   vsync-len = <2>;
> > +   };
> > +   };
> > +
> > +   port {
> > +   lcd_ep: endpoint {
> > +   remote-endpoint = <_ep>;
> > +   };
> > +   };
> > +   };
> 
>   Sam
> 
Thanks for review



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


[PATCH 1/2] drm: panel: Add Samsung s6e63m0 panel documentation

2019-01-26 Thread Paweł Chmiel
From: Jonathan Bakker 

This commit adds documentation for Samsung s6e63m0 AMOLED LCD panel
driver.

Signed-off-by: Jonathan Bakker 
Signed-off-by: Paweł Chmiel 
---
 .../display/panel/samsung,s6e63m0.txt | 60 +++
 1 file changed, 60 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/samsung,s6e63m0.txt

diff --git 
a/Documentation/devicetree/bindings/display/panel/samsung,s6e63m0.txt 
b/Documentation/devicetree/bindings/display/panel/samsung,s6e63m0.txt
new file mode 100644
index ..4979200e2dd2
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/samsung,s6e63m0.txt
@@ -0,0 +1,60 @@
+Samsung s6e63m0 AMOLED LCD panel
+
+Required properties:
+  - compatible: "samsung,s6e63m0"
+  - reset-gpio: GPIO spec for reset pin
+  - vdd3-supply: VDD regulator
+  - vci-supply: VCI regulator
+  - display-timings: timings for the connected panel as described by [1]
+
+Optional properties:
+  - reset-delay: Delay in ms after adjusting reset-gpio, default 120ms
+  - power-on-delay: Delay in ms after powering on, default 25ms
+  - power-off-delay: Delay in ms before powering off, default 200ms
+  - panel-width-mm: physical panel width in mm
+  - panel-height-mm: physical panel height in mm
+
+The device node can contain one 'port' child node with one child
+'endpoint' node, according to the bindings defined in [2]. This
+node should describe panel's video bus.
+
+[1]: Documentation/devicetree/bindings/display/panel/display-timing.txt
+[2]: Documentation/devicetree/bindings/media/video-interfaces.txt
+
+Example:
+
+   s6e63m0: display@0 {
+   compatible = "samsung,s6e63m0";
+   reg = <0>;
+   reset-gpio = < 5 1>;
+   vdd3-supply = <_reg>;
+   vci-supply = <_reg>;
+   spi-max-frequency = <100>;
+
+   power-on-delay = <0>;
+   power-off-delay = <0>;
+   reset-delay = <10>;
+   panel-width-mm = <53>;
+   panel-height-mm = <89>;
+
+   display-timings {
+   timing-0 {
+   /* 480x800@60Hz */
+   clock-frequency = <25628040>;
+   hactive = <480>;
+   vactive = <800>;
+   hfront-porch = <16>;
+   hback-porch = <16>;
+   hsync-len = <2>;
+   vfront-porch = <28>;
+   vback-porch = <1>;
+   vsync-len = <2>;
+   };
+   };
+
+   port {
+   lcd_ep: endpoint {
+   remote-endpoint = <_ep>;
+   };
+   };
+   };
-- 
2.17.1

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


[PATCH 2/2] drm/panel: Add driver for Samsung S6E63M0 panel

2019-01-26 Thread Paweł Chmiel
This patch adds Samsung S6E63M0 AMOLED LCD panel driver, connected over
spi. It's based on already removed, non dt s6e63m0 driver and
panel-samsung-ld9040. There is possibility to choose one from 3
different gamma tables.
It can be found for example in some of Samsung Aries based phones.

Signed-off-by: Paweł Chmiel 
---
 drivers/gpu/drm/panel/Kconfig |   7 +
 drivers/gpu/drm/panel/Makefile|   1 +
 drivers/gpu/drm/panel/panel-samsung-s6e63m0.c | 712 ++
 3 files changed, 720 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-samsung-s6e63m0.c

diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 3f3537719beb..4a4b64f74e70 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -82,6 +82,13 @@ config DRM_PANEL_SAMSUNG_LD9040
depends on OF && SPI
select VIDEOMODE_HELPERS
 
+config DRM_PANEL_SAMSUNG_S6E63M0
+   tristate "Samsung S6E63M0 RGB/SPI panel"
+   depends on OF
+   depends on SPI
+   depends on BACKLIGHT_CLASS_DEVICE
+   select VIDEOMODE_HELPERS
+
 config DRM_PANEL_LG_LG4573
tristate "LG4573 RGB/SPI panel"
depends on OF && SPI
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 4396658a7996..3e5d53fdee47 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -14,6 +14,7 @@ obj-$(CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN) += 
panel-raspberrypi-touchscreen
 obj-$(CONFIG_DRM_PANEL_RAYDIUM_RM68200) += panel-raydium-rm68200.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_LD9040) += panel-samsung-ld9040.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6D16D0) += panel-samsung-s6d16d0.o
+obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0) += panel-samsung-s6e63m0.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HA2) += panel-samsung-s6e3ha2.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03) += panel-samsung-s6e63j0x03.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0) += panel-samsung-s6e8aa0.o
diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c 
b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c
new file mode 100644
index ..cb5c090621ad
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c
@@ -0,0 +1,712 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * S6E63M0 AMOLED LCD drm_panel driver.
+ *
+ * Copyright (C) 2019 Paweł Chmiel 
+ * Derived from drivers/gpu/drm/panel-samsung-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 
+#include 
+
+/* Manufacturer Command Set */
+#define MCS_STAND_BY_OFF0x11
+#define MCS_DISPLAY_ON  0x29
+#define MCS_ELVSS_ON0xb1
+#define MCS_ACL_CTRL0xc0
+#define MCS_DISPLAY_CONDITION   0xf2
+#define MCS_ETC_CONDITION   0xf6
+#define MCS_PANEL_CONDITION 0xF8
+#define MCS_GAMMA_CTRL  0xfa
+
+#define MAX_GAMMA_LEVEL 11
+#define GAMMA_TABLE_COUNT   23
+
+#define MAX_BRIGHTNESS  (MAX_GAMMA_LEVEL - 1)
+#define GAMMA_MODE_22   0
+#define GAMMA_MODE_19   1
+#define GAMMA_MODE_17   2
+
+/* array of gamma tables for gamma value 2.2 */
+static u8 const s6e63m0_gamma_22[MAX_GAMMA_LEVEL][GAMMA_TABLE_COUNT] = {
+   { MCS_GAMMA_CTRL, 0x00,
+ 0x18, 0x08, 0x24, 0x78, 0xEC, 0x3D, 0xC8,
+ 0xC2, 0xB6, 0xC4, 0xC7, 0xB6, 0xD5, 0xD7,
+ 0xCC, 0x00, 0x39, 0x00, 0x36, 0x00, 0x51 },
+   { MCS_GAMMA_CTRL, 0x00,
+ 0x18, 0x08, 0x24, 0x73, 0x4A, 0x3D, 0xC0,
+ 0xC2, 0xB1, 0xBB, 0xBE, 0xAC, 0xCE, 0xCF,
+ 0xC5, 0x00, 0x5D, 0x00, 0x5E, 0x00, 0x82 },
+   { MCS_GAMMA_CTRL, 0x00,
+ 0x18, 0x08, 0x24, 0x70, 0x51, 0x3E, 0xBF,
+ 0xC1, 0xAF, 0xB9, 0xBC, 0xAB, 0xCC, 0xCC,
+ 0xC2, 0x00, 0x65, 0x00, 0x67, 0x00, 0x8D },
+   { MCS_GAMMA_CTRL, 0x00,
+ 0x18, 0x08, 0x24, 0x6C, 0x54, 0x3A, 0xBC,
+ 0xBF, 0xAC, 0xB7, 0xBB, 0xA9, 0xC9, 0xC9,
+ 0xBE, 0x00, 0x71, 0x00, 0x73, 0x00, 0x9E },
+   { MCS_GAMMA_CTRL, 0x00,
+ 0x18, 0x08, 0x24, 0x69, 0x54, 0x37, 0xBB,
+ 0xBE, 0xAC, 0xB4, 0xB7, 0xA6, 0xC7, 0xC8,
+ 0xBC, 0x00, 0x7B, 0x00, 0x7E, 0x00, 0xAB },
+   { MCS_GAMMA_CTRL, 0x00,
+ 0x18, 0x08, 0x24, 0x66, 0x55, 0x34, 0xBA,
+ 0xBD, 0xAB, 0xB1, 0xB5, 0xA3, 0xC5, 0xC6,
+ 0xB9, 0x00, 0x85, 0x00, 0x88, 0x00, 0xBA },
+   { MCS_GAMMA_CTRL, 0x00,
+ 0x18, 0x08, 0x24, 0x63, 0x53, 0x31, 0xB8,
+ 0xBC, 0xA9, 0xB0, 0xB5, 0xA2, 0xC4, 0xC4,
+ 0xB8, 0x00, 0x8B, 0x00, 0x8E, 0x00, 0xC2 },
+   { MCS_GAMMA_CTRL, 0x00,
+ 0x18, 0x08, 0x24, 0x62, 0x54, 0x30, 0xB9,
+ 0xBB, 0xA9, 0xB0, 0xB3, 0xA1, 0xC1, 0x

[PATCH v2 3/3] ARM: dts: s5pv210: Add node for exynos-rotator

2019-01-01 Thread Paweł Chmiel
This commit adds node for Exynos Rorator device,
so it can be used on all s5pv210 based devices.

Signed-off-by: Paweł Chmiel 
---
 arch/arm/boot/dts/s5pv210.dtsi | 9 +
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/boot/dts/s5pv210.dtsi b/arch/arm/boot/dts/s5pv210.dtsi
index 75f454a210d6..a5463003c7f6 100644
--- a/arch/arm/boot/dts/s5pv210.dtsi
+++ b/arch/arm/boot/dts/s5pv210.dtsi
@@ -542,6 +542,15 @@
#dma-requests = <1>;
};
 
+   rotator: rotator@fa30 {
+   compatible = "samsung,s5pv210-rotator";
+   reg = <0xfa30 0x1000>;
+   interrupt-parent = <>;
+   interrupts = <4>;
+   clocks = < CLK_ROTATOR>;
+   clock-names = "rotator";
+   };
+
i2c1: i2c@fab0 {
compatible = "samsung,s3c2440-i2c";
reg = <0xfab0 0x1000>;
-- 
2.17.1

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


[PATCH v2 0/3] drm/exynos: rotator: Add support for s5pv210

2019-01-01 Thread Paweł Chmiel
This patchset adds support for s5pv210 soc, into 
Samsung DRM Rotator driver. Currently only NV12 and XRGB formats
 are supported.

It was tested by using simple tool from 
https://www.spinics.net/lists/linux-samsung-soc/msg60498.html

Changes from v1:
  - fixed order of chipsets in documentation and removed ordering
from it

Paweł Chmiel (3):
  drm/exynos: rotator: Add support for s5pv210
  dt-bindings: gpu: samsung-rotator: Document s5pv210 support
  ARM: dts: s5pv210: Add node for exynos-rotator

 .../bindings/gpu/samsung-rotator.txt  |  7 +++---
 arch/arm/boot/dts/s5pv210.dtsi|  9 
 drivers/gpu/drm/exynos/exynos_drm_rotator.c   | 23 +++
 3 files changed, 36 insertions(+), 3 deletions(-)

-- 
2.17.1

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


[PATCH v2 2/3] dt-bindings: gpu: samsung-rotator: Document s5pv210 support

2019-01-01 Thread Paweł Chmiel
This commit documents new compatible for s5pv210 soc,
which will be also supported by this driver.

Signed-off-by: Paweł Chmiel 
---
Changes from v1:
  - Removed list enumeration
  - Placed s5pv210 at beginning of list (it's the oldest chipset)
---
 Documentation/devicetree/bindings/gpu/samsung-rotator.txt | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/gpu/samsung-rotator.txt 
b/Documentation/devicetree/bindings/gpu/samsung-rotator.txt
index 82cd1ed0be93..3aca2578da0b 100644
--- a/Documentation/devicetree/bindings/gpu/samsung-rotator.txt
+++ b/Documentation/devicetree/bindings/gpu/samsung-rotator.txt
@@ -2,9 +2,10 @@
 
 Required properties:
   - compatible : value should be one of the following:
-   (a) "samsung,exynos4210-rotator" for Rotator IP in Exynos4210
-   (b) "samsung,exynos4212-rotator" for Rotator IP in Exynos4212/4412
-   (c) "samsung,exynos5250-rotator" for Rotator IP in Exynos5250
+   * "samsung,s5pv210-rotator" for Rotator IP in S5PV210
+   * "samsung,exynos4210-rotator" for Rotator IP in Exynos4210
+   * "samsung,exynos4212-rotator" for Rotator IP in Exynos4212/4412
+   * "samsung,exynos5250-rotator" for Rotator IP in Exynos5250
 
   - reg : Physical base address of the IP registers and length of memory
  mapped region.
-- 
2.17.1

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


[PATCH v2 1/3] drm/exynos: rotator: Add support for s5pv210

2019-01-01 Thread Paweł Chmiel
This commit adds support for s5pv210.
Currently only NV12 and XRGB formats are supported.
It was tested by using tool from
https://www.spinics.net/lists/linux-samsung-soc/msg60498.html

Signed-off-by: Paweł Chmiel 
---
 drivers/gpu/drm/exynos/exynos_drm_rotator.c | 23 +
 1 file changed, 23 insertions(+)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c 
b/drivers/gpu/drm/exynos/exynos_drm_rotator.c
index 8d67b2a54be3..05abfed6f7f8 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c
@@ -356,6 +356,11 @@ static int rotator_runtime_resume(struct device *dev)
 }
 #endif
 
+static const struct drm_exynos_ipp_limit rotator_s5pv210_rbg888_limits[] = {
+   { IPP_SIZE_LIMIT(BUFFER, .h = { 8, SZ_16K }, .v = { 8, SZ_16K }) },
+   { IPP_SIZE_LIMIT(AREA, .h.align = 2, .v.align = 2) },
+};
+
 static const struct drm_exynos_ipp_limit rotator_4210_rbg888_limits[] = {
{ IPP_SIZE_LIMIT(BUFFER, .h = { 8, SZ_16K }, .v = { 8, SZ_16K }) },
{ IPP_SIZE_LIMIT(AREA, .h.align = 4, .v.align = 4) },
@@ -371,6 +376,11 @@ static const struct drm_exynos_ipp_limit 
rotator_5250_rbg888_limits[] = {
{ IPP_SIZE_LIMIT(AREA, .h.align = 2, .v.align = 2) },
 };
 
+static const struct drm_exynos_ipp_limit rotator_s5pv210_yuv_limits[] = {
+   { IPP_SIZE_LIMIT(BUFFER, .h = { 32, SZ_64K }, .v = { 32, SZ_64K }) },
+   { IPP_SIZE_LIMIT(AREA, .h.align = 8, .v.align = 8) },
+};
+
 static const struct drm_exynos_ipp_limit rotator_4210_yuv_limits[] = {
{ IPP_SIZE_LIMIT(BUFFER, .h = { 32, SZ_64K }, .v = { 32, SZ_64K }) },
{ IPP_SIZE_LIMIT(AREA, .h.align = 8, .v.align = 8) },
@@ -381,6 +391,11 @@ static const struct drm_exynos_ipp_limit 
rotator_4412_yuv_limits[] = {
{ IPP_SIZE_LIMIT(AREA, .h.align = 8, .v.align = 8) },
 };
 
+static const struct exynos_drm_ipp_formats rotator_s5pv210_formats[] = {
+   { IPP_SRCDST_FORMAT(XRGB, rotator_s5pv210_rbg888_limits) },
+   { IPP_SRCDST_FORMAT(NV12, rotator_s5pv210_yuv_limits) },
+};
+
 static const struct exynos_drm_ipp_formats rotator_4210_formats[] = {
{ IPP_SRCDST_FORMAT(XRGB, rotator_4210_rbg888_limits) },
{ IPP_SRCDST_FORMAT(NV12, rotator_4210_yuv_limits) },
@@ -396,6 +411,11 @@ static const struct exynos_drm_ipp_formats 
rotator_5250_formats[] = {
{ IPP_SRCDST_FORMAT(NV12, rotator_4412_yuv_limits) },
 };
 
+static const struct rot_variant rotator_s5pv210_data = {
+   .formats = rotator_s5pv210_formats,
+   .num_formats = ARRAY_SIZE(rotator_s5pv210_formats),
+};
+
 static const struct rot_variant rotator_4210_data = {
.formats = rotator_4210_formats,
.num_formats = ARRAY_SIZE(rotator_4210_formats),
@@ -413,6 +433,9 @@ static const struct rot_variant rotator_5250_data = {
 
 static const struct of_device_id exynos_rotator_match[] = {
{
+   .compatible = "samsung,s5pv210-rotator",
+   .data = _s5pv210_data,
+   }, {
.compatible = "samsung,exynos4210-rotator",
.data = _4210_data,
}, {
-- 
2.17.1

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


Re: [PATCH 2/3] dt-bindings: gpu: samsung-rotator: Document s5pv210 support

2018-12-27 Thread Paweł Chmiel
Dnia środa, 19 grudnia 2018 17:22:51 CET Krzysztof Kozlowski pisze:
> On Wed, 19 Dec 2018 at 17:04, Paweł Chmiel
>  wrote:
> >
> > This commit documents new compatible for s5pv210 soc,
> > which will be also supported by this driver.
> >
> > Signed-off-by: Paweł Chmiel 
> > ---
> >  Documentation/devicetree/bindings/gpu/samsung-rotator.txt | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/Documentation/devicetree/bindings/gpu/samsung-rotator.txt 
> > b/Documentation/devicetree/bindings/gpu/samsung-rotator.txt
> > index 82cd1ed0be93..78658dec6941 100644
> > --- a/Documentation/devicetree/bindings/gpu/samsung-rotator.txt
> > +++ b/Documentation/devicetree/bindings/gpu/samsung-rotator.txt
> > @@ -5,6 +5,7 @@ Required properties:
> > (a) "samsung,exynos4210-rotator" for Rotator IP in Exynos4210
> > (b) "samsung,exynos4212-rotator" for Rotator IP in Exynos4212/4412
> > (c) "samsung,exynos5250-rotator" for Rotator IP in Exynos5250
> > +   (d) "samsung,s5pv210-rotator" for Rotator IP in S5PV210
> 
> How about putting it at beginning as the oldest chipset? This would
> require reordering the list so maybe let's remove the a/b/c list
> enumerations? They are kind of useless.
Ok, i'll send v2 of patchset with this change.
> 
> Best regards,
> Krzysztof




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


[PATCH 0/3] drm/exynos: rotator: Add support for s5pv210

2018-12-20 Thread Paweł Chmiel
This patchset adds support for s5pv210 soc, into 
Samsung DRM Rotator driver. Currently only NV12 and XRGB formats
 are supported.

It was tested by using simple tool from 
https://www.spinics.net/lists/linux-samsung-soc/msg60498.html

Paweł Chmiel (3):
  drm/exynos: rotator: Add support for s5pv210
  dt-bindings: gpu: samsung-rotator: Document s5pv210 support
  ARM: dts: s5pv210: Add node for exynos-rotator

 .../bindings/gpu/samsung-rotator.txt  |  1 +
 arch/arm/boot/dts/s5pv210.dtsi|  9 
 drivers/gpu/drm/exynos/exynos_drm_rotator.c   | 23 +++
 3 files changed, 33 insertions(+)

-- 
2.17.1

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


[PATCH 3/3] ARM: dts: s5pv210: Add node for exynos-rotator

2018-12-20 Thread Paweł Chmiel
This commit adds node for Exynos Rorator device,
so it can be used on all s5pv210 based devices.

Signed-off-by: Paweł Chmiel 
---
 arch/arm/boot/dts/s5pv210.dtsi | 9 +
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/boot/dts/s5pv210.dtsi b/arch/arm/boot/dts/s5pv210.dtsi
index 75f454a210d6..a5463003c7f6 100644
--- a/arch/arm/boot/dts/s5pv210.dtsi
+++ b/arch/arm/boot/dts/s5pv210.dtsi
@@ -542,6 +542,15 @@
#dma-requests = <1>;
};
 
+   rotator: rotator@fa30 {
+   compatible = "samsung,s5pv210-rotator";
+   reg = <0xfa30 0x1000>;
+   interrupt-parent = <>;
+   interrupts = <4>;
+   clocks = < CLK_ROTATOR>;
+   clock-names = "rotator";
+   };
+
i2c1: i2c@fab0 {
compatible = "samsung,s3c2440-i2c";
reg = <0xfab0 0x1000>;
-- 
2.17.1

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


[PATCH 1/3] drm/exynos: rotator: Add support for s5pv210

2018-12-20 Thread Paweł Chmiel
This commit adds support for s5pv210.
Currently only NV12 and XRGB formats are supported.
It was tested by using tool from
https://www.spinics.net/lists/linux-samsung-soc/msg60498.html

Signed-off-by: Paweł Chmiel 
---
 drivers/gpu/drm/exynos/exynos_drm_rotator.c | 23 +
 1 file changed, 23 insertions(+)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c 
b/drivers/gpu/drm/exynos/exynos_drm_rotator.c
index a820a68429b9..a822d340ccf6 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c
@@ -357,6 +357,11 @@ static int rotator_runtime_resume(struct device *dev)
 }
 #endif
 
+static const struct drm_exynos_ipp_limit rotator_s5pv210_rbg888_limits[] = {
+   { IPP_SIZE_LIMIT(BUFFER, .h = { 8, SZ_16K }, .v = { 8, SZ_16K }) },
+   { IPP_SIZE_LIMIT(AREA, .h.align = 2, .v.align = 2) },
+};
+
 static const struct drm_exynos_ipp_limit rotator_4210_rbg888_limits[] = {
{ IPP_SIZE_LIMIT(BUFFER, .h = { 8, SZ_16K }, .v = { 8, SZ_16K }) },
{ IPP_SIZE_LIMIT(AREA, .h.align = 4, .v.align = 4) },
@@ -372,6 +377,11 @@ static const struct drm_exynos_ipp_limit 
rotator_5250_rbg888_limits[] = {
{ IPP_SIZE_LIMIT(AREA, .h.align = 2, .v.align = 2) },
 };
 
+static const struct drm_exynos_ipp_limit rotator_s5pv210_yuv_limits[] = {
+   { IPP_SIZE_LIMIT(BUFFER, .h = { 32, SZ_64K }, .v = { 32, SZ_64K }) },
+   { IPP_SIZE_LIMIT(AREA, .h.align = 8, .v.align = 8) },
+};
+
 static const struct drm_exynos_ipp_limit rotator_4210_yuv_limits[] = {
{ IPP_SIZE_LIMIT(BUFFER, .h = { 32, SZ_64K }, .v = { 32, SZ_64K }) },
{ IPP_SIZE_LIMIT(AREA, .h.align = 8, .v.align = 8) },
@@ -382,6 +392,11 @@ static const struct drm_exynos_ipp_limit 
rotator_4412_yuv_limits[] = {
{ IPP_SIZE_LIMIT(AREA, .h.align = 8, .v.align = 8) },
 };
 
+static const struct exynos_drm_ipp_formats rotator_s5pv210_formats[] = {
+   { IPP_SRCDST_FORMAT(XRGB, rotator_s5pv210_rbg888_limits) },
+   { IPP_SRCDST_FORMAT(NV12, rotator_s5pv210_yuv_limits) },
+};
+
 static const struct exynos_drm_ipp_formats rotator_4210_formats[] = {
{ IPP_SRCDST_FORMAT(XRGB, rotator_4210_rbg888_limits) },
{ IPP_SRCDST_FORMAT(NV12, rotator_4210_yuv_limits) },
@@ -397,6 +412,11 @@ static const struct exynos_drm_ipp_formats 
rotator_5250_formats[] = {
{ IPP_SRCDST_FORMAT(NV12, rotator_4412_yuv_limits) },
 };
 
+static const struct rot_variant rotator_s5pv210_data = {
+   .formats = rotator_s5pv210_formats,
+   .num_formats = ARRAY_SIZE(rotator_s5pv210_formats),
+};
+
 static const struct rot_variant rotator_4210_data = {
.formats = rotator_4210_formats,
.num_formats = ARRAY_SIZE(rotator_4210_formats),
@@ -414,6 +434,9 @@ static const struct rot_variant rotator_5250_data = {
 
 static const struct of_device_id exynos_rotator_match[] = {
{
+   .compatible = "samsung,s5pv210-rotator",
+   .data = _s5pv210_data,
+   }, {
.compatible = "samsung,exynos4210-rotator",
.data = _4210_data,
}, {
-- 
2.17.1

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


[PATCH 2/3] dt-bindings: gpu: samsung-rotator: Document s5pv210 support

2018-12-20 Thread Paweł Chmiel
This commit documents new compatible for s5pv210 soc,
which will be also supported by this driver.

Signed-off-by: Paweł Chmiel 
---
 Documentation/devicetree/bindings/gpu/samsung-rotator.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/gpu/samsung-rotator.txt 
b/Documentation/devicetree/bindings/gpu/samsung-rotator.txt
index 82cd1ed0be93..78658dec6941 100644
--- a/Documentation/devicetree/bindings/gpu/samsung-rotator.txt
+++ b/Documentation/devicetree/bindings/gpu/samsung-rotator.txt
@@ -5,6 +5,7 @@ Required properties:
(a) "samsung,exynos4210-rotator" for Rotator IP in Exynos4210
(b) "samsung,exynos4212-rotator" for Rotator IP in Exynos4212/4412
(c) "samsung,exynos5250-rotator" for Rotator IP in Exynos5250
+   (d) "samsung,s5pv210-rotator" for Rotator IP in S5PV210
 
   - reg : Physical base address of the IP registers and length of memory
  mapped region.
-- 
2.17.1

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


[PATCH v2 1/2] drm/exynos: fimd: Add support for S5PV210 FIMD variant

2018-04-21 Thread Paweł Chmiel
From: Tomasz Figa <tomasz.f...@gmail.com>

This patch adds support for FIMD variant found on S5PV210 SoC.
Except CLKSEL bit availability, it is identical to Exynos4210.

Tested-by: Paweł Chmiel <pawel.mikolaj.chm...@gmail.com>
Signed-off-by: Tomasz Figa <tomasz.f...@gmail.com>
Signed-off-by: Paweł Chmiel <pawel.mikolaj.chm...@gmail.com>
---

Changes from v1:
  - Added missing signed-off-by
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index d42ae2bc3e56..01b1570d0c3a 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -121,6 +121,12 @@ static struct fimd_driver_data s3c64xx_fimd_driver_data = {
.has_limited_fmt = 1,
 };
 
+static struct fimd_driver_data s5pv210_fimd_driver_data = {
+   .timing_base = 0x0,
+   .has_shadowcon = 1,
+   .has_clksel = 1,
+};
+
 static struct fimd_driver_data exynos3_fimd_driver_data = {
.timing_base = 0x2,
.lcdblk_offset = 0x210,
@@ -193,6 +199,8 @@ struct fimd_context {
 static const struct of_device_id fimd_driver_dt_match[] = {
{ .compatible = "samsung,s3c6400-fimd",
  .data = _fimd_driver_data },
+   { .compatible = "samsung,s5pv210-fimd",
+ .data = _fimd_driver_data },
{ .compatible = "samsung,exynos3250-fimd",
  .data = _fimd_driver_data },
{ .compatible = "samsung,exynos4210-fimd",
-- 
2.7.4

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


[PATCH v2 2/2] drm/exynos: Allow DRM_EXYNOS on s5pv210.

2018-04-21 Thread Paweł Chmiel
This patch brings back possibility to use drivers depending on
DRM_EXYNOS, on Samsung S5PV210/S5PC110 series based systems.

Fixes: dbbc925bb83a ("drm/exynos: depend on ARCH_EXYNOS for DRM_EXYNOS")
Signed-off-by: Paweł Chmiel <pawel.mikolaj.chm...@gmail.com>
---
 drivers/gpu/drm/exynos/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig
index 735ce47688f9..1548a784ef71 100644
--- a/drivers/gpu/drm/exynos/Kconfig
+++ b/drivers/gpu/drm/exynos/Kconfig
@@ -1,6 +1,6 @@
 config DRM_EXYNOS
tristate "DRM Support for Samsung SoC EXYNOS Series"
-   depends on OF && DRM && (ARCH_S3C64XX || ARCH_EXYNOS || 
ARCH_MULTIPLATFORM)
+   depends on OF && DRM && (ARCH_S3C64XX || ARCH_S5PV210 || ARCH_EXYNOS || 
ARCH_MULTIPLATFORM)
select DRM_KMS_HELPER
select VIDEOMODE_HELPERS
select SND_SOC_HDMI_CODEC if SND_SOC
-- 
2.7.4

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


Re: [PATCH 1/2] drm/exynos: fimd: Add support for S5PV210 FIMD variant

2018-04-21 Thread Paweł Chmiel
On Saturday, April 21, 2018 6:55:17 PM CEST Krzysztof Kozlowski wrote:
> On Fri, Apr 20, 2018 at 6:32 PM, Paweł Chmiel
> <pawel.mikolaj.chm...@gmail.com> wrote:
> > From: Tomasz Figa <tomasz.f...@gmail.com>
> >
> > This patch adds support for FIMD variant found on S5PV210 SoC.
> > Except CLKSEL bit availability, it is identical to Exynos4210.
> >
> > Tested-by: Paweł Chmiel <pawel.mikolaj.chm...@gmail.com>
> > Signed-off-by: Tomasz Figa <tomasz.f...@gmail.com>
> 
> You need to add your Signed-off-by here as well. It is necessary every
> time you touch a patch (and sending it is also a "touch" action).
Hi

Thanks for feedback, i've send a v2 version of this patchset with this issue 
fixed.

> 
> Best regards,
> Krzysztof
> 
> > ---
> >  drivers/gpu/drm/exynos/exynos_drm_fimd.c | 8 
> >  1 file changed, 8 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
> > b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> > index d42ae2bc3e56..01b1570d0c3a 100644
> > --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> > +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> > @@ -121,6 +121,12 @@ static struct fimd_driver_data 
> > s3c64xx_fimd_driver_data = {
> > .has_limited_fmt = 1,
> >  };
> >
> > +static struct fimd_driver_data s5pv210_fimd_driver_data = {
> > +   .timing_base = 0x0,
> > +   .has_shadowcon = 1,
> > +   .has_clksel = 1,
> > +};
> > +
> >  static struct fimd_driver_data exynos3_fimd_driver_data = {
> > .timing_base = 0x2,
> > .lcdblk_offset = 0x210,
> > @@ -193,6 +199,8 @@ struct fimd_context {
> >  static const struct of_device_id fimd_driver_dt_match[] = {
> > { .compatible = "samsung,s3c6400-fimd",
> >   .data = _fimd_driver_data },
> > +   { .compatible = "samsung,s5pv210-fimd",
> > + .data = _fimd_driver_data },
> > { .compatible = "samsung,exynos3250-fimd",
> >   .data = _fimd_driver_data },
> > { .compatible = "samsung,exynos4210-fimd",
> > --
> > 2.7.4
> >
> 


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


[PATCH v2 0/2] drm/exynos: fimd: Add support for S5PV210

2018-04-21 Thread Paweł Chmiel
This patch series compose of 2 patches.

First patch, adding support for S5PV210 FIMD variant to Exynos driver.
Compatible for this soc was already existing in documentation.

Second patch, brings back possibility to use drivers depending on
DRM_EXYNOS, on Samsung S5PV210/S5PC110 series based systems.

Both patches has been tested on (not yet mainlined), an S5PV210 based
Samsung Galaxy S (i9000) phone.

Changes from v1:
  - Added missing signed-off-by to one of patches

Paweł Chmiel (1):
  drm/exynos: Allow DRM_EXYNOS on s5pv210.

Tomasz Figa (1):
  drm/exynos: fimd: Add support for S5PV210 FIMD variant

 drivers/gpu/drm/exynos/Kconfig   | 2 +-
 drivers/gpu/drm/exynos/exynos_drm_fimd.c | 8 
 2 files changed, 9 insertions(+), 1 deletion(-)

-- 
2.7.4

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


[PATCH 0/2] drm/exynos: fimd: Add support for S5PV210

2018-04-21 Thread Paweł Chmiel
This patch series compose of 2 patches.

First patch, adding support for S5PV210 FIMD variant to Exynos driver.
Compatible for this soc was already existing in documentation.

Second patch, brings back possibility to use drivers depending on
DRM_EXYNOS, on Samsung S5PV210/S5PC110 series based systems.

Both patches has been tested on (not yet mainlined), an S5PV210 based
Samsung Galaxy S (i9000) phone.

Paweł Chmiel (1):
  drm/exynos: Allow DRM_EXYNOS on s5pv210.

Tomasz Figa (1):
  drm/exynos: fimd: Add support for S5PV210 FIMD variant

 drivers/gpu/drm/exynos/Kconfig   | 2 +-
 drivers/gpu/drm/exynos/exynos_drm_fimd.c | 8 
 2 files changed, 9 insertions(+), 1 deletion(-)

-- 
2.7.4

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


[PATCH 2/2] drm/exynos: Allow DRM_EXYNOS on s5pv210

2018-04-21 Thread Paweł Chmiel
This patch brings back possibility to use drivers depending on
DRM_EXYNOS, on Samsung S5PV210/S5PC110 series based systems.

Fixes: dbbc925bb83a ("drm/exynos: depend on ARCH_EXYNOS for DRM_EXYNOS")
Signed-off-by: Paweł Chmiel <pawel.mikolaj.chm...@gmail.com>
---
 drivers/gpu/drm/exynos/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig
index 735ce47688f9..1548a784ef71 100644
--- a/drivers/gpu/drm/exynos/Kconfig
+++ b/drivers/gpu/drm/exynos/Kconfig
@@ -1,6 +1,6 @@
 config DRM_EXYNOS
tristate "DRM Support for Samsung SoC EXYNOS Series"
-   depends on OF && DRM && (ARCH_S3C64XX || ARCH_EXYNOS || 
ARCH_MULTIPLATFORM)
+   depends on OF && DRM && (ARCH_S3C64XX || ARCH_S5PV210 || ARCH_EXYNOS || 
ARCH_MULTIPLATFORM)
select DRM_KMS_HELPER
select VIDEOMODE_HELPERS
select SND_SOC_HDMI_CODEC if SND_SOC
-- 
2.7.4

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


[PATCH 1/2] drm/exynos: fimd: Add support for S5PV210 FIMD variant

2018-04-21 Thread Paweł Chmiel
From: Tomasz Figa <tomasz.f...@gmail.com>

This patch adds support for FIMD variant found on S5PV210 SoC.
Except CLKSEL bit availability, it is identical to Exynos4210.

Tested-by: Paweł Chmiel <pawel.mikolaj.chm...@gmail.com>
Signed-off-by: Tomasz Figa <tomasz.f...@gmail.com>
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index d42ae2bc3e56..01b1570d0c3a 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -121,6 +121,12 @@ static struct fimd_driver_data s3c64xx_fimd_driver_data = {
.has_limited_fmt = 1,
 };
 
+static struct fimd_driver_data s5pv210_fimd_driver_data = {
+   .timing_base = 0x0,
+   .has_shadowcon = 1,
+   .has_clksel = 1,
+};
+
 static struct fimd_driver_data exynos3_fimd_driver_data = {
.timing_base = 0x2,
.lcdblk_offset = 0x210,
@@ -193,6 +199,8 @@ struct fimd_context {
 static const struct of_device_id fimd_driver_dt_match[] = {
{ .compatible = "samsung,s3c6400-fimd",
  .data = _fimd_driver_data },
+   { .compatible = "samsung,s5pv210-fimd",
+ .data = _fimd_driver_data },
{ .compatible = "samsung,exynos3250-fimd",
  .data = _fimd_driver_data },
{ .compatible = "samsung,exynos4210-fimd",
-- 
2.7.4

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