[PATCH] spi: s3c64xx: use clk_prepare_enable and clk_disable_unprepare
Convert clk_enable/clk_disable to clk_prepare_enable/clk_disable_unprepare calls as required by common clock framework. Signed-off-by: Thomas Abraham --- drivers/spi/spi-s3c64xx.c | 32 1 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 9e55c44..9ad7109 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -516,7 +516,7 @@ static void s3c64xx_spi_config(struct s3c64xx_spi_driver_data *sdd) /* Disable Clock */ if (sdd->port_conf->clk_from_cmu) { - clk_disable(sdd->src_clk); + clk_disable_unprepare(sdd->src_clk); } else { val = readl(regs + S3C64XX_SPI_CLK_CFG); val &= ~S3C64XX_SPI_ENCLK_ENABLE; @@ -564,7 +564,7 @@ static void s3c64xx_spi_config(struct s3c64xx_spi_driver_data *sdd) /* There is half-multiplier before the SPI */ clk_set_rate(sdd->src_clk, sdd->cur_speed * 2); /* Enable Clock */ - clk_enable(sdd->src_clk); + clk_prepare_enable(sdd->src_clk); } else { /* Configure Clock */ val = readl(regs + S3C64XX_SPI_CLK_CFG); @@ -1299,7 +1299,7 @@ static int __init s3c64xx_spi_probe(struct platform_device *pdev) goto err3; } - if (clk_enable(sdd->clk)) { + if (clk_prepare_enable(sdd->clk)) { dev_err(&pdev->dev, "Couldn't enable clock 'spi'\n"); ret = -EBUSY; goto err4; @@ -1314,7 +1314,7 @@ static int __init s3c64xx_spi_probe(struct platform_device *pdev) goto err5; } - if (clk_enable(sdd->src_clk)) { + if (clk_prepare_enable(sdd->src_clk)) { dev_err(&pdev->dev, "Couldn't enable clock '%s'\n", clk_name); ret = -EBUSY; goto err6; @@ -1358,11 +1358,11 @@ static int __init s3c64xx_spi_probe(struct platform_device *pdev) err8: free_irq(irq, sdd); err7: - clk_disable(sdd->src_clk); + clk_disable_unprepare(sdd->src_clk); err6: clk_put(sdd->src_clk); err5: - clk_disable(sdd->clk); + clk_disable_unprepare(sdd->clk); err4: clk_put(sdd->clk); err3: @@ -1390,10 +1390,10 @@ static int s3c64xx_spi_remove(struct platform_device *pdev) free_irq(platform_get_irq(pdev, 0), sdd); - clk_disable(sdd->src_clk); + clk_disable_unprepare(sdd->src_clk); clk_put(sdd->src_clk); - clk_disable(sdd->clk); + clk_disable_unprepare(sdd->clk); clk_put(sdd->clk); if (!sdd->cntrlr_info->cfg_gpio && pdev->dev.of_node) @@ -1414,8 +1414,8 @@ static int s3c64xx_spi_suspend(struct device *dev) spi_master_suspend(master); /* Disable the clock */ - clk_disable(sdd->src_clk); - clk_disable(sdd->clk); + clk_disable_unprepare(sdd->src_clk); + clk_disable_unprepare(sdd->clk); if (!sdd->cntrlr_info->cfg_gpio && dev->of_node) s3c64xx_spi_dt_gpio_free(sdd); @@ -1437,8 +1437,8 @@ static int s3c64xx_spi_resume(struct device *dev) sci->cfg_gpio(); /* Enable the clock */ - clk_enable(sdd->src_clk); - clk_enable(sdd->clk); + clk_prepare_enable(sdd->src_clk); + clk_prepare_enable(sdd->clk); s3c64xx_spi_hwinit(sdd, sdd->port_id); @@ -1454,8 +1454,8 @@ static int s3c64xx_spi_runtime_suspend(struct device *dev) struct spi_master *master = dev_get_drvdata(dev); struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master); - clk_disable(sdd->clk); - clk_disable(sdd->src_clk); + clk_disable_unprepare(sdd->clk); + clk_disable_unprepare(sdd->src_clk); return 0; } @@ -1465,8 +1465,8 @@ static int s3c64xx_spi_runtime_resume(struct device *dev) struct spi_master *master = dev_get_drvdata(dev); struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master); - clk_enable(sdd->src_clk); - clk_enable(sdd->clk); + clk_prepare_enable(sdd->src_clk); + clk_prepare_enable(sdd->clk); return 0; } -- 1.7.4.1 -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev ___ spi-devel-general mailing list spi-devel-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spi-devel-general
Re: [GIT PULL] SPI updates for 3.7
On Tue, Oct 2, 2012 at 6:49 PM, Mark Brown wrote: > The following changes since commit 979570e02981d4a8fc20b3cc8fd651856c98ee9d: > > Linux 3.6-rc7 (2012-09-23 18:10:57 -0700) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc.git tags/spi-3.7 > > for you to fetch changes up to 536a53a300d0d40152796eefb0a9e6e36ca37f7d: > > spi: remove completely broken Tegra driver (2012-10-01 13:29:49 +0100) > > I'm still looking after SPI for the time being while Grant's trying to > catch up with things. Thanks Mark, I really appreciate your help here. I should be able to pick things back up after the merge window. g. -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev ___ spi-devel-general mailing list spi-devel-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spi-devel-general
[GIT PULL] SPI updates for 3.7
The following changes since commit 979570e02981d4a8fc20b3cc8fd651856c98ee9d: Linux 3.6-rc7 (2012-09-23 18:10:57 -0700) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc.git tags/spi-3.7 for you to fetch changes up to 536a53a300d0d40152796eefb0a9e6e36ca37f7d: spi: remove completely broken Tegra driver (2012-10-01 13:29:49 +0100) I'm still looking after SPI for the time being while Grant's trying to catch up with things. spi: Updates for v3.7 No framework work here, only a bunch of driver updates of varying sizes: - Factoring out of the core hardware support from the MXS MMC driver by Marek Vasut to allow the hardware to also be used for SPI. - Lots of error handling cleanups from Guenter Roeck - Removal of the existing Tegra driver which is quite comprehensively broken as detailed in the changelog for the removal. - DT suppport for the PL022 and GPIO drivers. - pinctrl support for OMAP and PL022. Andrew Lunn (1): spi: Refactor spi-orion to use SPI framework queue. Daniel Mack (2): spi: spi-gpio: store chipselect information in private structure spi: spi-gpio: Add DT bindings Guenter Roeck (12): spi/pl022: Fix device remove function spi/mpc52xx: Fix error handling in probe function spi/mpc52xx: Fix device remove function spi/mpc52xx-psc: Avoid access to freed memory in device remove function spi/mpc512x-psc: Avoid access to freed memory in device remove function spi: Master driver for NXP SC18IS602/603 spi/sc18is602: Return -EINVAL for probe failures due to I2C function mismatch spi/stmp: Fix device remove function spi/tegra: Fix device remove function spi/topcliff-pch: Fix device remove function spi/s3c64xx: Drop extra calls to spi_master_get in suspend/remove functions spi/mxs: Fix device remove function Julia Lawall (2): drivers/spi/spi-s3c24xx.c: fix error return code spi: spi-sh-hspi: drop frees of devm_ alloc'd data Knut Wohlrab (1): spi/imx: set the inactive state of the clock according to the clock polarity Linus Walleij (2): spi/pl022: use more managed resources spi/pl022: get/put resources on suspend/resume Marek Vasut (16): mmc: spi: Move SSP register definitions into separate file mmc: spi: Rename IMX2[38]_MMC to IMX2[38]_SSP mmc: spi: Add necessary bits into mxs-spi.h mmc: spi: Pull out parts shared between MMC and SPI mmc: spi: Pull out the SSP clock configuration function spi/mxs: Add SPI driver for mx233/mx28 mmc: spi: Pull out common DMA parts from MXS MMC spi/mxs: Add DMA support into SPI driver spi/mxs: Add SSP/SPI device tree documentation mxs/spi: Restart the block after unsuccessful transfer mxs/spi: Fix misuse of init_completion mxs/spi: Fix issues when doing long continuous transfer mxs/spi: Increment the transfer length only if transfer succeeded mxs/spi: Decrement the DMA/PIO border mxs/spi: Rework the mxs_ssp_timeout to be more readable spi/mxs: Make the SPI block clock speed configurable via DT Mark Brown (4): spi/gpio: Fix stub for spi_gpio_probe_dt() Merge tag 'v3.6-rc6' into spi-drivers Merge tag 'v3.6-rc6' into spi-mxs Merge branches 'spi-drivers' and 'spi-mxs' into spi-next Matt Porter (1): spi: omap2-mcspi: add pinctrl support Patrice Chotard (1): spi/pl022: adopt pinctrl support Roland Stigge (5): spi/pl022: Add chip select handling via GPIO spi/pl022: Add devicetree support spi/dt: DT bindings documentation: "num-cs" property for SPI controllers spi/pl022: Fix chipselects pointer computation spi/pl022: Devicetree support w/o platform data Sachin Kamat (1): spi: spi-tle62x0: Use module_spi_driver macro Shubhrajyoti D (5): spi: omap2-mcspi: Remove the call to platform_set_drvdata(pdev, NULL) spi: omap2-mcspi: Remove the macro MOD_REG_BIT spi: omap2-mcspi: Call pm_runtime_* functions directly spi: omap2-mcspi: At remove dont use the runtime_autosuspend calls spi: omap2-mcspi: Cleanup the omap2_mcspi_txrx_dma function Stephen Warren (1): spi: remove completely broken Tegra driver Sylwester Nawrocki (1): spi/s3c64xx: Don't free controller_data on non-dt platforms Tobias Klauser (1): spi: spi-altera: Use of_match_ptr Documentation/devicetree/bindings/spi/mxs-spi.txt | 22 + Documentation/devicetree/bindings/spi/spi-bus.txt |3 + Documentation/devicetree/bindings/spi/spi-gpio.txt | 29 + .../devicetree/bindings/spi/spi-sc18is602.txt | 23 + .../devicetree/bindings/spi/spi_pl022.txt | 22 + Documentation/spi/spi-sc18is602| 36 + arch/arm/mach-u300/core.c |3 -
Re: [RFC PATCH 08/13] mmc: omap_hsmmc: limit max_segs with the EDMA DMAC
On Mon, 2012-10-01 at 12:39 -0400, Matt Porter wrote: > Anything you can show at this point? ;) I'd be happy to drop the > half-hack > for a real API. If not, I'm going to carry that to v2 atm. This is what I had done sometime back. Feel free to update diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 9c02a45..94ae006 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h @@ -86,11 +86,11 @@ enum dma_transaction_type { * @DMA_DEV_TO_DEV: Slave mode & From Device to Device */ enum dma_transfer_direction { - DMA_MEM_TO_MEM, - DMA_MEM_TO_DEV, - DMA_DEV_TO_MEM, - DMA_DEV_TO_DEV, - DMA_TRANS_NONE, + DMA_MEM_TO_MEM = 0x01, + DMA_MEM_TO_DEV = 0x02, + DMA_DEV_TO_MEM = 0x04, + DMA_DEV_TO_DEV = 0x08, + DMA_TRANS_NONE = 0x10, }; /** @@ -371,6 +371,41 @@ struct dma_slave_config { unsigned int slave_id; }; +enum dmaengine_apis { + DMAENGINE_MEMCPY= 0x0001, + DMAENGINE_XOR = 0x0002, + DMAENGINE_XOR_VAL = 0x0004, + DMAENGINE_PQ= 0x0008, + DMAENGINE_PQ_VAL= 0x0010, + DMAENGINE_MEMSET= 0x0020, + DMAENGINE_SLAVE = 0x0040, + DMAENGINE_CYCLIC= 0x0080, + DMAENGINE_INTERLEAVED = 0x0100, + DMAENGINE_SG= 0x0200, +}; + +/* struct dmaengine_chan_caps - expose capability of a channel + * Note: each channel can have same or different capabilities + * + * This primarily classifies capabilities into + * a) APIs/ops supported + * b) channel physical capabilities + * + * @ops: or'ed api capability + * @widths: channel widths supported + * @dirn: channel directions supported + * @bursts: bitmask of burst lengths supported + * @mux: configurable slave id or hard wired + * -1 for hard wired, otherwise valid positive slave id (including zero) + */ +struct dmaengine_chan_caps { + enum dmaengine_apis ops; + enum dma_slave_buswidth widths; + enum dma_transfer_direction dirn; + unsigned int dma_bursts; + int mux; +}; + static inline const char *dma_chan_name(struct dma_chan *chan) { return dev_name(&chan->dev->device); @@ -534,6 +569,7 @@ struct dma_tx_state { * struct with auxiliary transfer status information, otherwise the call * will just return a simple status code * @device_issue_pending: push pending transactions to hardware + * @device_channel_caps: return the capablities of channel */ struct dma_device { @@ -602,6 +638,9 @@ struct dma_device { dma_cookie_t cookie, struct dma_tx_state *txstate); void (*device_issue_pending)(struct dma_chan *chan); + + struct dmaengine_chan_caps *(*device_channel_caps)( + struct dma_chan *chan); }; static inline int dmaengine_device_control(struct dma_chan *chan, -- ~Vinod -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev ___ spi-devel-general mailing list spi-devel-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spi-devel-general