From patchwork Fri May 19 17:03:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Weber X-Patchwork-Id: 684404 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6AF9C7EE26 for ; Fri, 19 May 2023 17:04:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231671AbjESREK (ORCPT ); Fri, 19 May 2023 13:04:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231661AbjESREJ (ORCPT ); Fri, 19 May 2023 13:04:09 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB7E4134; Fri, 19 May 2023 10:04:06 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-510e419d701so4285612a12.1; Fri, 19 May 2023 10:04:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684515845; x=1687107845; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+mWDhNT3SMFA+v1ZbZMYCZbkIn1/LuleqGRVWsB+Jow=; b=UgXVhO+5yZsmGzn0PFot/4Kn0BNDlg1KOqu2UR5vikznCDWWNxGVcSfLRebtAFH+zl NE4gH6s4NaMH3YCS2tgoUxoP2RbwmAEf6014WOXsrMUkK5yA8IOTgoNIAdzeMjOwbrf7 Ke8qQHwzvuXocaiYdS/CRP4P8kJ2aspVA5qspIlX/dmn2xalNa8xXK9qC8Yl1j4lqTVh 7fQ4RFsO0Ci7hwdE1P7uUN1fhHQ+TS51P8lzqfQtCoFjnmjOT6DthQttFMOL/yimCqjx VsGj9yjWpX6N9HiGRg7GhVygGHhdR2TgSLAII1Mn3fL27wb0EEFnsdthOeJfPV7Bl/Kq 8T5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684515845; x=1687107845; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+mWDhNT3SMFA+v1ZbZMYCZbkIn1/LuleqGRVWsB+Jow=; b=PEVfyrMhoa0L7AUci9tjzj7IUnDrlfYVKfsvYFpNF1zqACQ8QQl23McvqS7Taz3SYW K4S0W4kb8peJt/ckti6zoLbJCnXcyzNMS74Jt4ZnPVRQd21ougDiWeLAUYlFuN59ZaKD 83u3sJJuUttQ4xlyVS7rKC5/ihVgGo1+ccolOorwWrVktBQ8h5cC0Yo4cOt3Q1UkN7Bd SpPHO+Gr1APh60J1ByjXvCjn/TI7bNRzIU2Z6l9SFjPqdQGO02CdY1dSn1+myFOqXguy lDaSuxsdK10bRSuO9Phj6KIj3mD5t5pCY3qsXNR5fm2pLhPDkgft9zb+B9bMsf9xSx8f rrxg== X-Gm-Message-State: AC+VfDxZhSQMYq9LKmbBXcHYo/ESg03w4w7GNvqrSZN04NFklIJWgTO/ v6CVkiOodQ804yLj/6yCsHs= X-Google-Smtp-Source: ACHHUZ68FfQMml39vnCEAqx6gkR0pWqPv0Aw6UrHhiOl3YAVeJ5P1Bx2u1AKgk1c/hxs3SbehNACGA== X-Received: by 2002:a17:907:928b:b0:969:faf3:7dba with SMTP id bw11-20020a170907928b00b00969faf37dbamr2432478ejc.52.1684515844971; Fri, 19 May 2023 10:04:04 -0700 (PDT) Received: from localhost.my.domain (83.11.222.198.ipv4.supernova.orange.pl. [83.11.222.198]) by smtp.gmail.com with ESMTPSA id mf13-20020a170906cb8d00b00965ffb8407asm2489988ejb.87.2023.05.19.10.04.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 May 2023 10:04:04 -0700 (PDT) From: Artur Weber To: thierry.reding@gmail.com Cc: Sam Ravnborg , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Nikita Travkin , Neil Armstrong , Artur Weber Subject: [PATCH v5 2/3] drm/panel: Add Samsung S6D7AA0 panel controller driver Date: Fri, 19 May 2023 19:03:53 +0200 Message-Id: <20230519170354.29610-3-aweber.kernel@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230519170354.29610-1-aweber.kernel@gmail.com> References: <20230519170354.29610-1-aweber.kernel@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Initial driver for S6D7AA0-controlled panels. Currently, the following panels are supported: - S6D7AA0-LSL080AL02 (Samsung Galaxy Tab 3 8.0) - S6D7AA0-LSL080AL03 (Samsung Galaxy Tab A 8.0 2015) - S6D7AA0-LTL101AT01 (Samsung Galaxy Tab A 9.7 2015) It should be possible to extend this driver to work with other panels using this IC. Tested-by: Nikita Travkin #ltl101at01 Signed-off-by: Artur Weber --- Changed in v2: - Removed unused panel_name property from desc struct Changed in v4: - Added LSL080AL03 and LTL101AT01 panels - Added DSI-controlled backlight support for panels that support it - Renamed command defines: CMD_* -> MCS_* - Dropped s6d7aa0_bl_ctl_on (not universal across panels) - Dropped MIPI_DSI_MODE_LPM flag - Added vmipi-supply, renamed enable-supply to power-supply Changed in v5: - Changed compatible to avoid concatenating multiple model numbers --- drivers/gpu/drm/panel/Kconfig | 7 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c | 585 ++++++++++++++++++ 3 files changed, 593 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 2b9d6db7860b..203c0ef0bbfd 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -553,6 +553,13 @@ config DRM_PANEL_SAMSUNG_S6D27A1 This panel can be found in Samsung Galaxy Ace 2 GT-I8160 mobile phone. +config DRM_PANEL_SAMSUNG_S6D7AA0 + tristate "Samsung S6D7AA0 MIPI-DSI video mode panel controller" + depends on OF + depends on BACKLIGHT_CLASS_DEVICE + select DRM_MIPI_DSI + select VIDEOMODE_HELPERS + 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 ff169781e82d..30cf553c8d1d 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -54,6 +54,7 @@ obj-$(CONFIG_DRM_PANEL_SAMSUNG_DB7430) += panel-samsung-db7430.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_LD9040) += panel-samsung-ld9040.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6D16D0) += panel-samsung-s6d16d0.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6D27A1) += panel-samsung-s6d27a1.o +obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6D7AA0) += panel-samsung-s6d7aa0.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HA2) += panel-samsung-s6e3ha2.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03) += panel-samsung-s6e63j0x03.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0) += panel-samsung-s6e63m0.o diff --git a/drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c b/drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c new file mode 100644 index 000000000000..f532aa018428 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c @@ -0,0 +1,585 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Samsung S6D7AA0 MIPI-DSI TFT LCD controller drm_panel driver. + * + * Copyright (C) 2022 Artur Weber + */ + +#include +#include +#include +#include +#include +#include +#include + +#include