From patchwork Thu Dec 21 19:23:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 10128303 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 84AFA6019C for ; Thu, 21 Dec 2017 19:24:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76B1429C61 for ; Thu, 21 Dec 2017 19:24:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B67829DDE; Thu, 21 Dec 2017 19:24:05 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 DAD8E29C61 for ; Thu, 21 Dec 2017 19:24:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A495D6E666; Thu, 21 Dec 2017 19:24:02 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from vern.gendns.com (vern.gendns.com [206.190.152.46]) by gabe.freedesktop.org (Postfix) with ESMTPS id A80AD6E65D for ; Thu, 21 Dec 2017 19:23:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lechnology.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject :Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=33KYwhoQCLxdiw5h0GI/TiY2ZNnevne434gRnCgzTJw=; b=Z0s2hPRU+X0O1b/DYIUYahH2I vZWKYqGwcJc1Rzd8qf1KDfijqeClViky/POB8IAIFeeTLk7bIfwrDL1qSryFiGsKh+ZkEQWqstOfE nozlESPqATJn6cZZfvXSrbPjLChzDWHXiW2K+TnOcEj64pAmD4tr50fj4vxA0Lp6/c5uMUE+TVRHi imlo9nv2rpoQkfcdZegsX7fJQkw0T8Eb4VweizKqPAHGMc9dZn2OYBKZlsLEoFVIOHTIDAindpfmv nQJ5VSQtFU2Lkc8QcZzda0iXxxXO0/ghAnbkBXA4R1L6zo3i8dFWPyDkB6uJKeoYAZ1E/fG5r3UYr E///iSJcw==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:51596 helo=freyr.lechnology.com) by vern.gendns.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-SHA256:128) (Exim 4.89) (envelope-from ) id 1eS6Pj-002FIs-8G; Thu, 21 Dec 2017 14:21:55 -0500 From: David Lechner To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v3 3/3] drm/tinydrm: add driver for ST7735R panels Date: Thu, 21 Dec 2017 13:23:53 -0600 Message-Id: <1513884233-31540-4-git-send-email-david@lechnology.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513884233-31540-1-git-send-email-david@lechnology.com> References: <1513884233-31540-1-git-send-email-david@lechnology.com> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - lists.freedesktop.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: Cc: Mark Rutland , limor@ladyada.net, David Lechner , linux-kernel@vger.kernel.org, Rob Herring X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This adds a new driver for Sitronix ST7735R display panels. This has been tested using an Adafruit 1.8" TFT. Signed-off-by: David Lechner Reviewed-by: Noralf Trønnes --- v3 changes: * Changed compatible string * use SPDX license header * Renamed mode struct to use panel name instead of controller name v2 changes: * Change delay from 10ms to 20ms to avoid checkpatch warning * Use mipi_dbi_pipe_enable()/mipi_dbi_pipe_disable() to reduce duplicated code * Rebase on drm-misc-next (tinydrm_lastclose => drm_fb_helper_lastclose) * Use mipi_dbi_debugfs_init * Add mipi->read_commands = NULL; since this display is write-only MAINTAINERS | 6 ++ drivers/gpu/drm/tinydrm/Kconfig | 10 ++ drivers/gpu/drm/tinydrm/Makefile | 1 + drivers/gpu/drm/tinydrm/st7735r.c | 215 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 232 insertions(+) create mode 100644 drivers/gpu/drm/tinydrm/st7735r.c diff --git a/MAINTAINERS b/MAINTAINERS index 91268cb..95e98e2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4556,6 +4556,12 @@ S: Maintained F: drivers/gpu/drm/tinydrm/st7586.c F: Documentation/devicetree/bindings/display/st7586.txt +DRM DRIVER FOR SITRONIX ST7735R PANELS +M: David Lechner +S: Maintained +F: drivers/gpu/drm/tinydrm/st7735r.c +F: Documentation/devicetree/bindings/display/st7735r.txt + DRM DRIVER FOR TDFX VIDEO CARDS S: Orphan / Obsolete F: drivers/gpu/drm/tdfx/ diff --git a/drivers/gpu/drm/tinydrm/Kconfig b/drivers/gpu/drm/tinydrm/Kconfig index 90c5bd5..b0e567d 100644 --- a/drivers/gpu/drm/tinydrm/Kconfig +++ b/drivers/gpu/drm/tinydrm/Kconfig @@ -52,3 +52,13 @@ config TINYDRM_ST7586 * LEGO MINDSTORMS EV3 If M is selected the module will be called st7586. + +config TINYDRM_ST7735R + tristate "DRM support for Sitronix ST7735R display panels" + depends on DRM_TINYDRM && SPI + select TINYDRM_MIPI_DBI + help + DRM driver Sitronix ST7735R with one of the following LCDs: + * JD-T18003-T01 1.8" 128x160 TFT + + If M is selected the module will be called st7735r. diff --git a/drivers/gpu/drm/tinydrm/Makefile b/drivers/gpu/drm/tinydrm/Makefile index 8aeee53..49a1119 100644 --- a/drivers/gpu/drm/tinydrm/Makefile +++ b/drivers/gpu/drm/tinydrm/Makefile @@ -8,3 +8,4 @@ obj-$(CONFIG_TINYDRM_ILI9225) += ili9225.o obj-$(CONFIG_TINYDRM_MI0283QT) += mi0283qt.o obj-$(CONFIG_TINYDRM_REPAPER) += repaper.o obj-$(CONFIG_TINYDRM_ST7586) += st7586.o +obj-$(CONFIG_TINYDRM_ST7735R) += st7735r.o diff --git a/drivers/gpu/drm/tinydrm/st7735r.c b/drivers/gpu/drm/tinydrm/st7735r.c new file mode 100644 index 0000000..0b05b2c --- /dev/null +++ b/drivers/gpu/drm/tinydrm/st7735r.c @@ -0,0 +1,215 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * DRM driver for Sitronix ST7735R panels + * + * Copyright 2017 David Lechner + */ + +#include +#include +#include +#include +#include +#include +#include