From patchwork Sat Jul 29 19:30:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 9870109 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 1D2E960353 for ; Sat, 29 Jul 2017 19:31:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D7AA2872E for ; Sat, 29 Jul 2017 19:31:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 01F9D287A9; Sat, 29 Jul 2017 19:31:11 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B40122872E for ; Sat, 29 Jul 2017 19:31:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7CNcCYDqzjx+8wZB21olBhFPVw2Xk8b/xRSxhsikmrI=; b=YHzDPUyxx3U1PHRHiBNibGMZI ie3AREmI8APNvqR7PVHSeSXqtQeDyS91tVziit5qArSm/bjsecTP/TW2izrt5a1g5qogRRhOoyRn8 jYdaGp0Y8NbZ8nhKX32hEcvwrlNUecgxdQ1Of/qckRScmUKC2FGYCTynAbyHly5AMupo7EK6qFUyD GUiETmp1bbFRZftXPKm5+eRo6Fo29tAveQ341klgiVd8FtAgF810kZNZl16ktKE+I/LeWLMq+x0Q2 /XkgdH+1ufRb1szMd/1adc8ggMx4/QvEOUfLWXz54gRxHszUaY153j3eCF6iVbfp1Ol5/IFz26uQ0 HEs24WN5g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dbXRh-0004ql-Bx; Sat, 29 Jul 2017 19:30:41 +0000 Received: from vern.gendns.com ([206.190.152.46]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dbXRd-0004pq-JH for linux-arm-kernel@lists.infradead.org; Sat, 29 Jul 2017 19:30:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lechnology.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To: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=FgeB2T/Txelda/sh2ZShutlRHYE92nfmGt+zIUwtkHw=; b=MrkHxDIu2qPRWsZ0rofubAjDiB L14r3OhlHVF+PSuv/RLcUV/8QZXGULkfXVaAiufea6kFQJ0X8cR5iywguTF7nY9xnVcE3zDbCQCla IgSmFrBzAoeoSWKOKysXnN3ZdPtVNGbPz6nwWt47dr3BRSovIanBRyO3S88npt47043K7TtZ7c7rA 4HJa+zuTRFHCYvoPNBmMe4EBcoo7dRScjXlNKFbJnOl4cxO2Kxv3ijKhHv9hBeubTI5dScohnQcku V2cAcTuSK3LkRbkjg8lB7iCoIXP606Ig7gmQOw3lpYA3kND8FkK7jblsQB5eaoT70AVNURlvvWAL1 3S2eg2+g==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:58346 helo=[192.168.0.113]) by vern.gendns.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89) (envelope-from ) id 1dbXOg-000Fnr-Rz; Sat, 29 Jul 2017 15:27:35 -0400 Subject: Re: [PATCH 3/6] drm/tinydrm: rename mi028qt module to mipi-panel To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org References: <1501355870-13960-1-git-send-email-david@lechnology.com> <1501355870-13960-4-git-send-email-david@lechnology.com> From: David Lechner Message-ID: Date: Sat, 29 Jul 2017 14:30:14 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1501355870-13960-4-git-send-email-david@lechnology.com> Content-Language: en-US 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.infradead.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: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170729_123037_680726_282535BD X-CRM114-Status: GOOD ( 17.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , linux-fbdev@vger.kernel.org, Kevin Hilman , David Airlie , Sekhar Nori , linux-kernel@vger.kernel.org, Rob Herring , =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On 07/29/2017 02:17 PM, David Lechner wrote: > This renames the mi028qt module to mipi-panel so that it can be used for > other types of panels as well. There is no reason to copy a bunch of > boiler-plate code for each panel or controller. > > Signed-off-by: David Lechner > --- > .../devicetree/bindings/display/mipi-panel.txt | 27 ++ > .../bindings/display/multi-inno,mi0283qt.txt | 27 -- > MAINTAINERS | 6 +- > drivers/gpu/drm/tinydrm/Kconfig | 12 +- > drivers/gpu/drm/tinydrm/Makefile | 2 +- > drivers/gpu/drm/tinydrm/mi0283qt.c | 283 -------------------- > drivers/gpu/drm/tinydrm/mipi-panel.c | 284 +++++++++++++++++++++ > 7 files changed, 323 insertions(+), 318 deletions(-) > create mode 100644 Documentation/devicetree/bindings/display/mipi-panel.txt > delete mode 100644 Documentation/devicetree/bindings/display/multi-inno,mi0283qt.txt > delete mode 100644 drivers/gpu/drm/tinydrm/mi0283qt.c > create mode 100644 drivers/gpu/drm/tinydrm/mipi-panel.c > Apparently, I missed an option on git format-patch. This diff should be easier to look at... --- struct tinydrm_device *tdev; @@ -195,20 +196,20 @@ static int mi0283qt_probe(struct spi_device *spi) device_property_read_u32(dev, "rotation", &rotation); - ret = mipi_dbi_spi_init(spi, mipi, dc, &mi0283qt_pipe_funcs, - &mi0283qt_driver, &mi0283qt_mode, + ret = mipi_dbi_spi_init(spi, mipi, dc, &mipi_panel_pipe_funcs, + &mipi_panel_driver, &mipi_panel_mode, MIPI_DCS_PIXEL_FMT_16BIT, rotation); if (ret) return ret; - ret = mi0283qt_init(mipi); + ret = mipi_panel_init(mipi); if (ret) return ret; /* use devres to fini after drm unregister (drv->remove is before) */ - ret = devm_add_action(dev, mi0283qt_fini, mipi); + ret = devm_add_action(dev, mipi_panel_fini, mipi); if (ret) { - mi0283qt_fini(mipi); + mipi_panel_fini(mipi); return ret; } @@ -228,14 +229,14 @@ static int mi0283qt_probe(struct spi_device *spi) return 0; } -static void mi0283qt_shutdown(struct spi_device *spi) +static void mipi_panel_shutdown(struct spi_device *spi) { struct mipi_dbi *mipi = spi_get_drvdata(spi); tinydrm_shutdown(&mipi->tinydrm); } -static int __maybe_unused mi0283qt_pm_suspend(struct device *dev) +static int __maybe_unused mipi_panel_pm_suspend(struct device *dev) { struct mipi_dbi *mipi = dev_get_drvdata(dev); int ret; @@ -244,40 +245,40 @@ static int __maybe_unused mi0283qt_pm_suspend(struct device *dev) if (ret) return ret; - mi0283qt_fini(mipi); + mipi_panel_fini(mipi); return 0; } -static int __maybe_unused mi0283qt_pm_resume(struct device *dev) +static int __maybe_unused mipi_panel_pm_resume(struct device *dev) { struct mipi_dbi *mipi = dev_get_drvdata(dev); int ret; - ret = mi0283qt_init(mipi); + ret = mipi_panel_init(mipi); if (ret) return ret; return tinydrm_resume(&mipi->tinydrm); } -static const struct dev_pm_ops mi0283qt_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(mi0283qt_pm_suspend, mi0283qt_pm_resume) +static const struct dev_pm_ops mipi_panel_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(mipi_panel_pm_suspend, mipi_panel_pm_resume) }; -static struct spi_driver mi0283qt_spi_driver = { +static struct spi_driver mipi_panel_spi_driver = { .driver = { - .name = "mi0283qt", + .name = "mipi-panel", .owner = THIS_MODULE, - .of_match_table = mi0283qt_of_match, - .pm = &mi0283qt_pm_ops, + .of_match_table = mipi_panel_of_match, + .pm = &mipi_panel_pm_ops, }, - .id_table = mi0283qt_id, - .probe = mi0283qt_probe, - .shutdown = mi0283qt_shutdown, + .id_table = mipi_panel_id, + .probe = mipi_panel_probe, + .shutdown = mipi_panel_shutdown, }; -module_spi_driver(mi0283qt_spi_driver); +module_spi_driver(mipi_panel_spi_driver); -MODULE_DESCRIPTION("Multi-Inno MI0283QT DRM driver"); +MODULE_DESCRIPTION("MIPI DBI panel DRM driver"); MODULE_AUTHOR("Noralf Trønnes"); MODULE_LICENSE("GPL"); -- 2.7.4 diff --git a/Documentation/devicetree/bindings/display/multi-inno,mi0283qt.txt b/Documentation/devicetree/bindings/display/mipi-panel.txt similarity index 94% rename from Documentation/devicetree/bindings/display/multi-inno,mi0283qt.txt rename to Documentation/devicetree/bindings/display/mipi-panel.txt index eed48c3..01d6ea9 100644 --- a/Documentation/devicetree/bindings/display/multi-inno,mi0283qt.txt +++ b/Documentation/devicetree/bindings/display/mipi-panel.txt @@ -1,4 +1,4 @@ -Multi-Inno MI0283QT display panel +MIPI DBI compatible display panel Required properties: - compatible: "multi-inno,mi0283qt". @@ -17,7 +17,7 @@ Optional properties: - rotation: panel rotation in degrees counter clockwise (0,90,180,270) Example: - mi0283qt@0{ + display@0{ compatible = "multi-inno,mi0283qt"; reg = <0>; spi-max-frequency = <32000000>; diff --git a/MAINTAINERS b/MAINTAINERS index f66488d..812ffd0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4315,11 +4315,11 @@ M: Dave Airlie S: Odd Fixes F: drivers/gpu/drm/mgag200/ -DRM DRIVER FOR MI0283QT +DRM DRIVER FOR MIPI DBI compatible panels M: Noralf Trønnes S: Maintained -F: drivers/gpu/drm/tinydrm/mi0283qt.c -F: Documentation/devicetree/bindings/display/multi-inno,mi0283qt.txt +F: drivers/gpu/drm/tinydrm/mipi-panel.c +F: Documentation/devicetree/bindings/display/mipi-panel.txt DRM DRIVER FOR MSM ADRENO GPU M: Rob Clark diff --git a/drivers/gpu/drm/tinydrm/Kconfig b/drivers/gpu/drm/tinydrm/Kconfig index 3504c53..0a0db7a 100644 --- a/drivers/gpu/drm/tinydrm/Kconfig +++ b/drivers/gpu/drm/tinydrm/Kconfig @@ -12,10 +12,14 @@ menuconfig DRM_TINYDRM config TINYDRM_MIPI_DBI tristate -config TINYDRM_MI0283QT - tristate "DRM support for MI0283QT" +config TINYDRM_MIPI_PANEL + tristate "DRM support for MIPI DBI compatible display panels" depends on DRM_TINYDRM && SPI select TINYDRM_MIPI_DBI help - DRM driver for the Multi-Inno MI0283QT display panel - If M is selected the module will be called mi0283qt. + DRM driver for the MIPI DBI compatible display panels. + + Supported panels include: + * Multi-Inno MI0283QT + + If M is selected the module will be called mipi-panel. diff --git a/drivers/gpu/drm/tinydrm/Makefile b/drivers/gpu/drm/tinydrm/Makefile index 7a3604c..7eae65e 100644 --- a/drivers/gpu/drm/tinydrm/Makefile +++ b/drivers/gpu/drm/tinydrm/Makefile @@ -4,4 +4,4 @@ obj-$(CONFIG_DRM_TINYDRM) += core/ obj-$(CONFIG_TINYDRM_MIPI_DBI) += mipi-dbi.o # Displays -obj-$(CONFIG_TINYDRM_MI0283QT) += mi0283qt.o +obj-$(CONFIG_TINYDRM_MIPI_PANEL) += mipi-panel.o diff --git a/drivers/gpu/drm/tinydrm/mi0283qt.c b/drivers/gpu/drm/tinydrm/mipi-panel.c similarity index 76% rename from drivers/gpu/drm/tinydrm/mi0283qt.c rename to drivers/gpu/drm/tinydrm/mipi-panel.c index 2680dab..64344f0 100644 --- a/drivers/gpu/drm/tinydrm/mi0283qt.c +++ b/drivers/gpu/drm/tinydrm/mipi-panel.c @@ -1,7 +1,8 @@ /* - * DRM driver for Multi-Inno MI0283QT panels + * DRM driver for MIPI DBI compatible panels * * Copyright 2016 Noralf Trønnes + * Copyright 2017 David Lechner * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,7 +21,7 @@ #include #include