Votre BMW Série 1 récente avec GPS à 240€ / mois.
Les Offres Ephémères BMW, saisissez-les avant qu?elles ne s?envolent. Votre BMW 116d 115ch récente avec GPS à 240€ /mois.» -- EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev ___ spi-devel-general mailing list spi-devel-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spi-devel-general
[PATCH 0/5] Designware SPI driver update
From: Dirk Brandewie dirk.brande...@gmail.com This patch set reworks the Designware SPI driver. This patch set is based on commit f8f82d4 on spi/next Patch 1: Fixes trivial typo from commit f8f82d4 in spi/next Patch 2: exports the platform data structure for client driver use. Patch 3: Reworks the core message and transfer handling. Patch 4: Changes internal function naming convention to match new file names. Patch 5: Adds runtime power management to the PCI driver. Dirk Brandewie (5): spi/makefile: Fix typo from reorganize drivers patch. spi/dw_spi: expose dw_spi platform data stucture. dw_spi: rework message processing spi/spi-dw: update function naming convention spi_dw_pci: Add runtime power management drivers/spi/Makefile |2 +- drivers/spi/spi-dw-mid.c | 47 +- drivers/spi/spi-dw-mmio.c | 34 +- drivers/spi/spi-dw-pci.c | 69 ++- drivers/spi/spi-dw.c | 1674 +++- drivers/spi/spi-dw.h | 138 ++-- include/linux/spi/spi-dw.h | 20 + 7 files changed, 930 insertions(+), 1054 deletions(-) rewrite drivers/spi/spi-dw.c (62%) create mode 100644 include/linux/spi/spi-dw.h -- 1.7.3.4 -- EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev ___ spi-devel-general mailing list spi-devel-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spi-devel-general
[PATCH 5/5] spi_dw_pci: Add runtime power management
From: Dirk Brandewie dirk.brande...@gmail.com This patch adds runtime power management to the PCI variant of the designware SPI host controller driver. Signed-off-by: Kristen Carlson Accardi kris...@linux.intel.com Signed-off-by: Dirk Brandewie dirk.brande...@gmail.com --- drivers/spi/spi-dw-pci.c | 59 +- drivers/spi/spi-dw.c |4 ++- 2 files changed, 61 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-dw-pci.c b/drivers/spi/spi-dw-pci.c index eb35fa5..d661c2a 100644 --- a/drivers/spi/spi-dw-pci.c +++ b/drivers/spi/spi-dw-pci.c @@ -20,6 +20,7 @@ #include linux/interrupt.h #include linux/pci.h #include linux/slab.h +#include linux/pm_runtime.h #include linux/spi/spi.h #include spi-dw.h @@ -91,6 +92,11 @@ static int __devinit spi_pci_probe(struct pci_dev *pdev, /* PCI hook and SPI hook use the same drv data */ pci_set_drvdata(pdev, dwpci); + + pm_suspend_ignore_children(pdev-dev, true); + pm_runtime_put_noidle(pdev-dev); + pm_runtime_allow(pdev-dev); + return 0; err_unmap: @@ -110,6 +116,9 @@ static void __devexit spi_pci_remove(struct pci_dev *pdev) pci_set_drvdata(pdev, NULL); spi_dw_remove_host(dwpci-dws); + pm_runtime_forbid(pdev-dev); + pm_runtime_get_noresume(pdev-dev); + iounmap(dwpci-dws.regs); pci_release_region(pdev, 0); kfree(dwpci); @@ -143,16 +152,61 @@ static int spi_resume(struct pci_dev *pdev) return ret; return spi_dw_resume_host(dwpci-dws); } + +static int spi_dw_pci_runtime_suspend(struct device *dev) +{ + struct pci_dev *pdev = to_pci_dev(dev); + struct dw_spi_pci *dwpci = pci_get_drvdata(pdev); + int ret; + + dev_dbg(dev, PCI runtime suspend called\n); + + ret = spi_dw_stop_queue(dwpci-dws); + if (ret == 0) + spi_dw_enable(dwpci-dws); + + return ret; +} + +static int spi_dw_pci_runtime_resume(struct device *dev) +{ + struct pci_dev *pdev = to_pci_dev(dev); + struct dw_spi_pci *dwpci = pci_get_drvdata(pdev); + + dev_dbg(dev, pci_runtime_resume called\n); + return spi_dw_resume_host(dwpci-dws); +} + +static int spi_dw_pci_runtime_idle(struct device *dev) +{ + int err; + + dev_dbg(dev, pci_runtime_idle called\n); + + err = pm_schedule_suspend(dev, 500); + if (err != 0) + return 0; + return -EBUSY; +} + #else #define spi_suspendNULL #define spi_resume NULL +#define spi_dw_pci_runtime_suspend NULL +#define spi_dw_pci_runtime_resume NULL +#define spi_dw_pci_runtime_idle NULL #endif static const struct pci_device_id pci_ids[] __devinitdata = { - /* Intel MID platform SPI controller 0 */ + /* Intel Moorestown platform SPI controller 0 */ { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x0800) }, {}, }; +static const struct dev_pm_ops dw_spi_pm_ops = { + .runtime_suspend = spi_dw_pci_runtime_suspend, + .runtime_resume = spi_dw_pci_runtime_resume, + .runtime_idle = spi_dw_pci_runtime_idle, +}; static struct pci_driver dw_spi_driver = { .name = DRIVER_NAME, @@ -161,6 +215,9 @@ static struct pci_driver dw_spi_driver = { .remove = __devexit_p(spi_pci_remove), .suspend = spi_suspend, .resume = spi_resume, + .driver = { + .pm = dw_spi_pm_ops, + }, }; static int __init mrst_spi_init(void) diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c index 20f94fa..1210460 100644 --- a/drivers/spi/spi-dw.c +++ b/drivers/spi/spi-dw.c @@ -22,6 +22,7 @@ #include linux/highmem.h #include linux/delay.h #include linux/slab.h +#include linux/pm_runtime.h #include linux/spi/spi.h #include spi-dw.h @@ -438,7 +439,7 @@ static void pump_messages(struct work_struct *work) struct slave_cfg *controller; int err = 0; - + pm_runtime_get_sync(dws-parent_dev); message = get_message(dws); while (message dws-run != QUEUE_STOPPED) { @@ -473,6 +474,7 @@ static void pump_messages(struct work_struct *work) } if (dws-run == QUEUE_STOPPED) drain_message_queue(dws); + pm_runtime_put_sync(dws-parent_dev); } /* spi_device use this to queue in their spi_msg */ -- 1.7.3.4 -- EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev ___ spi-devel-general mailing list spi-devel-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spi-devel-general
[PATCH 4/5] spi/spi-dw: update function naming convention
From: Dirk Brandewie dirk.brande...@gmail.com Update internal maning to match new file names now that the naming convention for driver files is being enforced. Signed-off-by: Dirk Brandewie dirk.brande...@gmail.com --- drivers/spi/spi-dw-mid.c |8 ++-- drivers/spi/spi-dw-mmio.c | 34 ++-- drivers/spi/spi-dw-pci.c | 10 ++-- drivers/spi/spi-dw.c | 116 ++- drivers/spi/spi-dw.h | 46 +- include/linux/spi/spi-dw.h |2 +- 6 files changed, 109 insertions(+), 107 deletions(-) diff --git a/drivers/spi/spi-dw-mid.c b/drivers/spi/spi-dw-mid.c index e44e37f..fb41ea4 100644 --- a/drivers/spi/spi-dw-mid.c +++ b/drivers/spi/spi-dw-mid.c @@ -118,7 +118,7 @@ static int mid_spi_dma_transfer(struct dw_spi *dws) /* 1. setup DMA related registers */ - dw_spi_disable(dws); + spi_dw_disable(dws); dw_writew(dws, dmardlr, 0xf); dw_writew(dws, dmatdlr, 0x10); if (dws-xfer.tx_dma) @@ -126,7 +126,7 @@ static int mid_spi_dma_transfer(struct dw_spi *dws) if (dws-xfer.rx_dma) dma_ctrl |= 0x1; dw_writew(dws, dmacr, dma_ctrl); - dw_spi_enable(dws); + spi_dw_enable(dws); dws-dma_chan_done = 0; @@ -183,7 +183,7 @@ static int mid_spi_dma_transfer(struct dw_spi *dws) return 0; } -static struct dw_spi_dma_ops mid_dma_ops = { +static struct spi_dw_dma_ops mid_dma_ops = { .dma_init = mid_spi_dma_init, .dma_exit = mid_spi_dma_exit, .dma_transfer = mid_spi_dma_transfer, @@ -200,7 +200,7 @@ static struct dw_spi_dma_ops mid_dma_ops = { #define CLK_SPI_CDIV_MASK 0x0e00 #define CLK_SPI_DISABLE_OFFSET 8 -int dw_spi_mid_init(struct dw_spi *dws) +int spi_dw_mid_init(struct dw_spi *dws) { u32 *clk_reg, clk_cdiv; diff --git a/drivers/spi/spi-dw-mmio.c b/drivers/spi/spi-dw-mmio.c index 34eb665..c978d35 100644 --- a/drivers/spi/spi-dw-mmio.c +++ b/drivers/spi/spi-dw-mmio.c @@ -18,21 +18,21 @@ #include spi-dw.h -#define DRIVER_NAME dw_spi_mmio +#define DRIVER_NAME spi_dw_mmio -struct dw_spi_mmio { +struct spi_dw_mmio { struct dw_spi dws; struct clk *clk; }; -static int __devinit dw_spi_mmio_probe(struct platform_device *pdev) +static int __devinit spi_dw_mmio_probe(struct platform_device *pdev) { - struct dw_spi_mmio *dwsmmio; + struct spi_dw_mmio *dwsmmio; struct dw_spi *dws; struct resource *mem, *ioarea; int ret; - dwsmmio = kzalloc(sizeof(struct dw_spi_mmio), GFP_KERNEL); + dwsmmio = kzalloc(sizeof(struct spi_dw_mmio), GFP_KERNEL); if (!dwsmmio) { ret = -ENOMEM; goto err_end; @@ -82,7 +82,7 @@ static int __devinit dw_spi_mmio_probe(struct platform_device *pdev) dws-num_cs = 4; dws-max_freq = clk_get_rate(dwsmmio-clk); - ret = dw_spi_add_host(dws); + ret = spi_dw_add_host(dws); if (ret) goto err_clk; @@ -105,9 +105,9 @@ err_end: return ret; } -static int __devexit dw_spi_mmio_remove(struct platform_device *pdev) +static int __devexit spi_dw_mmio_remove(struct platform_device *pdev) { - struct dw_spi_mmio *dwsmmio = platform_get_drvdata(pdev); + struct spi_dw_mmio *dwsmmio = platform_get_drvdata(pdev); struct resource *mem; platform_set_drvdata(pdev, NULL); @@ -117,7 +117,7 @@ static int __devexit dw_spi_mmio_remove(struct platform_device *pdev) dwsmmio-clk = NULL; free_irq(dwsmmio-dws.irq, dwsmmio-dws); - dw_spi_remove_host(dwsmmio-dws); + spi_dw_remove_host(dwsmmio-dws); iounmap(dwsmmio-dws.regs); kfree(dwsmmio); @@ -126,25 +126,25 @@ static int __devexit dw_spi_mmio_remove(struct platform_device *pdev) return 0; } -static struct platform_driver dw_spi_mmio_driver = { - .remove = __devexit_p(dw_spi_mmio_remove), +static struct platform_driver spi_dw_mmio_driver = { + .remove = __devexit_p(spi_dw_mmio_remove), .driver = { .name = DRIVER_NAME, .owner = THIS_MODULE, }, }; -static int __init dw_spi_mmio_init(void) +static int __init spi_dw_mmio_init(void) { - return platform_driver_probe(dw_spi_mmio_driver, dw_spi_mmio_probe); + return platform_driver_probe(spi_dw_mmio_driver, spi_dw_mmio_probe); } -module_init(dw_spi_mmio_init); +module_init(spi_dw_mmio_init); -static void __exit dw_spi_mmio_exit(void) +static void __exit spi_dw_mmio_exit(void) { - platform_driver_unregister(dw_spi_mmio_driver); + platform_driver_unregister(spi_dw_mmio_driver); } -module_exit(dw_spi_mmio_exit); +module_exit(spi_dw_mmio_exit); MODULE_AUTHOR(Jean-Hugues Deschenes jean-hugues.desche...@octasic.com); MODULE_DESCRIPTION(Memory-mapped I/O interface driver for DW SPI Core); diff --git
[PATCH 3/5] dw_spi: rework message processing
From: Dirk Brandewie dirk.brande...@gmail.com NOTE: patch created git format-patch --break-rewrites=/50% This patch reworks the message pump worker thread function to run until all messages queued to the driver have been handled. The function to handle individual spi_transfers is now a synchronus function the tasklet to handle spi_transfers has been removed. Work for the worker thread is only queued in host controller transfer function. Psuedo code for new thread function: message = get_message() while (message){ for_each_transfer_in_msg(message){ transfer_setup(transfer) do_transfer() } complete_message() message = get_message() } Changes that fell out of the message thread changes: Non-DMA transfers that are larger than the size of the controller FIFO are handled as interrupt driven transfers. Common FIFO handling functions shared PIO and interrupt transfers. Simplified queue stop/start funcitons. Cleanup fixes: Changed exported all exported function names to have dw_spi_ prefix Removed support for registering chip select control function. Setting the slave chip select is handled by setting the SER (Slave enable register) Removed code that looked at the cs_change hint in the spi_transfer. Software has no contorl over whether the slave chip select is de-asserted at the end of the transfer. Once the TX FIFO goes empty the slave chip select is dropped. Added dw_spi_{en,dis}able inline functions to replace spi_enable_chip() Added dw_spi_{mask,umask}_intr inline functions Signed-off-by: Dirk Brandewie dirk.brande...@gmail.com --- drivers/spi/spi-dw-mid.c | 43 +- drivers/spi/spi-dw.c | 1670 -- drivers/spi/spi-dw.h | 92 ++-- 3 files changed, 809 insertions(+), 996 deletions(-) rewrite drivers/spi/spi-dw.c (55%) diff --git a/drivers/spi/spi-dw-mid.c b/drivers/spi/spi-dw-mid.c index 130e555..e44e37f 100644 --- a/drivers/spi/spi-dw-mid.c +++ b/drivers/spi/spi-dw-mid.c @@ -38,7 +38,10 @@ static bool mid_spi_dma_chan_filter(struct dma_chan *chan, void *param) { struct dw_spi *dws = param; - return dws-dmac (dws-dmac-dev == chan-device-dev); + if (dws-dmac dws-dmac-dev == chan-device-dev) + return true; + else + return false; } static int mid_spi_dma_init(struct dw_spi *dws) @@ -103,10 +106,10 @@ static void dw_spi_dma_done(void *arg) if (++dws-dma_chan_done != 2) return; - dw_spi_xfer_done(dws); + complete(dws-xfer.complete); } -static int mid_spi_dma_transfer(struct dw_spi *dws, int cs_change) +static int mid_spi_dma_transfer(struct dw_spi *dws) { struct dma_async_tx_descriptor *txdesc = NULL, *rxdesc = NULL; struct dma_chan *txchan, *rxchan; @@ -114,17 +117,17 @@ static int mid_spi_dma_transfer(struct dw_spi *dws, int cs_change) u16 dma_ctrl = 0; /* 1. setup DMA related registers */ - if (cs_change) { - spi_enable_chip(dws, 0); - dw_writew(dws, dmardlr, 0xf); - dw_writew(dws, dmatdlr, 0x10); - if (dws-tx_dma) - dma_ctrl |= 0x2; - if (dws-rx_dma) - dma_ctrl |= 0x1; - dw_writew(dws, dmacr, dma_ctrl); - spi_enable_chip(dws, 1); - } + + dw_spi_disable(dws); + dw_writew(dws, dmardlr, 0xf); + dw_writew(dws, dmatdlr, 0x10); + if (dws-xfer.tx_dma) + dma_ctrl |= 0x2; + if (dws-xfer.rx_dma) + dma_ctrl |= 0x1; + dw_writew(dws, dmacr, dma_ctrl); + dw_spi_enable(dws); + dws-dma_chan_done = 0; txchan = dws-txchan; @@ -141,8 +144,8 @@ static int mid_spi_dma_transfer(struct dw_spi *dws, int cs_change) (unsigned long) txconf); memset(dws-tx_sgl, 0, sizeof(dws-tx_sgl)); - dws-tx_sgl.dma_address = dws-tx_dma; - dws-tx_sgl.length = dws-len; + dws-tx_sgl.dma_address = dws-xfer.tx_dma; + dws-tx_sgl.length = dws-xfer.len; txdesc = txchan-device-device_prep_slave_sg(txchan, dws-tx_sgl, @@ -163,8 +166,8 @@ static int mid_spi_dma_transfer(struct dw_spi *dws, int cs_change) (unsigned long) rxconf); memset(dws-rx_sgl, 0, sizeof(dws-rx_sgl)); - dws-rx_sgl.dma_address = dws-rx_dma; - dws-rx_sgl.length = dws-len; + dws-rx_sgl.dma_address = dws-xfer.rx_dma; + dws-rx_sgl.length = dws-xfer.len; rxdesc = rxchan-device-device_prep_slave_sg(rxchan, dws-rx_sgl, @@ -188,7 +191,6 @@ static struct dw_spi_dma_ops mid_dma_ops = { #endif /* Some specific info for SPI0 controller on Moorestown */ - /* HW info for MRST CLk Control Unit, one 32b reg */ #define MRST_SPI_CLK_BASE 1 /* 100m */ #define MRST_CLK_SPI0_REG
[PATCH] spi/tegra: add devicetree support
Allow the tegra spi driver to obtain populate the spi bus with devices from the device tree. Signed-off-by: Grant Likely grant.lik...@secretlab.ca --- .../devicetree/bindings/spi/spi_nvidia.txt |5 + drivers/spi/spi-tegra.c| 12 2 files changed, 17 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/spi/spi_nvidia.txt diff --git a/Documentation/devicetree/bindings/spi/spi_nvidia.txt b/Documentation/devicetree/bindings/spi/spi_nvidia.txt new file mode 100644 index 000..bde450b --- /dev/null +++ b/Documentation/devicetree/bindings/spi/spi_nvidia.txt @@ -0,0 +1,5 @@ +NVIDIA Tegra 2 SPI device + +Required properties: +- compatible : should be nvidia,tegra250-spi. +- gpios : should specify GPIOs used for chipselect. diff --git a/drivers/spi/spi-tegra.c b/drivers/spi/spi-tegra.c index 8e30727..a43ceeb 100644 --- a/drivers/spi/spi-tegra.c +++ b/drivers/spi/spi-tegra.c @@ -546,6 +546,7 @@ static int __init spi_tegra_probe(struct platform_device *pdev) tspi-rx_dma_req.req_sel = spi_tegra_req_sels[pdev-id]; tspi-rx_dma_req.dev = tspi; + master-dev.of_node = pdev-dev.of_node; ret = spi_register_master(master); if (ret 0) @@ -595,10 +596,21 @@ static int __devexit spi_tegra_remove(struct platform_device *pdev) MODULE_ALIAS(platform:spi_tegra); +#ifdef CONFIG_OF +static struct of_device_id spi_tegra_of_match_table[] __devinitdata = { + { .compatible = nvidia,tegra250-spi, }, + {} +}; +MODULE_DEVICE_TABLE(of, spi_tegra_of_match_table); +#else /* CONFIG_OF */ +#define spi_tegra_of_match_table NULL +#endif /* CONFIG_OF */ + static struct platform_driver spi_tegra_driver = { .driver = { .name = spi_tegra, .owner =THIS_MODULE, + .of_match_table = spi_tegra_of_match_table, }, .remove = __devexit_p(spi_tegra_remove), }; -- EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev ___ spi-devel-general mailing list spi-devel-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spi-devel-general
RE: [PATCH] spi/tegra: add devicetree support
Grant Likely wrote at Wednesday, June 15, 2011 1:08 PM: Allow the tegra spi driver to obtain populate the spi bus with devices Remote obtain? from the device tree. Signed-off-by: Grant Likely grant.lik...@secretlab.ca --- .../devicetree/bindings/spi/spi_nvidia.txt |5 + drivers/spi/spi-tegra.c| 12 2 files changed, 17 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/spi/spi_nvidia.txt diff --git a/Documentation/devicetree/bindings/spi/spi_nvidia.txt b/Documentation/devicetree/bindings/spi/spi_nvidia.txt new file mode 100644 index 000..bde450b --- /dev/null +++ b/Documentation/devicetree/bindings/spi/spi_nvidia.txt @@ -0,0 +1,5 @@ +NVIDIA Tegra 2 SPI device + +Required properties: +- compatible : should be nvidia,tegra250-spi. +- gpios : should specify GPIOs used for chipselect. Are things like reg, interrupts, and other general stuff implicit? I notice that fsl-spi.txt does specify those, but spi_altera.txt and spi_oc_tiny.txt don't. Otherwise, LGTM. diff --git a/drivers/spi/spi-tegra.c b/drivers/spi/spi-tegra.c index 8e30727..a43ceeb 100644 --- a/drivers/spi/spi-tegra.c +++ b/drivers/spi/spi-tegra.c @@ -546,6 +546,7 @@ static int __init spi_tegra_probe(struct platform_device *pdev) tspi-rx_dma_req.req_sel = spi_tegra_req_sels[pdev-id]; tspi-rx_dma_req.dev = tspi; + master-dev.of_node = pdev-dev.of_node; ret = spi_register_master(master); if (ret 0) @@ -595,10 +596,21 @@ static int __devexit spi_tegra_remove(struct platform_device *pdev) MODULE_ALIAS(platform:spi_tegra); +#ifdef CONFIG_OF +static struct of_device_id spi_tegra_of_match_table[] __devinitdata = { + { .compatible = nvidia,tegra250-spi, }, + {} +}; +MODULE_DEVICE_TABLE(of, spi_tegra_of_match_table); +#else /* CONFIG_OF */ +#define spi_tegra_of_match_table NULL +#endif /* CONFIG_OF */ + static struct platform_driver spi_tegra_driver = { .driver = { .name = spi_tegra, .owner =THIS_MODULE, + .of_match_table = spi_tegra_of_match_table, }, .remove = __devexit_p(spi_tegra_remove), }; -- nvpublic -- EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev ___ spi-devel-general mailing list spi-devel-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spi-devel-general
Re: [PATCH] spi/tegra: add devicetree support
On Wed, Jun 15, 2011 at 1:25 PM, Stephen Warren swar...@nvidia.com wrote: Grant Likely wrote at Wednesday, June 15, 2011 1:08 PM: Allow the tegra spi driver to obtain populate the spi bus with devices Remote obtain? heh, oops. from the device tree. Signed-off-by: Grant Likely grant.lik...@secretlab.ca --- .../devicetree/bindings/spi/spi_nvidia.txt | 5 + drivers/spi/spi-tegra.c | 12 2 files changed, 17 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/spi/spi_nvidia.txt diff --git a/Documentation/devicetree/bindings/spi/spi_nvidia.txt b/Documentation/devicetree/bindings/spi/spi_nvidia.txt new file mode 100644 index 000..bde450b --- /dev/null +++ b/Documentation/devicetree/bindings/spi/spi_nvidia.txt @@ -0,0 +1,5 @@ +NVIDIA Tegra 2 SPI device + +Required properties: +- compatible : should be nvidia,tegra250-spi. +- gpios : should specify GPIOs used for chipselect. Are things like reg, interrupts, and other general stuff implicit? I notice that fsl-spi.txt does specify those, but spi_altera.txt and spi_oc_tiny.txt don't. yeah, standard properties are pretty much implicit. I don't bother writing the words if there isn't much value to them. I've been contemplating a tool that will take DT documentation written in a certain form, and automatically fill in standard properties as needed, but that's a project for another day. g. -- EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev ___ spi-devel-general mailing list spi-devel-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spi-devel-general
Re: [PATCH] spi/tegra: add devicetree support
On Wed, Jun 15, 2011 at 1:07 PM, Grant Likely grant.lik...@secretlab.ca wrote: Allow the tegra spi driver to obtain populate the spi bus with devices from the device tree. Signed-off-by: Grant Likely grant.lik...@secretlab.ca I'll commit this to spi/next in a few days if nobody objects. g. --- .../devicetree/bindings/spi/spi_nvidia.txt | 5 + drivers/spi/spi-tegra.c | 12 2 files changed, 17 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/spi/spi_nvidia.txt diff --git a/Documentation/devicetree/bindings/spi/spi_nvidia.txt b/Documentation/devicetree/bindings/spi/spi_nvidia.txt new file mode 100644 index 000..bde450b --- /dev/null +++ b/Documentation/devicetree/bindings/spi/spi_nvidia.txt @@ -0,0 +1,5 @@ +NVIDIA Tegra 2 SPI device + +Required properties: +- compatible : should be nvidia,tegra250-spi. +- gpios : should specify GPIOs used for chipselect. diff --git a/drivers/spi/spi-tegra.c b/drivers/spi/spi-tegra.c index 8e30727..a43ceeb 100644 --- a/drivers/spi/spi-tegra.c +++ b/drivers/spi/spi-tegra.c @@ -546,6 +546,7 @@ static int __init spi_tegra_probe(struct platform_device *pdev) tspi-rx_dma_req.req_sel = spi_tegra_req_sels[pdev-id]; tspi-rx_dma_req.dev = tspi; + master-dev.of_node = pdev-dev.of_node; ret = spi_register_master(master); if (ret 0) @@ -595,10 +596,21 @@ static int __devexit spi_tegra_remove(struct platform_device *pdev) MODULE_ALIAS(platform:spi_tegra); +#ifdef CONFIG_OF +static struct of_device_id spi_tegra_of_match_table[] __devinitdata = { + { .compatible = nvidia,tegra250-spi, }, + {} +}; +MODULE_DEVICE_TABLE(of, spi_tegra_of_match_table); +#else /* CONFIG_OF */ +#define spi_tegra_of_match_table NULL +#endif /* CONFIG_OF */ + static struct platform_driver spi_tegra_driver = { .driver = { .name = spi_tegra, .owner = THIS_MODULE, + .of_match_table = spi_tegra_of_match_table, }, .remove = __devexit_p(spi_tegra_remove), }; -- Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd. -- EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev ___ spi-devel-general mailing list spi-devel-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spi-devel-general
[PATCH 1/2] gpio/tegra: Move Tegra gpio driver to drivers/gpio
As part of the gpio driver consolidation, this patch moves the Tegra driver into drivers/gpio Signed-off-by: Grant Likely grant.lik...@secretlab.ca --- If there are no objections, I'll merge this via gpio/next g. arch/arm/mach-tegra/Makefile |1 - drivers/gpio/Makefile|1 + drivers/gpio/gpio-tegra.c|0 3 files changed, 1 insertions(+), 1 deletions(-) rename arch/arm/mach-tegra/gpio.c = drivers/gpio/gpio-tegra.c (100%) diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile index 823c703..ed58ef9 100644 --- a/arch/arm/mach-tegra/Makefile +++ b/arch/arm/mach-tegra/Makefile @@ -4,7 +4,6 @@ obj-y += io.o obj-y += irq.o obj-y += clock.o obj-y += timer.o -obj-y += gpio.o obj-y += pinmux.o obj-y += powergate.o obj-y += fuse.o diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile index 68e3bfd..0fbdd75 100644 --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile @@ -43,6 +43,7 @@ obj-$(CONFIG_GPIO_SCH)+= gpio-sch.o obj-$(CONFIG_GPIO_STMPE) += gpio-stmpe.o obj-$(CONFIG_GPIO_SX150X) += gpio-sx150x.o obj-$(CONFIG_GPIO_TC3589X) += gpio-tc3589x.o +obj-$(CONFIG_ARCH_TEGRA) += gpio-tegra.o obj-$(CONFIG_GPIO_TIMBERDALE) += gpio-timberdale.o obj-$(CONFIG_GPIO_TPS65910)+= gpio-tps65910.o obj-$(CONFIG_GPIO_TWL4030) += gpio-twl4030.o diff --git a/arch/arm/mach-tegra/gpio.c b/drivers/gpio/gpio-tegra.c similarity index 100% rename from arch/arm/mach-tegra/gpio.c rename to drivers/gpio/gpio-tegra.c -- EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev ___ spi-devel-general mailing list spi-devel-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spi-devel-general
[PATCH 2/2] gpio/tegra: add devicetree support
Add support for decoding gpios from the device tree Signed-off-by: Grant Likely grant.lik...@secretlab.ca --- .../devicetree/bindings/gpio/gpio_nvidia.txt |7 +++ drivers/gpio/gpio-tegra.c | 10 ++ 2 files changed, 17 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/gpio/gpio_nvidia.txt diff --git a/Documentation/devicetree/bindings/gpio/gpio_nvidia.txt b/Documentation/devicetree/bindings/gpio/gpio_nvidia.txt new file mode 100644 index 000..afb3ff3 --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/gpio_nvidia.txt @@ -0,0 +1,7 @@ +NVIDIA Tegra 2 GPIO controller + +Required properties: +- compatible : nvidia,tegra250-gpio +- #gpio-cells : Should be two. The first cell is the pin number and the + second cell is used to specify optional parameters (currently unused). +- gpio-controller : Marks the device node as a GPIO controller. diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c index 919d638..13afb88 100644 --- a/drivers/gpio/gpio-tegra.c +++ b/drivers/gpio/gpio-tegra.c @@ -23,6 +23,7 @@ #include linux/io.h #include linux/gpio.h +#include linux/of.h #include asm/mach/irq.h @@ -340,6 +341,15 @@ static int __init tegra_gpio_init(void) } } +#ifdef CONFIG_OF_GPIO + /* +* This isn't ideal, but it gets things hooked up until this +* driver is converted into a platform_device +*/ + tegra_gpio_chip.of_node = of_find_compatible_node(NULL, NULL, + nvidia,tegra250-gpio); +#endif /* CONFIG_OF_GPIO */ + gpiochip_add(tegra_gpio_chip); for (i = INT_GPIO_BASE; i (INT_GPIO_BASE + TEGRA_NR_GPIOS); i++) { -- EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev ___ spi-devel-general mailing list spi-devel-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spi-devel-general
[PATCH] spi/bfin_spi: fix reverse condition during interrupt mode
From: Bob Liu lliu...@gmail.com Commit 4d676fc5c39a677aa72148 drivers:spi_bfin5xx: add support for multiples of 8bits introduced a bug during interrupt mode. The if condition was inverted which can cause some bugs such as the SPI mmc in interrupt mode fails to detect SD cards. Signed-off-by: Bob Liu lliu...@gmail.com Signed-off-by: Mike Frysinger vap...@gentoo.org --- drivers/spi/spi_bfin5xx.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c index f706dba..ae30fa3 100644 --- a/drivers/spi/spi_bfin5xx.c +++ b/drivers/spi/spi_bfin5xx.c @@ -436,7 +436,7 @@ static irqreturn_t bfin_spi_pio_irq_handler(int irq, void *dev_id) /* last read */ if (drv_data-rx) { dev_dbg(drv_data-pdev-dev, last read\n); - if (n_bytes % 2) { + if (!(n_bytes % 2)) { u16 *buf = (u16 *)drv_data-rx; for (loop = 0; loop n_bytes / 2; loop++) *buf++ = read_RDBR(drv_data); @@ -464,7 +464,7 @@ static irqreturn_t bfin_spi_pio_irq_handler(int irq, void *dev_id) if (drv_data-rx drv_data-tx) { /* duplex */ dev_dbg(drv_data-pdev-dev, duplex: write_TDBR\n); - if (n_bytes % 2) { + if (!(n_bytes % 2)) { u16 *buf = (u16 *)drv_data-rx; u16 *buf2 = (u16 *)drv_data-tx; for (loop = 0; loop n_bytes / 2; loop++) { @@ -482,7 +482,7 @@ static irqreturn_t bfin_spi_pio_irq_handler(int irq, void *dev_id) } else if (drv_data-rx) { /* read */ dev_dbg(drv_data-pdev-dev, read: write_TDBR\n); - if (n_bytes % 2) { + if (!(n_bytes % 2)) { u16 *buf = (u16 *)drv_data-rx; for (loop = 0; loop n_bytes / 2; loop++) { *buf++ = read_RDBR(drv_data); @@ -498,7 +498,7 @@ static irqreturn_t bfin_spi_pio_irq_handler(int irq, void *dev_id) } else if (drv_data-tx) { /* write */ dev_dbg(drv_data-pdev-dev, write: write_TDBR\n); - if (n_bytes % 2) { + if (!(n_bytes % 2)) { u16 *buf = (u16 *)drv_data-tx; for (loop = 0; loop n_bytes / 2; loop++) { read_RDBR(drv_data); -- 1.7.5.3 -- EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev ___ spi-devel-general mailing list spi-devel-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spi-devel-general
Re: [PATCH 1/2] gpio/tegra: Move Tegra gpio driver to drivers/gpio
On Wed, Jun 15, 2011 at 12:37 PM, Grant Likely grant.lik...@secretlab.ca wrote: As part of the gpio driver consolidation, this patch moves the Tegra driver into drivers/gpio Signed-off-by: Grant Likely grant.lik...@secretlab.ca --- If there are no objections, I'll merge this via gpio/next I have this patch as part of a series that should get posted later this week, as well as a patch on top of it that depends on this change and another change in my tree, but I'm pessimistic that my series will get in to 3.1 since it depends on some common consolidation that hasn't been agreed upon yet. So, Acked-by: Colin Cross ccr...@android.com Put it in gpio/next, and I'll make sure any other Tegra patches with dependencies get pulled after yours. -- EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev ___ spi-devel-general mailing list spi-devel-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spi-devel-general
Re: [PATCH 2/2] gpio/tegra: add devicetree support
On Wed, Jun 15, 2011 at 12:38 PM, Grant Likely grant.lik...@secretlab.ca wrote: Add support for decoding gpios from the device tree Signed-off-by: Grant Likely grant.lik...@secretlab.ca Acked-by: Olof Johansson o...@lixom.net -- EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev ___ spi-devel-general mailing list spi-devel-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spi-devel-general
Re: [PATCH 1/2] gpio/tegra: Move Tegra gpio driver to drivers/gpio
On Wed, Jun 15, 2011 at 12:37 PM, Grant Likely grant.lik...@secretlab.ca wrote: As part of the gpio driver consolidation, this patch moves the Tegra driver into drivers/gpio Signed-off-by: Grant Likely grant.lik...@secretlab.ca Acked-by: Olof Johansson o...@lixom.net Colin said he had plans to do it, or I would already have sent this out. Thanks for doing it! :) -Olof -- EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev ___ spi-devel-general mailing list spi-devel-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spi-devel-general
Re: [PATCH 1/2] gpio/tegra: Move Tegra gpio driver to drivers/gpio
On Wed, Jun 15, 2011 at 2:21 PM, Colin Cross ccr...@android.com wrote: On Wed, Jun 15, 2011 at 12:37 PM, Grant Likely grant.lik...@secretlab.ca wrote: As part of the gpio driver consolidation, this patch moves the Tegra driver into drivers/gpio Signed-off-by: Grant Likely grant.lik...@secretlab.ca --- If there are no objections, I'll merge this via gpio/next I have this patch as part of a series that should get posted later this week, as well as a patch on top of it that depends on this change and another change in my tree, but I'm pessimistic that my series will get in to 3.1 since it depends on some common consolidation that hasn't been agreed upon yet. So, Acked-by: Colin Cross ccr...@android.com Put it in gpio/next, and I'll make sure any other Tegra patches with dependencies get pulled after yours. How about I put it in a separate branch so that if you need to pull it for dependencies then you can do so without pulling in all the gpio/next commits. g. -- Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd. -- EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev ___ spi-devel-general mailing list spi-devel-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spi-devel-general
Re: [PATCH 1/2] gpio/tegra: Move Tegra gpio driver to drivers/gpio
On Wed, Jun 15, 2011 at 2:00 PM, Grant Likely grant.lik...@secretlab.ca wrote: On Wed, Jun 15, 2011 at 2:48 PM, Grant Likely grant.lik...@secretlab.ca wrote: On Wed, Jun 15, 2011 at 2:21 PM, Colin Cross ccr...@android.com wrote: On Wed, Jun 15, 2011 at 12:37 PM, Grant Likely grant.lik...@secretlab.ca wrote: As part of the gpio driver consolidation, this patch moves the Tegra driver into drivers/gpio Signed-off-by: Grant Likely grant.lik...@secretlab.ca --- If there are no objections, I'll merge this via gpio/next I have this patch as part of a series that should get posted later this week, as well as a patch on top of it that depends on this change and another change in my tree, but I'm pessimistic that my series will get in to 3.1 since it depends on some common consolidation that hasn't been agreed upon yet. So, Acked-by: Colin Cross ccr...@android.com Put it in gpio/next, and I'll make sure any other Tegra patches with dependencies get pulled after yours. How about I put it in a separate branch so that if you need to pull it for dependencies then you can do so without pulling in all the gpio/next commits. I've pushed it out to the following branch. If everything looks okay to you, then I'll merge it into gpio/next and push it out. The following changes since commit 2c53b436a30867eb6b47dd7bab23ba638d1fb0d2: Linux 3.0-rc3 (2011-06-13 15:29:59 -0700) are available in the git repository at: git://git.secretlab.ca/git/linux-2.6 gpio/next-tegra Grant Likely (2): gpio/tegra: Move Tegra gpio driver to drivers/gpio gpio/tegra: add devicetree support .../devicetree/bindings/gpio/gpio_nvidia.txt | 7 +++ arch/arm/mach-tegra/Makefile | 1 - drivers/gpio/Makefile | 1 + .../mach-tegra/gpio.c = drivers/gpio/gpio-tegra.c | 10 ++ 4 files changed, 18 insertions(+), 1 deletions(-) create mode 100644 Documentation/devicetree/bindings/gpio/gpio_nvidia.txt rename arch/arm/mach-tegra/gpio.c = drivers/gpio/gpio-tegra.c (97%) Thanks, that sounds good. -- EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev ___ spi-devel-general mailing list spi-devel-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spi-devel-general
Re: [PATCH 1/2] gpio/tegra: Move Tegra gpio driver to drivers/gpio
On Wed, Jun 15, 2011 at 2:48 PM, Grant Likely grant.lik...@secretlab.ca wrote: On Wed, Jun 15, 2011 at 2:21 PM, Colin Cross ccr...@android.com wrote: On Wed, Jun 15, 2011 at 12:37 PM, Grant Likely grant.lik...@secretlab.ca wrote: As part of the gpio driver consolidation, this patch moves the Tegra driver into drivers/gpio Signed-off-by: Grant Likely grant.lik...@secretlab.ca --- If there are no objections, I'll merge this via gpio/next I have this patch as part of a series that should get posted later this week, as well as a patch on top of it that depends on this change and another change in my tree, but I'm pessimistic that my series will get in to 3.1 since it depends on some common consolidation that hasn't been agreed upon yet. So, Acked-by: Colin Cross ccr...@android.com Put it in gpio/next, and I'll make sure any other Tegra patches with dependencies get pulled after yours. How about I put it in a separate branch so that if you need to pull it for dependencies then you can do so without pulling in all the gpio/next commits. I've pushed it out to the following branch. If everything looks okay to you, then I'll merge it into gpio/next and push it out. The following changes since commit 2c53b436a30867eb6b47dd7bab23ba638d1fb0d2: Linux 3.0-rc3 (2011-06-13 15:29:59 -0700) are available in the git repository at: git://git.secretlab.ca/git/linux-2.6 gpio/next-tegra Grant Likely (2): gpio/tegra: Move Tegra gpio driver to drivers/gpio gpio/tegra: add devicetree support .../devicetree/bindings/gpio/gpio_nvidia.txt |7 +++ arch/arm/mach-tegra/Makefile |1 - drivers/gpio/Makefile |1 + .../mach-tegra/gpio.c = drivers/gpio/gpio-tegra.c | 10 ++ 4 files changed, 18 insertions(+), 1 deletions(-) create mode 100644 Documentation/devicetree/bindings/gpio/gpio_nvidia.txt rename arch/arm/mach-tegra/gpio.c = drivers/gpio/gpio-tegra.c (97%) -- EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev ___ spi-devel-general mailing list spi-devel-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spi-devel-general
[SPAM] Recevez un ebook sur le chauffe-eau solaire sans frais
-- EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev ___ spi-devel-general mailing list spi-devel-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spi-devel-general
Téléchargez le guide des radiateurs à inertie
Téléchargez le guide des radiateurs à inertie http://p4tre.emv3.com/HS?a=ENX7CqnmaymC8SA9MKJObwXnGHxKLIFH8PcStGb5lw8W0bBhOG5mpqVsje_HhdBQ4VIZ -- EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev ___ spi-devel-general mailing list spi-devel-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spi-devel-general