From patchwork Thu Jan 24 18:28:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10779857 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CE51B746 for ; Thu, 24 Jan 2019 18:29:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE9ED3077F for ; Thu, 24 Jan 2019 18:29:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B0B0B3218D; Thu, 24 Jan 2019 18:29:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 94DA33077F for ; Thu, 24 Jan 2019 18:29:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E09E26F21A; Thu, 24 Jan 2019 18:29:11 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by gabe.freedesktop.org (Postfix) with ESMTPS id 33AC06F219 for ; Thu, 24 Jan 2019 18:29:10 +0000 (UTC) Received: by mail-pl1-x644.google.com with SMTP id y1so3261452plp.9 for ; Thu, 24 Jan 2019 10:29:10 -0800 (PST) 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=PeINbjerEmtPSiwCUVmX1VkkDU6rMM6JARYI9+cTqGA=; b=RRMHYRaHxTFteM+qgug8f13PEIu8t2GLm/MxpYbdrui0HjzlQcb7SbmBW1IetSg40q oF0Rwei5E+wTZN0yS3G770sYSbF1ZJ8Ft9vgPlNLHROjj+WbCgmierVSKJJ2n5lz09Pi 8thSFUxXXpkOHPHO+w3TibSYIhXUZ0k/qh6yQsXScw/9j5nM9wffUD52MlEvE63a/ioG ley8nXjdvOOcIjIf2PZQvBlupzmInyhg1z2DeLKsRFflF9kE5ODq827QDQl+ou7eK7aq yZsiNAHBNyEgmVUc1OmRYSjQBLfwsQzfJkuLWgyXX++UP63k/P9t5/OKdmg3KbmoW5Xc kVHw== X-Gm-Message-State: AJcUukcofDbcjJJrzZ+fKkJhs+VcTWluQGlARk1urSOQnRmYNu5BU6Tm 6YOV6MXvvehiPgdE79JLmk5LVRdjdFg= X-Google-Smtp-Source: ALg8bN5cXHEMijGNz0A1A5Kjb9K3lcCRQR/K717SjVeI2DwZWvbS4wut9mvNv/PBeypnWYK1na59xQ== X-Received: by 2002:a17:902:7614:: with SMTP id k20mr7718447pll.285.1548354549272; Thu, 24 Jan 2019 10:29:09 -0800 (PST) Received: from localhost.localdomain ([115.97.179.75]) by smtp.gmail.com with ESMTPSA id d25sm31803995pfe.40.2019.01.24.10.29.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Jan 2019 10:29:08 -0800 (PST) From: Jagan Teki To: Thierry Reding , David Airlie , Daniel Vetter , Sam Ravnborg Subject: [PATCH v8 2/2] drm/panel: Add Sitronix ST7701 panel driver Date: Thu, 24 Jan 2019 23:58:44 +0530 Message-Id: <20190124182844.28961-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190124182844.28961-1-jagan@amarulasolutions.com> References: <20190124182844.28961-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Trimarchi , linux-amarula@amarulasolutions.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Jagan Teki Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP ST7701 designed for small and medium sizes of TFT LCD display, is capable of supporting up to 480RGBX864 in resolution. It provides several system interfaces like MIPI/RGB/SPI. Currently added support for Techstar TS8550B which is ST7701 based 480x854, 2-lane MIPI DSI LCD panel. Driver now registering mipi_dsi device, but indeed it can extendable for RGB if any requirement trigger in future. Signed-off-by: Jagan Teki Reviewed-by: Sam Ravnborg --- Changes for v8: - use DRM_DEV_ERROR instead of dev_err - use devm_of_find_backlight() instead of of_parse_phandle() - remove unneeded 'num_supplies' from struct st7701 - add proper comments about panel sepecific sleep mode delay as per st7701 datasheet - update msleep delay values in .prepare as per datasheet and as per discussion in v7, thanks to 'Sam Ravnborg' - update msleep delay values in .unprepare as per datasheet and as per discussion in v7, thanks to 'Sam Ravnborg' - add proper comments on msleep delay values as per st7701 datasheet - use MIPI_DCS_ENTER_SLEEP_MODE in .unprepare - drop unneeded gpio set in .prepare and .unprepare as per panel-simple - remove unneeded include files - rebase on master Changes for v7: - rebase on master Changes for v6: - use sleep delay value as per datasheet - add panel_sleep_delay variable for panel specific delay - use command sequnce display on and off instead panel functions - add proper comments on the delays - remove delays from command switch - move mode type on struct display mode - drop refresh rate value, let drm compute Changes for v5: - found the chip from vendor, so added new panel driver - here is v4: https://patchwork.kernel.org/patch/10680335/ MAINTAINERS | 6 + drivers/gpu/drm/panel/Kconfig | 10 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-sitronix-st7701.c | 429 ++++++++++++++++++ 4 files changed, 446 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-sitronix-st7701.c diff --git a/MAINTAINERS b/MAINTAINERS index 5c8591eb5840..875bba40157b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4937,6 +4937,12 @@ S: Orphan / Obsolete F: drivers/gpu/drm/sis/ F: include/uapi/drm/sis_drm.h +DRM DRIVER FOR SITRONIX ST7701 PANELS +M: Jagan Teki +S: Maintained +F: drivers/gpu/drm/panel/panel-sitronix-st7701.c +F: Documentation/devicetree/bindings/display/panel/sitronix,st7701.txt + DRM DRIVER FOR SITRONIX ST7586 PANELS M: David Lechner S: Maintained diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 5304db7b7b55..a65b3a065598 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -214,6 +214,16 @@ config DRM_PANEL_SHARP_LS043T1LE01 Say Y here if you want to enable support for Sharp LS043T1LE01 qHD (540x960) DSI panel as found on the Qualcomm APQ8074 Dragonboard +config DRM_PANEL_SITRONIX_ST7701 + tristate "Sitronix ST7701 panel driver" + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + help + Say Y here if you want to enable support for the Sitronix + ST7701 controller for 480X864 LCD panels with MIPI/RGB/SPI + system interfaces. + config DRM_PANEL_SITRONIX_ST7789V tristate "Sitronix ST7789V panel" depends on OF && SPI diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index c88dacf9d439..0ec4c41915dd 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -22,6 +22,7 @@ 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 obj-$(CONFIG_DRM_PANEL_SHARP_LS043T1LE01) += panel-sharp-ls043t1le01.o +obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7701) += panel-sitronix-st7701.o obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7789V) += panel-sitronix-st7789v.o obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) += panel-truly-nt35597.o diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7701.c b/drivers/gpu/drm/panel/panel-sitronix-st7701.c new file mode 100644 index 000000000000..499dd8a34a6d --- /dev/null +++ b/drivers/gpu/drm/panel/panel-sitronix-st7701.c @@ -0,0 +1,429 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019, Amarula Solutions. + * Author: Jagan Teki + */ + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include