[PATCH] staging: fbtft: add invert display parameter

Nam Cao namcao at linutronix.de
Wed May 28 20:25:18 UTC 2025


On Wed, May 28, 2025 at 05:42:30PM +0200, Bram Vlerick wrote:
> Add devicetree parameter to enable or disable the invert feature of the
> ili9341 display

Can't/shouldn't this be done by userspace application? Why would someone
want to invert the color by default.

Also, this driver is built on top of the deprecated framebuffer, it will
never get out of staging/. For new feature, you probably want to send it to
drivers/gpu/drm/panel/panel-ilitek-ili9341.c instead.

> Signed-off-by: Bram Vlerick <bram.vlerick at openpixelsystems.org>
> ---
>  drivers/staging/fbtft/fb_ili9341.c | 3 +++
>  drivers/staging/fbtft/fbtft-core.c | 2 ++
>  drivers/staging/fbtft/fbtft.h      | 3 +++
>  3 files changed, 8 insertions(+)
> 
> diff --git a/drivers/staging/fbtft/fb_ili9341.c b/drivers/staging/fbtft/fb_ili9341.c
> index 47e72b87d76d996111aaadcf5e56dfdfc1c331ab..a184f57df12b5ad6612a2e83b664a8911c7c79be 100644
> --- a/drivers/staging/fbtft/fb_ili9341.c
> +++ b/drivers/staging/fbtft/fb_ili9341.c
> @@ -103,6 +103,9 @@ static int set_var(struct fbtft_par *par)
>  		break;
>  	}
>  
> +	if (par->invert)
> +		write_reg(par, 0x21);

Use MIPI_DCS_ENTER_INVERT_MODE instead of the magic number.

Best regards,
Nam


More information about the dri-devel mailing list