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 15D11C433EF for ; Sun, 21 Nov 2021 03:50:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237899AbhKUDxS (ORCPT ); Sat, 20 Nov 2021 22:53:18 -0500 Received: from mail-0301.mail-europe.com ([188.165.51.139]:40261 "EHLO mail-0301.mail-europe.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237884AbhKUDxQ (ORCPT ); Sat, 20 Nov 2021 22:53:16 -0500 Date: Sun, 21 Nov 2021 03:50:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1637466608; bh=XpEBgdlM09HjmAZhScWwGpU2Xf/z2jThaEqQ3MdHN8A=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=Etp8TE+ZigcIgNkfcNco9lPr7Uk7MduJg94gwDHFxPsJZwU//jXZIKh3wbsc+v7OC l/1VTeNzqGqQQI3s6zku04Y0BWV0oYOCh74faYbp0NTSueV/4FoFPqtEzpM4NYhEap LZs4ceJ5AhLz8wbzPk3MKK4i3rdgTIyJ7a7/WaV8= To: Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , Rob Herring From: Yassine Oudjana Cc: Yassine Oudjana , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, linux-kernel@vger.kernel.org Reply-To: Yassine Oudjana Subject: [PATCH v3 2/2] drm/panel: Add driver for LG.Philips SW43101 DSI video mode panel Message-ID: <20211121034748.158296-3-y.oudjana@protonmail.com> In-Reply-To: <20211121034748.158296-1-y.oudjana@protonmail.com> References: <20211121034748.158296-1-y.oudjana@protonmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a driver for the LG.Philips SW43101 FHD (1080x1920) OLED DSI video mode= panel. This driver has been generated using linux-mdss-dsi-panel-driver-generator. Signed-off-by: Yassine Oudjana --- Changes since v2: - Make the DT schema patch first in the series. - Use backlight_get_brightness where needed. - Remove 0xff mask from return value in sw43101_bl_get_brightness. - Constify struct backlight_properties props in sw43101_create_backlight. Changes since v1: - Add regulator support. - Add MAINTAINERS entry. - Dual-license DT binding. MAINTAINERS | 1 + drivers/gpu/drm/panel/Kconfig | 10 + drivers/gpu/drm/panel/Makefile | 1 + .../gpu/drm/panel/panel-lgphilips-sw43101.c | 358 ++++++++++++++++++ 4 files changed, 370 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-lgphilips-sw43101.c diff --git a/MAINTAINERS b/MAINTAINERS index b096425e3c01..d987bb703863 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -6006,6 +6006,7 @@ DRM DRIVER FOR LG.PHILIPS SW43101 PANEL M:=09Yassine Oudjana S:=09Maintained F:=09Documentation/devicetree/bindings/display/panel/lgphilips,sw43101.yam= l +F:=09drivers/gpu/drm/panel/panel-lgphilips-sw43101.c =20 DRM DRIVER FOR LVDS PANELS M:=09Laurent Pinchart diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index cfc8d644cedf..5157689fa3e6 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -238,6 +238,16 @@ config DRM_PANEL_SAMSUNG_LD9040 =09depends on OF && SPI =09select VIDEOMODE_HELPERS =20 +config DRM_PANEL_LGPHILIPS_SW43101 +=09tristate "LG.Philips SW43101 DSI video mode panel" +=09depends on OF +=09depends on DRM_MIPI_DSI +=09depends on BACKLIGHT_CLASS_DEVICE +=09help +=09 Say Y here if you want to enable support for the LG.Philips SW43101 F= HD +=09 (1080x1920) OLED DSI video mode panel found on the Xiaomi Mi Note 2. +=09 To compile this driver as a module, choose M here. + config DRM_PANEL_LG_LB035Q02 =09tristate "LG LB035Q024573 RGB panel" =09depends on GPIOLIB && OF && SPI diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefil= e index bca4cc1f2715..605954e2de70 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -21,6 +21,7 @@ obj-$(CONFIG_DRM_PANEL_KHADAS_TS050) +=3D panel-khadas-ts= 050.o obj-$(CONFIG_DRM_PANEL_KINGDISPLAY_KD097D04) +=3D panel-kingdisplay-kd097d= 04.o obj-$(CONFIG_DRM_PANEL_LEADTEK_LTK050H3146W) +=3D panel-leadtek-ltk050h314= 6w.o obj-$(CONFIG_DRM_PANEL_LEADTEK_LTK500HD1829) +=3D panel-leadtek-ltk500hd18= 29.o +obj-$(CONFIG_DRM_PANEL_LGPHILIPS_SW43101) +=3D panel-lgphilips-sw43101.o obj-$(CONFIG_DRM_PANEL_LG_LB035Q02) +=3D panel-lg-lb035q02.o obj-$(CONFIG_DRM_PANEL_LG_LG4573) +=3D panel-lg-lg4573.o obj-$(CONFIG_DRM_PANEL_NEC_NL8048HL11) +=3D panel-nec-nl8048hl11.o diff --git a/drivers/gpu/drm/panel/panel-lgphilips-sw43101.c b/drivers/gpu/= drm/panel/panel-lgphilips-sw43101.c new file mode 100644 index 000000000000..5b5b3fad1ab2 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-lgphilips-sw43101.c @@ -0,0 +1,358 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * LG.Philips SW43101 OLED Panel driver + * Generated with linux-mdss-dsi-panel-driver-generator + * + * Copyright (c) 2020 Yassine Oudjana + */ + +#include +#include +#include +#include +#include +#include + +#include