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 */
> > +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, 

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

2019-01-28 Thread Andrzej Hajda
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 ?


> +#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 },
> + 

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

2019-01-26 Thread Sam Ravnborg
Hi Pawel.

Thanks for this nice patch too.

Comment follows and you need to judge what to follow.
The timing part will not be commented as this was covered in
feedback on the binding.

Using a sysfs file to select the gamma mode looks like a local hack.
Someone with more drm knowledge needs comment on that.


On Fri, Jan 25, 2019 at 05:46:45PM +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. 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/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 
For new drivers please do not use drmP.h, we are working
on gettting rid of it.
The list is sorted in alphabetical order - good.
> +
> +#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_19[MAX_GAMMA_LEVEL][GAMMA_TABLE_COUNT] = {
> + { MCS_GAMMA_CTRL, 0x00,
> +   0x18, 0x08, 0x24, 0x84, 0x45, 0x4F, 0xCA,
> +   0xCB, 0xBC, 0xC9, 0xCB, 0xBC, 0xDA, 0xDA,
> +   0xD0, 0x00, 0x35, 0x00, 0x34, 0x00, 0x4E },
> + { MCS_GAMMA_CTRL, 0x00,
> +   0x18, 0x08, 0x24, 0x74, 0x60, 0x4A, 0xC3,
> +   0xC6, 0xB5, 0xBF, 0xC3, 0xB2, 0xD2, 0xD3,
> +   0xC8, 0x00, 0x5B, 0x00, 0x5B, 0x00, 0x81 },
> + { MCS_GAMMA_CTRL, 0x00,
> +   0x18, 0x08, 0x24, 0x6F, 0x65, 0x46, 0xC2,
> +   0xC4, 0xB3, 0xBF, 0xC2, 0xB2, 0xCF, 0xD1,
> +   0xC6, 0x00, 0x64, 0x00, 0x64, 0x00, 0x8D },
> + { MCS_GAMMA_CTRL, 0x00,
> +   0x18, 0x08, 0x24, 0x6E, 0x65, 0x45, 0xC0,
> +   0xC3, 0xB2, 0xBA, 0xBE, 0xAE, 0xCD, 0xD0,
> +   0xC4, 0x00, 0x70, 0x00, 0x70, 0x00, 0x9C },
> + { MCS_GAMMA_CTRL, 0x00,
> +   0x18, 0x08, 0x24, 0x69, 0x64, 0x40, 0xBF,
> +   0xC1, 0xB0, 0xB9, 0xBE, 0xAD, 0xCB, 0xCD,
> +   0xC2, 0x00, 0x7A, 0x00, 0x7B, 0x00, 0xAA },
> + { MCS_GAMMA_CTRL, 0x00,
> +   0x18, 0x08, 0x24, 0x68, 0x64, 0x3F, 0xBE,
> +   0xC0, 0xB0, 0xB6, 0xBB, 0xAB, 0xC8, 0xCB,
> +   0xBF, 0x00, 0x85, 0x00, 0x86, 0x00, 0xB8 },
> + { MCS_GAMMA_CTRL, 0x00,
> +   0x18, 0x08, 0x24, 0x68, 0x64, 0x40, 0xBC,
> +   0xBF, 0xAF, 0xB4, 0xBA, 0xA9, 0xC8, 0xCA,
> +   0xBE, 0x00, 0x8B, 0x00, 0x8C, 0x00, 0xC0 },
> + { MCS_GAMMA_CTRL, 0x00,
> +   0x18, 0x08, 0x24, 0x67, 0x64, 0x3F, 0xBB,
> +   0xBE, 0xAD, 0xB3, 0xB9, 0xA7, 0xC8, 0xC9,
> +   0xBE, 0x00, 0x90, 0x00, 0x92, 0x00, 0xC8 },
> + { MCS_GAMMA_CTRL, 0x00,
> +   0x18, 0x08, 0x24, 0x63, 0x61, 0x3B, 0xBA,
> +   0xBE, 0xAC, 0xB3, 0xB8, 0xA7, 0xC6, 0xC8,
> +   0xBD, 0x00, 0x96, 0x00, 0x98, 0x00, 0xCF },
> + { MCS_GAMMA_CTRL, 0x00,
> +   0x18, 0x08, 0x24, 0x61, 0x60, 0x39, 0xBB,
> +   0xBE, 0xAD, 0xB2, 0xB6, 0xA6, 0xC5, 0xC7,
> +   0xBD, 0x00, 0x9B, 0x00, 0x9E, 0x00, 0xD5 },
> + { MCS_GAMMA_CTRL, 0x00,
> +   0x18, 0x08, 0x24, 0x61, 0x5F, 0x39, 0xBA,
> +   0xBD, 0xAD, 0xB1, 0xB6, 0xA5, 0xC4, 0xC5,
> +   0xBC, 0x00, 0xA0, 0x00, 0xA4, 0x00, 0xDB },
> +};
> +
> +/* array of gamma tables for gamma value 1.7 */
> +static u8 const s6e63m0_gamma_17[MAX_GAMMA_LEVEL][GAMMA_TABLE_COUNT] = {
> + { 

[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, 0xC3,
+ 0xB7, 0x00, 0x91, 0x00,