Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9190432ybl; Fri, 17 Jan 2020 07:46:39 -0800 (PST) X-Google-Smtp-Source: APXvYqyPCDO1iotXUH2CwT5dVkZqvelPtWVu/NwHPTMZf9Th5A5tw7ma2Xx7wn8WpvTnyKJYvCPl X-Received: by 2002:a9d:5f13:: with SMTP id f19mr6774859oti.180.1579275999278; Fri, 17 Jan 2020 07:46:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579275999; cv=none; d=google.com; s=arc-20160816; b=wCeqnozf4DfE4gwaYBkd1UeJzHiAzZKZeAwcT5MaDWJRdIKh3E8WEuCPgxvEizQUIu H4zjRXs5OV76LBP2s9AAtqSguGHqvV5Vm3cto96lPosOf5djsfLsLywxvFltSEifCPZW UBZO6wab3+mXuJ3YJWFzLjOhNOiZtWDlmCyoY+dsEby+VG5BhHme0FVpKJzezaA8AjMU 4kkAgEZp7aCKlc0KL1jwXY+1ujvqTNgAnK+Zhz1MbNqfVi+V32QwHCxbVAoiuPUBeDa9 RvI8Aoyl7Y3W6gkVa838Afl2tlNFBZ3wVqEjEX5rY6xZ0MR5812eFfVBQnw4Y1BtNaft jgiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from:dkim-signature; bh=YZm/5f9wodQfID90hCH6kdu/JpRhW+QGeHbLTu7g0DM=; b=WpNd1Hg5MI+q/hcp4V+vduxG1U2OwO6DfbJQn8+NmlT3bk42nEgeFqLK9OdDVvGKhw f/My5jGdVrHyRG7HBvIqHPMBGLrshDYfCoaesV0bJKKeqrYGRfI7ZT60eKQUPeX762Mc R/G0vDUI7P9gNJ0ClZ4WrjJZTCHly5lL9QtZbdTWgTGaFIZdt8b2ND5hWBVTFCPyRT6l dJS8i4ubVMW34xUE6QWiNgTImdG9QkJ+6Ba1ANGwE7M/o8N7VDszXaanD7XK7L90SU/C JJ3WLGvdYuukBEx1FDc/PiMGZx2axuKcbHvEB4RgCgnVASfsTIXFn/ds3biAEb44oQa2 MvhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=Wu4Px26Q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z4si15604542oti.93.2020.01.17.07.46.27; Fri, 17 Jan 2020 07:46:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=Wu4Px26Q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729410AbgAQPo6 (ORCPT + 99 others); Fri, 17 Jan 2020 10:44:58 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:53974 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729207AbgAQPoa (ORCPT ); Fri, 17 Jan 2020 10:44:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=YZm/5f9wodQfID90hCH6kdu/JpRhW+QGeHbLTu7g0DM=; b=Wu4Px26QUDJX 9BBVnJdZiujoKJDRPmgP7URAGeeMyS/2vWCDgNjtat6R+Jn/iNX6uDYsbaQoX2FpFED4ivBh0ykiy gWthDXylaQc0TVOl5Co7tjBTBLMpbclsVxl9c6jd3o8B7cq+SFdcTwtX8Hix9hiS2VevtxOixKqYe /084o=; Received: from fw-tnat-cam4.arm.com ([217.140.106.52] helo=fitzroy.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1isTnM-0006ua-JB; Fri, 17 Jan 2020 15:44:24 +0000 Received: by fitzroy.sirena.org.uk (Postfix, from userid 1000) id 4C87BD02A2A; Fri, 17 Jan 2020 15:44:24 +0000 (GMT) From: Mark Brown To: Tomer Maimon Cc: avifishman70@gmail.com, benjaminfair@google.com, broonie@kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, Mark Brown , mark.rutland@arm.com, openbmc@lists.ozlabs.org, robh+dt@kernel.org, tali.perry1@gmail.com, venture@google.com, yuenn@google.com Subject: Applied "spi: npcm-pspi: fix 16 bit send and receive support" to the spi tree In-Reply-To: <20200115162301.235926-2-tmaimon77@gmail.com> Message-Id: X-Patchwork-Hint: ignore Date: Fri, 17 Jan 2020 15:44:24 +0000 (GMT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch spi: npcm-pspi: fix 16 bit send and receive support has been applied to the spi tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-5.5 All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From 47416a5f27be0a0e815ef5f9f2f06618ae5e0470 Mon Sep 17 00:00:00 2001 From: Tomer Maimon Date: Wed, 15 Jan 2020 18:22:58 +0200 Subject: [PATCH] spi: npcm-pspi: fix 16 bit send and receive support Fixing NPCM BMC Peripheral SPI controller 16 bit send and receive support by writing and reading the SPI data in the right order. Signed-off-by: Tomer Maimon Link: https://lore.kernel.org/r/20200115162301.235926-2-tmaimon77@gmail.com Signed-off-by: Mark Brown --- drivers/spi/spi-npcm-pspi.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/spi/spi-npcm-pspi.c b/drivers/spi/spi-npcm-pspi.c index fe624731c74c..c74611abe2a9 100644 --- a/drivers/spi/spi-npcm-pspi.c +++ b/drivers/spi/spi-npcm-pspi.c @@ -195,6 +195,7 @@ static void npcm_pspi_setup_transfer(struct spi_device *spi, static void npcm_pspi_send(struct npcm_pspi *priv) { int wsize; + u16 val; wsize = min(bytes_per_word(priv->bits_per_word), priv->tx_bytes); priv->tx_bytes -= wsize; @@ -204,17 +205,18 @@ static void npcm_pspi_send(struct npcm_pspi *priv) switch (wsize) { case 1: - iowrite8(*priv->tx_buf, NPCM_PSPI_DATA + priv->base); + val = *priv->tx_buf++; + iowrite8(val, NPCM_PSPI_DATA + priv->base); break; case 2: - iowrite16(*priv->tx_buf, NPCM_PSPI_DATA + priv->base); + val = *priv->tx_buf++; + val = *priv->tx_buf++ | (val << 8); + iowrite16(val, NPCM_PSPI_DATA + priv->base); break; default: WARN_ON_ONCE(1); return; } - - priv->tx_buf += wsize; } static void npcm_pspi_recv(struct npcm_pspi *priv) @@ -230,18 +232,17 @@ static void npcm_pspi_recv(struct npcm_pspi *priv) switch (rsize) { case 1: - val = ioread8(priv->base + NPCM_PSPI_DATA); + *priv->rx_buf++ = ioread8(priv->base + NPCM_PSPI_DATA); break; case 2: val = ioread16(priv->base + NPCM_PSPI_DATA); + *priv->rx_buf++ = (val >> 8); + *priv->rx_buf++ = val & 0xff; break; default: WARN_ON_ONCE(1); return; } - - *priv->rx_buf = val; - priv->rx_buf += rsize; } static int npcm_pspi_transfer_one(struct spi_master *master, -- 2.20.1