From patchwork Thu Aug 3 22:33:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 9879965 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 E7B6460311 for ; Thu, 3 Aug 2017 22:34:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D24E926E74 for ; Thu, 3 Aug 2017 22:34:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C733E274B4; Thu, 3 Aug 2017 22:34: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=-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 4337626E74 for ; Thu, 3 Aug 2017 22:34:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0206B881ED; Thu, 3 Aug 2017 22:34:07 +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 A50F26E079 for ; Thu, 3 Aug 2017 22:34:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lechnology.com; s=default; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: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=5oZlJBU6JvA6UVswBfXXH0IZHnAIQNXxN4VCH77jqq0=; b=JEIdNGwKeGD0XwCEJdkLKJSzQo Odz1KZ72OEOprxzNgM9vhgbC7ykDBmyFHyOO/35EX1svpN6HOOap5LdtMOZ9K6Vo9OQff6pJjdOdG TOja+4fFwVmqQRYAx5wh3MYzdTrmH2r7yDQu0xac/QHloTcrg92Nia1ojkpof7QVM/G70SzxwFiQv i2nLEsx/sELaLCDsqan4Tuy8lArKlKCJ+yux+vkUzA0w4s+b5z5wXTlkNJWiEVM59C2/NNrHcfy3p fDw70s4N0HD0M0NNVjXbQ7dEHm0DTQGKuUxakHAqD+08bP4XdP+n8BrMuKZ/7wdFxkAuSxDFLL228 a9755CoA==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:57234 helo=freyr.lechnology.com) by vern.gendns.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-SHA256:128) (Exim 4.89) (envelope-from ) id 1ddOe8-000kyM-9V; Thu, 03 Aug 2017 18:31:12 -0400 From: David Lechner To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v3 1/6] drm/tinydrm: remove call to mipi_dbi_init() from mipi_dbi_spi_init() Date: Thu, 3 Aug 2017 17:33:45 -0500 Message-Id: <1501799630-1650-2-git-send-email-david@lechnology.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1501799630-1650-1-git-send-email-david@lechnology.com> References: <1501799630-1650-1-git-send-email-david@lechnology.com> MIME-Version: 1.0 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 , David Lechner , Kevin Hilman , Sekhar Nori , linux-kernel@vger.kernel.org, Rob Herring , linux-arm-kernel@lists.infradead.org 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This removes the call to mipi_dbi_init() from mipi_dbi_spi_init() so that drivers can have a driver-specific implementation if needed. Suggested-by: Noralf Trønnes Signed-off-by: David Lechner Reviewed-by: Noralf Trønnes --- drivers/gpu/drm/tinydrm/mi0283qt.c | 8 ++++++-- drivers/gpu/drm/tinydrm/mipi-dbi.c | 17 +++++------------ include/drm/tinydrm/mipi-dbi.h | 6 +----- 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/tinydrm/mi0283qt.c b/drivers/gpu/drm/tinydrm/mi0283qt.c index 482ff1c3..7e5bb7d 100644 --- a/drivers/gpu/drm/tinydrm/mi0283qt.c +++ b/drivers/gpu/drm/tinydrm/mi0283qt.c @@ -195,8 +195,12 @@ 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, rotation); + ret = mipi_dbi_spi_init(spi, mipi, dc); + if (ret) + return ret; + + ret = mipi_dbi_init(&spi->dev, mipi, &mi0283qt_pipe_funcs, + &mi0283qt_driver, &mi0283qt_mode, rotation); if (ret) return ret; diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c b/drivers/gpu/drm/tinydrm/mipi-dbi.c index e10fa4b..cba9784 100644 --- a/drivers/gpu/drm/tinydrm/mipi-dbi.c +++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c @@ -777,15 +777,12 @@ static int mipi_dbi_typec3_command(struct mipi_dbi *mipi, u8 cmd, /** * mipi_dbi_spi_init - Initialize MIPI DBI SPI interfaced controller * @spi: SPI device - * @dc: D/C gpio (optional) * @mipi: &mipi_dbi structure to initialize - * @pipe_funcs: Display pipe functions - * @driver: DRM driver - * @mode: Display mode - * @rotation: Initial rotation in degrees Counter Clock Wise + * @dc: D/C gpio (optional) * * This function sets &mipi_dbi->command, enables &mipi->read_commands for the - * usual read commands and initializes @mipi using mipi_dbi_init(). + * usual read commands. It should be followed by a call to mipi_dbi_init() or + * a driver-specific init. * * If @dc is set, a Type C Option 3 interface is assumed, if not * Type C Option 1. @@ -800,11 +797,7 @@ static int mipi_dbi_typec3_command(struct mipi_dbi *mipi, u8 cmd, * Zero on success, negative error code on failure. */ int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *mipi, - struct gpio_desc *dc, - const struct drm_simple_display_pipe_funcs *pipe_funcs, - struct drm_driver *driver, - const struct drm_display_mode *mode, - unsigned int rotation) + struct gpio_desc *dc) { size_t tx_size = tinydrm_spi_max_transfer_size(spi, 0); struct device *dev = &spi->dev; @@ -850,7 +843,7 @@ int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *mipi, return -ENOMEM; } - return mipi_dbi_init(dev, mipi, pipe_funcs, driver, mode, rotation); + return 0; } EXPORT_SYMBOL(mipi_dbi_spi_init); diff --git a/include/drm/tinydrm/mipi-dbi.h b/include/drm/tinydrm/mipi-dbi.h index d137b16..83346dd 100644 --- a/include/drm/tinydrm/mipi-dbi.h +++ b/include/drm/tinydrm/mipi-dbi.h @@ -62,11 +62,7 @@ mipi_dbi_from_tinydrm(struct tinydrm_device *tdev) } int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *mipi, - struct gpio_desc *dc, - const struct drm_simple_display_pipe_funcs *pipe_funcs, - struct drm_driver *driver, - const struct drm_display_mode *mode, - unsigned int rotation); + struct gpio_desc *dc); int mipi_dbi_init(struct device *dev, struct mipi_dbi *mipi, const struct drm_simple_display_pipe_funcs *pipe_funcs, struct drm_driver *driver,