Skip to content

Commit

Permalink
Merge tag 'spi-for-linus' of git://git.secretlab.ca/git/linux-2.6
Browse files Browse the repository at this point in the history
Pull SPI updates from Grant Likely:
 "Primarily SPI device driver bug fixes, one removal of an old driver,
  and some new tegra support.  There is some core code change too, but
  all in all pretty small stuff.

  The new features to note are:
   - Common code for describing GPIO CS lines in the device tree
   - Remove the SPI_BUFSIZ limitation on spi_write_the_read()
   - core spi ensures bits_per_word is set correctly
   - SPARC can now use SPI"

* tag 'spi-for-linus' of git://git.secretlab.ca/git/linux-2.6: (36 commits)
  spi/sparc: Allow of_register_spi_devices for sparc
  spi: Remove HOTPLUG section attributes
  spi: Add support for specifying 3-wire mode via device tree
  spi: Fix comparison of different integer types
  spi/orion: Add SPI_CHPA and SPI_CPOL support to kirkwood driver.
  spi/sh: Add SH Mobile series as dependency to MSIOF controller
  spi/sh-msiof: Remove unneeded clock name
  spi: Remove SPI_BUFSIZ restriction on spi_write_then_read()
  spi/stmp: remove obsolete driver
  spi/clps711x: New SPI master driver
  spi: omap2-mcspi: remove duplicate inclusion of linux/err.h
  spi: omap2-mcspi: Fix the redifine warning
  spi/sh-hspi: add CS manual control support
  of_spi: add generic binding support to specify cs gpio
  spi: omap2-mcspi: remove duplicated include from spi-omap2-mcspi.c
  spi/bitbang: (cosmetic) simplify list manipulation
  spi/bitbang: avoid needless loop flow manipulations
  spi/omap: fix D0/D1 direction confusion
  spi: tegra: add spi driver for sflash controller
  spi: Dont call master->setup if not populated
  ...
  • Loading branch information
Linus Torvalds committed Dec 14, 2012
2 parents 15de059 + 7cb9436 commit d3b43e1
Show file tree
Hide file tree
Showing 60 changed files with 2,894 additions and 939 deletions.
26 changes: 26 additions & 0 deletions Documentation/devicetree/bindings/spi/nvidia,tegra20-sflash.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
NVIDIA Tegra20 SFLASH controller.

Required properties:
- compatible : should be "nvidia,tegra20-sflash".
- reg: Should contain SFLASH registers location and length.
- interrupts: Should contain SFLASH interrupts.
- nvidia,dma-request-selector : The Tegra DMA controller's phandle and
request selector for this SFLASH controller.

Recommended properties:
- spi-max-frequency: Definition as per
Documentation/devicetree/bindings/spi/spi-bus.txt

Example:

spi@7000d600 {
compatible = "nvidia,tegra20-sflash";
reg = <0x7000c380 0x80>;
interrupts = <0 39 0x04>;
nvidia,dma-request-selector = <&apbdma 16>;
spi-max-frequency = <25000000>;
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
};

26 changes: 26 additions & 0 deletions Documentation/devicetree/bindings/spi/nvidia,tegra20-slink.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
NVIDIA Tegra20/Tegra30 SLINK controller.

Required properties:
- compatible : should be "nvidia,tegra20-slink", "nvidia,tegra30-slink".
- reg: Should contain SLINK registers location and length.
- interrupts: Should contain SLINK interrupts.
- nvidia,dma-request-selector : The Tegra DMA controller's phandle and
request selector for this SLINK controller.

Recommended properties:
- spi-max-frequency: Definition as per
Documentation/devicetree/bindings/spi/spi-bus.txt

Example:

slink@7000d600 {
compatible = "nvidia,tegra20-slink";
reg = <0x7000d600 0x200>;
interrupts = <0 82 0x04>;
nvidia,dma-request-selector = <&apbdma 16>;
spi-max-frequency = <25000000>;
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
};

4 changes: 3 additions & 1 deletion Documentation/devicetree/bindings/spi/omap-spi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ Required properties:
- "ti,omap4-spi" for OMAP4+.
- ti,spi-num-cs : Number of chipselect supported by the instance.
- ti,hwmods: Name of the hwmod associated to the McSPI

- ti,pindir-d0-out-d1-in: Select the D0 pin as output and D1 as
input. The default is D0 as input and
D1 as output.

Example:

Expand Down
22 changes: 22 additions & 0 deletions Documentation/devicetree/bindings/spi/spi-bus.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The SPI master node requires the following properties:
- #size-cells - should be zero.
- compatible - name of SPI bus controller following generic names
recommended practice.
- cs-gpios - (optional) gpios chip select.
No other properties are required in the SPI bus node. It is assumed
that a driver for an SPI bus device will understand that it is an SPI bus.
However, the binding does not attempt to define the specific method for
Expand All @@ -24,6 +25,22 @@ support describing the chip select layout.
Optional property:
- num-cs : total number of chipselects

If cs-gpios is used the number of chip select will automatically increased
with max(cs-gpios > hw cs)

So if for example the controller has 2 CS lines, and the cs-gpios
property looks like this:

cs-gpios = <&gpio1 0 0> <0> <&gpio1 1 0> <&gpio1 2 0>;

Then it should be configured so that num_chipselect = 4 with the
following mapping:

cs0 : &gpio1 0 0
cs1 : native
cs2 : &gpio1 1 0
cs3 : &gpio1 2 0

SPI slave nodes must be children of the SPI master node and can
contain the following properties.
- reg - (required) chip select address of device.
Expand All @@ -36,6 +53,11 @@ contain the following properties.
shifted clock phase (CPHA) mode
- spi-cs-high - (optional) Empty property indicating device requires
chip select active high
- spi-3wire - (optional) Empty property indicating device requires
3-wire mode.

If a gpio chipselect is used for the SPI slave the gpio number will be passed
via the cs_gpio

SPI example for an MPC5200 SPI bus:
spi@f00 {
Expand Down
31 changes: 23 additions & 8 deletions drivers/spi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,13 @@ config SPI_BUTTERFLY
inexpensive battery powered microcontroller evaluation board.
This same cable can be used to flash new firmware.

config SPI_CLPS711X
tristate "CLPS711X host SPI controller"
depends on ARCH_CLPS711X
help
This enables dedicated general purpose SPI/Microwire1-compatible
master mode interface (SSI1) for CLPS711X-based CPUs.

config SPI_COLDFIRE_QSPI
tristate "Freescale Coldfire QSPI controller"
depends on (M520x || M523x || M5249 || M525x || M527x || M528x || M532x)
Expand Down Expand Up @@ -341,10 +348,10 @@ config SPI_SC18IS602

config SPI_SH_MSIOF
tristate "SuperH MSIOF SPI controller"
depends on SUPERH && HAVE_CLK
depends on (SUPERH || ARCH_SHMOBILE) && HAVE_CLK
select SPI_BITBANG
help
SPI driver for SuperH MSIOF blocks.
SPI driver for SuperH and SH Mobile MSIOF blocks.

config SPI_SH
tristate "SuperH SPI controller"
Expand Down Expand Up @@ -372,19 +379,27 @@ config SPI_SIRF
help
SPI driver for CSR SiRFprimaII SoCs

config SPI_STMP3XXX
tristate "Freescale STMP37xx/378x SPI/SSP controller"
depends on ARCH_STMP3XXX
help
SPI driver for Freescale STMP37xx/378x SoC SSP interface

config SPI_MXS
tristate "Freescale MXS SPI controller"
depends on ARCH_MXS
select STMP_DEVICE
help
SPI driver for Freescale MXS devices.

config SPI_TEGRA20_SFLASH
tristate "Nvidia Tegra20 Serial flash Controller"
depends on ARCH_TEGRA
help
SPI driver for Nvidia Tegra20 Serial flash Controller interface.
The main usecase of this controller is to use spi flash as boot
device.

config SPI_TEGRA20_SLINK
tristate "Nvidia Tegra20/Tegra30 SLINK Controller"
depends on ARCH_TEGRA && TEGRA20_APB_DMA
help
SPI driver for Nvidia Tegra20/Tegra30 SLINK Controller interface.

config SPI_TI_SSP
tristate "TI Sequencer Serial Port - SPI Support"
depends on MFD_TI_SSP
Expand Down
5 changes: 3 additions & 2 deletions drivers/spi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ obj-$(CONFIG_SPI_BFIN5XX) += spi-bfin5xx.o
obj-$(CONFIG_SPI_BFIN_SPORT) += spi-bfin-sport.o
obj-$(CONFIG_SPI_BITBANG) += spi-bitbang.o
obj-$(CONFIG_SPI_BUTTERFLY) += spi-butterfly.o
obj-$(CONFIG_SPI_CLPS711X) += spi-clps711x.o
obj-$(CONFIG_SPI_COLDFIRE_QSPI) += spi-coldfire-qspi.o
obj-$(CONFIG_SPI_DAVINCI) += spi-davinci.o
obj-$(CONFIG_SPI_DESIGNWARE) += spi-dw.o
Expand Down Expand Up @@ -59,11 +60,11 @@ obj-$(CONFIG_SPI_SH_HSPI) += spi-sh-hspi.o
obj-$(CONFIG_SPI_SH_MSIOF) += spi-sh-msiof.o
obj-$(CONFIG_SPI_SH_SCI) += spi-sh-sci.o
obj-$(CONFIG_SPI_SIRF) += spi-sirf.o
obj-$(CONFIG_SPI_STMP3XXX) += spi-stmp.o
obj-$(CONFIG_SPI_TEGRA20_SFLASH) += spi-tegra20-sflash.o
obj-$(CONFIG_SPI_TEGRA20_SLINK) += spi-tegra20-slink.o
obj-$(CONFIG_SPI_TI_SSP) += spi-ti-ssp.o
obj-$(CONFIG_SPI_TLE62X0) += spi-tle62x0.o
obj-$(CONFIG_SPI_TOPCLIFF_PCH) += spi-topcliff-pch.o
obj-$(CONFIG_SPI_TXX9) += spi-txx9.o
obj-$(CONFIG_SPI_XCOMM) += spi-xcomm.o
obj-$(CONFIG_SPI_XILINX) += spi-xilinx.o

6 changes: 3 additions & 3 deletions drivers/spi/spi-altera.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ static irqreturn_t altera_spi_irq(int irq, void *dev)
return IRQ_HANDLED;
}

static int __devinit altera_spi_probe(struct platform_device *pdev)
static int altera_spi_probe(struct platform_device *pdev)
{
struct altera_spi_platform_data *platp = pdev->dev.platform_data;
struct altera_spi *hw;
Expand Down Expand Up @@ -290,7 +290,7 @@ static int __devinit altera_spi_probe(struct platform_device *pdev)
return err;
}

static int __devexit altera_spi_remove(struct platform_device *dev)
static int altera_spi_remove(struct platform_device *dev)
{
struct altera_spi *hw = platform_get_drvdata(dev);
struct spi_master *master = hw->bitbang.master;
Expand All @@ -311,7 +311,7 @@ MODULE_DEVICE_TABLE(of, altera_spi_match);

static struct platform_driver altera_spi_driver = {
.probe = altera_spi_probe,
.remove = __devexit_p(altera_spi_remove),
.remove = altera_spi_remove,
.driver = {
.name = DRV_NAME,
.owner = THIS_MODULE,
Expand Down
6 changes: 3 additions & 3 deletions drivers/spi/spi-ath79.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ static u32 ath79_spi_txrx_mode0(struct spi_device *spi, unsigned nsecs,
return ath79_spi_rr(sp, AR71XX_SPI_REG_RDS);
}

static __devinit int ath79_spi_probe(struct platform_device *pdev)
static int ath79_spi_probe(struct platform_device *pdev)
{
struct spi_master *master;
struct ath79_spi *sp;
Expand Down Expand Up @@ -251,7 +251,7 @@ static __devinit int ath79_spi_probe(struct platform_device *pdev)
return ret;
}

static __devexit int ath79_spi_remove(struct platform_device *pdev)
static int ath79_spi_remove(struct platform_device *pdev)
{
struct ath79_spi *sp = platform_get_drvdata(pdev);

Expand All @@ -265,7 +265,7 @@ static __devexit int ath79_spi_remove(struct platform_device *pdev)

static struct platform_driver ath79_spi_driver = {
.probe = ath79_spi_probe,
.remove = __devexit_p(ath79_spi_remove),
.remove = ath79_spi_remove,
.driver = {
.name = DRV_NAME,
.owner = THIS_MODULE,
Expand Down
4 changes: 2 additions & 2 deletions drivers/spi/spi-atmel.c
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ static void atmel_spi_cleanup(struct spi_device *spi)

/*-------------------------------------------------------------------------*/

static int __devinit atmel_spi_probe(struct platform_device *pdev)
static int atmel_spi_probe(struct platform_device *pdev)
{
struct resource *regs;
int irq;
Expand Down Expand Up @@ -1003,7 +1003,7 @@ static int __devinit atmel_spi_probe(struct platform_device *pdev)
return ret;
}

static int __devexit atmel_spi_remove(struct platform_device *pdev)
static int atmel_spi_remove(struct platform_device *pdev)
{
struct spi_master *master = platform_get_drvdata(pdev);
struct atmel_spi *as = spi_master_get_devdata(master);
Expand Down
22 changes: 9 additions & 13 deletions drivers/spi/spi-bcm63xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include <bcm63xx_dev_spi.h>

#define PFX KBUILD_MODNAME
#define DRV_VER "0.1.2"

struct bcm63xx_spi {
struct completion done;
Expand Down Expand Up @@ -170,13 +169,6 @@ static int bcm63xx_spi_setup(struct spi_device *spi)
return -EINVAL;
}

ret = bcm63xx_spi_check_transfer(spi, NULL);
if (ret < 0) {
dev_err(&spi->dev, "setup: unsupported mode bits %x\n",
spi->mode & ~MODEBITS);
return ret;
}

dev_dbg(&spi->dev, "%s, mode %d, %u bits/w, %u nsec/bit\n",
__func__, spi->mode & MODEBITS, spi->bits_per_word, 0);

Expand Down Expand Up @@ -337,7 +329,7 @@ static irqreturn_t bcm63xx_spi_interrupt(int irq, void *dev_id)
}


static int __devinit bcm63xx_spi_probe(struct platform_device *pdev)
static int bcm63xx_spi_probe(struct platform_device *pdev)
{
struct resource *r;
struct device *dev = &pdev->dev;
Expand Down Expand Up @@ -441,8 +433,8 @@ static int __devinit bcm63xx_spi_probe(struct platform_device *pdev)
goto out_clk_disable;
}

dev_info(dev, "at 0x%08x (irq %d, FIFOs size %d) v%s\n",
r->start, irq, bs->fifo_size, DRV_VER);
dev_info(dev, "at 0x%08x (irq %d, FIFOs size %d)\n",
r->start, irq, bs->fifo_size);

return 0;

Expand All @@ -457,7 +449,7 @@ static int __devinit bcm63xx_spi_probe(struct platform_device *pdev)
return ret;
}

static int __devexit bcm63xx_spi_remove(struct platform_device *pdev)
static int bcm63xx_spi_remove(struct platform_device *pdev)
{
struct spi_master *master = spi_master_get(platform_get_drvdata(pdev));
struct bcm63xx_spi *bs = spi_master_get_devdata(master);
Expand Down Expand Up @@ -485,6 +477,8 @@ static int bcm63xx_spi_suspend(struct device *dev)
platform_get_drvdata(to_platform_device(dev));
struct bcm63xx_spi *bs = spi_master_get_devdata(master);

spi_master_suspend(master);

clk_disable(bs->clk);

return 0;
Expand All @@ -498,6 +492,8 @@ static int bcm63xx_spi_resume(struct device *dev)

clk_enable(bs->clk);

spi_master_resume(master);

return 0;
}

Expand All @@ -518,7 +514,7 @@ static struct platform_driver bcm63xx_spi_driver = {
.pm = BCM63XX_SPI_PM_OPS,
},
.probe = bcm63xx_spi_probe,
.remove = __devexit_p(bcm63xx_spi_remove),
.remove = bcm63xx_spi_remove,
};

module_platform_driver(bcm63xx_spi_driver);
Expand Down
8 changes: 3 additions & 5 deletions drivers/spi/spi-bfin-sport.c
Original file line number Diff line number Diff line change
Expand Up @@ -755,8 +755,7 @@ bfin_sport_spi_destroy_queue(struct bfin_sport_spi_master_data *drv_data)
return 0;
}

static int __devinit
bfin_sport_spi_probe(struct platform_device *pdev)
static int bfin_sport_spi_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct bfin5xx_spi_master *platform_info;
Expand Down Expand Up @@ -863,8 +862,7 @@ bfin_sport_spi_probe(struct platform_device *pdev)
}

/* stop hardware and remove the driver */
static int __devexit
bfin_sport_spi_remove(struct platform_device *pdev)
static int bfin_sport_spi_remove(struct platform_device *pdev)
{
struct bfin_sport_spi_master_data *drv_data = platform_get_drvdata(pdev);
int status = 0;
Expand Down Expand Up @@ -935,7 +933,7 @@ static struct platform_driver bfin_sport_spi_driver = {
.owner = THIS_MODULE,
},
.probe = bfin_sport_spi_probe,
.remove = __devexit_p(bfin_sport_spi_remove),
.remove = bfin_sport_spi_remove,
.suspend = bfin_sport_spi_suspend,
.resume = bfin_sport_spi_resume,
};
Expand Down
4 changes: 2 additions & 2 deletions drivers/spi/spi-bfin5xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1387,7 +1387,7 @@ static int __init bfin_spi_probe(struct platform_device *pdev)
}

/* stop hardware and remove the driver */
static int __devexit bfin_spi_remove(struct platform_device *pdev)
static int bfin_spi_remove(struct platform_device *pdev)
{
struct bfin_spi_master_data *drv_data = platform_get_drvdata(pdev);
int status = 0;
Expand Down Expand Up @@ -1477,7 +1477,7 @@ static struct platform_driver bfin_spi_driver = {
},
.suspend = bfin_spi_suspend,
.resume = bfin_spi_resume,
.remove = __devexit_p(bfin_spi_remove),
.remove = bfin_spi_remove,
};

static int __init bfin_spi_init(void)
Expand Down
Loading

0 comments on commit d3b43e1

Please sign in to comment.