Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp730571ima; Fri, 1 Feb 2019 10:05:17 -0800 (PST) X-Google-Smtp-Source: AHgI3IZMDMsUlhCMvicVDpnIoXAIfiiywJSJV7ewthJcRZN1bLHP63men6oZvA3mDH8NWH91yo1w X-Received: by 2002:a17:902:eb03:: with SMTP id cw3mr10491507plb.130.1549044317557; Fri, 01 Feb 2019 10:05:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549044317; cv=none; d=google.com; s=arc-20160816; b=BCxxffyaLBBh/Ba5Ys69G0K2o47zO7xljMX3Dxg5co9HDssAzBLOuYRpgc+AUYtyDm 1YYxalCEKDm67vnhaCfsJS0fZR6lJroiLP7D8M/rcemMNuGMQawFqPbnsIidxssum+x7 EN15rawyB1598sGA8Hw6IRegZWfatgSJuiW6AoSR3G6Lk9wC9PtSjnW7E5Zjlp4bWEjA Z9S6TxB69/5FZ52EreKi2mU+sUvvFawiLEWiVxFBRzHMeCI8g7Ty7ZQ0L8i5+52UZmR2 9kHNGzsXFdFdbFr1yAsv54ZQmP0ypVI82/rTZQFL2MLuAc09GWecNERvfg4k2tAy7s3S 1Vaw== 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=BXx5ppy3Cxa8ue+r2iDJAtbQ20DIPseQM6vRxnwyhkg=; b=ItduMNaJ1yIraGi2TwbwCoIskfo4y9LpSHdrEj6v61K1D/ZShEs/0V/qM0kkcFZ8WE FfoVruSGLeushBNZba4S8qhskiSMJq+C0uHQ2EFd+DD5nUIxXdzhJSqG+WR8Jf4meEjy +0rR5SA0wS7nAI8EgP+k6eh9AqRrhbgdG5z5azyMvEdnvG99usy+DfSMcOXF8RVjc4Qp n36Rtc59Ta/IG8rIOnZ0ZZ/DA3Y4adxguoVHh4IwOjEACxYvGsnq8KS1HZQ8AhWt3OL9 ALmUh9Jmiio4AUSBFq6EZABcQLk5hxbjS8VqF6wNkhKkOCQUAImojECjcBUfM4hBp/9z vzSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="JfU/q/p0"; 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 q9si7506686pgh.92.2019.02.01.10.05.02; Fri, 01 Feb 2019 10:05:17 -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="JfU/q/p0"; 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 S1731256AbfBAR3G (ORCPT + 99 others); Fri, 1 Feb 2019 12:29:06 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:33287 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726542AbfBAR3E (ORCPT ); Fri, 1 Feb 2019 12:29:04 -0500 Received: by mail-lj1-f195.google.com with SMTP id v1-v6so6513769ljd.0; Fri, 01 Feb 2019 09:29:02 -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=BXx5ppy3Cxa8ue+r2iDJAtbQ20DIPseQM6vRxnwyhkg=; b=JfU/q/p0KqIV0f065O6eTrhw8ZBFZLQRUQpDcogyZKXbr0YR2zLAOX3SqoDfzHvFRh pRVsfFX3+54t5KE7YcaZyUQEpO9Tor1fzWa+4/cOFxsV/ub3JOKv6uike6/EvfIP361Y 8D5mDwM+V4k6XdjJ71BUhtA9gWNmWBrwwWNFZY1GULBut3J8sHgr6YCj3lcxAAevm6dD 8bjuLsTHHdHPJzQAXo35SsH1LP674Fh7qY10pXvav7U+B6EdIVVqqLSG6RuIDb4xrI5L M1vcZgTO7wF4cIBRdbbV7n/jVeSZsMVaawJgb6YYxd5l50IiyK008Qi/+7UFvZgngYSw I4LA== 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=BXx5ppy3Cxa8ue+r2iDJAtbQ20DIPseQM6vRxnwyhkg=; b=KdlfVWKFski3YrU3yHk14TBE05pXnRYcTLJ+ZZm5CMurx8lExpLnXQlFMnLM+lcQss yJX1xtmiuT14CBxjvM+aVOAn2zrKgqfWTBPth+isShED6VRQiTqvHXEz1EM9HL0CYBls M6d+lRViCnhT7f4gmzL8FbDVJksAlIVz1B9LwatrBC8Njy+5wq7AoNItWgH7JioSnOw+ Le9IdZZh5GMmF4aoKbDduyQdeiKWz1/njVVsXIwvwRyw2Np0qRGvCLEfY3/hj4OV8r+b TgnepAjXJ9jk3R4nFkGZ/5ODLIDJ1WxzKZSblo3q1/DeBJZ2IE6Xk3YPWdLdPsMEIV1Q qG3A== X-Gm-Message-State: AJcUukfrAPbYRhjaAghTRWHPxzm8/VOGiNlyPWDHaMaQxT++qe3DWlnF gHeY3F0N6a9ppywsXqZD7kk= X-Received: by 2002:a2e:5418:: with SMTP id i24-v6mr32337104ljb.51.1549042141184; Fri, 01 Feb 2019 09:29:01 -0800 (PST) Received: from localhost.localdomain ([2a02:a315:5445:5300:b0fa:39a8:9559:1b76]) by smtp.googlemail.com with ESMTPSA id u21-v6sm1388796lju.46.2019.02.01.09.28.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Feb 2019 09:29:00 -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 v2 2/2] drm/panel: Add driver for Samsung S6E63M0 panel Date: Fri, 1 Feb 2019 18:28:52 +0100 Message-Id: <20190201172852.4944-2-pawel.mikolaj.chmiel@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190201172852.4944-1-pawel.mikolaj.chmiel@gmail.com> References: <20190201172852.4944-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 --- 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 | 7 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-samsung-s6e63m0.c | 517 ++++++++++++++++++ 3 files changed, 525 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..be05ed5218eb 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -158,6 +158,13 @@ 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 + select VIDEOMODE_HELPERS + 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..7658bd993088 --- /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