[linux-sunxi] Re: [PATCH v4 3/5] drm: panel: Add Xingbangda XBD599 panel (ST7703 controller)

2020-06-22 Thread Ondřej Jirman
Hello Sam,

On Mon, Jun 22, 2020 at 10:08:02AM +0200, Sam Ravnborg wrote:
> On Sun, Jun 21, 2020 at 12:30:10AM +0200, Ondřej Jirman wrote:
> > On Sat, Jun 20, 2020 at 11:25:29PM +0200, Sam Ravnborg wrote:
> > > Hi Ondrej et al.

...

> > > Would it not be better to have one st7703 driver that suipports both
> > > panels?
> > >
> > > The driver would need dedicated init functions depending on the panel.
> > > But a lot could also be shared.
> > 
> > I guess I can move the code there. 
> In the same process the river should then be renamed to follow other
> sitronix based drivers.
> So the next developer will recognize this and use the correct driver.

Are driver/module names considered kernel ABI? Or is it possible to
change them?

regards,
o.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20200622111752.jsz37zl7hidvkozw%40core.my.home.


[linux-sunxi] Re: [PATCH v4 3/5] drm: panel: Add Xingbangda XBD599 panel (ST7703 controller)

2020-06-20 Thread Ondřej Jirman
On Sat, Jun 20, 2020 at 11:25:29PM +0200, Sam Ravnborg wrote:
> Hi Ondrej et al.
> 
> On Wed, Jun 17, 2020 at 02:32:07AM +0200, Ondrej Jirman wrote:
> > From: Icenowy Zheng 
> > 
> > Xingbangda XBD599 is a 5.99" 720x1440 MIPI-DSI IPS LCD panel made by
> > Xingbangda, which is used on PinePhone final assembled phones.
> > 
> > It is based on Sitronix ST7703 LCD controller.
> 
> I am a little late to the game here - so sorry if this has been
> discussed before.
> We already have panel-rocktech-jh057n00900.c which is a panle driver
> based on st7703.
> Why is it we need a new driver?

No reason other than the driver not being named after the controller,
so I didn't notice.

> Would it not be better to have one st7703 driver that suipports both
> panels?
>
> The driver would need dedicated init functions depending on the panel.
> But a lot could also be shared.

I guess I can move the code there. 

regards,
o.

>   Sam
> 
> > 
> > Add support for it.
> > 
> > Signed-off-by: Icenowy Zheng 
> > Signed-off-by: Ondrej Jirman 
> > ---
> >  drivers/gpu/drm/panel/Kconfig |  10 +
> >  drivers/gpu/drm/panel/Makefile|   1 +
> >  drivers/gpu/drm/panel/panel-sitronix-st7703.c | 535 ++
> >  3 files changed, 546 insertions(+)
> >  create mode 100644 drivers/gpu/drm/panel/panel-sitronix-st7703.c
> > 
> > diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
> > index 39055c1f0e2f..b7bc157b0612 100644
> > --- a/drivers/gpu/drm/panel/Kconfig
> > +++ b/drivers/gpu/drm/panel/Kconfig
> > @@ -395,6 +395,16 @@ config DRM_PANEL_SITRONIX_ST7701
> >   ST7701 controller for 480X864 LCD panels with MIPI/RGB/SPI
> >   system interfaces.
> >  
> > +config DRM_PANEL_SITRONIX_ST7703
> > +   tristate "Sitronix ST7703 panel driver"
> > +   depends on OF
> > +   depends on DRM_MIPI_DSI
> > +   depends on BACKLIGHT_CLASS_DEVICE
> > +   help
> > + Say Y here if you want to enable support for the Sitronix
> > + ST7703 controller for 720X1440 LCD panels with MIPI/RGB/SPI
> > + system interfaces.
> > +
> >  config DRM_PANEL_SITRONIX_ST7789V
> > tristate "Sitronix ST7789V panel"
> > depends on OF && SPI
> > diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
> > index de74f282c433..47f4789a8685 100644
> > --- a/drivers/gpu/drm/panel/Makefile
> > +++ b/drivers/gpu/drm/panel/Makefile
> > @@ -41,6 +41,7 @@ obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += 
> > panel-sharp-lq101r1sx01.o
> >  obj-$(CONFIG_DRM_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o
> >  obj-$(CONFIG_DRM_PANEL_SHARP_LS043T1LE01) += panel-sharp-ls043t1le01.o
> >  obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7701) += panel-sitronix-st7701.o
> > +obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7703) += panel-sitronix-st7703.o
> >  obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7789V) += panel-sitronix-st7789v.o
> >  obj-$(CONFIG_DRM_PANEL_SONY_ACX424AKP) += panel-sony-acx424akp.o
> >  obj-$(CONFIG_DRM_PANEL_SONY_ACX565AKM) += panel-sony-acx565akm.o
> > diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c 
> > b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> > new file mode 100644
> > index ..dbd46b6c0b46
> > --- /dev/null
> > +++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> > @@ -0,0 +1,535 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +/*
> > + * DRM driver for Sitronix ST7703 MIPI DSI panel
> > + *
> > + * Copyright (C) 2020 Ondrej Jirman 
> > + * Copyright (C) 2019-2020 Icenowy Zheng 
> > + *
> > + * Based on panel-rocktech-jh057n00900.c, which is:
> > + *   Copyright (C) Purism SPC 2019
> > + */
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +/* Manufacturer specific DCS commands */
> > +#define ST7703_CMD_SETDISP 0xB2
> > +#define ST7703_CMD_SETRGBIF0xB3
> > +#define ST7703_CMD_SETCYC  0xB4
> > +#define ST7703_CMD_SETBGP  0xB5
> > +#define ST7703_CMD_SETVCOM 0xB6
> > +#define ST7703_CMD_SETOTP  0xB7
> > +#define ST7703_CMD_SETPOWER_EXT0xB8
> > +#define ST7703_CMD_SETEXTC 0xB9
> > +#define ST7703_CMD_SETMIPI 0xBA
> > +#define ST7703_CMD_SETVDC  0xBC
> > +#define ST7703_CMD_UNK_BF  0xBF
> > +#define ST7703_CMD_SETSCR  0xC0
> > +#define ST7703_CMD_SETPOWER0xC1
> > +#define ST7703_CMD_UNK_C6  0xC6
> > +#define ST7703_CMD_SETPANEL0xCC
> > +#define ST7703_CMD_RDID1   0xDA
> > +#define ST7703_CMD_RDID2   0xDB
> > +#define ST7703_CMD_RDID3   0xDC
> > +#define ST7703_CMD_SETGAMMA0xE0
> > +#define ST7703_CMD_SETEQ   0xE3
> > +#define ST7703_CMD_SETGIP1 0xE9
> > +#define ST7703_CMD_SETGIP2 0xEA
> > +
> > +struct st7703_panel_desc {
> > +   const struct drm_display_mode *mode;
> > +   unsigned int lanes;
> > +   unsigned long flags;
> > +   enum mipi_dsi_pixel_format format;
> > +   const char *const *supply_names;
> > +   unsigned int num_supplies;
> > +};
> > +
> > +struct st7703 {
> > +   struct device *dev;