From patchwork Wed Jan 19 09:32:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alain Volmat X-Patchwork-Id: 12717335 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B4969C433F5 for ; Wed, 19 Jan 2022 09:35:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VPVsUooq4uz9R1nnZYYE1zHW7j3zRF+HysPBmaYJSmk=; b=dUmKGT1CAegiIo Gl7pzJ9vBV9kgnnzhkqlCzeXE9Unnyafx5yShIRQ+SDKXoytQItBwoYDc8rAzFGUFmfECxyvUylrz QM95NKB8n/Tp4dDOL4bYrupJXx1GaEG/Fjr4nsujsrVvxVzzW+UsqW02bdVRdEA6WmjmH78xqpfdh QHvwxtuaRTITcvBPWzE6Uoz7QVDcYtwDR5L+DPL1yM/GfFTmYlsdce9jcg1HWpmlf/t6gxJgGhgih mN8Rny1DJ5NEDNBeBERg1wb6LfQHvNTu8YwIGjDEXguDSUK9apASzUhGjA93s8c1daB+5FTHdYuSp E74rX0rfU0vjl1+bOgiw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nA7Ls-004bWU-Fn; Wed, 19 Jan 2022 09:34:00 +0000 Received: from mx07-00178001.pphosted.com ([185.132.182.106]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nA7LP-004bKB-JC for linux-arm-kernel@lists.infradead.org; Wed, 19 Jan 2022 09:33:34 +0000 Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 20J3l3Vr008035; Wed, 19 Jan 2022 10:33:15 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=TLpzstAMcWP5PV344Qh1JhgIkc8FofNAZU5SwUGE5QY=; b=4eV0x0OePdeTvlQLkxwGqU+Qt19W1Fs2867BWat/Bp+PsZtwC8GFguD92VaT9i/v2xCe aHAcm6NhmoRvLsaOXIpUQ5Nj7/mrWZ9c+lHVAwdkPT/Y1hVcgF0dWMFdY1WbXV0oqWLU m908jnwIeSfM59/VUKGPyzGS/C/Y1/siHzvd+OxwjJ7YgQkbbc+N6oNrRsLwUfgGZCjV kAOo+AP7W6bKsjyDIwmBcIAV08eefAdpxzd4M7x6h1ifc1o5IryHpAAwVXFPCGzUvGb/ O9rPP4UTN6Xj/UegCw1Ar+ME3sfLELeIJTHjQkkBxKAPOB6+bjTFXo97zW8X5u3jh7Xa uA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3dnsd0e3j8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 19 Jan 2022 10:33:15 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id E6EE4100034; Wed, 19 Jan 2022 10:33:14 +0100 (CET) Received: from Webmail-eu.st.com (gpxdag2node5.st.com [10.75.127.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id DE28320ED10; Wed, 19 Jan 2022 10:33:14 +0100 (CET) Received: from localhost (10.75.127.51) by GPXDAG2NODE5.st.com (10.75.127.69) with Microsoft SMTP Server (TLS) id 15.0.1497.26; Wed, 19 Jan 2022 10:33:14 +0100 From: Alain Volmat To: , CC: , , , , , , , Subject: [PATCH 1/2] spi: stm32: remove inexistant variables in struct stm32_spi_cfg comment Date: Wed, 19 Jan 2022 10:32:44 +0100 Message-ID: <20220119093245.624878-2-alain.volmat@foss.st.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220119093245.624878-1-alain.volmat@foss.st.com> References: <20220119093245.624878-1-alain.volmat@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.51] X-ClientProxiedBy: SFHDAG2NODE3.st.com (10.75.127.6) To GPXDAG2NODE5.st.com (10.75.127.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-19_06,2022-01-18_01,2021-12-02_01 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220119_013332_116475_A1BD14D5 X-CRM114-Status: GOOD ( 15.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Variables 'can_dma' and 'has_startbit' are described within the struct stm32_spi_cfg comment but have never existed in this structure so remove them. Signed-off-by: Alain Volmat --- drivers/spi/spi-stm32.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c index 9bd3fd1652f7..b5ef2470cefe 100644 --- a/drivers/spi/spi-stm32.c +++ b/drivers/spi/spi-stm32.c @@ -221,7 +221,6 @@ struct stm32_spi; * time between frames (if driver has this functionality) * @set_number_of_data: optional routine to configure registers to desired * number of data (if driver has this functionality) - * @can_dma: routine to determine if the transfer is eligible for DMA use * @transfer_one_dma_start: routine to start transfer a single spi_transfer * using DMA * @dma_rx_cb: routine to call after DMA RX channel operation is complete @@ -232,7 +231,6 @@ struct stm32_spi; * @baud_rate_div_min: minimum baud rate divisor * @baud_rate_div_max: maximum baud rate divisor * @has_fifo: boolean to know if fifo is used for driver - * @has_startbit: boolean to know if start bit is used to start transfer */ struct stm32_spi_cfg { const struct stm32_spi_regspec *regs; From patchwork Wed Jan 19 09:32:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alain Volmat X-Patchwork-Id: 12717334 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 57ECEC433F5 for ; Wed, 19 Jan 2022 09:35:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=62ZhkCWnpCRIILABbicNQCuIQo7rqBu2abE+9jHYBsE=; b=qY7ReIIpswsOvE UhC83uj1M+3WoRyeVSVfcofRuNDF4Sr/9jFtLUOQa9hBjVI9FXWUwcWjSGev4G4Q2Ql5OMTbQzvZQ vTSSdyORi5pr0Q88j5M54sJxBDDG21SabzFn1DQjhpJy68jqT8LlTB0Btwp0KOwhEux0XXob8UoJ2 bBl+97HCxlLGNoj+/7I8kJjyqPv0aDStfpEkQO81pCH5fXq68/cOvcWupWMXkkjuqcQSK5o/tQcT0 mF7f4JFuj+yGxuZ9Tnt6jPbaUaMXh0zmK0m7HuHbiO+Wnp7qLBhJds4cS46OE44YA4oIPZTFbakUu MBvvVO6X8O8+Nq0XFiKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nA7LT-004bN1-Ra; Wed, 19 Jan 2022 09:33:36 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nA7LP-004bK8-Da for linux-arm-kernel@lists.infradead.org; Wed, 19 Jan 2022 09:33:33 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 20J8MJq3014974; Wed, 19 Jan 2022 10:33:15 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=Vz5Z00wN5zPjPO1SANvL9AXqgyIwOm0yfPV4ilWMIWI=; b=yhCwni+ENghLAF4NeUwjEY26pxzdzd1+ZEGGXBI4PUPMGXprekNh+nYp+CDvw4o0kwoS bH8a+IB6AvuACGo3kmXfX58RUKXI3y64Fa+YIGS2BXdVvp/oPtWqK4u7PW1hH8eS1U+z +aVgr9dcbtcoxvUjVBocaSdFA24vmk9qY1lMmeW+KVfASguf/BBuJiYYjnMRzcqYVX8v dUAYzsYDWCSJ1kzA7X71dTlb4wOVA4Z9dGcB7mEpVrJFdrMhuoD4+hONSa3IXOPJd2DW W9xb55E2Kb8tRyx45vv8+4NiC7RYPBKUHZyydE+OD6TSbQOomYp5uwGNH98RrdNI70sK fQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3dpf2v8f73-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 19 Jan 2022 10:33:15 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 58B5F100038; Wed, 19 Jan 2022 10:33:15 +0100 (CET) Received: from Webmail-eu.st.com (gpxdag2node5.st.com [10.75.127.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 4F26C20ED10; Wed, 19 Jan 2022 10:33:15 +0100 (CET) Received: from localhost (10.75.127.51) by GPXDAG2NODE5.st.com (10.75.127.69) with Microsoft SMTP Server (TLS) id 15.0.1497.26; Wed, 19 Jan 2022 10:33:14 +0100 From: Alain Volmat To: , CC: , , , , , , , Subject: [PATCH 2/2] spi: stm32: make SPI_MASTER_MUST_TX flags only specific to STM32F4 Date: Wed, 19 Jan 2022 10:32:45 +0100 Message-ID: <20220119093245.624878-3-alain.volmat@foss.st.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220119093245.624878-1-alain.volmat@foss.st.com> References: <20220119093245.624878-1-alain.volmat@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.51] X-ClientProxiedBy: SFHDAG2NODE1.st.com (10.75.127.4) To GPXDAG2NODE5.st.com (10.75.127.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-19_06,2022-01-18_01,2021-12-02_01 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220119_013332_106701_9F55FA6C X-CRM114-Status: GOOD ( 21.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Commit 61367d0b8f5e ("spi: stm32: Add 'SPI_SIMPLEX_RX', 'SPI_3WIRE_RX' support for stm32f4") allowed to properly communicate with the st-gyro-spi even when there is no tx_buf provided by setting the flag SPI_MASTER_MUST_TX and thus forcing a dummy TX buffer to work in Full Duplex. This behavior should kept only for the STM32F4 and not for other compatible since the STM32H7 do support SIMPLEX_RX and SIMPLEX_TX. Add the flags variable within the struct stm32_spi_cfg so that flags used at master registration time are compatible specific. Fixes: 61367d0b8f5e ("spi: stm32: Add 'SPI_SIMPLEX_RX', 'SPI_3WIRE_RX' support for stm32f4") Signed-off-by: Alain Volmat --- drivers/spi/spi-stm32.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c index b5ef2470cefe..7fc24505a72c 100644 --- a/drivers/spi/spi-stm32.c +++ b/drivers/spi/spi-stm32.c @@ -231,6 +231,7 @@ struct stm32_spi; * @baud_rate_div_min: minimum baud rate divisor * @baud_rate_div_max: maximum baud rate divisor * @has_fifo: boolean to know if fifo is used for driver + * @flags: compatible specific SPI controller flags used at registration time */ struct stm32_spi_cfg { const struct stm32_spi_regspec *regs; @@ -251,6 +252,7 @@ struct stm32_spi_cfg { unsigned int baud_rate_div_min; unsigned int baud_rate_div_max; bool has_fifo; + u16 flags; }; /** @@ -1720,6 +1722,7 @@ static const struct stm32_spi_cfg stm32f4_spi_cfg = { .baud_rate_div_min = STM32F4_SPI_BR_DIV_MIN, .baud_rate_div_max = STM32F4_SPI_BR_DIV_MAX, .has_fifo = false, + .flags = SPI_MASTER_MUST_TX, }; static const struct stm32_spi_cfg stm32h7_spi_cfg = { @@ -1852,7 +1855,7 @@ static int stm32_spi_probe(struct platform_device *pdev) master->prepare_message = stm32_spi_prepare_msg; master->transfer_one = stm32_spi_transfer_one; master->unprepare_message = stm32_spi_unprepare_msg; - master->flags = SPI_MASTER_MUST_TX; + master->flags = spi->cfg->flags; spi->dma_tx = dma_request_chan(spi->dev, "tx"); if (IS_ERR(spi->dma_tx)) {