Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp1734942ima; Sat, 2 Feb 2019 06:30:44 -0800 (PST) X-Google-Smtp-Source: ALg8bN7p8W032QbNe6IPl1nUvIS6/aKGD/Cf5mApJ7vX4C4sdMOU+LCwZ7LxnS+Jp/2rRpnJ88w0 X-Received: by 2002:a62:9913:: with SMTP id d19mr43844370pfe.107.1549117844631; Sat, 02 Feb 2019 06:30:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549117844; cv=none; d=google.com; s=arc-20160816; b=euZa+whWSK1VoXQHexKJWXChFeVdO1DRH5RdQWJ11hQpTSehY3WvemH0Fe45UzqbEL 58s0twMBR75/wumMAy3JTogu9UN43HWhE384buk6EsnTi48eKddxPB8t92L4eoNBmchv FPnFtNEw6HugwZX4V121RHYHqgCClwGAfV+b6B4e4uhtut5Z9IrFUjJrMPLMz6+7Aesn LoMaxR3nTUzfQ02/6y0jbWIgxUswyruYrX7qxM/gOosHf+8185XDlOBiOBcMqQfGw+Jg /RxBy8928eVoCVKsxQgyvoFYLi0omk3kC3tx54qu5TqWRsn7IZ5YOk9OWsrcrbiJdl9s 6BHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PVlvuBNryTZzCAkXgNoDswPQu8rdyBzkBbB0v/SgJ4Q=; b=wRdZ6lDzuI61xhtarn6RFvwAcGmaTz3qaSViWZGS0Z6QkRAsyMgzxwyZIlSPTyByMd C+AnIxJjJoG8NGNCjHyMueGGgYu0EBcCh6FlqeFYkY2A4/uRjLssKKo//JSR9y/4q9+W 6CLSxR/UTCHZ0FAOCcp7o/uGL5vuOJrvEoAj09zbwyw/l4v0nQYFC9cdEg1Ly+uOGUe/ LjVp3w0GOkm/ZEwiKeM+uQUkrcqHBF1Sg/qzShDkIDYXzL7UCtuQTHjET/2ztB9KYLMv hmptWk1q+mrLUSae9ummw0AmgwsFlXvcLAJx2k319kW1Ky7HKojfuLtMaciqZafXoW6k 3jxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="AO/ORVfc"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a90si8022687plc.314.2019.02.02.06.30.28; Sat, 02 Feb 2019 06:30:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="AO/ORVfc"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727944AbfBBO17 (ORCPT + 99 others); Sat, 2 Feb 2019 09:27:59 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:45749 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725843AbfBBO17 (ORCPT ); Sat, 2 Feb 2019 09:27:59 -0500 Received: by mail-lj1-f196.google.com with SMTP id s5-v6so8165786ljd.12; Sat, 02 Feb 2019 06:27:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PVlvuBNryTZzCAkXgNoDswPQu8rdyBzkBbB0v/SgJ4Q=; b=AO/ORVfcHdSwX3ie7M5aTBv3NYKvksyzJ9rSL4daKmW9asEtPqnc3kbAsYuavtRi99 dOgBNU/uCMA1HFHVX9dvANzwjtLgrjcMbgzWKG8nu0TH87TkkzsFH0DWBCyJzDWzZKZI 4dpOVEEyIwcd0mRCoYXDB0nlEaXSXyzjw/fCDw/NX+NfRCZuOP406p0/mZLd2VoqLbjv ftGMTOQUcJpDwDT6Egsyxc977xFtYpgii74KGJsISycpYQAWhFjDkp/a9T5n667hyouq OTHqULzetnuE6qGJlyORzyKCoa2EBycFummudueJFV8F/BtoofdfJTT1EnwN1fvl6AG7 sC2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PVlvuBNryTZzCAkXgNoDswPQu8rdyBzkBbB0v/SgJ4Q=; b=b2Ej1miZd6G2GIH5D03QssdgEoPeVgWpMrY71TYLr5ebaib52/d73YGXK3SMPFV3Ex BpOHCAsYxBC1ZsOB9+Pv+eRgtEHwAwD14oQY2tP+tU7WU4JlXDiB4Ci5pdxP/Z6DcnOn K+ZQzbqDUA+AZS9q+yLKiffRW+NgtPv6jK9tgayp5Rq9oRCgxeLUTm5g0Lh5CyngNmal HqOL1d0QeEtPDBXJcJ46BFZtCt/gLPQTEkfb1JRGUqVPE8P5tAmuk1AhW8qUv98amZIC XXzD7MXyXZzB1XbyyDi2WDqRaOelztudmUhxy/N5lz0Spl0x34bBIHpZHK/6rm9wd7/d 4zAQ== X-Gm-Message-State: AJcUukc076dmZP/C9d/OO1gyYZXN7dNeV0qSpHL9sP3HYW1LmD38BeKf eilhCjJ2eRo7qnItUkLpscA= X-Received: by 2002:a2e:86ca:: with SMTP id n10-v6mr30898087ljj.49.1549117675084; Sat, 02 Feb 2019 06:27:55 -0800 (PST) Received: from localhost.localdomain ([2a02:a315:5445:5300:6cb2:9e25:2436:6eda]) by smtp.googlemail.com with ESMTPSA id v9sm1937963lfg.15.2019.02.02.06.27.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Feb 2019 06:27:54 -0800 (PST) From: =?UTF-8?q?Pawe=C5=82=20Chmiel?= To: thierry.reding@gmail.com Cc: airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, mark.rutland@arm.com, m.szyprowski@samsung.com, krzk@kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Pawe=C5=82=20Chmiel?= Subject: [PATCH v3 2/2] drm/panel: Add driver for Samsung S6E63M0 panel Date: Sat, 2 Feb 2019 15:27:48 +0100 Message-Id: <20190202142748.6830-2-pawel.mikolaj.chmiel@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190202142748.6830-1-pawel.mikolaj.chmiel@gmail.com> References: <20190202142748.6830-1-pawel.mikolaj.chmiel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds Samsung S6E63M0 AMOLED LCD panel driver, connected over spi. It's based on already removed, non dt s6e63m0 driver and panel-samsung-ld9040. It can be found for example in some of Samsung Aries based phones. Signed-off-by: Paweł Chmiel Reviewed-by: Sam Ravnborg --- Changes from v2: - VIDEOMODE_HELPERS is not needed in Kconfig - Added help text to Kconfig - Remove unneeded videomode includes/fields - Add sentinel comment in s6e63m0_of_match struct - Handle errors during registration of backlight device. We shouldn't register panel if we fail to register backlight device - Added Reviewed-by Changes from v1: - Correct order of Kconfig/Makefile entry - Fix SPDX tag, so it matches value of MODULE_LICENSE - Remove inclusion of drmP.h - Fix code formatting - Use DRM_DEV_ERROR/DEBUG - Extract hardcoded values - Remove possibility to change gamma through sysfs, leaving only one gamma table values - Fix reset_gpio handling, so it'll be asserted in power_on and deasserted in power_off. Also do it before turning voltage on. - Disable backlight and enter sleep mode in disable callback. Previously it was done in unprepare - Enable display and backlight in enable callback. Previously it was done in prepare - Hardcode display timings and delays. Previously they were readed from device tree - We're using SPDX, so we don't need to have license body - Use MIPI_DCS_EXIT_SLEEP_MODE and MIPI_DCS_SET_DISPLAY_ON - Rename MAX_GAMMA_LEVEL to NUM_GAMMA_LEVELS - Ommit get_brightness callback - Use backlight_enable/disable API, like it's done in other panel drivers (for example panel-simple) - Make set_brightness called only from backlight api, like it's done in other panel drivers (for example panel-simple). - Reset gpio should be set to GPIOD_OUT_HIGH. It's declared as active low in device tree - Don't call power_off in remove callback --- drivers/gpu/drm/panel/Kconfig | 9 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-samsung-s6e63m0.c | 517 ++++++++++++++++++ 3 files changed, 527 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-samsung-s6e63m0.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 3f3537719beb..45e9ab4b7857 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -158,6 +158,15 @@ config DRM_PANEL_SAMSUNG_S6E63J0X03 depends on BACKLIGHT_CLASS_DEVICE select VIDEOMODE_HELPERS +config DRM_PANEL_SAMSUNG_S6E63M0 + tristate "Samsung S6E63M0 RGB/SPI panel" + depends on OF + depends on SPI + depends on BACKLIGHT_CLASS_DEVICE + help + Say Y here if you want to enable support for Samsung s6e63m0 + AMOLED LCD panel. + config DRM_PANEL_SAMSUNG_S6E8AA0 tristate "Samsung S6E8AA0 DSI video mode panel" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 4396658a7996..4507a2d253ac 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -16,6 +16,7 @@ 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_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 obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0) += panel-samsung-s6e8aa0.o obj-$(CONFIG_DRM_PANEL_SEIKO_43WVF1G) += panel-seiko-43wvf1g.o obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c new file mode 100644 index 000000000000..4312aa3e4386 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c @@ -0,0 +1,517 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * S6E63M0 AMOLED LCD drm_panel driver. + * + * Copyright (C) 2019 Paweł Chmiel + * Derived from drivers/gpu/drm/panel-samsung-ld9040.c + * + * Andrzej Hajda + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include