From mboxrd@z Thu Jan 1 00:00:00 1970 From: Krzysztof Kozlowski Subject: Re: [PATCH v3] SPI: s3c64xx: pass DMA arguments in platform data Date: Thu, 19 Nov 2015 09:57:40 +0900 Message-ID: <564D1E84.6070808@samsung.com> References: <3835977.ZFLKtOk346@wuerfel> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Return-path: In-reply-to: <3835977.ZFLKtOk346@wuerfel> Sender: linux-spi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Arnd Bergmann , Mark Brown Cc: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Kukjin Kim , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: linux-samsung-soc@vger.kernel.org On 18.11.2015 23:21, Arnd Bergmann wrote: > The s3c64xx platform data already contains a pointer to the > DMA filter function, but not to the associated data. > > This simplifies the code and makes it more generic by > passing the data along with the filter function like > we do for other drivers. > > Signed-off-by: Arnd Bergmann > --- > v3: leave pl330 support in place. this is not needed any more, but this > patch should not remove it. We will however need to come back to > this for multiplatform support, so a combined s3c64xx+s5p gets the > right filter function > v3: fix bug in probe function that caused the DT case to use polling mode > v2: This version is now independent of the ASoC changes. > > diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c > index 07a5a6e6dcaa..b53d4ff3befb 100644 > --- a/arch/arm/plat-samsung/devs.c > +++ b/arch/arm/plat-samsung/devs.c > @@ -1105,9 +1105,7 @@ struct platform_device s3c_device_wdt = { > #ifdef CONFIG_S3C64XX_DEV_SPI0 > static struct resource s3c64xx_spi0_resource[] = { > [0] = DEFINE_RES_MEM(S3C_PA_SPI0, SZ_256), > - [1] = DEFINE_RES_DMA(DMACH_SPI0_TX), > - [2] = DEFINE_RES_DMA(DMACH_SPI0_RX), > - [3] = DEFINE_RES_IRQ(IRQ_SPI0), > + [1] = DEFINE_RES_IRQ(IRQ_SPI0), > }; > > struct platform_device s3c64xx_device_spi0 = { > @@ -1135,6 +1133,8 @@ void __init s3c64xx_spi0_set_platdata(int (*cfg_gpio)(void), int src_clk_nr, > pd.num_cs = num_cs; > pd.src_clk_nr = src_clk_nr; > pd.cfg_gpio = (cfg_gpio) ? cfg_gpio : s3c64xx_spi0_cfg_gpio; > + pd.dma_tx = (void *)DMACH_SPI0_TX; > + pd.dma_rx = (void *)DMACH_SPI0_RX; > #if defined(CONFIG_PL330_DMA) > pd.filter = pl330_filter; > #elif defined(CONFIG_S3C64XX_PL080) > @@ -1150,9 +1150,7 @@ void __init s3c64xx_spi0_set_platdata(int (*cfg_gpio)(void), int src_clk_nr, > #ifdef CONFIG_S3C64XX_DEV_SPI1 > static struct resource s3c64xx_spi1_resource[] = { > [0] = DEFINE_RES_MEM(S3C_PA_SPI1, SZ_256), > - [1] = DEFINE_RES_DMA(DMACH_SPI1_TX), > - [2] = DEFINE_RES_DMA(DMACH_SPI1_RX), > - [3] = DEFINE_RES_IRQ(IRQ_SPI1), > + [1] = DEFINE_RES_IRQ(IRQ_SPI1), > }; > > struct platform_device s3c64xx_device_spi1 = { > @@ -1180,12 +1178,15 @@ void __init s3c64xx_spi1_set_platdata(int (*cfg_gpio)(void), int src_clk_nr, > pd.num_cs = num_cs; > pd.src_clk_nr = src_clk_nr; > pd.cfg_gpio = (cfg_gpio) ? cfg_gpio : s3c64xx_spi1_cfg_gpio; > + pd.dma_tx = (void *)DMACH_SPI1_TX; > + pd.dma_rx = (void *)DMACH_SPI1_RX; > #if defined(CONFIG_PL330_DMA) > pd.filter = pl330_filter; > #elif defined(CONFIG_S3C64XX_PL080) > pd.filter = pl08x_filter_id; > #endif > > + That empty line is not needed here. Rest is good so with removal of this empty line: Reviewed-by: Krzysztof Kozlowski Best regards, Krzysztof -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: k.kozlowski@samsung.com (Krzysztof Kozlowski) Date: Thu, 19 Nov 2015 09:57:40 +0900 Subject: [PATCH v3] SPI: s3c64xx: pass DMA arguments in platform data In-Reply-To: <3835977.ZFLKtOk346@wuerfel> References: <3835977.ZFLKtOk346@wuerfel> Message-ID: <564D1E84.6070808@samsung.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 18.11.2015 23:21, Arnd Bergmann wrote: > The s3c64xx platform data already contains a pointer to the > DMA filter function, but not to the associated data. > > This simplifies the code and makes it more generic by > passing the data along with the filter function like > we do for other drivers. > > Signed-off-by: Arnd Bergmann > --- > v3: leave pl330 support in place. this is not needed any more, but this > patch should not remove it. We will however need to come back to > this for multiplatform support, so a combined s3c64xx+s5p gets the > right filter function > v3: fix bug in probe function that caused the DT case to use polling mode > v2: This version is now independent of the ASoC changes. > > diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c > index 07a5a6e6dcaa..b53d4ff3befb 100644 > --- a/arch/arm/plat-samsung/devs.c > +++ b/arch/arm/plat-samsung/devs.c > @@ -1105,9 +1105,7 @@ struct platform_device s3c_device_wdt = { > #ifdef CONFIG_S3C64XX_DEV_SPI0 > static struct resource s3c64xx_spi0_resource[] = { > [0] = DEFINE_RES_MEM(S3C_PA_SPI0, SZ_256), > - [1] = DEFINE_RES_DMA(DMACH_SPI0_TX), > - [2] = DEFINE_RES_DMA(DMACH_SPI0_RX), > - [3] = DEFINE_RES_IRQ(IRQ_SPI0), > + [1] = DEFINE_RES_IRQ(IRQ_SPI0), > }; > > struct platform_device s3c64xx_device_spi0 = { > @@ -1135,6 +1133,8 @@ void __init s3c64xx_spi0_set_platdata(int (*cfg_gpio)(void), int src_clk_nr, > pd.num_cs = num_cs; > pd.src_clk_nr = src_clk_nr; > pd.cfg_gpio = (cfg_gpio) ? cfg_gpio : s3c64xx_spi0_cfg_gpio; > + pd.dma_tx = (void *)DMACH_SPI0_TX; > + pd.dma_rx = (void *)DMACH_SPI0_RX; > #if defined(CONFIG_PL330_DMA) > pd.filter = pl330_filter; > #elif defined(CONFIG_S3C64XX_PL080) > @@ -1150,9 +1150,7 @@ void __init s3c64xx_spi0_set_platdata(int (*cfg_gpio)(void), int src_clk_nr, > #ifdef CONFIG_S3C64XX_DEV_SPI1 > static struct resource s3c64xx_spi1_resource[] = { > [0] = DEFINE_RES_MEM(S3C_PA_SPI1, SZ_256), > - [1] = DEFINE_RES_DMA(DMACH_SPI1_TX), > - [2] = DEFINE_RES_DMA(DMACH_SPI1_RX), > - [3] = DEFINE_RES_IRQ(IRQ_SPI1), > + [1] = DEFINE_RES_IRQ(IRQ_SPI1), > }; > > struct platform_device s3c64xx_device_spi1 = { > @@ -1180,12 +1178,15 @@ void __init s3c64xx_spi1_set_platdata(int (*cfg_gpio)(void), int src_clk_nr, > pd.num_cs = num_cs; > pd.src_clk_nr = src_clk_nr; > pd.cfg_gpio = (cfg_gpio) ? cfg_gpio : s3c64xx_spi1_cfg_gpio; > + pd.dma_tx = (void *)DMACH_SPI1_TX; > + pd.dma_rx = (void *)DMACH_SPI1_RX; > #if defined(CONFIG_PL330_DMA) > pd.filter = pl330_filter; > #elif defined(CONFIG_S3C64XX_PL080) > pd.filter = pl08x_filter_id; > #endif > > + That empty line is not needed here. Rest is good so with removal of this empty line: Reviewed-by: Krzysztof Kozlowski Best regards, Krzysztof From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757518AbbKSA5o (ORCPT ); Wed, 18 Nov 2015 19:57:44 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:20339 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755519AbbKSA5m (ORCPT ); Wed, 18 Nov 2015 19:57:42 -0500 X-AuditID: cbfec7f5-f79b16d000005389-f4-564d1e836670 Subject: Re: [PATCH v3] SPI: s3c64xx: pass DMA arguments in platform data To: Arnd Bergmann , Mark Brown References: <3835977.ZFLKtOk346@wuerfel> Cc: linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, Kukjin Kim , linux-arm-kernel@lists.infradead.org From: Krzysztof Kozlowski Message-id: <564D1E84.6070808@samsung.com> Date: Thu, 19 Nov 2015 09:57:40 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-version: 1.0 In-reply-to: <3835977.ZFLKtOk346@wuerfel> Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrHLMWRmVeSWpSXmKPExsVy+t/xK7rNcr5hBhO3KFr8nXSM3WLqwyds Fq9fGFr0P37NbLHp8TVWi8u75rBZzDi/j8mi8eNNdgcOj9+/JjF6bFrVyeaxeUm9R9+WVYwe nzfJBbBGcdmkpOZklqUW6dslcGUs3PaKveCqWMXVJ6vZGxiPC3UxcnJICJhI/Pr4nQ3CFpO4 cG89kM3FISSwlFGib14DO4TzhVGiveEZK0iVsICnxK+1V9hBbBEBJ4lLR6+ygNhCAhoSbUvP MYM0MAssZ5Ro3vOfCSTBJmAssXn5ErAVvAJaEseeHgSLswioSqw7cArMFhWIkJg4oYEVokZQ 4sfke2BDOQU0Ja5s2AdUwwE0VE/i/kUtkDCzgLzE5jVvmScwCsxC0jELoWoWkqoFjMyrGEVT S5MLipPSc430ihNzi0vz0vWS83M3MUJC/esOxqXHrA4xCnAwKvHwbjjlEybEmlhWXJl7iFGC g1lJhLfsElCINyWxsiq1KD++qDQntfgQozQHi5I478xd70OEBNITS1KzU1MLUotgskwcnFIN jCdDuFr2mIv/WNg/sela69zuj3syTz65I1612e11dVspm7SUuasq34SiZYvO+U+78+ix5lNO kWlL625bhW1rPrwq2z4nuSd4zkotbu6YIMfPmg9qpRw9Eh/lNWvX6jfr3zh078yWNx7RWzmt hfNYD5xQNyz+fTRgcuG95q3SyUv0Gu8cvNSxX4mlOCPRUIu5qDgRAEZbMnRxAgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18.11.2015 23:21, Arnd Bergmann wrote: > The s3c64xx platform data already contains a pointer to the > DMA filter function, but not to the associated data. > > This simplifies the code and makes it more generic by > passing the data along with the filter function like > we do for other drivers. > > Signed-off-by: Arnd Bergmann > --- > v3: leave pl330 support in place. this is not needed any more, but this > patch should not remove it. We will however need to come back to > this for multiplatform support, so a combined s3c64xx+s5p gets the > right filter function > v3: fix bug in probe function that caused the DT case to use polling mode > v2: This version is now independent of the ASoC changes. > > diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c > index 07a5a6e6dcaa..b53d4ff3befb 100644 > --- a/arch/arm/plat-samsung/devs.c > +++ b/arch/arm/plat-samsung/devs.c > @@ -1105,9 +1105,7 @@ struct platform_device s3c_device_wdt = { > #ifdef CONFIG_S3C64XX_DEV_SPI0 > static struct resource s3c64xx_spi0_resource[] = { > [0] = DEFINE_RES_MEM(S3C_PA_SPI0, SZ_256), > - [1] = DEFINE_RES_DMA(DMACH_SPI0_TX), > - [2] = DEFINE_RES_DMA(DMACH_SPI0_RX), > - [3] = DEFINE_RES_IRQ(IRQ_SPI0), > + [1] = DEFINE_RES_IRQ(IRQ_SPI0), > }; > > struct platform_device s3c64xx_device_spi0 = { > @@ -1135,6 +1133,8 @@ void __init s3c64xx_spi0_set_platdata(int (*cfg_gpio)(void), int src_clk_nr, > pd.num_cs = num_cs; > pd.src_clk_nr = src_clk_nr; > pd.cfg_gpio = (cfg_gpio) ? cfg_gpio : s3c64xx_spi0_cfg_gpio; > + pd.dma_tx = (void *)DMACH_SPI0_TX; > + pd.dma_rx = (void *)DMACH_SPI0_RX; > #if defined(CONFIG_PL330_DMA) > pd.filter = pl330_filter; > #elif defined(CONFIG_S3C64XX_PL080) > @@ -1150,9 +1150,7 @@ void __init s3c64xx_spi0_set_platdata(int (*cfg_gpio)(void), int src_clk_nr, > #ifdef CONFIG_S3C64XX_DEV_SPI1 > static struct resource s3c64xx_spi1_resource[] = { > [0] = DEFINE_RES_MEM(S3C_PA_SPI1, SZ_256), > - [1] = DEFINE_RES_DMA(DMACH_SPI1_TX), > - [2] = DEFINE_RES_DMA(DMACH_SPI1_RX), > - [3] = DEFINE_RES_IRQ(IRQ_SPI1), > + [1] = DEFINE_RES_IRQ(IRQ_SPI1), > }; > > struct platform_device s3c64xx_device_spi1 = { > @@ -1180,12 +1178,15 @@ void __init s3c64xx_spi1_set_platdata(int (*cfg_gpio)(void), int src_clk_nr, > pd.num_cs = num_cs; > pd.src_clk_nr = src_clk_nr; > pd.cfg_gpio = (cfg_gpio) ? cfg_gpio : s3c64xx_spi1_cfg_gpio; > + pd.dma_tx = (void *)DMACH_SPI1_TX; > + pd.dma_rx = (void *)DMACH_SPI1_RX; > #if defined(CONFIG_PL330_DMA) > pd.filter = pl330_filter; > #elif defined(CONFIG_S3C64XX_PL080) > pd.filter = pl08x_filter_id; > #endif > > + That empty line is not needed here. Rest is good so with removal of this empty line: Reviewed-by: Krzysztof Kozlowski Best regards, Krzysztof