From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6DFB8C56201 for ; Thu, 12 Nov 2020 16:21:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ED77E20936 for ; Thu, 12 Nov 2020 16:21:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=connolly.tech header.i=@connolly.tech header.b="L38i1ruQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728939AbgKLQV3 (ORCPT ); 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 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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