From patchwork Mon Oct 12 16:59:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 7377961 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 208FFBEEA4 for ; Mon, 12 Oct 2015 16:59:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1805A208DB for ; Mon, 12 Oct 2015 16:59:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C329E208D3 for ; Mon, 12 Oct 2015 16:59:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751592AbbJLQ7s (ORCPT ); Mon, 12 Oct 2015 12:59:48 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:55367 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751086AbbJLQ7r (ORCPT ); Mon, 12 Oct 2015 12:59:47 -0400 Received: from cpc11-sgyl31-2-0-cust672.sgyl.cable.virginm.net ([94.175.94.161] helo=finisterre) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1ZlgRk-0002a3-TD; Mon, 12 Oct 2015 16:59:42 +0000 Received: from broonie by finisterre with local (Exim 4.86) (envelope-from ) id 1ZlgRi-00052F-1v; Mon, 12 Oct 2015 17:59:34 +0100 From: Mark Brown To: Jonas Gorski , Mark Brown Cc: linux-spi@vger.kernel.org In-Reply-To: <1444645463-20915-3-git-send-email-jogo@openwrt.org> Message-Id: Date: Mon, 12 Oct 2015 17:59:34 +0100 X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Subject: Applied "spi/bcm63xx: move message control word description to register offsets" to the spi tree X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The patch spi/bcm63xx: move message control word description to register offsets has been applied to the spi tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git 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 f13a5e8a856cda0626da316d853a71952f14b1d7 Mon Sep 17 00:00:00 2001 From: Jonas Gorski Date: Mon, 12 Oct 2015 12:24:22 +0200 Subject: [PATCH] spi/bcm63xx: move message control word description to register offsets Make the message control word parameters part of the register offsets array so we have them all in one struct. Signed-off-by: Jonas Gorski Signed-off-by: Mark Brown --- arch/mips/bcm63xx/dev-spi.c | 20 ++------------------ arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_spi.h | 16 +++++++--------- drivers/spi/spi-bcm63xx.c | 7 +++---- 3 files changed, 12 insertions(+), 31 deletions(-) diff --git a/arch/mips/bcm63xx/dev-spi.c b/arch/mips/bcm63xx/dev-spi.c index ad448e4..b212256 100644 --- a/arch/mips/bcm63xx/dev-spi.c +++ b/arch/mips/bcm63xx/dev-spi.c @@ -53,19 +53,11 @@ static struct resource spi_resources[] = { }, }; -static struct bcm63xx_spi_pdata spi_pdata = { - .bus_num = 0, - .num_chipselect = 8, -}; - static struct platform_device bcm63xx_spi_device = { .name = "bcm63xx-spi", .id = -1, .num_resources = ARRAY_SIZE(spi_resources), .resource = spi_resources, - .dev = { - .platform_data = &spi_pdata, - }, }; int __init bcm63xx_spi_register(void) @@ -77,20 +69,12 @@ int __init bcm63xx_spi_register(void) spi_resources[0].end = spi_resources[0].start; spi_resources[1].start = bcm63xx_get_irq_number(IRQ_SPI); - if (BCMCPU_IS_6338() || BCMCPU_IS_6348()) { + if (BCMCPU_IS_6338() || BCMCPU_IS_6348()) spi_resources[0].end += BCM_6348_RSET_SPI_SIZE - 1; - spi_pdata.fifo_size = SPI_6348_MSG_DATA_SIZE; - spi_pdata.msg_type_shift = SPI_6348_MSG_TYPE_SHIFT; - spi_pdata.msg_ctl_width = SPI_6348_MSG_CTL_WIDTH; - } if (BCMCPU_IS_3368() || BCMCPU_IS_6358() || BCMCPU_IS_6362() || - BCMCPU_IS_6368()) { + BCMCPU_IS_6368()) spi_resources[0].end += BCM_6358_RSET_SPI_SIZE - 1; - spi_pdata.fifo_size = SPI_6358_MSG_DATA_SIZE; - spi_pdata.msg_type_shift = SPI_6358_MSG_TYPE_SHIFT; - spi_pdata.msg_ctl_width = SPI_6358_MSG_CTL_WIDTH; - } bcm63xx_spi_regs_init(); diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_spi.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_spi.h index 2573765..1d121fd 100644 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_spi.h +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_spi.h @@ -7,14 +7,6 @@ int __init bcm63xx_spi_register(void); -struct bcm63xx_spi_pdata { - unsigned int fifo_size; - unsigned int msg_type_shift; - unsigned int msg_ctl_width; - int bus_num; - int num_chipselect; -}; - enum bcm63xx_regs_spi { SPI_CMD, SPI_INT_STATUS, @@ -28,6 +20,9 @@ enum bcm63xx_regs_spi { SPI_MSG_CTL, SPI_MSG_DATA, SPI_RX_DATA, + SPI_MSG_TYPE_SHIFT, + SPI_MSG_CTL_WIDTH, + SPI_MSG_DATA_SIZE, }; #define __GEN_SPI_REGS_TABLE(__cpu) \ @@ -42,7 +37,10 @@ enum bcm63xx_regs_spi { [SPI_RX_TAIL] = SPI_## __cpu ##_RX_TAIL, \ [SPI_MSG_CTL] = SPI_## __cpu ##_MSG_CTL, \ [SPI_MSG_DATA] = SPI_## __cpu ##_MSG_DATA, \ - [SPI_RX_DATA] = SPI_## __cpu ##_RX_DATA, + [SPI_RX_DATA] = SPI_## __cpu ##_RX_DATA, \ + [SPI_MSG_TYPE_SHIFT] = SPI_## __cpu ##_MSG_TYPE_SHIFT, \ + [SPI_MSG_CTL_WIDTH] = SPI_## __cpu ##_MSG_CTL_WIDTH, \ + [SPI_MSG_DATA_SIZE] = SPI_## __cpu ##_MSG_DATA_SIZE, static inline unsigned long bcm63xx_spireg(enum bcm63xx_regs_spi reg) { diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c index 461891f..b3da044 100644 --- a/drivers/spi/spi-bcm63xx.c +++ b/drivers/spi/spi-bcm63xx.c @@ -329,7 +329,6 @@ static int bcm63xx_spi_probe(struct platform_device *pdev) { struct resource *r; struct device *dev = &pdev->dev; - struct bcm63xx_spi_pdata *pdata = dev_get_platdata(&pdev->dev); int irq; struct spi_master *master; struct clk *clk; @@ -369,7 +368,7 @@ static int bcm63xx_spi_probe(struct platform_device *pdev) bs->irq = irq; bs->clk = clk; - bs->fifo_size = pdata->fifo_size; + bs->fifo_size = bcm63xx_spireg(SPI_MSG_DATA_SIZE); ret = devm_request_irq(&pdev->dev, irq, bcm63xx_spi_interrupt, 0, pdev->name, master); @@ -384,8 +383,8 @@ static int bcm63xx_spi_probe(struct platform_device *pdev) master->mode_bits = MODEBITS; master->bits_per_word_mask = SPI_BPW_MASK(8); master->auto_runtime_pm = true; - bs->msg_type_shift = pdata->msg_type_shift; - bs->msg_ctl_width = pdata->msg_ctl_width; + bs->msg_type_shift = bcm63xx_spireg(SPI_MSG_TYPE_SHIFT); + bs->msg_ctl_width = bcm63xx_spireg(SPI_MSG_CTL_WIDTH); bs->tx_io = (u8 *)(bs->regs + bcm63xx_spireg(SPI_MSG_DATA)); bs->rx_io = (const u8 *)(bs->regs + bcm63xx_spireg(SPI_RX_DATA));