Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp479325pxb; Thu, 12 Nov 2020 08:23:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJx+UXdLSejoz9EuvjPsC1qxvuWdj5pei5FzJilX5MX/a4JldPwfLb+eqebKqgX1rK0bj8gP X-Received: by 2002:a17:906:5841:: with SMTP id h1mr54754ejs.342.1605198219694; Thu, 12 Nov 2020 08:23:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605198219; cv=none; d=google.com; s=arc-20160816; b=oQ4qlOBZGAA4zWadF7U885Qy9WPBUZJrV8JnChjxH8HjqYckkbj9KmyeUtCFQKvLAf leXdv37N9Q2F8Ft/sa4iAM1oen27hL53RyBLqQn4DmCFOUKCYTpcVgDG5noZndFAls3o Epfq0TpH7UWbr3t5U0pIMZHrKv40H4gI+6TOIagpScvxGEwSSRI0Y/VIFTbjAkwcTM3T kxJNEQTZRtx6/JhmdrOapgq1apdaL4DmvIlSgoZOr+p3NZziAgqpWuqzlU8O8bMOYmuF 9O5sbJ8e/fsYWr51E5aVqVJRUKLlO3eV+7htsXwjcjJPaaYYY6iauSMwjBojCVz1gpc3 BlgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:reply-to:cc:from:to :dkim-signature:date; bh=OX0uNZ/OkPeX422zzpXH+Id8u6JoteSOQcBLBHoP/No=; b=iEHEvqxl10vkH35MUmUn3jTBxAydOesSMArA6Cl1ine6twL5UmXcG85HS10a7ima8X RkbFSLauA/YHQPeInKlkR5RD0TfAHvg98OT4tX9g5pvK4u/mbc5chc/EamrZq7++x2sO 0ZbtwWd5kaEL02FKvdjVQ0qeUudcfxB0n3jC9ziYJ3+IPYXfuS3kBzSv4UxyhUKF08GD zhFvqejF9eM8ShMAQAmycHsfLeJ2s0Yyab+XOtoZelFxbsfhyoKGom+rL3EJsN00c3zm N0pqVgJGfC5bN1nA1/KVQkIdY82tdY7Pc3mwC7w8z25Eg4aPkhL72FEC8YCLRq2FhoAL OPVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@connolly.tech header.s=protonmail header.b=L38i1ruQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=connolly.tech Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i22si3874664ejh.318.2020.11.12.08.23.14; Thu, 12 Nov 2020 08:23:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@connolly.tech header.s=protonmail header.b=L38i1ruQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=connolly.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728964AbgKLQV3 (ORCPT + 99 others); Thu, 12 Nov 2020 11:21:29 -0500 Received: from mail-03.mail-europe.com ([91.134.188.129]:52578 "EHLO mail-03.mail-europe.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728898AbgKLQV2 (ORCPT ); Thu, 12 Nov 2020 11:21:28 -0500 Date: Thu, 12 Nov 2020 16:21:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=connolly.tech; s=protonmail; t=1605198081; bh=OX0uNZ/OkPeX422zzpXH+Id8u6JoteSOQcBLBHoP/No=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=L38i1ruQd1Hp1BqC2C4XXz4GwPjd9r7DUTY7vLiptzO7SIV78W5NW0BgsONBtbIZB lpGqIDmy/+aOq0jMQMwXoacm/Qf4lLb4HAF9r/pD3qYedXixjxfeULGPckgm5Kpgiq xf62Ld0oXmAII4dGREgbVnVZa5UWLuJqRHw5xisw= To: linux-arm-msm@vger.kernel.org, Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter From: Caleb Connolly Cc: phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Caleb Connolly , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Reply-To: Caleb Connolly Subject: [PATCH 1/5] drm/panel/samsung-sofef00: Add panel for OnePlus 6/T devices Message-ID: <20201112161920.2671430-2-caleb@connolly.tech> In-Reply-To: <20201112161920.2671430-1-caleb@connolly.tech> References: <20201112161920.2671430-1-caleb@connolly.tech> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The OnePlus 6/T devices use different panels however they are functionally identical with the only differences being the resolution. The panels also don't seem to be used by any other devices, just combine them into one driver. The panels are: samsung,sofef00 and samsung,s6e3fc2x01 Signed-off-by: Caleb Connolly --- Changes since v1: * Rename driver to samsung-sofef00 rather than be device specific. * Make use of drm_panel backlight, simplifying the driver. * Make reset function do a full reset, instead of simply taking the panel out of reset. * Removed get_brightness function as it doesn't return correct data. --- drivers/gpu/drm/panel/Kconfig | 12 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-samsung-sofef00.c | 353 ++++++++++++++++++ 3 files changed, 366 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-samsung-sofef00.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index b9dbedf8f15e..c4486b6b4e5a 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -361,6 +361,18 @@ config DRM_PANEL_SAMSUNG_S6E8AA0 =09select DRM_MIPI_DSI =09select VIDEOMODE_HELPERS =20 +config DRM_PANEL_SAMSUNG_SOFEF00 +=09tristate "Samsung sofef00/s6e3fc2x01 OnePlus 6/6T DSI cmd mode panels" +=09depends on OF +=09depends on DRM_MIPI_DSI +=09depends on BACKLIGHT_CLASS_DEVICE +=09select VIDEOMODE_HELPERS +=09help +=09 Say Y or M here if you want to enable support for the Samsung AMOLED +=09 command mode panels found in the OnePlus 6/6T smartphones. + +=09 The panels are 2280x1080@60Hz and 2340x1080@60Hz respectively + config DRM_PANEL_SEIKO_43WVF1G =09tristate "Seiko 43WVF1G panel" =09depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefil= e index 2ba560bca61d..ebb67f3de10e 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -38,6 +38,7 @@ obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0_SPI) +=3D panel-sa= msung-s6e63m0-spi.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0_DSI) +=3D panel-samsung-s6e63m0-dsi= .o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E88A0_AMS452EF01) +=3D panel-samsung-s6e8= 8a0-ams452ef01.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0) +=3D panel-samsung-s6e8aa0.o +obj-$(CONFIG_DRM_PANEL_SAMSUNG_SOFEF00) +=3D panel-samsung-sofef00.o obj-$(CONFIG_DRM_PANEL_SEIKO_43WVF1G) +=3D panel-seiko-43wvf1g.o obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) +=3D panel-sharp-lq101r1sx01.o obj-$(CONFIG_DRM_PANEL_SHARP_LS037V7DW01) +=3D panel-sharp-ls037v7dw01.o diff --git a/drivers/gpu/drm/panel/panel-samsung-sofef00.c b/drivers/gpu/dr= m/panel/panel-samsung-sofef00.c new file mode 100644 index 000000000000..84b4f4cb2e6f --- /dev/null +++ b/drivers/gpu/drm/panel/panel-samsung-sofef00.c @@ -0,0 +1,353 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* Copyright (c) 2020 Caleb Connolly + * Generated with linux-mdss-dsi-panel-driver-generator from vendor device= tree: + * Copyright (c) 2020, The Linux Foundation. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include