Re: [PATCH v1 2/2] drm/panel: Add support for Raydium rm68200 panel driver
Hi Thierry, A big thank you for your code review and comments. It helped me to improve the driver and to send a v2. Philippe :-) On 02/28/2018 08:16 PM, Thierry Reding wrote: > On Thu, Feb 08, 2018 at 03:30:26PM +0100, Philippe Cornu wrote: >> This patch adds Raydium Semiconductor Corporation rm68200 >> 5.5" 720x1280 TFT LCD panel driver (MIPI-DSI video mode). >> >> Signed-off-by: Philippe Cornu >> --- >> drivers/gpu/drm/panel/Kconfig | 8 + >> drivers/gpu/drm/panel/Makefile| 1 + >> drivers/gpu/drm/panel/panel-raydium-rm68200.c | 464 >> ++ >> 3 files changed, 473 insertions(+) >> create mode 100755 drivers/gpu/drm/panel/panel-raydium-rm68200.c >> >> diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig >> index 988048ebcc22..08d99dd46765 100644 >> --- a/drivers/gpu/drm/panel/Kconfig >> +++ b/drivers/gpu/drm/panel/Kconfig >> @@ -108,6 +108,14 @@ config DRM_PANEL_RASPBERRYPI_TOUCHSCREEN >>Pi 7" Touchscreen. To compile this driver as a module, >>choose M here. >> >> +config DRM_PANEL_RAYDIUM_RM68200 >> +tristate "Raydium rm68200 720x1280 dsi 2dl video mode panel" > > What's 2dl? Either this is something already implied by the RM68200 > model or if there are multiple variants of the RM68200 you'll probably > want to ensure that's reflected in the compatible string. > >> +depends on OF >> +depends on DRM_MIPI_DSI >> +help >> + Say Y here if you want to enable support for Raydium rm68200 >> + 720x1280 dsi 2dl video mode panel >> + >> config DRM_PANEL_SAMSUNG_S6E3HA2 >> tristate "Samsung S6E3HA2 DSI video mode panel" >> depends on OF >> diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile >> index 3d2a88d0e965..f26efc11d746 100644 >> --- a/drivers/gpu/drm/panel/Makefile >> +++ b/drivers/gpu/drm/panel/Makefile >> @@ -9,6 +9,7 @@ obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o >> obj-$(CONFIG_DRM_PANEL_ORISETECH_OTM8009A) += panel-orisetech-otm8009a.o >> obj-$(CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00) += >> panel-panasonic-vvx10f034n00.o >> obj-$(CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN) += >> panel-raspberrypi-touchscreen.o >> +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_S6E3HA2) += panel-samsung-s6e3ha2.o >> obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03) += panel-samsung-s6e63j0x03.o >> diff --git a/drivers/gpu/drm/panel/panel-raydium-rm68200.c >> b/drivers/gpu/drm/panel/panel-raydium-rm68200.c >> new file mode 100755 >> index ..f3e15873d05a >> --- /dev/null >> +++ b/drivers/gpu/drm/panel/panel-raydium-rm68200.c >> @@ -0,0 +1,464 @@ >> +// SPDX-License-Identifier: GPL-2.0 >> +/* >> + * Copyright (C) STMicroelectronics SA 2017 >> + * >> + * Authors: Philippe Cornu >> + * Yannick Fertre >> + */ >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +#define DRV_NAME "raydium_rm68200" > > Not needed, see below. > >> + >> +/*** Manufacturer Command Set ***/ >> +#define MCS_CMD_MODE_SW 0xFE /* CMD Mode Switch */ >> +#define MCS_CMD1_UCS0x00 /* User Command Set (UCS = CMD1) */ >> +#define MCS_CMD2_P0 0x01 /* Manufacture Command Set Page0 (CMD2 P0) */ >> +#define MCS_CMD2_P1 0x02 /* Manufacture Command Set Page1 (CMD2 P1) */ >> +#define MCS_CMD2_P2 0x03 /* Manufacture Command Set Page2 (CMD2 P2) */ >> +#define MCS_CMD2_P3 0x04 /* Manufacture Command Set Page3 (CMD2 P3) */ >> + >> +/* CMD2 P0 commands (Display Options and Power) */ >> +#define MCS_STBCTR 0x12 /* TE1 Output Setting Zig-Zag Connection */ >> +#define MCS_SGOPCTR 0x16 /* Source Bias Current */ >> +#define MCS_SDCTR 0x1A /* Source Output Delay Time */ >> +#define MCS_INVCTR 0x1B /* Inversion Type */ >> +#define MCS_EXT_PWR_IC 0x24 /* External PWR IC Control */ >> +#define MCS_SETAVDD 0x27 /* PFM Control for AVDD Output */ >> +#define MCS_SETAVEE 0x29 /* PFM Control for AVEE Output */ >> +#define MCS_BT2CTR 0x2B /* DDVDL Charge Pump Control */ >> +#define MCS_BT3CTR 0x2F /* VGH Charge Pump Control */ >> +#define MCS_BT4CTR 0x34 /* VGL Charge Pump Control */ >> +#define MCS_VCMCTR 0x46 /* VCOM Output Level Control */ >> +#define MCS_SETVGN 0x52 /* VG M/S N Control */ >> +#define MCS_SETVGP 0x54 /* VG M/S P Control */ >> +#define MCS_SW_CTRL 0x5F /* Interface Control for PFM and MIPI */ >> + >> +/* CMD2 P2 commands (GOA Timing Control) - no description in datasheet */ >> +#define GOA_VSTV1 0x00 >> +#define GOA_VSTV2 0x07 >> +#define GOA_VCLK1 0x0E >> +#define GOA_VCLK2 0x17 >> +#define GOA_VCLK_OPT1 0x20 >> +#define GOA_BICLK1 0x2A >> +#define GOA_BICLK2 0x37 >> +#define GOA_BICLK3 0x44 >> +#define GOA_BICLK4 0x4F >> +#define GOA_BICLK_OPT1 0x5B >> +#define GOA_BICLK_OPT2 0x60 >> +#define MCS_GOA_GPO10x6D
Re: [PATCH v1 2/2] drm/panel: Add support for Raydium rm68200 panel driver
On Thu, Feb 08, 2018 at 03:30:26PM +0100, Philippe Cornu wrote: > This patch adds Raydium Semiconductor Corporation rm68200 > 5.5" 720x1280 TFT LCD panel driver (MIPI-DSI video mode). > > Signed-off-by: Philippe Cornu > --- > drivers/gpu/drm/panel/Kconfig | 8 + > drivers/gpu/drm/panel/Makefile| 1 + > drivers/gpu/drm/panel/panel-raydium-rm68200.c | 464 > ++ > 3 files changed, 473 insertions(+) > create mode 100755 drivers/gpu/drm/panel/panel-raydium-rm68200.c > > diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig > index 988048ebcc22..08d99dd46765 100644 > --- a/drivers/gpu/drm/panel/Kconfig > +++ b/drivers/gpu/drm/panel/Kconfig > @@ -108,6 +108,14 @@ config DRM_PANEL_RASPBERRYPI_TOUCHSCREEN > Pi 7" Touchscreen. To compile this driver as a module, > choose M here. > > +config DRM_PANEL_RAYDIUM_RM68200 > + tristate "Raydium rm68200 720x1280 dsi 2dl video mode panel" What's 2dl? Either this is something already implied by the RM68200 model or if there are multiple variants of the RM68200 you'll probably want to ensure that's reflected in the compatible string. > + depends on OF > + depends on DRM_MIPI_DSI > + help > + Say Y here if you want to enable support for Raydium rm68200 > + 720x1280 dsi 2dl video mode panel > + > config DRM_PANEL_SAMSUNG_S6E3HA2 > tristate "Samsung S6E3HA2 DSI video mode panel" > depends on OF > diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile > index 3d2a88d0e965..f26efc11d746 100644 > --- a/drivers/gpu/drm/panel/Makefile > +++ b/drivers/gpu/drm/panel/Makefile > @@ -9,6 +9,7 @@ obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o > obj-$(CONFIG_DRM_PANEL_ORISETECH_OTM8009A) += panel-orisetech-otm8009a.o > obj-$(CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00) += > panel-panasonic-vvx10f034n00.o > obj-$(CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN) += > panel-raspberrypi-touchscreen.o > +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_S6E3HA2) += panel-samsung-s6e3ha2.o > obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03) += panel-samsung-s6e63j0x03.o > diff --git a/drivers/gpu/drm/panel/panel-raydium-rm68200.c > b/drivers/gpu/drm/panel/panel-raydium-rm68200.c > new file mode 100755 > index ..f3e15873d05a > --- /dev/null > +++ b/drivers/gpu/drm/panel/panel-raydium-rm68200.c > @@ -0,0 +1,464 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Copyright (C) STMicroelectronics SA 2017 > + * > + * Authors: Philippe Cornu > + * Yannick Fertre > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#define DRV_NAME "raydium_rm68200" Not needed, see below. > + > +/*** Manufacturer Command Set ***/ > +#define MCS_CMD_MODE_SW 0xFE /* CMD Mode Switch */ > +#define MCS_CMD1_UCS 0x00 /* User Command Set (UCS = CMD1) */ > +#define MCS_CMD2_P0 0x01 /* Manufacture Command Set Page0 (CMD2 P0) */ > +#define MCS_CMD2_P1 0x02 /* Manufacture Command Set Page1 (CMD2 P1) */ > +#define MCS_CMD2_P2 0x03 /* Manufacture Command Set Page2 (CMD2 P2) */ > +#define MCS_CMD2_P3 0x04 /* Manufacture Command Set Page3 (CMD2 P3) */ > + > +/* CMD2 P0 commands (Display Options and Power) */ > +#define MCS_STBCTR 0x12 /* TE1 Output Setting Zig-Zag Connection */ > +#define MCS_SGOPCTR 0x16 /* Source Bias Current */ > +#define MCS_SDCTR0x1A /* Source Output Delay Time */ > +#define MCS_INVCTR 0x1B /* Inversion Type */ > +#define MCS_EXT_PWR_IC 0x24 /* External PWR IC Control */ > +#define MCS_SETAVDD 0x27 /* PFM Control for AVDD Output */ > +#define MCS_SETAVEE 0x29 /* PFM Control for AVEE Output */ > +#define MCS_BT2CTR 0x2B /* DDVDL Charge Pump Control */ > +#define MCS_BT3CTR 0x2F /* VGH Charge Pump Control */ > +#define MCS_BT4CTR 0x34 /* VGL Charge Pump Control */ > +#define MCS_VCMCTR 0x46 /* VCOM Output Level Control */ > +#define MCS_SETVGN 0x52 /* VG M/S N Control */ > +#define MCS_SETVGP 0x54 /* VG M/S P Control */ > +#define MCS_SW_CTRL 0x5F /* Interface Control for PFM and MIPI */ > + > +/* CMD2 P2 commands (GOA Timing Control) - no description in datasheet */ > +#define GOA_VSTV10x00 > +#define GOA_VSTV20x07 > +#define GOA_VCLK10x0E > +#define GOA_VCLK20x17 > +#define GOA_VCLK_OPT10x20 > +#define GOA_BICLK1 0x2A > +#define GOA_BICLK2 0x37 > +#define GOA_BICLK3 0x44 > +#define GOA_BICLK4 0x4F > +#define GOA_BICLK_OPT1 0x5B > +#define GOA_BICLK_OPT2 0x60 > +#define MCS_GOA_GPO1 0x6D > +#define MCS_GOA_GPO2 0x71 > +#define MCS_GOA_EQ 0x74 > +#define MCS_GOA_CLK_GALLON 0x7C > +#define MCS_GOA_FS_SEL0 0x7E > +#define MCS_GOA_FS_SEL1 0x87 > +#define MCS_GOA_FS_SEL2 0x91 > +#define MCS_GOA_FS_SEL3 0x9B > +#define MCS_GOA_BS_SEL0 0xAC > +#define
Re: [PATCH v1 2/2] drm/panel: Add support for Raydium rm68200 panel driver
Hi Thierry & David, Do you have any comments on this new 720p panel patch? Note: I plan to add 2 new patchs on top on this patch in the future linked to the recent backlight updates (of_find_backlight() & backlight_enable/disable helpers). Thank you, Philippe :-) On 02/23/2018 09:31 AM, Yannick FERTRE wrote: > Reviewed-by: Yannick Fertré > > > On 02/08/2018 03:30 PM, Philippe Cornu wrote: >> This patch adds Raydium Semiconductor Corporation rm68200 >> 5.5" 720x1280 TFT LCD panel driver (MIPI-DSI video mode). >> >> Signed-off-by: Philippe Cornu >> --- >>drivers/gpu/drm/panel/Kconfig | 8 + >>drivers/gpu/drm/panel/Makefile| 1 + >>drivers/gpu/drm/panel/panel-raydium-rm68200.c | 464 >> ++ >>3 files changed, 473 insertions(+) >>create mode 100755 drivers/gpu/drm/panel/panel-raydium-rm68200.c >> >> diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig >> index 988048ebcc22..08d99dd46765 100644 >> --- a/drivers/gpu/drm/panel/Kconfig >> +++ b/drivers/gpu/drm/panel/Kconfig >> @@ -108,6 +108,14 @@ config DRM_PANEL_RASPBERRYPI_TOUCHSCREEN >>Pi 7" Touchscreen. To compile this driver as a module, >>choose M here. >> >> +config DRM_PANEL_RAYDIUM_RM68200 >> +tristate "Raydium rm68200 720x1280 dsi 2dl video mode panel" >> +depends on OF >> +depends on DRM_MIPI_DSI >> +help >> + Say Y here if you want to enable support for Raydium rm68200 >> + 720x1280 dsi 2dl video mode panel >> + >>config DRM_PANEL_SAMSUNG_S6E3HA2 >> tristate "Samsung S6E3HA2 DSI video mode panel" >> depends on OF >> diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile >> index 3d2a88d0e965..f26efc11d746 100644 >> --- a/drivers/gpu/drm/panel/Makefile >> +++ b/drivers/gpu/drm/panel/Makefile >> @@ -9,6 +9,7 @@ obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o >>obj-$(CONFIG_DRM_PANEL_ORISETECH_OTM8009A) += panel-orisetech-otm8009a.o >>obj-$(CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00) += >> panel-panasonic-vvx10f034n00.o >>obj-$(CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN) += >> panel-raspberrypi-touchscreen.o >> +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_S6E3HA2) += panel-samsung-s6e3ha2.o >>obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03) += panel-samsung-s6e63j0x03.o >> diff --git a/drivers/gpu/drm/panel/panel-raydium-rm68200.c >> b/drivers/gpu/drm/panel/panel-raydium-rm68200.c >> new file mode 100755 >> index ..f3e15873d05a >> --- /dev/null >> +++ b/drivers/gpu/drm/panel/panel-raydium-rm68200.c >> @@ -0,0 +1,464 @@ >> +// SPDX-License-Identifier: GPL-2.0 >> +/* >> + * Copyright (C) STMicroelectronics SA 2017 >> + * >> + * Authors: Philippe Cornu >> + * Yannick Fertre >> + */ >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +#define DRV_NAME "raydium_rm68200" >> + >> +/*** Manufacturer Command Set ***/ >> +#define MCS_CMD_MODE_SW 0xFE /* CMD Mode Switch */ >> +#define MCS_CMD1_UCS0x00 /* User Command Set (UCS = CMD1) */ >> +#define MCS_CMD2_P0 0x01 /* Manufacture Command Set Page0 (CMD2 P0) */ >> +#define MCS_CMD2_P1 0x02 /* Manufacture Command Set Page1 (CMD2 P1) */ >> +#define MCS_CMD2_P2 0x03 /* Manufacture Command Set Page2 (CMD2 P2) */ >> +#define MCS_CMD2_P3 0x04 /* Manufacture Command Set Page3 (CMD2 P3) */ >> + >> +/* CMD2 P0 commands (Display Options and Power) */ >> +#define MCS_STBCTR 0x12 /* TE1 Output Setting Zig-Zag Connection */ >> +#define MCS_SGOPCTR 0x16 /* Source Bias Current */ >> +#define MCS_SDCTR 0x1A /* Source Output Delay Time */ >> +#define MCS_INVCTR 0x1B /* Inversion Type */ >> +#define MCS_EXT_PWR_IC 0x24 /* External PWR IC Control */ >> +#define MCS_SETAVDD 0x27 /* PFM Control for AVDD Output */ >> +#define MCS_SETAVEE 0x29 /* PFM Control for AVEE Output */ >> +#define MCS_BT2CTR 0x2B /* DDVDL Charge Pump Control */ >> +#define MCS_BT3CTR 0x2F /* VGH Charge Pump Control */ >> +#define MCS_BT4CTR 0x34 /* VGL Charge Pump Control */ >> +#define MCS_VCMCTR 0x46 /* VCOM Output Level Control */ >> +#define MCS_SETVGN 0x52 /* VG M/S N Control */ >> +#define MCS_SETVGP 0x54 /* VG M/S P Control */ >> +#define MCS_SW_CTRL 0x5F /* Interface Control for PFM and MIPI */ >> + >> +/* CMD2 P2 commands (GOA Timing Control) - no description in datasheet */ >> +#define GOA_VSTV1 0x00 >> +#define GOA_VSTV2 0x07 >> +#define GOA_VCLK1 0x0E >> +#define GOA_VCLK2 0x17 >> +#define GOA_VCLK_OPT1 0x20 >> +#define GOA_BICLK1 0x2A >> +#define GOA_BICLK2 0x37 >> +#define GOA_BICLK3 0x44 >> +#define GOA_BICLK4 0x4F >> +#define GOA_BICLK_OPT1 0x5B >> +#define GOA_BICLK_OPT2 0x60 >> +#define MCS_GOA_GPO10x6D >> +#define MCS_GOA_GPO20x71 >> +#define MCS_GOA_EQ 0x74 >>
Re: [PATCH v1 2/2] drm/panel: Add support for Raydium rm68200 panel driver
Reviewed-by: Yannick Fertré On 02/08/2018 03:30 PM, Philippe Cornu wrote: > This patch adds Raydium Semiconductor Corporation rm68200 > 5.5" 720x1280 TFT LCD panel driver (MIPI-DSI video mode). > > Signed-off-by: Philippe Cornu > --- > drivers/gpu/drm/panel/Kconfig | 8 + > drivers/gpu/drm/panel/Makefile| 1 + > drivers/gpu/drm/panel/panel-raydium-rm68200.c | 464 > ++ > 3 files changed, 473 insertions(+) > create mode 100755 drivers/gpu/drm/panel/panel-raydium-rm68200.c > > diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig > index 988048ebcc22..08d99dd46765 100644 > --- a/drivers/gpu/drm/panel/Kconfig > +++ b/drivers/gpu/drm/panel/Kconfig > @@ -108,6 +108,14 @@ config DRM_PANEL_RASPBERRYPI_TOUCHSCREEN > Pi 7" Touchscreen. To compile this driver as a module, > choose M here. > > +config DRM_PANEL_RAYDIUM_RM68200 > + tristate "Raydium rm68200 720x1280 dsi 2dl video mode panel" > + depends on OF > + depends on DRM_MIPI_DSI > + help > + Say Y here if you want to enable support for Raydium rm68200 > + 720x1280 dsi 2dl video mode panel > + > config DRM_PANEL_SAMSUNG_S6E3HA2 > tristate "Samsung S6E3HA2 DSI video mode panel" > depends on OF > diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile > index 3d2a88d0e965..f26efc11d746 100644 > --- a/drivers/gpu/drm/panel/Makefile > +++ b/drivers/gpu/drm/panel/Makefile > @@ -9,6 +9,7 @@ obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o > obj-$(CONFIG_DRM_PANEL_ORISETECH_OTM8009A) += panel-orisetech-otm8009a.o > obj-$(CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00) += > panel-panasonic-vvx10f034n00.o > obj-$(CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN) += > panel-raspberrypi-touchscreen.o > +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_S6E3HA2) += panel-samsung-s6e3ha2.o > obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03) += panel-samsung-s6e63j0x03.o > diff --git a/drivers/gpu/drm/panel/panel-raydium-rm68200.c > b/drivers/gpu/drm/panel/panel-raydium-rm68200.c > new file mode 100755 > index ..f3e15873d05a > --- /dev/null > +++ b/drivers/gpu/drm/panel/panel-raydium-rm68200.c > @@ -0,0 +1,464 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Copyright (C) STMicroelectronics SA 2017 > + * > + * Authors: Philippe Cornu > + * Yannick Fertre > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#define DRV_NAME "raydium_rm68200" > + > +/*** Manufacturer Command Set ***/ > +#define MCS_CMD_MODE_SW 0xFE /* CMD Mode Switch */ > +#define MCS_CMD1_UCS 0x00 /* User Command Set (UCS = CMD1) */ > +#define MCS_CMD2_P0 0x01 /* Manufacture Command Set Page0 (CMD2 P0) */ > +#define MCS_CMD2_P1 0x02 /* Manufacture Command Set Page1 (CMD2 P1) */ > +#define MCS_CMD2_P2 0x03 /* Manufacture Command Set Page2 (CMD2 P2) */ > +#define MCS_CMD2_P3 0x04 /* Manufacture Command Set Page3 (CMD2 P3) */ > + > +/* CMD2 P0 commands (Display Options and Power) */ > +#define MCS_STBCTR 0x12 /* TE1 Output Setting Zig-Zag Connection */ > +#define MCS_SGOPCTR 0x16 /* Source Bias Current */ > +#define MCS_SDCTR0x1A /* Source Output Delay Time */ > +#define MCS_INVCTR 0x1B /* Inversion Type */ > +#define MCS_EXT_PWR_IC 0x24 /* External PWR IC Control */ > +#define MCS_SETAVDD 0x27 /* PFM Control for AVDD Output */ > +#define MCS_SETAVEE 0x29 /* PFM Control for AVEE Output */ > +#define MCS_BT2CTR 0x2B /* DDVDL Charge Pump Control */ > +#define MCS_BT3CTR 0x2F /* VGH Charge Pump Control */ > +#define MCS_BT4CTR 0x34 /* VGL Charge Pump Control */ > +#define MCS_VCMCTR 0x46 /* VCOM Output Level Control */ > +#define MCS_SETVGN 0x52 /* VG M/S N Control */ > +#define MCS_SETVGP 0x54 /* VG M/S P Control */ > +#define MCS_SW_CTRL 0x5F /* Interface Control for PFM and MIPI */ > + > +/* CMD2 P2 commands (GOA Timing Control) - no description in datasheet */ > +#define GOA_VSTV10x00 > +#define GOA_VSTV20x07 > +#define GOA_VCLK10x0E > +#define GOA_VCLK20x17 > +#define GOA_VCLK_OPT10x20 > +#define GOA_BICLK1 0x2A > +#define GOA_BICLK2 0x37 > +#define GOA_BICLK3 0x44 > +#define GOA_BICLK4 0x4F > +#define GOA_BICLK_OPT1 0x5B > +#define GOA_BICLK_OPT2 0x60 > +#define MCS_GOA_GPO1 0x6D > +#define MCS_GOA_GPO2 0x71 > +#define MCS_GOA_EQ 0x74 > +#define MCS_GOA_CLK_GALLON 0x7C > +#define MCS_GOA_FS_SEL0 0x7E > +#define MCS_GOA_FS_SEL1 0x87 > +#define MCS_GOA_FS_SEL2 0x91 > +#define MCS_GOA_FS_SEL3 0x9B > +#define MCS_GOA_BS_SEL0 0xAC > +#define MCS_GOA_BS_SEL1 0xB5 > +#define MCS_GOA_BS_SEL2 0xBF > +#define MCS_GOA_BS_SEL3 0xC9 > +#define MCS_GOA_BS_SEL4 0xD3 > + > +/* CMD2 P3 commands (Gamma) */ > +#define MCS_GAMMA_VP
[PATCH v1 2/2] drm/panel: Add support for Raydium rm68200 panel driver
This patch adds Raydium Semiconductor Corporation rm68200 5.5" 720x1280 TFT LCD panel driver (MIPI-DSI video mode). Signed-off-by: Philippe Cornu --- drivers/gpu/drm/panel/Kconfig | 8 + drivers/gpu/drm/panel/Makefile| 1 + drivers/gpu/drm/panel/panel-raydium-rm68200.c | 464 ++ 3 files changed, 473 insertions(+) create mode 100755 drivers/gpu/drm/panel/panel-raydium-rm68200.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 988048ebcc22..08d99dd46765 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -108,6 +108,14 @@ config DRM_PANEL_RASPBERRYPI_TOUCHSCREEN Pi 7" Touchscreen. To compile this driver as a module, choose M here. +config DRM_PANEL_RAYDIUM_RM68200 + tristate "Raydium rm68200 720x1280 dsi 2dl video mode panel" + depends on OF + depends on DRM_MIPI_DSI + help + Say Y here if you want to enable support for Raydium rm68200 + 720x1280 dsi 2dl video mode panel + config DRM_PANEL_SAMSUNG_S6E3HA2 tristate "Samsung S6E3HA2 DSI video mode panel" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 3d2a88d0e965..f26efc11d746 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -9,6 +9,7 @@ obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o obj-$(CONFIG_DRM_PANEL_ORISETECH_OTM8009A) += panel-orisetech-otm8009a.o obj-$(CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00) += panel-panasonic-vvx10f034n00.o obj-$(CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN) += panel-raspberrypi-touchscreen.o +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_S6E3HA2) += panel-samsung-s6e3ha2.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03) += panel-samsung-s6e63j0x03.o diff --git a/drivers/gpu/drm/panel/panel-raydium-rm68200.c b/drivers/gpu/drm/panel/panel-raydium-rm68200.c new file mode 100755 index ..f3e15873d05a --- /dev/null +++ b/drivers/gpu/drm/panel/panel-raydium-rm68200.c @@ -0,0 +1,464 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) STMicroelectronics SA 2017 + * + * Authors: Philippe Cornu + * Yannick Fertre + */ + +#include +#include +#include +#include +#include +#include +#include + +#define DRV_NAME "raydium_rm68200" + +/*** Manufacturer Command Set ***/ +#define MCS_CMD_MODE_SW0xFE /* CMD Mode Switch */ +#define MCS_CMD1_UCS 0x00 /* User Command Set (UCS = CMD1) */ +#define MCS_CMD2_P00x01 /* Manufacture Command Set Page0 (CMD2 P0) */ +#define MCS_CMD2_P10x02 /* Manufacture Command Set Page1 (CMD2 P1) */ +#define MCS_CMD2_P20x03 /* Manufacture Command Set Page2 (CMD2 P2) */ +#define MCS_CMD2_P30x04 /* Manufacture Command Set Page3 (CMD2 P3) */ + +/* CMD2 P0 commands (Display Options and Power) */ +#define MCS_STBCTR 0x12 /* TE1 Output Setting Zig-Zag Connection */ +#define MCS_SGOPCTR0x16 /* Source Bias Current */ +#define MCS_SDCTR 0x1A /* Source Output Delay Time */ +#define MCS_INVCTR 0x1B /* Inversion Type */ +#define MCS_EXT_PWR_IC 0x24 /* External PWR IC Control */ +#define MCS_SETAVDD0x27 /* PFM Control for AVDD Output */ +#define MCS_SETAVEE0x29 /* PFM Control for AVEE Output */ +#define MCS_BT2CTR 0x2B /* DDVDL Charge Pump Control */ +#define MCS_BT3CTR 0x2F /* VGH Charge Pump Control */ +#define MCS_BT4CTR 0x34 /* VGL Charge Pump Control */ +#define MCS_VCMCTR 0x46 /* VCOM Output Level Control */ +#define MCS_SETVGN 0x52 /* VG M/S N Control */ +#define MCS_SETVGP 0x54 /* VG M/S P Control */ +#define MCS_SW_CTRL0x5F /* Interface Control for PFM and MIPI */ + +/* CMD2 P2 commands (GOA Timing Control) - no description in datasheet */ +#define GOA_VSTV1 0x00 +#define GOA_VSTV2 0x07 +#define GOA_VCLK1 0x0E +#define GOA_VCLK2 0x17 +#define GOA_VCLK_OPT1 0x20 +#define GOA_BICLK1 0x2A +#define GOA_BICLK2 0x37 +#define GOA_BICLK3 0x44 +#define GOA_BICLK4 0x4F +#define GOA_BICLK_OPT1 0x5B +#define GOA_BICLK_OPT2 0x60 +#define MCS_GOA_GPO1 0x6D +#define MCS_GOA_GPO2 0x71 +#define MCS_GOA_EQ 0x74 +#define MCS_GOA_CLK_GALLON 0x7C +#define MCS_GOA_FS_SEL00x7E +#define MCS_GOA_FS_SEL10x87 +#define MCS_GOA_FS_SEL20x91 +#define MCS_GOA_FS_SEL30x9B +#define MCS_GOA_BS_SEL00xAC +#define MCS_GOA_BS_SEL10xB5 +#define MCS_GOA_BS_SEL20xBF +#define MCS_GOA_BS_SEL30xC9 +#define MCS_GOA_BS_SEL40xD3 + +/* CMD2 P3 commands (Gamma) */ +#define MCS_GAMMA_VP 0x60 /* Gamma VP1~VP16 */ +#define MCS_GAMMA_VN 0x70 /* Gamma VN1~VN16 */ + +struct rm68200 { + struct device *dev; + struct drm_panel panel; + struct gpio_desc *reset_gpio; + struct regulator *supply; + struct backlight_devi