mbox series

[v2,0/2] Samsung s6e3fc2x01 panel driver for OnePlus 6T

Message ID 20221007111442.51481-1-a5b6@riseup.net
Headers show
Series Samsung s6e3fc2x01 panel driver for OnePlus 6T | expand

Message

Nia Espera Oct. 7, 2022, 11:14 a.m. UTC
This patch series adds proper support for the panel used in OnePlus 6T
smartphones (s6e3fc2x01). Previously, the panel relied on the driver
used by the sofef00 panel which failed to properly initialise it after
a reset.

Nia Espera (2):
  drivers: gpu: drm: add driver for samsung s6e3fc2x01 cmd mode panel
  drivers: gpu: drm: remove support for sofef00 driver on s6e3fc2x01
    panel

 MAINTAINERS                                   |   5 +
 drivers/gpu/drm/panel/Kconfig                 |  17 +-
 drivers/gpu/drm/panel/Makefile                |   1 +
 .../gpu/drm/panel/panel-samsung-s6e3fc2x01.c  | 396 ++++++++++++++++++
 drivers/gpu/drm/panel/panel-samsung-sofef00.c |  18 -
 5 files changed, 416 insertions(+), 21 deletions(-)
 create mode 100644 drivers/gpu/drm/panel/panel-samsung-s6e3fc2x01.c

Comments

Alexey Minnekhanov Oct. 8, 2022, 12:28 a.m. UTC | #1
Hi,

On 07.10.2022 14:14, Nia Espera wrote:

> +
> +#define dsi_dcs_write_seq(dsi, seq...) do {				\
> +		static const u8 d[] = { seq };				\
> +		int ret;						\
> +		ret = mipi_dsi_dcs_write_buffer(dsi, d, ARRAY_SIZE(d));	\
> +		if (ret < 0)						\
> +			return ret;					\
> +	} while (0)
> +

There is now a standard macro for this - mipi_dsi_dcs_write_seq() [1] , 
so you don't need to reinvent it.

> +static void samsung_s6e3fc2x01_reset(struct samsung_s6e3fc2x01 *ctx)
> +{
> +	gpiod_set_value_cansleep(ctx->reset_gpio, 0);
> +	usleep_range(5000, 6000);
> +	gpiod_set_value_cansleep(ctx->reset_gpio, 1);
> +	usleep_range(2000, 3000);
> +	gpiod_set_value_cansleep(ctx->reset_gpio, 0);
> +	usleep_range(10000, 11000);
> +}

There is a high chance that first gpiod_set_value() is not needed, only 
the last 2.

[1] https://elixir.bootlin.com/linux/latest/C/ident/mipi_dsi_dcs_write_seq