From patchwork Fri Jul 19 15:59:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Noralf_Tr=C3=B8nnes?= X-Patchwork-Id: 11050289 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 7DA7813BD for ; Fri, 19 Jul 2019 15:59:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E205288BF for ; Fri, 19 Jul 2019 15:59:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6282F288C4; Fri, 19 Jul 2019 15:59:55 +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 1299E288BF for ; Fri, 19 Jul 2019 15:59:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D635D6E854; Fri, 19 Jul 2019 15:59:49 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp.domeneshop.no (smtp.domeneshop.no [IPv6:2a01:5b40:0:3005::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id E30E46E851 for ; Fri, 19 Jul 2019 15:59:39 +0000 (UTC) Received: from 211.81-166-168.customer.lyse.net ([81.166.168.211]:55144 helo=localhost.localdomain) by smtp.domeneshop.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.84_2) (envelope-from ) id 1hoVII-0001bQ-0i; Fri, 19 Jul 2019 17:59:38 +0200 From: =?utf-8?q?Noralf_Tr=C3=B8nnes?= To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 08/11] drm/tinydrm: Move tinydrm_machine_little_endian() Date: Fri, 19 Jul 2019 17:59:13 +0200 Message-Id: <20190719155916.62465-9-noralf@tronnes.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190719155916.62465-1-noralf@tronnes.org> References: <20190719155916.62465-1-noralf@tronnes.org> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tronnes.org; s=ds201810; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=QC1DVaAr7w9zNecL3u8hYiPRH/1+MdnGd8Z1nT/gVm8=; b=SVN7DRsbFO3Vuo40eH/x4OasjXv9EjE2KI99yqxCAp5+qMjcfqX14OiI9Siu+wRLQuiYJpkD1AQELG+JkeBT2EU/LJQQm7JqIR9QuAXK05WGG3bqq1jA+/kzLwd87fAKnng/wl1pb1ox+SRXzfjNaApEZxFSGlF5D9OMajEUWkfn7UgLeQ/o5rSU87gugnyhE9Ke6Fl5Z8XGYufLw2JvKJGGv1ZGdpEyp1Z5NCJZtIjIf0tqqugnYNpc+G08y0+byn1zWZpOMxB8a7tV/sLtKg8rqpIHix3TXRAXALgF2FW9VUIOYLxYuRxvkOKZSklbo4U54bDshXUeK70wZUodaQ==; 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: sam@ravnborg.org, david@lechnology.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The tinydrm helper is going away so move it into the only user mipi-dbi. Reviewed-by: Sam Ravnborg Signed-off-by: Noralf Trønnes --- drivers/gpu/drm/tinydrm/mipi-dbi.c | 15 ++++++++++++--- include/drm/tinydrm/tinydrm-helpers.h | 15 --------------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c b/drivers/gpu/drm/tinydrm/mipi-dbi.c index 6a8f2d66377f..73db287e5c52 100644 --- a/drivers/gpu/drm/tinydrm/mipi-dbi.c +++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c @@ -628,6 +628,15 @@ u32 mipi_dbi_spi_cmd_max_speed(struct spi_device *spi, size_t len) } EXPORT_SYMBOL(mipi_dbi_spi_cmd_max_speed); +static bool mipi_dbi_machine_little_endian(void) +{ +#if defined(__LITTLE_ENDIAN) + return true; +#else + return false; +#endif +} + /* * MIPI DBI Type C Option 1 * @@ -650,7 +659,7 @@ static int mipi_dbi_spi1e_transfer(struct mipi_dbi *mipi, int dc, const void *buf, size_t len, unsigned int bpw) { - bool swap_bytes = (bpw == 16 && tinydrm_machine_little_endian()); + bool swap_bytes = (bpw == 16 && mipi_dbi_machine_little_endian()); size_t chunk, max_chunk = mipi->tx_buf9_len; struct spi_device *spi = mipi->spi; struct spi_transfer tr = { @@ -799,7 +808,7 @@ static int mipi_dbi_spi1_transfer(struct mipi_dbi *mipi, int dc, size_t chunk = min(len, max_chunk); unsigned int i; - if (bpw == 16 && tinydrm_machine_little_endian()) { + if (bpw == 16 && mipi_dbi_machine_little_endian()) { for (i = 0; i < (chunk * 2); i += 2) { dst16[i] = *src16 >> 8; dst16[i + 1] = *src16++ & 0xFF; @@ -991,7 +1000,7 @@ int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *mipi, if (dc) { mipi->command = mipi_dbi_typec3_command; mipi->dc = dc; - if (tinydrm_machine_little_endian() && !spi_is_bpw_supported(spi, 16)) + if (mipi_dbi_machine_little_endian() && !spi_is_bpw_supported(spi, 16)) mipi->swap_bytes = true; } else { mipi->command = mipi_dbi_typec1_command; diff --git a/include/drm/tinydrm/tinydrm-helpers.h b/include/drm/tinydrm/tinydrm-helpers.h index 8c5d20efeaa1..0e7470771c5e 100644 --- a/include/drm/tinydrm/tinydrm-helpers.h +++ b/include/drm/tinydrm/tinydrm-helpers.h @@ -15,21 +15,6 @@ struct drm_simple_display_pipe; struct drm_simple_display_pipe_funcs; struct device; -/** - * tinydrm_machine_little_endian - Machine is little endian - * - * Returns: - * true if *defined(__LITTLE_ENDIAN)*, false otherwise - */ -static inline bool tinydrm_machine_little_endian(void) -{ -#if defined(__LITTLE_ENDIAN) - return true; -#else - return false; -#endif -} - int tinydrm_display_pipe_init(struct drm_device *drm, struct drm_simple_display_pipe *pipe, const struct drm_simple_display_pipe_funcs *funcs,