Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp327947rbb; Sat, 24 Feb 2024 02:16:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUhyZ6oxhKXb4anixHPONEDweNSMgJHIKPyQhPZcOk32slrczkFbcemCBLTHEug6qbayi4FqLQ0EdWAU8ycy2k+jcRrI5FoOGCUy1UhaQ== X-Google-Smtp-Source: AGHT+IE7/vIO1c7/eBPvri5zIyUJ2Obz4Dder+wJfC3k5umHR5Crf5HnU0wPvUWxeCt44Bz51tix X-Received: by 2002:a05:6512:1326:b0:512:da77:6f2a with SMTP id x38-20020a056512132600b00512da776f2amr1557328lfu.53.1708769819725; Sat, 24 Feb 2024 02:16:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708769819; cv=pass; d=google.com; s=arc-20160816; b=ATvABGs0xdXcQPlEDkIGOGfA/BW/1BgSc4RBCJDO6R7ooO7v5plUeQGuF6CSIkWcya tQD48NmOnkCRvgbTgPewdSTAE0HHWG9SBRQRhWsHiMSrjZnOQDVbDogDpy/D2FDbE6eL aEDogx9uwIbr7Pqwj0Q0NToHy6IJJ06rNgRFIHec+ZZ3vks63J2RzLiR+ZYK32ix7lqJ GxGY/DDhWZz9Rda4YbSK+pPSZqeGkUeTHHeVaBcR0feOjPozB0dyBEx8F6oyU5MkSVvo 9rA6+KaFm2pcTJimggPikPUb5t6OFRaVw8r1OPt4nopwjivHMc+UzV7o/5yPV1X3WPBL 3Sig== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=D2ZXF0iZo/6iAjeOarlGvbT9yJV0/dj7cjkGOEKn2Lw=; fh=bnAFHUwQZjjGsAbWm/qOrb1LYcxzcFaadDpDmogL2I8=; b=QSKPAZHk22vr4GRyIP9i9AH7Nh0adPOrQsSr/flYqLrz19UVuJ9ToQujH9HGNp6dY6 C8BJCXlSQJCVzywAWpMRw+vNEkA+iRW9ERF3scehNtjxXcjm+gXzeOd/HdcAe71K4e1K URZr+Z0HeX/ieGd3n4QbQc9KV2RZHcbbO3u3957jSrULZICZcJi7Wclnv8w7WAm5nKQW jDSy2Xsg4PAlqTy90T7pX8bmjyMMbiLKLOZzy90454eNulR2500MG52l8hW2HxqL3cEk cM3taI3eSm8XPP1/UyhN2h6wuRqc+WM85AyTIPC0uJjDP8I2JzkLGQkzHY/l90N3xs7Z u4Ow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="PltfZ/dg"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-79558-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79558-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id v14-20020a170906338e00b00a3eeadef5adsi376235eja.789.2024.02.24.02.16.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 02:16:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79558-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="PltfZ/dg"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-79558-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79558-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 44B2D1F22721 for ; Sat, 24 Feb 2024 10:16:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 151AA3F9C3; Sat, 24 Feb 2024 10:15:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PltfZ/dg" Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36A693EA8A; Sat, 24 Feb 2024 10:15:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708769728; cv=none; b=SRlUS77PuYAmrWXIXYUMQuN4RJ0S5Om0GyYXirxO3+RE3XRbSpMPH/yclAN8qaLoB2abRdFnMRr46W7cpU6m7ykBRyL92OL6rKqXRNJsqgOjPti5NyWuq6P9HAO6A1TmNfsRr7JxsDEHBYoyZ3u25cMfYU4CeWDbzwozQQpF2k4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708769728; c=relaxed/simple; bh=Oq6f4EUAeMtUNAncKQaFBl9MwPBf6Bhnx70XCRpCmPs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WDIo3OVAsN3EbYd1eedl/FKtJPovV34vgpVB9u5mXCHuj1WN6iY8nhYLGsx/Y+CWVW/SEHvxLzZGk/f4h38t9vKV1QXtIsAneoQrcFc0WA21+ofTiVrF13VsW1iDlwRveVY/rrnq9twEYTphZeCx9zVSYon+ORfWz9GuWkAdPos= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PltfZ/dg; arc=none smtp.client-ip=209.85.218.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-a3d484a58f6so230021466b.3; Sat, 24 Feb 2024 02:15:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708769724; x=1709374524; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=D2ZXF0iZo/6iAjeOarlGvbT9yJV0/dj7cjkGOEKn2Lw=; b=PltfZ/dglFuakAQBqGHgH6JCOcSfPcqRrymcTohSCBWlXjeFu9oLzQ05sFpaNa4+4x 3OmVeFznd0iYT4IVqwjhLxsgOP7Vxu4XGn65QqbpcDoYXZ5AEQtDDuBbThiTWw6X6sMp 4k1cJyhhoWMcuEb0RM0YY5bHcafrkwFg1OUFtsOeAw86YSMvhBBilIkklZlnN/bZWTTe YZ7Pvj6+eyxyJtpawbJp/8eJzP+rcmFc5OSa5hkKeU2dbHJ+jSJ/3jFTUbE0w/pZkV63 pxfdLKBTTng2VFjeY1fwvkH9hBzhGHa2saTpXVhDSeVtfkuF5IdmhRu8UPycrdyV+gGB TVDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708769724; x=1709374524; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=D2ZXF0iZo/6iAjeOarlGvbT9yJV0/dj7cjkGOEKn2Lw=; b=mPFS07wDOUpamf4ez03D3bBrwdseDvtzruNVNdIi766UK9TSxIZ2VbnVntQswdKXt6 HfoznjAJK8LVIzGXUcVGEyOecaHquvofMpWSCDgjPhhCfy7qGCOKzJSTcjULNcr7B/oi Lm68B1PlU7UwDRCiixHyiqaXNs+TZWEPa6OWVmIKI7NG7epnx6rxc87PGsvJq0FGJzK1 AONZbjNxzm087MQsP6H5ucQ1nY1kY+9qLU0X17/kQI0T89Jgh71EGbKSd3dJ5pWt64DL gont+OQtfoNHvBm1PkojnR89px3p9o9v87YLO4Y5859BXKYWAVvOpayz+3z2Qjr8dcl/ c9Sg== X-Forwarded-Encrypted: i=1; AJvYcCWhb5eNTqtrhy5h+zd7DpIki59lbVW5N+cT1ty7XEV+Yb23o3GOaV4IgwtecHzrbiq8YyHfKrLWKj6+TzpoNfa4OUYVrL3w3uqEyz7KGeYRirF7+0GSzWlv5fi7xM3KyPyq+k6reHb7FQ== X-Gm-Message-State: AOJu0YxexTZYHHr8CuosVdUb8lUBi45rtNk8V3KGMIlVJSWe3eJDpJt2 sCuETY159K0oRPrsMLdZTAYcNJjbXS7uai/xUdcx9nXeiUM+doeL X-Received: by 2002:a17:906:2508:b0:a3e:4f8b:bcc5 with SMTP id i8-20020a170906250800b00a3e4f8bbcc5mr1366807ejb.34.1708769724211; Sat, 24 Feb 2024 02:15:24 -0800 (PST) Received: from mehdi-archlinux ([45.156.240.98]) by smtp.gmail.com with ESMTPSA id lv21-20020a170906bc9500b00a3fd98237aasm447906ejb.156.2024.02.24.02.15.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 02:15:23 -0800 (PST) Date: Sat, 24 Feb 2024 11:15:19 +0100 From: Mehdi Djait To: Thomas Zimmermann Cc: Mehdi Djait , mripard@kernel.org, maarten.lankhorst@linux.intel.com, airlied@gmail.com, daniel@ffwll.ch, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, alexandre.belloni@bootlin.com, luca.ceresoli@bootlin.com, paul.kocialkowski@bootlin.com, dri-devel@lists.freedesktop.org, geert@linux-m68k.org Subject: Re: [PATCH 2/2] drm/tiny: Add driver for the sharp LS027B7DH01 Memory LCD Message-ID: References: <71a9dbf4609dbba46026a31f60261830163a0b99.1701267411.git.mehdi.djait@bootlin.com> <078cdd6f-7b38-497d-8480-00569c63f843@suse.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <078cdd6f-7b38-497d-8480-00569c63f843@suse.de> Hi Thomas, Thank you for the review. On Wed, Nov 29, 2023 at 05:21:19PM +0100, Thomas Zimmermann wrote: > Hi, > > thanks for the patches. > > Am 29.11.23 um 15:29 schrieb Mehdi Djait: > > Introduce a DRM driver for the sharp LS027B7DH01 Memory LCD. > > > > LS027B7DH01 is a 2.7" 400x240 monochrome display connected to a SPI bus. > > The drivers implements the Multiple Lines Data Update Mode. > > External COM inversion is enabled using a PWM signal as input. > > > > Signed-off-by: Mehdi Djait > > --- > > MAINTAINERS | 7 + > > drivers/gpu/drm/tiny/Kconfig | 8 + > > drivers/gpu/drm/tiny/Makefile | 1 + > > drivers/gpu/drm/tiny/sharp-ls027b7dh01.c | 411 +++++++++++++++++++++++ > > 4 files changed, 427 insertions(+) > > create mode 100644 drivers/gpu/drm/tiny/sharp-ls027b7dh01.c > > > > diff --git a/MAINTAINERS b/MAINTAINERS > > index 012df8ccf34e..fb859698bd3d 100644 > > --- a/MAINTAINERS > > +++ b/MAINTAINERS > > @@ -6832,6 +6832,13 @@ S: Maintained > > F: Documentation/devicetree/bindings/display/panel/samsung,s6d7aa0.yaml > > F: drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c > > +DRM DRIVER FOR SHARP LS027B7DH01 Memory LCD > > +M: Mehdi Djait > > +S: Maintained > > +T: git git://anongit.freedesktop.org/drm/drm-misc > > +F: Documentation/devicetree/bindings/display/sharp,ls027b7dh01.yaml > > +F: drivers/gpu/drm/tiny/sharp-ls027b7dh01.c > > + > > DRM DRIVER FOR SITRONIX ST7586 PANELS > > M: David Lechner > > S: Maintained > > diff --git a/drivers/gpu/drm/tiny/Kconfig b/drivers/gpu/drm/tiny/Kconfig > > index f6889f649bc1..a2ade06403ca 100644 > > --- a/drivers/gpu/drm/tiny/Kconfig > > +++ b/drivers/gpu/drm/tiny/Kconfig > > @@ -186,6 +186,14 @@ config TINYDRM_REPAPER > > If M is selected the module will be called repaper. > > +config TINYDRM_SHARP_LS027B7DH01 > > + tristate "DRM support for SHARP LS027B7DH01 display" > > + depends on DRM && SPI > > + select DRM_KMS_HELPER > > + select DRM_GEM_DMA_HELPER > > + help > > + DRM driver for the SHARP LS027B7DD01 LCD display. > > + > > config TINYDRM_ST7586 > > tristate "DRM support for Sitronix ST7586 display panels" > > depends on DRM && SPI > > diff --git a/drivers/gpu/drm/tiny/Makefile b/drivers/gpu/drm/tiny/Makefile > > index 76dde89a044b..b05df3afb231 100644 > > --- a/drivers/gpu/drm/tiny/Makefile > > +++ b/drivers/gpu/drm/tiny/Makefile > > @@ -14,5 +14,6 @@ obj-$(CONFIG_TINYDRM_ILI9341) += ili9341.o > > obj-$(CONFIG_TINYDRM_ILI9486) += ili9486.o > > obj-$(CONFIG_TINYDRM_MI0283QT) += mi0283qt.o > > obj-$(CONFIG_TINYDRM_REPAPER) += repaper.o > > +obj-$(CONFIG_TINYDRM_SHARP_LS027B7DH01) += sharp-ls027b7dh01.o > > obj-$(CONFIG_TINYDRM_ST7586) += st7586.o > > obj-$(CONFIG_TINYDRM_ST7735R) += st7735r.o > > diff --git a/drivers/gpu/drm/tiny/sharp-ls027b7dh01.c b/drivers/gpu/drm/tiny/sharp-ls027b7dh01.c > > new file mode 100644 > > index 000000000000..2f58865a5c78 > > --- /dev/null > > +++ b/drivers/gpu/drm/tiny/sharp-ls027b7dh01.c > > @@ -0,0 +1,411 @@ > > +// SPDX-License-Identifier: GPL-2.0 > > +/* > > + * Sharp LS027B7DH01 Memory Display Driver > > + * > > + * Copyright (C) 2023 Andrew D'Angelo > > + * Copyright (C) 2023 Mehdi Djait > > + * > > + * The Sharp Memory LCD requires an alternating signal to prevent the buildup of > > + * a DC bias that would result in a Display that no longer can be updated. Two > > + * modes for the generation of this signal are supported: > > + * > > + * Software, EXTMODE = Low: toggling the BIT(1) of the Command and writing it at > > + * least once a second to the display. > > + * > > + * Hardware, EXTMODE = High: the alternating signal should be supplied on the > > + * EXTCOMIN pin. > > + * > > + * In this driver the Hardware mode is implemented with a PWM signal. > > + */ > > + > > +#include > > +#include > > +#include > > +#include > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#define CMD_WRITE BIT(0) > > +#define CMD_CLEAR BIT(2) > > + > > +struct sharp_ls027b7dh01 { > > + struct spi_device *spi; > > + > > + struct drm_device drm; > > + struct drm_connector connector; > > + struct drm_simple_display_pipe pipe; > > Could you please replace the simple pipe and its helpers with regular > DRMhelpers. It should no tbe used in new drivers. It's an unnecessary > indirection. Replacing is simple: copy the content of the data structure and > its helpers into the driver. Maybe clean up the result, if necessary. Could you please further explain where to copy the helper functions or give me an example driver ? This is my first DRM driver and grepping did not help me much. (Sorry for the delayed response) -- Kind Regards Mehdi Djait