From patchwork Mon May 10 13:12:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12248173 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 642ACC433B4 for ; Mon, 10 May 2021 13:32:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 36AF761421 for ; Mon, 10 May 2021 13:32:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232223AbhEJNdJ (ORCPT ); Mon, 10 May 2021 09:33:09 -0400 Received: from mga11.intel.com ([192.55.52.93]:42873 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351921AbhEJNNY (ORCPT ); Mon, 10 May 2021 09:13:24 -0400 IronPort-SDR: 1o+SxFzh8YMItWPU2aHLsEIVaZozNOcA6oQ+bjhH0HYgLv+QBm6t/Cm3IzLqvB/X+FkyDYZ3g8 Qm2cv1wuT4VA== X-IronPort-AV: E=McAfee;i="6200,9189,9980"; a="196097984" X-IronPort-AV: E=Sophos;i="5.82,287,1613462400"; d="scan'208";a="196097984" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2021 06:12:11 -0700 IronPort-SDR: cvIFTPk3l/qMviQ4zOXZz5u7wXujsGpD2xZDy2UCJMkhSlGTsvEsp9+QKCPPxNo9eoDxDcd1+a 1YhLpxzqJB/g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,287,1613462400"; d="scan'208";a="461292622" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 10 May 2021 06:12:07 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id E13F7D7; Mon, 10 May 2021 16:12:27 +0300 (EEST) From: Andy Shevchenko To: Linus Walleij , Mark Brown , openbmc@lists.ozlabs.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Kunihiko Hayashi , Masami Hiramatsu , Andy Shevchenko Subject: [PATCH v1 1/7] spi: Use SPI_MODE_X_MASK Date: Mon, 10 May 2021 16:12:11 +0300 Message-Id: <20210510131217.49357-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Use SPI_MODE_X_MASK instead of open coded variant. While at it, fix format specifier and drop explicit casting. Signed-off-by: Andy Shevchenko --- drivers/spi/spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 407420977a73..956dce3aafca 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -3441,8 +3441,8 @@ int spi_setup(struct spi_device *spi) spi_set_thread_rt(spi->controller); } - dev_dbg(&spi->dev, "setup mode %d, %s%s%s%s%u bits/w, %u Hz max --> %d\n", - (int) (spi->mode & (SPI_CPOL | SPI_CPHA)), + dev_dbg(&spi->dev, "setup mode %lu, %s%s%s%s%u bits/w, %u Hz max --> %d\n", + spi->mode & SPI_MODE_X_MASK, (spi->mode & SPI_CS_HIGH) ? "cs_high, " : "", (spi->mode & SPI_LSB_FIRST) ? "lsb, " : "", (spi->mode & SPI_3WIRE) ? "3wire, " : "", From patchwork Mon May 10 13:12:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12248175 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC5C9C433B4 for ; Mon, 10 May 2021 13:32:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9148461400 for ; Mon, 10 May 2021 13:32:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236987AbhEJNdL (ORCPT ); Mon, 10 May 2021 09:33:11 -0400 Received: from mga03.intel.com ([134.134.136.65]:10488 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351983AbhEJNNo (ORCPT ); Mon, 10 May 2021 09:13:44 -0400 IronPort-SDR: P8je5+K4gaAsnU1dbEDEBONp3uU885e0ZFlPK0ZhEDoj4gUULLooH4NCXUofHzCr3vre7ESAB0 y9BD5HhXCaqQ== X-IronPort-AV: E=McAfee;i="6200,9189,9980"; a="199243589" X-IronPort-AV: E=Sophos;i="5.82,287,1613462400"; d="scan'208";a="199243589" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2021 06:12:11 -0700 IronPort-SDR: 1dK34HlXywKWlK8OUBdgS4JFa5nJQ8xwpk922IMg7i3LR1jhohThkirVKwBBhcIUgx8hCkmyHI ZqugYUwZYGAg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,287,1613462400"; d="scan'208";a="391916757" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga006.jf.intel.com with ESMTP; 10 May 2021 06:12:07 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id EDA5812A; Mon, 10 May 2021 16:12:27 +0300 (EEST) From: Andy Shevchenko To: Linus Walleij , Mark Brown , openbmc@lists.ozlabs.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Kunihiko Hayashi , Masami Hiramatsu , Andy Shevchenko Subject: [PATCH v1 2/7] spi: spidev: Use SPI_MODE_X_MASK Date: Mon, 10 May 2021 16:12:12 +0300 Message-Id: <20210510131217.49357-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210510131217.49357-1-andriy.shevchenko@linux.intel.com> References: <20210510131217.49357-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Use SPI_MODE_X_MASK instead of open coded variant. Signed-off-by: Andy Shevchenko --- drivers/spi/spidev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index f56e0e975a46..24e9469ea35b 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c @@ -59,7 +59,7 @@ static DECLARE_BITMAP(minors, N_SPI_MINORS); * * REVISIT should changing those flags be privileged? */ -#define SPI_MODE_MASK (SPI_CPHA | SPI_CPOL | SPI_CS_HIGH \ +#define SPI_MODE_MASK (SPI_MODE_X_MASK | SPI_CS_HIGH \ | SPI_LSB_FIRST | SPI_3WIRE | SPI_LOOP \ | SPI_NO_CS | SPI_READY | SPI_TX_DUAL \ | SPI_TX_QUAD | SPI_TX_OCTAL | SPI_RX_DUAL \ From patchwork Mon May 10 13:12:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12248185 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 397E1C433B4 for ; Mon, 10 May 2021 13:32:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 11F4561433 for ; Mon, 10 May 2021 13:32:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237875AbhEJNdq (ORCPT ); Mon, 10 May 2021 09:33:46 -0400 Received: from mga06.intel.com ([134.134.136.31]:34990 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352061AbhEJNNy (ORCPT ); Mon, 10 May 2021 09:13:54 -0400 IronPort-SDR: W3qn28fC68RPwrIqUeWAVAkY3EyBRW2VyvwgknhumLaXFEjo2rjVWP2VBayPLymh6GrPD/TV5l pr5LomO31giA== X-IronPort-AV: E=McAfee;i="6200,9189,9980"; a="260455803" X-IronPort-AV: E=Sophos;i="5.82,286,1613462400"; d="scan'208";a="260455803" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2021 06:12:25 -0700 IronPort-SDR: sIr9jWrurMg6PCum7v4YEo45Ps8OCp/+M2IwXM+YdUseDNtgvfm3TEpVvP4KqrsfGQ0m5TpSfQ WGXaXftYpy7g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,287,1613462400"; d="scan'208";a="470793108" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga001.jf.intel.com with ESMTP; 10 May 2021 06:12:08 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 05E33142; Mon, 10 May 2021 16:12:27 +0300 (EEST) From: Andy Shevchenko To: Linus Walleij , Mark Brown , openbmc@lists.ozlabs.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Kunihiko Hayashi , Masami Hiramatsu , Andy Shevchenko Subject: [PATCH v1 3/7] spi: npcm-pspi: Use SPI_MODE_X_MASK Date: Mon, 10 May 2021 16:12:13 +0300 Message-Id: <20210510131217.49357-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210510131217.49357-1-andriy.shevchenko@linux.intel.com> References: <20210510131217.49357-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Use SPI_MODE_X_MASK instead of open coded variant. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-npcm-pspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-npcm-pspi.c b/drivers/spi/spi-npcm-pspi.c index 56d10c4511db..1668a347e003 100644 --- a/drivers/spi/spi-npcm-pspi.c +++ b/drivers/spi/spi-npcm-pspi.c @@ -105,7 +105,7 @@ static void npcm_pspi_set_mode(struct spi_device *spi) u16 regtemp; u16 mode_val; - switch (spi->mode & (SPI_CPOL | SPI_CPHA)) { + switch (spi->mode & SPI_MODE_X_MASK) { case SPI_MODE_0: mode_val = 0; break; From patchwork Mon May 10 13:12:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12248181 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 556F1C433ED for ; Mon, 10 May 2021 13:32:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2EDC261288 for ; Mon, 10 May 2021 13:32:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233982AbhEJNdj (ORCPT ); Mon, 10 May 2021 09:33:39 -0400 Received: from mga09.intel.com ([134.134.136.24]:19656 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352063AbhEJNNy (ORCPT ); Mon, 10 May 2021 09:13:54 -0400 IronPort-SDR: kB78eF1+FfDRMsvKcZ8hs63pShJlKc0bGTnK9Ahw7J559hRZ0C3H5VvwBrQMZnscbNKfbXtFbd drO9wap2sIug== X-IronPort-AV: E=McAfee;i="6200,9189,9980"; a="199261266" X-IronPort-AV: E=Sophos;i="5.82,287,1613462400"; d="scan'208";a="199261266" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2021 06:12:12 -0700 IronPort-SDR: cdfWr8A2AqccBATyGw3BVMyWmpt2JQ+K0F3lVLPuHtOtqNEguqvlmt+ZXmhI3myDhFKSLE2Upf HJX+9qMCT0KQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,287,1613462400"; d="scan'208";a="624279386" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 10 May 2021 06:12:07 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 11E22147; Mon, 10 May 2021 16:12:28 +0300 (EEST) From: Andy Shevchenko To: Linus Walleij , Mark Brown , openbmc@lists.ozlabs.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Kunihiko Hayashi , Masami Hiramatsu , Andy Shevchenko Subject: [PATCH v1 4/7] spi: oc-tiny: Use SPI_MODE_X_MASK Date: Mon, 10 May 2021 16:12:14 +0300 Message-Id: <20210510131217.49357-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210510131217.49357-1-andriy.shevchenko@linux.intel.com> References: <20210510131217.49357-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Use SPI_MODE_X_MASK instead of open coded variant. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-oc-tiny.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-oc-tiny.c b/drivers/spi/spi-oc-tiny.c index f3843f0ff260..38c14c4e4e21 100644 --- a/drivers/spi/spi-oc-tiny.c +++ b/drivers/spi/spi-oc-tiny.c @@ -86,7 +86,7 @@ static int tiny_spi_setup(struct spi_device *spi) hw->speed_hz = spi->max_speed_hz; hw->baud = tiny_spi_baud(spi, hw->speed_hz); } - hw->mode = spi->mode & (SPI_CPOL | SPI_CPHA); + hw->mode = spi->mode & SPI_MODE_X_MASK; return 0; } From patchwork Mon May 10 13:12:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12248179 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1382BC433B4 for ; Mon, 10 May 2021 13:32:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D60A561288 for ; Mon, 10 May 2021 13:32:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231928AbhEJNde (ORCPT ); Mon, 10 May 2021 09:33:34 -0400 Received: from mga09.intel.com ([134.134.136.24]:19863 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351985AbhEJNNo (ORCPT ); Mon, 10 May 2021 09:13:44 -0400 IronPort-SDR: swFkPIj9AfCF1MLysQBsOxNQwp523p1WUgJRasM3H7Uew923kF5wfG4MAAwY04nnqjmclBy9SK leoy1C2mzSoQ== X-IronPort-AV: E=McAfee;i="6200,9189,9980"; a="199261260" X-IronPort-AV: E=Sophos;i="5.82,287,1613462400"; d="scan'208";a="199261260" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2021 06:12:12 -0700 IronPort-SDR: 8cq4xdeItGeJtjcaNXc/GLgNpMLgVbQgOorFy/ktICqTUna/9qzT4szFJTTALAuqPSM/5np71L kJAgbte4tPNg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,287,1613462400"; d="scan'208";a="624279388" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 10 May 2021 06:12:07 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 1E1CB1D2; Mon, 10 May 2021 16:12:28 +0300 (EEST) From: Andy Shevchenko To: Linus Walleij , Mark Brown , openbmc@lists.ozlabs.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Kunihiko Hayashi , Masami Hiramatsu , Andy Shevchenko Subject: [PATCH v1 5/7] spi: omap-uwire: Use SPI_MODE_X_MASK Date: Mon, 10 May 2021 16:12:15 +0300 Message-Id: <20210510131217.49357-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210510131217.49357-1-andriy.shevchenko@linux.intel.com> References: <20210510131217.49357-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Use SPI_MODE_X_MASK instead of open coded variant. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-omap-uwire.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-omap-uwire.c b/drivers/spi/spi-omap-uwire.c index 71402f71ddd8..ceb479f5c88f 100644 --- a/drivers/spi/spi-omap-uwire.c +++ b/drivers/spi/spi-omap-uwire.c @@ -330,7 +330,7 @@ static int uwire_setup_transfer(struct spi_device *spi, struct spi_transfer *t) if (spi->mode & SPI_CPOL) flags |= UWIRE_CLK_INVERTED; - switch (spi->mode & (SPI_CPOL | SPI_CPHA)) { + switch (spi->mode & SPI_MODE_X_MASK) { case SPI_MODE_0: case SPI_MODE_3: flags |= UWIRE_WRITE_FALLING_EDGE | UWIRE_READ_RISING_EDGE; From patchwork Mon May 10 13:12:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12248189 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 109D2C433ED for ; Mon, 10 May 2021 13:33:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D700F613EE for ; Mon, 10 May 2021 13:33:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234662AbhEJNd4 (ORCPT ); Mon, 10 May 2021 09:33:56 -0400 Received: from mga06.intel.com ([134.134.136.31]:34987 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352113AbhEJNN6 (ORCPT ); Mon, 10 May 2021 09:13:58 -0400 IronPort-SDR: GwiuOdu5HVi32vlQhEkq8BQG5zy4sxi+14mIyb8ckxATMM1fBgNz4nChjzuIGarAwvGzCU3qFB GVUUKfjrPWFA== X-IronPort-AV: E=McAfee;i="6200,9189,9980"; a="260455814" X-IronPort-AV: E=Sophos;i="5.82,286,1613462400"; d="scan'208";a="260455814" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2021 06:12:29 -0700 IronPort-SDR: SEBoGOsd7HXGOK7sM3x2GPA4qSj8lyD5tn9LcErORMjswRKOZx6rTJNkTWPONTmR8JmYPkViGo u8daIbcG3TWQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,287,1613462400"; d="scan'208";a="470793122" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga001.jf.intel.com with ESMTP; 10 May 2021 06:12:12 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 2A2AA202; Mon, 10 May 2021 16:12:28 +0300 (EEST) From: Andy Shevchenko To: Linus Walleij , Mark Brown , openbmc@lists.ozlabs.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Kunihiko Hayashi , Masami Hiramatsu , Andy Shevchenko Subject: [PATCH v1 6/7] spi: ppc4xx: Use SPI_MODE_X_MASK Date: Mon, 10 May 2021 16:12:16 +0300 Message-Id: <20210510131217.49357-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210510131217.49357-1-andriy.shevchenko@linux.intel.com> References: <20210510131217.49357-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Use SPI_MODE_X_MASK instead of open coded variant. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-ppc4xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-ppc4xx.c b/drivers/spi/spi-ppc4xx.c index d8ee363fb714..cb6aaad73f63 100644 --- a/drivers/spi/spi-ppc4xx.c +++ b/drivers/spi/spi-ppc4xx.c @@ -235,7 +235,7 @@ static int spi_ppc4xx_setup(struct spi_device *spi) */ cs->mode = SPI_PPC4XX_MODE_SPE; - switch (spi->mode & (SPI_CPHA | SPI_CPOL)) { + switch (spi->mode & SPI_MODE_X_MASK) { case SPI_MODE_0: cs->mode |= SPI_CLK_MODE0; break; From patchwork Mon May 10 13:12:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12248177 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03ED7C433B4 for ; Mon, 10 May 2021 13:32:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D1DE0613E1 for ; Mon, 10 May 2021 13:32:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232200AbhEJNdU (ORCPT ); Mon, 10 May 2021 09:33:20 -0400 Received: from mga09.intel.com ([134.134.136.24]:19860 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351984AbhEJNNo (ORCPT ); Mon, 10 May 2021 09:13:44 -0400 IronPort-SDR: wjq9qYUaWBjy5/cV1Jqha2pF8az1ePAtdfJ5im+3P4mvWTpCTUqIPeo3LtpEeWj65O3QulQEIt SLsrTG+myFaQ== X-IronPort-AV: E=McAfee;i="6200,9189,9980"; a="199261271" X-IronPort-AV: E=Sophos;i="5.82,287,1613462400"; d="scan'208";a="199261271" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2021 06:12:15 -0700 IronPort-SDR: crr0PTD/wqg0xrIajIR5THwsMYJDeciaOCujFPoUOsxt9UYSNWFPAGgXObKqV02E0UiuaaaKih uCtpejFevx/Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,287,1613462400"; d="scan'208";a="436139440" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 10 May 2021 06:12:12 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 3665B501; Mon, 10 May 2021 16:12:28 +0300 (EEST) From: Andy Shevchenko To: Linus Walleij , Mark Brown , openbmc@lists.ozlabs.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Kunihiko Hayashi , Masami Hiramatsu , Andy Shevchenko Subject: [PATCH v1 7/7] spi: uniphier: Use SPI_MODE_X_MASK Date: Mon, 10 May 2021 16:12:17 +0300 Message-Id: <20210510131217.49357-7-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210510131217.49357-1-andriy.shevchenko@linux.intel.com> References: <20210510131217.49357-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Use SPI_MODE_X_MASK instead of open coded variant. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-uniphier.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-uniphier.c b/drivers/spi/spi-uniphier.c index 6a9ef8ee3cc9..8900e51e1a1c 100644 --- a/drivers/spi/spi-uniphier.c +++ b/drivers/spi/spi-uniphier.c @@ -142,7 +142,7 @@ static void uniphier_spi_set_mode(struct spi_device *spi) * FSTRT start frame timing * 0: rising edge of clock, 1: falling edge of clock */ - switch (spi->mode & (SPI_CPOL | SPI_CPHA)) { + switch (spi->mode & SPI_MODE_X_MASK) { case SPI_MODE_0: /* CKPHS=1, CKINIT=0, CKDLY=1, FSTRT=0 */ val1 = SSI_CKS_CKPHS | SSI_CKS_CKDLY;