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: 9879983 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 5A1D960311 for ; Thu, 3 Aug 2017 22:35:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4536426E74 for ; Thu, 3 Aug 2017 22:35:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A14A28974; Thu, 3 Aug 2017 22:35:33 +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=unavailable 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 B3D8626E74 for ; Thu, 3 Aug 2017 22:35:32 +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-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5EGy25B1D0Rt28OvKEzp71TjNetAHJzqJXgtq2lkkXM=; b=ZSMfE9ZAIgeC/e tN1/2NZK001tpUhsxnQ7xQjkInI2iI9QFEuZHHTn8MXN4xNIge0CNjJwPdusXIyP6szaH1kkZ+P4I PWZglBs+rLm06BgtgvrhCzdNVO3Wt0MxujYV+IWZcwgDy3R1DceI2rNk2RXmFNhbpvRNMOB9vQ2kh I/TZu2nl23Wi1V2uuk1fVHK/hxb6sWhdO8WrSawh+11i9cpeM2awl1nRHveuJQ7tbueHEGd1AyzMh lJ6LsaIuIoSqVR0HxMz6Iy/2A+rA/IhrFlPybo8/jt8SfdRDBy6mHkg2qujZmCQWhrfBzmjXAkVym U8PCNXPxyCK6ufVxzjuQ==; 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 1ddOiJ-0000WR-Jf; Thu, 03 Aug 2017 22:35:31 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ddOhz-0000VY-Jb for linux-arm-kernel@bombadil.infradead.org; Thu, 03 Aug 2017 22:35:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=AtbNOZ6K+BxabgJHXyDiN0eU/o PuzL1p7dw/iMeAPcwLKHaN4YFU/POTwRmbgClGRqP+LakaTJpnbh+ACQ6I3Bq1+ACFDmjSCQfXbtJ cNDqy5aFsk67F5rB+87lvMnTu+XJu4Ee7GvKwNdfGSRDhgkNEXh3g9cMVim1HC/L4BMag1McST5rn vzKbIXUc22++yrDfEfnRmZbTdpOeIzADdOVlQVTOgDk/ebpIupXSndgoBi7xFGOZCeMMby8cRALnb ddKgGPKTTAUI9+XLmbKJqDovw/IKzwwZh7HTssiRyb0MuA16wyDM5E4a0rWbPbejYSc/WOhxpYm4N oUQQkrlg==; Received: from vern.gendns.com ([206.190.152.46]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ddOhv-0001eg-QA for linux-arm-kernel@lists.infradead.org; Thu, 03 Aug 2017 22:35:09 +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: 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.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-20170803_233507_995910_23F2B118 X-CRM114-Status: GOOD ( 13.10 ) 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 , =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= , David Lechner , Kevin Hilman , David Airlie , Sekhar Nori , linux-kernel@vger.kernel.org, Rob Herring , Daniel Vetter , 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 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,