]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branch 'spi/for-next'
authorStephen Rothwell <sfr@canb.auug.org.au>
Thu, 5 Nov 2015 02:40:03 +0000 (13:40 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 5 Nov 2015 02:40:03 +0000 (13:40 +1100)
247 files changed:
Documentation/devicetree/bindings/spi/brcm,bcm2835-aux-spi.txt [new file with mode: 0644]
Documentation/devicetree/bindings/spi/spi-mt65xx.txt
arch/arm/mach-u300/dummyspichip.c
arch/mips/bcm63xx/dev-spi.c
arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_spi.h
arch/mips/txx9/generic/spi_eeprom.c
drivers/char/tpm/st33zp24/spi.c
drivers/gpio/gpio-74x164.c
drivers/gpio/gpio-max7301.c
drivers/gpio/gpio-mc33880.c
drivers/gpio/gpio-mcp23s08.c
drivers/gpu/drm/panel/panel-lg-lg4573.c
drivers/gpu/drm/panel/panel-samsung-ld9040.c
drivers/hwmon/ad7314.c
drivers/hwmon/adcxx.c
drivers/hwmon/ads7871.c
drivers/hwmon/adt7310.c
drivers/hwmon/lm70.c
drivers/hwmon/max1111.c
drivers/iio/accel/kxsd9.c
drivers/iio/accel/st_accel_spi.c
drivers/iio/adc/ad7266.c
drivers/iio/adc/ad7298.c
drivers/iio/adc/ad7476.c
drivers/iio/adc/ad7791.c
drivers/iio/adc/ad7793.c
drivers/iio/adc/ad7887.c
drivers/iio/adc/ad7923.c
drivers/iio/adc/max1027.c
drivers/iio/adc/mcp320x.c
drivers/iio/adc/ti-adc128s052.c
drivers/iio/amplifiers/ad8366.c
drivers/iio/common/ssp_sensors/ssp_dev.c
drivers/iio/dac/ad5064.c
drivers/iio/dac/ad5360.c
drivers/iio/dac/ad5380.c
drivers/iio/dac/ad5421.c
drivers/iio/dac/ad5446.c
drivers/iio/dac/ad5449.c
drivers/iio/dac/ad5504.c
drivers/iio/dac/ad5624r_spi.c
drivers/iio/dac/ad5686.c
drivers/iio/dac/ad5755.c
drivers/iio/dac/ad5764.c
drivers/iio/dac/ad5791.c
drivers/iio/dac/ad7303.c
drivers/iio/dac/mcp4922.c
drivers/iio/frequency/ad9523.c
drivers/iio/frequency/adf4350.c
drivers/iio/gyro/adis16080.c
drivers/iio/gyro/adis16130.c
drivers/iio/gyro/adis16136.c
drivers/iio/gyro/adis16260.c
drivers/iio/gyro/adxrs450.c
drivers/iio/gyro/st_gyro_spi.c
drivers/iio/imu/adis16400_core.c
drivers/iio/imu/adis16480.c
drivers/iio/magnetometer/st_magn_spi.c
drivers/iio/pressure/ms5611_spi.c
drivers/iio/pressure/st_pressure_spi.c
drivers/iio/proximity/as3935.c
drivers/input/misc/ad714x-spi.c
drivers/input/misc/adxl34x-spi.c
drivers/input/touchscreen/ad7877.c
drivers/input/touchscreen/ad7879-spi.c
drivers/input/touchscreen/ads7846.c
drivers/input/touchscreen/cyttsp4_spi.c
drivers/input/touchscreen/cyttsp_spi.c
drivers/input/touchscreen/tsc2005.c
drivers/leds/leds-dac124s085.c
drivers/media/i2c/s5c73m3/s5c73m3-spi.c
drivers/media/tuners/msi001.c
drivers/mfd/arizona-spi.c
drivers/mfd/cros_ec_spi.c
drivers/mfd/da9052-spi.c
drivers/mfd/ezx-pcap.c
drivers/mfd/mc13xxx-spi.c
drivers/mfd/stmpe-spi.c
drivers/mfd/tps65912-spi.c
drivers/mfd/wm831x-spi.c
drivers/misc/ad525x_dpot-spi.c
drivers/misc/bmp085-spi.c
drivers/misc/eeprom/at25.c
drivers/misc/eeprom/eeprom_93xx46.c
drivers/misc/lattice-ecp3-config.c
drivers/misc/lis3lv02d/lis3lv02d_spi.c
drivers/misc/ti_dac7512.c
drivers/mmc/host/mmc_spi.c
drivers/mtd/devices/m25p80.c
drivers/mtd/devices/mtd_dataflash.c
drivers/mtd/devices/sst25l.c
drivers/net/can/spi/mcp251x.c
drivers/net/ethernet/micrel/ks8851.c
drivers/net/ethernet/microchip/enc28j60.c
drivers/net/ethernet/qualcomm/qca_spi.c
drivers/net/ieee802154/at86rf230.c
drivers/net/ieee802154/cc2520.c
drivers/net/ieee802154/mrf24j40.c
drivers/net/phy/spi_ks8995.c
drivers/net/wireless/cw1200/cw1200_spi.c
drivers/net/wireless/libertas/if_spi.c
drivers/net/wireless/p54/p54spi.c
drivers/net/wireless/ti/wl1251/spi.c
drivers/net/wireless/ti/wlcore/spi.c
drivers/nfc/st-nci/spi.c
drivers/nfc/trf7970a.c
drivers/regulator/tps6524x-regulator.c
drivers/rtc/rtc-ds1305.c
drivers/rtc/rtc-ds1343.c
drivers/rtc/rtc-ds1347.c
drivers/rtc/rtc-ds1390.c
drivers/rtc/rtc-ds3234.c
drivers/rtc/rtc-m41t93.c
drivers/rtc/rtc-m41t94.c
drivers/rtc/rtc-max6902.c
drivers/rtc/rtc-mcp795.c
drivers/rtc/rtc-pcf2123.c
drivers/rtc/rtc-r9701.c
drivers/rtc/rtc-rs5c348.c
drivers/rtc/rtc-rx4581.c
drivers/spi/Kconfig
drivers/spi/Makefile
drivers/spi/spi-ath79.c
drivers/spi/spi-atmel.c
drivers/spi/spi-au1550.c
drivers/spi/spi-bcm2835.c
drivers/spi/spi-bcm2835aux.c [new file with mode: 0644]
drivers/spi/spi-bcm53xx.c
drivers/spi/spi-bcm63xx.c
drivers/spi/spi-bfin-sport.c
drivers/spi/spi-bfin5xx.c
drivers/spi/spi-bitbang.c
drivers/spi/spi-coldfire-qspi.c
drivers/spi/spi-davinci.c
drivers/spi/spi-dw-mmio.c
drivers/spi/spi-dw-pci.c
drivers/spi/spi-dw.c
drivers/spi/spi-dw.h
drivers/spi/spi-fsl-dspi.c
drivers/spi/spi-imx.c
drivers/spi/spi-mpc512x-psc.c
drivers/spi/spi-mt65xx.c
drivers/spi/spi-oc-tiny.c
drivers/spi/spi-octeon.c
drivers/spi/spi-omap-100k.c
drivers/spi/spi-omap-uwire.c
drivers/spi/spi-omap2-mcspi.c
drivers/spi/spi-ppc4xx.c
drivers/spi/spi-pxa2xx-dma.c
drivers/spi/spi-pxa2xx.c
drivers/spi/spi-pxa2xx.h
drivers/spi/spi-s3c24xx.c
drivers/spi/spi-s3c64xx.c
drivers/spi/spi-ti-qspi.c
drivers/spi/spi-tle62x0.c
drivers/spi/spi-txx9.c
drivers/spi/spi-xilinx.c
drivers/spi/spi.c
drivers/spi/spidev.c
drivers/staging/fbtft/fbtft.h
drivers/staging/fbtft/flexfb.c
drivers/staging/iio/accel/adis16201_core.c
drivers/staging/iio/accel/adis16203_core.c
drivers/staging/iio/accel/adis16204_core.c
drivers/staging/iio/accel/adis16209_core.c
drivers/staging/iio/accel/adis16220_core.c
drivers/staging/iio/accel/adis16240_core.c
drivers/staging/iio/accel/lis3l02dq_core.c
drivers/staging/iio/accel/sca3000_core.c
drivers/staging/iio/adc/ad7192.c
drivers/staging/iio/adc/ad7280a.c
drivers/staging/iio/adc/ad7606_spi.c
drivers/staging/iio/adc/ad7780.c
drivers/staging/iio/adc/ad7816.c
drivers/staging/iio/addac/adt7316-spi.c
drivers/staging/iio/frequency/ad9832.c
drivers/staging/iio/frequency/ad9834.c
drivers/staging/iio/gyro/adis16060_core.c
drivers/staging/iio/magnetometer/hmc5843_spi.c
drivers/staging/iio/meter/ade7753.c
drivers/staging/iio/meter/ade7754.c
drivers/staging/iio/meter/ade7758_core.c
drivers/staging/iio/meter/ade7759.c
drivers/staging/iio/meter/ade7854-spi.c
drivers/staging/iio/resolver/ad2s1200.c
drivers/staging/iio/resolver/ad2s1210.c
drivers/staging/iio/resolver/ad2s90.c
drivers/staging/mt29f_spinand/mt29f_spinand.c
drivers/tty/serial/ifx6x60.c
drivers/tty/serial/max3100.c
drivers/tty/serial/max310x.c
drivers/tty/serial/sc16is7xx.c
drivers/usb/host/max3421-hcd.c
drivers/video/backlight/ams369fg06.c
drivers/video/backlight/corgi_lcd.c
drivers/video/backlight/ili922x.c
drivers/video/backlight/l4f00242t03.c
drivers/video/backlight/ld9040.c
drivers/video/backlight/lms283gf05.c
drivers/video/backlight/lms501kf03.c
drivers/video/backlight/ltv350qv.c
drivers/video/backlight/s6e63m0.c
drivers/video/backlight/tdo24m.c
drivers/video/backlight/tosa_lcd.c
drivers/video/backlight/vgg2432a4.c
drivers/video/fbdev/mmp/panel/tpo_tj032md01bw.c
drivers/video/fbdev/omap/lcd_mipid.c
drivers/video/fbdev/omap2/displays-new/panel-lgphilips-lb035q02.c
drivers/video/fbdev/omap2/displays-new/panel-nec-nl8048hl11.c
drivers/video/fbdev/omap2/displays-new/panel-sony-acx565akm.c
drivers/video/fbdev/omap2/displays-new/panel-tpo-td028ttec1.c
drivers/video/fbdev/omap2/displays-new/panel-tpo-td043mtea1.c
include/linux/pxa2xx_ssp.h
include/linux/spi/spi.h
include/linux/spi/spi_bitbang.h
sound/soc/codecs/ad1836.c
sound/soc/codecs/ad193x-spi.c
sound/soc/codecs/adau1761-spi.c
sound/soc/codecs/adau1781-spi.c
sound/soc/codecs/adau1977-spi.c
sound/soc/codecs/adav801.c
sound/soc/codecs/ak4104.c
sound/soc/codecs/cs4271-spi.c
sound/soc/codecs/da7210.c
sound/soc/codecs/pcm1792a.c
sound/soc/codecs/pcm512x-spi.c
sound/soc/codecs/rt5677-spi.c
sound/soc/codecs/ssm2602-spi.c
sound/soc/codecs/tlv320aic23-spi.c
sound/soc/codecs/tlv320aic26.c
sound/soc/codecs/wm0010.c
sound/soc/codecs/wm8510.c
sound/soc/codecs/wm8711.c
sound/soc/codecs/wm8728.c
sound/soc/codecs/wm8731.c
sound/soc/codecs/wm8737.c
sound/soc/codecs/wm8741.c
sound/soc/codecs/wm8750.c
sound/soc/codecs/wm8753.c
sound/soc/codecs/wm8770.c
sound/soc/codecs/wm8776.c
sound/soc/codecs/wm8804-spi.c
sound/soc/codecs/wm8900.c
sound/soc/codecs/wm8983.c
sound/soc/codecs/wm8985.c
sound/soc/codecs/wm8988.c
sound/soc/codecs/wm8995.c

diff --git a/Documentation/devicetree/bindings/spi/brcm,bcm2835-aux-spi.txt b/Documentation/devicetree/bindings/spi/brcm,bcm2835-aux-spi.txt
new file mode 100644 (file)
index 0000000..9887b07
--- /dev/null
@@ -0,0 +1,38 @@
+Broadcom BCM2835 auxiliar SPI1/2 controller
+
+The BCM2835 contains two forms of SPI master controller, one known simply as
+SPI0, and the other known as the "Universal SPI Master"; part of the
+auxiliary block. This binding applies to the SPI1/2 controller.
+
+Required properties:
+- compatible: Should be "brcm,bcm2835-aux-spi".
+- reg: Should contain register location and length for the spi block
+- interrupts: Should contain shared interrupt of the aux block
+- clocks: The clock feeding the SPI controller - needs to
+         point to the auxiliar clock driver of the bcm2835,
+         as this clock will enable the output gate for the specific
+         clock.
+- cs-gpios: the cs-gpios (native cs is NOT supported)
+           see also spi-bus.txt
+
+Example:
+
+spi1@7e215080 {
+       compatible = "brcm,bcm2835-aux-spi";
+       reg = <0x7e215080 0x40>;
+       interrupts = <1 29>;
+       clocks = <&aux_clocks BCM2835_AUX_CLOCK_SPI1>;
+       #address-cells = <1>;
+       #size-cells = <0>;
+       cs-gpios = <&gpio 18>, <&gpio 17>, <&gpio 16>;
+};
+
+spi2@7e2150c0 {
+       compatible = "brcm,bcm2835-aux-spi";
+       reg = <0x7e2150c0 0x40>;
+       interrupts = <1 29>;
+       clocks = <&aux_clocks BCM2835_AUX_CLOCK_SPI2>;
+       #address-cells = <1>;
+       #size-cells = <0>;
+       cs-gpios = <&gpio 43>, <&gpio 44>, <&gpio 45>;
+};
index 6160ffbcb3d331b8712eec389a2d4dc95c3bac64..ce363c923f446b66dcfffc51274da4623630f15d 100644 (file)
@@ -29,8 +29,11 @@ Required properties:
   muxes clock, and "spi-clk" for the clock gate.
 
 Optional properties:
+-cs-gpios: see spi-bus.txt, only required for MT8173.
+
 - mediatek,pad-select: specify which pins group(ck/mi/mo/cs) spi
-  controller used, this value should be 0~3, only required for MT8173.
+  controller used. This is a array, the element value should be 0~3,
+  only required for MT8173.
     0: specify GPIO69,70,71,72 for spi pins.
     1: specify GPIO102,103,104,105 for spi pins.
     2: specify GPIO128,129,130,131 for spi pins.
@@ -49,7 +52,7 @@ spi: spi@1100a000 {
                 <&topckgen CLK_TOP_SPI_SEL>,
                 <&pericfg CLK_PERI_SPI0>;
        clock-names = "parent-clk", "sel-clk", "spi-clk";
-
-       mediatek,pad-select = <0>;
+       cs-gpios = <&pio 105 GPIO_ACTIVE_LOW>, <&pio 72 GPIO_ACTIVE_LOW>;
+       mediatek,pad-select = <1>, <0>;
        status = "disabled";
 };
index 131996805690849a187561ab06014ae9095bd32e..68fe986ca42e7a3252ff2aa6efee2df365ac27cb 100644 (file)
@@ -264,7 +264,6 @@ static const struct of_device_id pl022_dummy_dt_match[] = {
 static struct spi_driver pl022_dummy_driver = {
        .driver = {
                .name   = "spi-dummy",
-               .owner  = THIS_MODULE,
                .of_match_table = pl022_dummy_dt_match,
        },
        .probe  = pl022_dummy_probe,
index ad448e41e3bd58c633d49afa5b2d24723c1881a9..232385441e468729ca0f70c6acebbb1be62eadd0 100644 (file)
 #include <bcm63xx_dev_spi.h>
 #include <bcm63xx_regs.h>
 
-/*
- * register offsets
- */
-static const unsigned long bcm6348_regs_spi[] = {
-       __GEN_SPI_REGS_TABLE(6348)
-};
-
-static const unsigned long bcm6358_regs_spi[] = {
-       __GEN_SPI_REGS_TABLE(6358)
-};
-
-const unsigned long *bcm63xx_regs_spi;
-EXPORT_SYMBOL(bcm63xx_regs_spi);
-
-static __init void bcm63xx_spi_regs_init(void)
-{
-       if (BCMCPU_IS_6338() || BCMCPU_IS_6348())
-               bcm63xx_regs_spi = bcm6348_regs_spi;
-       if (BCMCPU_IS_3368() || BCMCPU_IS_6358() ||
-               BCMCPU_IS_6362() || BCMCPU_IS_6368())
-               bcm63xx_regs_spi = bcm6358_regs_spi;
-}
-
 static struct resource spi_resources[] = {
        {
                .start          = -1, /* filled at runtime */
@@ -53,19 +30,10 @@ 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)
@@ -78,21 +46,15 @@ int __init bcm63xx_spi_register(void)
        spi_resources[1].start = bcm63xx_get_irq_number(IRQ_SPI);
 
        if (BCMCPU_IS_6338() || BCMCPU_IS_6348()) {
+               bcm63xx_spi_device.name = "bcm6348-spi",
                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()) {
+               bcm63xx_spi_device.name = "bcm6358-spi",
                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();
-
        return platform_device_register(&bcm63xx_spi_device);
 }
index 25737655d1415a96bc913c96f5229ab21e120f24..dd299548860d1619d70070799224c8b3758bd75b 100644 (file)
@@ -7,48 +7,4 @@
 
 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,
-       SPI_INT_MASK_ST,
-       SPI_INT_MASK,
-       SPI_ST,
-       SPI_CLK_CFG,
-       SPI_FILL_BYTE,
-       SPI_MSG_TAIL,
-       SPI_RX_TAIL,
-       SPI_MSG_CTL,
-       SPI_MSG_DATA,
-       SPI_RX_DATA,
-};
-
-#define __GEN_SPI_REGS_TABLE(__cpu)                                    \
-       [SPI_CMD]               = SPI_## __cpu ##_CMD,                  \
-       [SPI_INT_STATUS]        = SPI_## __cpu ##_INT_STATUS,           \
-       [SPI_INT_MASK_ST]       = SPI_## __cpu ##_INT_MASK_ST,          \
-       [SPI_INT_MASK]          = SPI_## __cpu ##_INT_MASK,             \
-       [SPI_ST]                = SPI_## __cpu ##_ST,                   \
-       [SPI_CLK_CFG]           = SPI_## __cpu ##_CLK_CFG,              \
-       [SPI_FILL_BYTE]         = SPI_## __cpu ##_FILL_BYTE,            \
-       [SPI_MSG_TAIL]          = SPI_## __cpu ##_MSG_TAIL,             \
-       [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,
-
-static inline unsigned long bcm63xx_spireg(enum bcm63xx_regs_spi reg)
-{
-       extern const unsigned long *bcm63xx_regs_spi;
-
-       return bcm63xx_regs_spi[reg];
-}
-
 #endif /* BCM63XX_DEV_SPI_H */
index 3dbad99d5611e2428666a4475cd5504f441d0c40..d833dd2c9b5572940e0f43baca3d9a60f3117bae 100644 (file)
@@ -80,7 +80,6 @@ static int __init early_seeprom_probe(struct spi_device *spi)
 static struct spi_driver early_seeprom_driver __initdata = {
        .driver = {
                .name   = "at25",
-               .owner  = THIS_MODULE,
        },
        .probe  = early_seeprom_probe,
 };
index f0184a1b0c1c9814043f45e39d139d596a4fb020..f974c945c97ad79f5860a350249f0086dec1ff97 100644 (file)
@@ -381,7 +381,6 @@ static SIMPLE_DEV_PM_OPS(st33zp24_spi_ops, st33zp24_pm_suspend,
 
 static struct spi_driver tpm_st33_spi_driver = {
        .driver = {
-               .owner = THIS_MODULE,
                .name = TPM_ST33_SPI,
                .pm = &st33zp24_spi_ops,
                .of_match_table = of_match_ptr(of_st33zp24_spi_match),
index e3d968f751f124e2eda733e2ee2a061fd08b1cbd..60172f835d15f1398fa8c7ac58901f40d0a5914c 100644 (file)
@@ -183,7 +183,6 @@ MODULE_DEVICE_TABLE(of, gen_74x164_dt_ids);
 static struct spi_driver gen_74x164_driver = {
        .driver = {
                .name           = "74x164",
-               .owner          = THIS_MODULE,
                .of_match_table = gen_74x164_dt_ids,
        },
        .probe          = gen_74x164_probe,
index 6e1c984a75d45e4253d0f2c1563364d310f37708..05813fbf3daf25f4aeb6ea0233f13c13dd95ad73 100644 (file)
@@ -87,7 +87,6 @@ MODULE_DEVICE_TABLE(spi, max7301_id);
 static struct spi_driver max7301_driver = {
        .driver = {
                .name = "max7301",
-               .owner = THIS_MODULE,
        },
        .probe = max7301_probe,
        .remove = max7301_remove,
index a431604c9e677beb30c69be99c221e44ea70f2e5..2853731db5bc297fbe5fe96afd6cf9b9e16f2935 100644 (file)
@@ -163,7 +163,6 @@ static int mc33880_remove(struct spi_device *spi)
 static struct spi_driver mc33880_driver = {
        .driver = {
                .name           = DRIVER_NAME,
-               .owner          = THIS_MODULE,
        },
        .probe          = mc33880_probe,
        .remove         = mc33880_remove,
index 73db7ecd7ffd9c2e44bc0a98af639884ee6fb9ad..4a41694919dae1e1d960da377b2e7ce48a593dec 100644 (file)
@@ -848,7 +848,6 @@ MODULE_DEVICE_TABLE(i2c, mcp230xx_id);
 static struct i2c_driver mcp230xx_driver = {
        .driver = {
                .name   = "mcp230xx",
-               .owner  = THIS_MODULE,
                .of_match_table = of_match_ptr(mcp23s08_i2c_of_match),
        },
        .probe          = mcp230xx_probe,
@@ -1021,7 +1020,6 @@ static struct spi_driver mcp23s08_driver = {
        .id_table       = mcp23s08_ids,
        .driver = {
                .name   = "mcp23s08",
-               .owner  = THIS_MODULE,
                .of_match_table = of_match_ptr(mcp23s08_spi_of_match),
        },
 };
index a7b4939cee6d83be6e34ae1e45feb294d9f1da70..6989238b276aee9faf7551c2c0b1cd681cc03eaf 100644 (file)
@@ -287,7 +287,6 @@ static struct spi_driver lg4573_driver = {
        .remove = lg4573_remove,
        .driver = {
                .name = "lg4573",
-               .owner = THIS_MODULE,
                .of_match_table = lg4573_of_match,
        },
 };
index b202377135e7b320e825e6005bcb1d733fc1a47a..3cf4cf6a6942c3f3e33f467efa22445fccbd6998 100644 (file)
@@ -378,7 +378,6 @@ static struct spi_driver ld9040_driver = {
        .remove = ld9040_remove,
        .driver = {
                .name = "panel-samsung-ld9040",
-               .owner = THIS_MODULE,
                .of_match_table = ld9040_of_match,
        },
 };
index 11955467fc0f48a53f4cf776802cd3494820ccca..202c1fbb3407a7973d8ff993813dbf38dd802d24 100644 (file)
@@ -157,7 +157,6 @@ MODULE_DEVICE_TABLE(spi, ad7314_id);
 static struct spi_driver ad7314_driver = {
        .driver = {
                .name = "ad7314",
-               .owner = THIS_MODULE,
        },
        .probe = ad7314_probe,
        .remove = ad7314_remove,
index 04c08c2f79b8a3e16e2b537cd7a6427cb745e36d..69e0bb97e5973911e1fdbfba07a36420b585894b 100644 (file)
@@ -234,7 +234,6 @@ MODULE_DEVICE_TABLE(spi, adcxx_ids);
 static struct spi_driver adcxx_driver = {
        .driver = {
                .name   = "adcxx",
-               .owner  = THIS_MODULE,
        },
        .id_table = adcxx_ids,
        .probe  = adcxx_probe,
index 3eff73b6220d87d92cc43b8aff5e8fcd7b774ab1..4fd9e4de19723432d172b07508777e629a400252 100644 (file)
@@ -237,7 +237,6 @@ static int ads7871_remove(struct spi_device *spi)
 static struct spi_driver ads7871_driver = {
        .driver = {
                .name = DEVICE_NAME,
-               .owner = THIS_MODULE,
        },
 
        .probe = ads7871_probe,
index 5994cf68e0a4225813f165f6c3160277c191352b..ec02f4f0d67a95a3a89f0d0d026007898cb0ae52 100644 (file)
@@ -104,7 +104,6 @@ MODULE_DEVICE_TABLE(spi, adt7310_id);
 static struct spi_driver adt7310_driver = {
        .driver = {
                .name   = "adt7310",
-               .owner  = THIS_MODULE,
                .pm     = ADT7X10_DEV_PM_OPS,
        },
        .probe          = adt7310_spi_probe,
index 9296e9daf774474654d3fa7037e579ef01be5566..583f883a4cfe61eb2bcaa9530a4c146eb8d23045 100644 (file)
@@ -199,7 +199,6 @@ MODULE_DEVICE_TABLE(spi, lm70_ids);
 static struct spi_driver lm70_driver = {
        .driver = {
                .name   = "lm70",
-               .owner  = THIS_MODULE,
                .of_match_table = of_match_ptr(lm70_of_ids),
        },
        .id_table = lm70_ids,
index f67d71ee8386a4ff8a485ec8c3a03c498dd661e5..36544c4f653c6d2f1c7c3ca1333186d68f2f6269 100644 (file)
@@ -277,7 +277,6 @@ MODULE_DEVICE_TABLE(spi, max1111_ids);
 static struct spi_driver max1111_driver = {
        .driver         = {
                .name   = "max1111",
-               .owner  = THIS_MODULE,
        },
        .id_table       = max1111_ids,
        .probe          = max1111_probe,
index 98ba761cbb9ce6943913c03b0a65d861e6956661..923f56598d4b51a84ee7b5b322c2c9bfefe4f0a5 100644 (file)
@@ -263,7 +263,6 @@ MODULE_DEVICE_TABLE(spi, kxsd9_id);
 static struct spi_driver kxsd9_driver = {
        .driver = {
                .name = "kxsd9",
-               .owner = THIS_MODULE,
        },
        .probe = kxsd9_probe,
        .remove = kxsd9_remove,
index 54b61a3961c305e60222de437e4355103ae67029..f71b0d391272476a96656bef1ad22172fd3e2f28 100644 (file)
@@ -64,7 +64,6 @@ MODULE_DEVICE_TABLE(spi, st_accel_id_table);
 
 static struct spi_driver st_accel_driver = {
        .driver = {
-               .owner = THIS_MODULE,
                .name = "st-accel-spi",
        },
        .probe = st_accel_spi_probe,
index 70f78c3062a718f0d7267ee517a60387c8500fbe..21e19b60e2b98305b209a648690e8f18f64b40f9 100644 (file)
@@ -509,7 +509,6 @@ MODULE_DEVICE_TABLE(spi, ad7266_id);
 static struct spi_driver ad7266_driver = {
        .driver = {
                .name   = "ad7266",
-               .owner  = THIS_MODULE,
        },
        .probe          = ad7266_probe,
        .remove         = ad7266_remove,
index 4a8c0a2f49b6959f5528f80124f4d10a2d9ae9f9..62bb8f7ce4a0f93e0d657a584d56cd3feea75bd7 100644 (file)
@@ -378,7 +378,6 @@ MODULE_DEVICE_TABLE(spi, ad7298_id);
 static struct spi_driver ad7298_driver = {
        .driver = {
                .name   = "ad7298",
-               .owner  = THIS_MODULE,
        },
        .probe          = ad7298_probe,
        .remove         = ad7298_remove,
index ce400ec176f13e34fddd799deaa2caf595114b03..be85c2a0ad97feeedd9b0a4ac4d61548d236c57b 100644 (file)
@@ -302,7 +302,6 @@ MODULE_DEVICE_TABLE(spi, ad7476_id);
 static struct spi_driver ad7476_driver = {
        .driver = {
                .name   = "ad7476",
-               .owner  = THIS_MODULE,
        },
        .probe          = ad7476_probe,
        .remove         = ad7476_remove,
index c19f8fd1b4b7ac9ba5c2b216d5aa7be362200859..cf172d58cd44ce18691c7219d2d1c1935265d25b 100644 (file)
@@ -440,7 +440,6 @@ MODULE_DEVICE_TABLE(spi, ad7791_spi_ids);
 static struct spi_driver ad7791_driver = {
        .driver = {
                .name   = "ad7791",
-               .owner  = THIS_MODULE,
        },
        .probe          = ad7791_probe,
        .remove         = ad7791_remove,
index b84922a4b32e6bb508c8a5c812a281907102159f..eea0c79111e7c7e2beb6be21cda21d597833e793 100644 (file)
@@ -852,7 +852,6 @@ MODULE_DEVICE_TABLE(spi, ad7793_id);
 static struct spi_driver ad7793_driver = {
        .driver = {
                .name   = "ad7793",
-               .owner  = THIS_MODULE,
        },
        .probe          = ad7793_probe,
        .remove         = ad7793_remove,
index 2fd012ee99f5b3f005bbe4c152760a3af36a27be..2d3c397e66ad4f8ca1785657e0e7159734680b65 100644 (file)
@@ -356,7 +356,6 @@ MODULE_DEVICE_TABLE(spi, ad7887_id);
 static struct spi_driver ad7887_driver = {
        .driver = {
                .name   = "ad7887",
-               .owner  = THIS_MODULE,
        },
        .probe          = ad7887_probe,
        .remove         = ad7887_remove,
index 28732c28e8197a688c27d1d665458fae24c8a97f..45e29ccd824f25f9c6d167dc3aeadef3dc542e43 100644 (file)
@@ -357,7 +357,6 @@ MODULE_DEVICE_TABLE(spi, ad7923_id);
 static struct spi_driver ad7923_driver = {
        .driver = {
                .name   = "ad7923",
-               .owner  = THIS_MODULE,
        },
        .probe          = ad7923_probe,
        .remove         = ad7923_remove,
index 44bf815adb6c0d4edd9162fca82b4aaa1dd95d81..3bc059c698241a46908c9b5047082f0262cdae26 100644 (file)
@@ -508,7 +508,6 @@ static int max1027_remove(struct spi_device *spi)
 static struct spi_driver max1027_driver = {
        .driver = {
                .name   = "max1027",
-               .owner  = THIS_MODULE,
        },
        .probe          = max1027_probe,
        .remove         = max1027_remove,
index b19e4f9d16e0ded7ba602ccb8269369720a64dee..d5d8b4180914d873a673072c5c377e68cd2e603e 100644 (file)
@@ -404,7 +404,6 @@ MODULE_DEVICE_TABLE(spi, mcp320x_id);
 static struct spi_driver mcp320x_driver = {
        .driver = {
                .name = "mcp320x",
-               .owner = THIS_MODULE,
        },
        .probe = mcp320x_probe,
        .remove = mcp320x_remove,
index 915be6b60097b259a29c3b780a3f04736a0ac9b3..76b619649409a43329719e17668b851b427e3c84 100644 (file)
@@ -184,7 +184,6 @@ MODULE_DEVICE_TABLE(spi, adc128_id);
 static struct spi_driver adc128_driver = {
        .driver = {
                .name = "adc128s052",
-               .owner = THIS_MODULE,
        },
        .probe = adc128_probe,
        .remove = adc128_remove,
index c0d364ebaea83efd39ef919f21011423ee78288e..6da31e4dbdd4833332a6888115eb29f458c4c3de 100644 (file)
@@ -199,7 +199,6 @@ static const struct spi_device_id ad8366_id[] = {
 static struct spi_driver ad8366_driver = {
        .driver = {
                .name   = KBUILD_MODNAME,
-               .owner  = THIS_MODULE,
        },
        .probe          = ad8366_probe,
        .remove         = ad8366_remove,
index d338bb595db3eda0ec2d472b62ef8a195f09e1e8..ea7adb638d99a71c31366ee89361fd1618e76ed6 100644 (file)
@@ -700,7 +700,6 @@ static struct spi_driver ssp_driver = {
        .remove = ssp_remove,
        .driver = {
                .pm = &ssp_pm_ops,
-               .owner = THIS_MODULE,
                .of_match_table = of_match_ptr(ssp_of_match),
                .name = "sensorhub"
        },
index c067e682149600f5d65eab9d442744f2fd6e9f62..9e4d2c18b5541b2043e244229aeb393e79e737d4 100644 (file)
@@ -568,7 +568,6 @@ MODULE_DEVICE_TABLE(spi, ad5064_spi_ids);
 static struct spi_driver ad5064_spi_driver = {
        .driver = {
                   .name = "ad5064",
-                  .owner = THIS_MODULE,
        },
        .probe = ad5064_spi_probe,
        .remove = ad5064_spi_remove,
index 64634d7f578e2aa0bccb338ebff682daa92d7829..8ba0e9c501761cf2da4e250d0ff18bf82fd34d96 100644 (file)
@@ -549,7 +549,6 @@ MODULE_DEVICE_TABLE(spi, ad5360_ids);
 static struct spi_driver ad5360_driver = {
        .driver = {
                   .name = "ad5360",
-                  .owner = THIS_MODULE,
        },
        .probe = ad5360_probe,
        .remove = ad5360_remove,
index 130de9b3e0bf4d0d969a87d7c1d62c3114e77848..97d2c5111f4389b7804bab5253262f5532b80271 100644 (file)
@@ -519,7 +519,6 @@ MODULE_DEVICE_TABLE(spi, ad5380_spi_ids);
 static struct spi_driver ad5380_spi_driver = {
        .driver = {
                   .name = "ad5380",
-                  .owner = THIS_MODULE,
        },
        .probe = ad5380_spi_probe,
        .remove = ad5380_spi_remove,
index 787ef1d859c6301fde64d828e3d8cb40bbab2342..968712be967f44bc73d5d34f04edbcc492f69589 100644 (file)
@@ -524,7 +524,6 @@ static int ad5421_probe(struct spi_device *spi)
 static struct spi_driver ad5421_driver = {
        .driver = {
                   .name = "ad5421",
-                  .owner = THIS_MODULE,
        },
        .probe = ad5421_probe,
 };
index 07e17d72a3f3d13922684c85dab2b6a13811c702..b555552a0d803047050d511ecc6b15c280b2dc4e 100644 (file)
@@ -481,7 +481,6 @@ static int ad5446_spi_remove(struct spi_device *spi)
 static struct spi_driver ad5446_spi_driver = {
        .driver = {
                .name   = "ad5446",
-               .owner  = THIS_MODULE,
        },
        .probe          = ad5446_spi_probe,
        .remove         = ad5446_spi_remove,
index 64d7256cbb6d0a20dd7e4e6d33b2aab03fbfbca4..5f32023394206e2232f65760b77d3d9c6ec955bb 100644 (file)
@@ -356,7 +356,6 @@ MODULE_DEVICE_TABLE(spi, ad5449_spi_ids);
 static struct spi_driver ad5449_spi_driver = {
        .driver = {
                .name = "ad5449",
-               .owner = THIS_MODULE,
        },
        .probe = ad5449_spi_probe,
        .remove = ad5449_spi_remove,
index 581ec141de3df7ba92e6b2198c185fcef6acbc60..88b2c92e243bccdb1cb20e0d038853500f8b3fd0 100644 (file)
@@ -364,7 +364,6 @@ MODULE_DEVICE_TABLE(spi, ad5504_id);
 static struct spi_driver ad5504_driver = {
        .driver = {
                   .name = "ad5504",
-                  .owner = THIS_MODULE,
                   },
        .probe = ad5504_probe,
        .remove = ad5504_remove,
index e98428df0d44781e557ed2dfcf96017ad7d48baf..5489ec43b95d7c3acabcc2416c742b64edf92469 100644 (file)
@@ -306,7 +306,6 @@ MODULE_DEVICE_TABLE(spi, ad5624r_id);
 static struct spi_driver ad5624r_driver = {
        .driver = {
                   .name = "ad5624r",
-                  .owner = THIS_MODULE,
                   },
        .probe = ad5624r_probe,
        .remove = ad5624r_remove,
index 15c73e20272d874655e544366e2a8d6f1c24912a..d1d8450c19f62a39300fb5a4829a1eaa119ff7dd 100644 (file)
@@ -395,7 +395,6 @@ MODULE_DEVICE_TABLE(spi, ad5686_id);
 static struct spi_driver ad5686_driver = {
        .driver = {
                   .name = "ad5686",
-                  .owner = THIS_MODULE,
                   },
        .probe = ad5686_probe,
        .remove = ad5686_remove,
index a7c851f62d7c2089bab84b4fa1743fa664ca2174..bfb350a85a16dac01b7ce25984bea3242eafbfb2 100644 (file)
@@ -610,7 +610,6 @@ MODULE_DEVICE_TABLE(spi, ad5755_id);
 static struct spi_driver ad5755_driver = {
        .driver = {
                .name = "ad5755",
-               .owner = THIS_MODULE,
        },
        .probe = ad5755_probe,
        .id_table = ad5755_id,
index d0d38165339d5bd9c89939fc48bfb22f31e33f1a..9a547bbf7d2bcc33f2cee3ed53e41ff4610aa1fe 100644 (file)
@@ -357,7 +357,6 @@ MODULE_DEVICE_TABLE(spi, ad5764_ids);
 static struct spi_driver ad5764_driver = {
        .driver = {
                .name = "ad5764",
-               .owner = THIS_MODULE,
        },
        .probe = ad5764_probe,
        .remove = ad5764_remove,
index 5ba785f1858988b6cef32e3dc79b78e171da3bfe..33e4ae5c42f8d6c8186ce0ac1afc02ffe376907a 100644 (file)
@@ -461,7 +461,6 @@ MODULE_DEVICE_TABLE(spi, ad5791_id);
 static struct spi_driver ad5791_driver = {
        .driver = {
                   .name = "ad5791",
-                  .owner = THIS_MODULE,
                   },
        .probe = ad5791_probe,
        .remove = ad5791_remove,
index fa281003296846b35bc1086ca1eb58299f82d535..399de2cfeb16b52c75180c88f8435e4102a53be5 100644 (file)
@@ -290,7 +290,6 @@ MODULE_DEVICE_TABLE(spi, ad7303_spi_ids);
 static struct spi_driver ad7303_driver = {
        .driver = {
                .name = "ad7303",
-               .owner = THIS_MODULE,
        },
        .probe = ad7303_probe,
        .remove = ad7303_remove,
index 92cf4ca6981d0a7794dfc560259f1a7069a06c27..3854d201a5d6c3a05a1a118c03cee4e815314e20 100644 (file)
@@ -203,7 +203,6 @@ MODULE_DEVICE_TABLE(spi, mcp4922_id);
 static struct spi_driver mcp4922_driver = {
        .driver = {
                   .name = "mcp4922",
-                  .owner = THIS_MODULE,
                   },
        .probe = mcp4922_probe,
        .remove = mcp4922_remove,
index 50ed8d1ca45a61141cd4fe4ed86dd571e81cde4a..44a30f286de102c30f6052309de978d072c68e57 100644 (file)
@@ -1027,7 +1027,6 @@ MODULE_DEVICE_TABLE(spi, ad9523_id);
 static struct spi_driver ad9523_driver = {
        .driver = {
                .name   = "ad9523",
-               .owner  = THIS_MODULE,
        },
        .probe          = ad9523_probe,
        .remove         = ad9523_remove,
index 9890c81c027d30b370483c3bdd778c0fcec4e79f..b83534cc2ab14bde5fb25819e9a6d854275f2895 100644 (file)
@@ -625,7 +625,6 @@ static const struct spi_device_id adf4350_id[] = {
 static struct spi_driver adf4350_driver = {
        .driver = {
                .name   = "adf4350",
-               .owner  = THIS_MODULE,
        },
        .probe          = adf4350_probe,
        .remove         = adf4350_remove,
index add509837269ba8868f717950256fa9670174a17..ad31a1372a04ce87c4d2218d07a45bff9e51901d 100644 (file)
@@ -228,7 +228,6 @@ MODULE_DEVICE_TABLE(spi, adis16080_ids);
 static struct spi_driver adis16080_driver = {
        .driver = {
                .name = "adis16080",
-               .owner = THIS_MODULE,
        },
        .probe = adis16080_probe,
        .remove = adis16080_remove,
index 8d08c7ed1ea64d554f9414eb15c8ad41303c3381..e5241f41e65e53cb174fc780ecae38e74d6128fa 100644 (file)
@@ -167,7 +167,6 @@ static int adis16130_probe(struct spi_device *spi)
 static struct spi_driver adis16130_driver = {
        .driver = {
                .name = "adis16130",
-               .owner = THIS_MODULE,
        },
        .probe = adis16130_probe,
 };
index 26de876b223d07cb7d51c437d3dec0047bf7a2ce..f8d1c22100660d752c0b1d192291f76b6675f4d5 100644 (file)
@@ -570,7 +570,6 @@ MODULE_DEVICE_TABLE(spi, adis16136_ids);
 static struct spi_driver adis16136_driver = {
        .driver = {
                .name = "adis16136",
-               .owner = THIS_MODULE,
        },
        .id_table = adis16136_ids,
        .probe = adis16136_probe,
index 00c6ad9bf35f74fcd903cd824ee3c10c19e2d5b0..7da8825f4791901d0c3757823e15cf30080993c0 100644 (file)
@@ -435,7 +435,6 @@ MODULE_DEVICE_TABLE(spi, adis16260_id);
 static struct spi_driver adis16260_driver = {
        .driver = {
                .name = "adis16260",
-               .owner = THIS_MODULE,
        },
        .probe = adis16260_probe,
        .remove = adis16260_remove,
index eb0e08ec9e20d43fce5233e44d8144006fd433a3..a330d4288bb07dcdeb124094fa369fa3d70b9599 100644 (file)
@@ -456,7 +456,6 @@ MODULE_DEVICE_TABLE(spi, adxrs450_id);
 static struct spi_driver adxrs450_driver = {
        .driver = {
                .name = "adxrs450",
-               .owner = THIS_MODULE,
        },
        .probe = adxrs450_probe,
        .id_table       = adxrs450_id,
index e59bead6bc3cb2fa8ba5a3cf2e34851cad20a33f..d2b7a5fa344c1c9f60748d0faf92a1bfa7cff56c 100644 (file)
@@ -60,7 +60,6 @@ MODULE_DEVICE_TABLE(spi, st_gyro_id_table);
 
 static struct spi_driver st_gyro_driver = {
        .driver = {
-               .owner = THIS_MODULE,
                .name = "st-gyro-spi",
        },
        .probe = st_gyro_spi_probe,
index abc4c50de9e8b334548560c593f6c53c5bba675c..0618f831ecd49fdb7dce287ffacb34928595c556 100644 (file)
@@ -986,7 +986,6 @@ MODULE_DEVICE_TABLE(spi, adis16400_id);
 static struct spi_driver adis16400_driver = {
        .driver = {
                .name = "adis16400",
-               .owner = THIS_MODULE,
        },
        .id_table = adis16400_id,
        .probe = adis16400_probe,
index b94bfd3f595bfad7e091bda7639d35b30b4e6bc4..2485b88ee1b654d4753e889aaec1376cc1e5d06d 100644 (file)
@@ -896,7 +896,6 @@ MODULE_DEVICE_TABLE(spi, adis16480_ids);
 static struct spi_driver adis16480_driver = {
        .driver = {
                .name = "adis16480",
-               .owner = THIS_MODULE,
        },
        .id_table = adis16480_ids,
        .probe = adis16480_probe,
index 0abca2c6afa6787c3eff0deb84cbd71864030f61..6325e7dc8e03e2cfce529cbab75e38204a46f61b 100644 (file)
@@ -58,7 +58,6 @@ MODULE_DEVICE_TABLE(spi, st_magn_id_table);
 
 static struct spi_driver st_magn_driver = {
        .driver = {
-               .owner = THIS_MODULE,
                .name = "st-magn-spi",
        },
        .probe = st_magn_spi_probe,
index 08ee6e88c79ff7068ce3e4751b35db827b1e7578..aaa0c4ba91a7c9f14fda64b91d26df91e367d1ab 100644 (file)
@@ -117,7 +117,6 @@ MODULE_DEVICE_TABLE(spi, ms5611_id);
 static struct spi_driver ms5611_driver = {
        .driver = {
                .name = "ms5611",
-               .owner = THIS_MODULE,
        },
        .id_table = ms5611_id,
        .probe = ms5611_spi_probe,
index 1ffa6d4d349c1462f4326a6af3738b1fc3e9828a..40c0692ff1de339f123d93d9056fb52134e673df 100644 (file)
@@ -56,7 +56,6 @@ MODULE_DEVICE_TABLE(spi, st_press_id_table);
 
 static struct spi_driver st_press_driver = {
        .driver = {
-               .owner = THIS_MODULE,
                .name = "st-press-spi",
        },
        .probe = st_press_spi_probe,
index bc0d68efd4558cd0cb78a2f23029e399534d15ed..2865aa63f4f1de9cf4900700663bbbf617c49e2c 100644 (file)
@@ -443,7 +443,6 @@ MODULE_DEVICE_TABLE(spi, as3935_id);
 static struct spi_driver as3935_driver = {
        .driver = {
                .name   = "as3935",
-               .owner  = THIS_MODULE,
                .pm     = AS3935_PM_OPS,
        },
        .probe          = as3935_probe,
index c8170f0829624a111f1d8a3a68ad1abe6d6b7445..aac910326447cfcf39a1ae611cdb435150bbd5d4 100644 (file)
@@ -104,7 +104,6 @@ static int ad714x_spi_probe(struct spi_device *spi)
 static struct spi_driver ad714x_spi_driver = {
        .driver = {
                .name   = "ad714x_captouch",
-               .owner  = THIS_MODULE,
                .pm     = &ad714x_spi_pm,
        },
        .probe          = ad714x_spi_probe,
index da6e76b58dab12285c6d06af619c4d69893427fd..3ec03ad88eed35eb59651ada00a003937687419d 100644 (file)
@@ -120,7 +120,6 @@ static SIMPLE_DEV_PM_OPS(adxl34x_spi_pm, adxl34x_spi_suspend,
 static struct spi_driver adxl34x_driver = {
        .driver = {
                .name = "adxl34x",
-               .owner = THIS_MODULE,
                .pm = &adxl34x_spi_pm,
        },
        .probe   = adxl34x_spi_probe,
index da4e5bb5e04559f1be10e43deabea2ee67a11822..9c250ae780d976fdd84980cb08fcb6cf3e4cbfbb 100644 (file)
@@ -843,7 +843,6 @@ static SIMPLE_DEV_PM_OPS(ad7877_pm, ad7877_suspend, ad7877_resume);
 static struct spi_driver ad7877_driver = {
        .driver = {
                .name   = "ad7877",
-               .owner  = THIS_MODULE,
                .pm     = &ad7877_pm,
        },
        .probe          = ad7877_probe,
index 1a7b1143536e1d4a68dd6fb9e1c85cf992afee04..48033c2689ab47dcdbf6334a76930a460c87df73 100644 (file)
@@ -149,7 +149,6 @@ static int ad7879_spi_remove(struct spi_device *spi)
 static struct spi_driver ad7879_spi_driver = {
        .driver = {
                .name   = "ad7879",
-               .owner  = THIS_MODULE,
                .pm     = &ad7879_pm_ops,
        },
        .probe          = ad7879_spi_probe,
index 6c676e41fe3c3b418223497e62cfb33e0dee0637..a61b2153ab8c20fb685d4af7595dba125df6023f 100644 (file)
@@ -1498,7 +1498,6 @@ static int ads7846_remove(struct spi_device *spi)
 static struct spi_driver ads7846_driver = {
        .driver = {
                .name   = "ads7846",
-               .owner  = THIS_MODULE,
                .pm     = &ads7846_pm,
                .of_match_table = of_match_ptr(ads7846_dt_ids),
        },
index b19434cebbf6ac56d18ff13fc408108d119d7843..ec5f7c74f0487928c9ac3b8f552a412f3d0f0165 100644 (file)
@@ -185,7 +185,6 @@ static int cyttsp4_spi_remove(struct spi_device *spi)
 static struct spi_driver cyttsp4_spi_driver = {
        .driver = {
                .name   = CYTTSP4_SPI_NAME,
-               .owner  = THIS_MODULE,
                .pm     = &cyttsp4_pm_ops,
        },
        .probe  = cyttsp4_spi_probe,
index 4728bcb1916c37f9a3ce379689d3dc7e8101a8a0..bbeeb2488b579f5ca380b54f411f21f0cdb65281 100644 (file)
@@ -182,7 +182,6 @@ static int cyttsp_spi_remove(struct spi_device *spi)
 static struct spi_driver cyttsp_spi_driver = {
        .driver = {
                .name   = CY_SPI_NAME,
-               .owner  = THIS_MODULE,
                .pm     = &cyttsp_pm_ops,
        },
        .probe  = cyttsp_spi_probe,
index 1bbe64c89a10e6cfcc845bb472fed785acebab7d..b9f593dfd2ef8368223e5d7d7d9ca06856afcc8d 100644 (file)
@@ -75,7 +75,6 @@ static int tsc2005_remove(struct spi_device *spi)
 static struct spi_driver tsc2005_driver = {
        .driver = {
                .name   = "tsc2005",
-               .owner  = THIS_MODULE,
                .pm     = &tsc200x_pm_ops,
        },
        .probe  = tsc2005_probe,
index db3ba8b42517f7b963c3d45c20949d17c42884fe..314159610d240a1e063befb88e499a6eccc3b3ee 100644 (file)
@@ -122,7 +122,6 @@ static struct spi_driver dac124s085_driver = {
        .remove         = dac124s085_remove,
        .driver = {
                .name   = "dac124s085",
-               .owner  = THIS_MODULE,
        },
 };
 
index 17ac4417fb176a50518ac57e9c09e7b1c415486f..72ef9f936e6ceb13ad7b94e5c998ffa9543700e8 100644 (file)
@@ -150,7 +150,6 @@ int s5c73m3_register_spi_driver(struct s5c73m3 *state)
        spidrv->remove = s5c73m3_spi_remove;
        spidrv->probe = s5c73m3_spi_probe;
        spidrv->driver.name = S5C73M3_SPI_DRV_NAME;
-       spidrv->driver.owner = THIS_MODULE;
        spidrv->driver.of_match_table = s5c73m3_spi_ids;
 
        return spi_register_driver(spidrv);
index b533240f8ec07da917825e43d9b45fb6b6495561..3a12ef35682b54d64db15cdedbda190c5f364e61 100644 (file)
@@ -513,7 +513,6 @@ MODULE_DEVICE_TABLE(spi, msi001_id_table);
 static struct spi_driver msi001_driver = {
        .driver = {
                .name   = "msi001",
-               .owner  = THIS_MODULE,
                .suppress_bind_attrs = true,
        },
        .probe          = msi001_probe,
index 8cffb1cfe73d112052859a30c47ad413508c878a..befbc89bfd3456c210d736d2ad295c646a2bd4fc 100644 (file)
@@ -96,7 +96,6 @@ MODULE_DEVICE_TABLE(spi, arizona_spi_ids);
 static struct spi_driver arizona_spi_driver = {
        .driver = {
                .name   = "arizona",
-               .owner  = THIS_MODULE,
                .pm     = &arizona_pm_ops,
                .of_match_table = of_match_ptr(arizona_of_match),
        },
index 30a296b4e748c05abf038c2f90b1b8e172c4770e..6a0f6ec67c6be09356c0976f3b2ad2c38be190b3 100644 (file)
@@ -717,7 +717,6 @@ static struct spi_driver cros_ec_driver_spi = {
        .driver = {
                .name   = "cros-ec-spi",
                .of_match_table = of_match_ptr(cros_ec_spi_of_match),
-               .owner  = THIS_MODULE,
                .pm     = &cros_ec_spi_pm_ops,
        },
        .probe          = cros_ec_spi_probe,
index 0f5e2c2858c18deebfa65d00529fd61eead11620..b9ea1b27db642d452b39ceaf1a5a96fa9657804c 100644 (file)
@@ -82,7 +82,6 @@ static struct spi_driver da9052_spi_driver = {
        .id_table = da9052_spi_id,
        .driver = {
                .name = "da9052",
-               .owner = THIS_MODULE,
        },
 };
 
index b279205659a4280b3ab2c578b4b7825e2cfb47d4..542b47c6bcd2756be9b41ce2e7871ab3cd292ce1 100644 (file)
@@ -513,7 +513,6 @@ static struct spi_driver ezxpcap_driver = {
        .remove = ezx_pcap_remove,
        .driver = {
                .name   = "ezx-pcap",
-               .owner  = THIS_MODULE,
        },
 };
 
index 58a170e45d88ddc61bce928610703ba48cb20844..cbc1e5ed599c096420bee388372b02cfa31bce90 100644 (file)
@@ -177,7 +177,6 @@ static struct spi_driver mc13xxx_spi_driver = {
        .id_table = mc13xxx_device_id,
        .driver = {
                .name = "mc13xxx",
-               .owner = THIS_MODULE,
                .of_match_table = mc13xxx_dt_ids,
        },
        .probe = mc13xxx_spi_probe,
index 618ba244d98a61a70341381ee46d0f8a9fb5d5e5..f8b14ab8b9d727ca5f0bcdcbc44ca405d1bcfa9f 100644 (file)
@@ -135,7 +135,6 @@ static struct spi_driver stmpe_spi_driver = {
        .driver = {
                .name   = "stmpe-spi",
                .of_match_table = of_match_ptr(stmpe_spi_of_match),
-               .owner  = THIS_MODULE,
 #ifdef CONFIG_PM
                .pm     = &stmpe_dev_pm_ops,
 #endif
index de60ad98bd9f009ebb87dbc7685867f6be8f5852..d59aa55b14953f8a5457d1e6e93eb39b8300da5d 100644 (file)
@@ -111,7 +111,6 @@ static int tps65912_spi_remove(struct spi_device *spi)
 static struct spi_driver tps65912_spi_driver = {
        .driver = {
                .name = "tps65912",
-               .owner = THIS_MODULE,
        },
        .probe  = tps65912_spi_probe,
        .remove = tps65912_spi_remove,
index b8a5e3b34ec78448abea9eef2cc79b56871733f6..80482aeb246a4bd77e5828f5720b481005d365f3 100644 (file)
@@ -96,7 +96,6 @@ MODULE_DEVICE_TABLE(spi, wm831x_spi_ids);
 static struct spi_driver wm831x_spi_driver = {
        .driver = {
                .name   = "wm831x",
-               .owner  = THIS_MODULE,
                .pm     = &wm831x_spi_pm,
        },
        .id_table       = wm831x_spi_ids,
index f4c82eafa8e57a15cda2da73c6f276fb09f5c0b9..39a7f517ee7ed45d0168df91460d4f43a6427039 100644 (file)
@@ -132,7 +132,6 @@ MODULE_DEVICE_TABLE(spi, ad_dpot_spi_id);
 static struct spi_driver ad_dpot_spi_driver = {
        .driver = {
                .name   = "ad_dpot",
-               .owner  = THIS_MODULE,
        },
        .probe          = ad_dpot_spi_probe,
        .remove         = ad_dpot_spi_remove,
index 864ecac323732aadb1feb27644140e443b978405..17ecbf95ff152ddaaed5ae1d0796ca0c4546939d 100644 (file)
@@ -64,7 +64,6 @@ MODULE_DEVICE_TABLE(spi, bmp085_id);
 
 static struct spi_driver bmp085_spi_driver = {
        .driver = {
-               .owner  = THIS_MODULE,
                .name   = BMP085_NAME,
                .of_match_table = bmp085_of_match
        },
index 0a1af93ec638c39b9b685d953f4d16256daa297d..f850ef556bcc48d598f11537fffa6fe351b7eef9 100644 (file)
@@ -462,7 +462,6 @@ MODULE_DEVICE_TABLE(of, at25_of_match);
 static struct spi_driver at25_driver = {
        .driver = {
                .name           = "at25",
-               .owner          = THIS_MODULE,
                .of_match_table = at25_of_match,
        },
        .probe          = at25_probe,
index a6bd9e3fe9d3fb1d730c99a05386c490633f67a0..ff63f05edc763cac7bb8aefef565e20e1463a82b 100644 (file)
@@ -370,7 +370,6 @@ static int eeprom_93xx46_remove(struct spi_device *spi)
 static struct spi_driver eeprom_93xx46_driver = {
        .driver = {
                .name   = "93xx46",
-               .owner  = THIS_MODULE,
        },
        .probe          = eeprom_93xx46_probe,
        .remove         = eeprom_93xx46_remove,
index c544f1f50f52a67fcc0d43deee087ed402130add..626fdcaf25101b6b7c9a3f7f5c0b56061a5044c1 100644 (file)
@@ -235,7 +235,6 @@ MODULE_DEVICE_TABLE(spi, lattice_ecp3_id);
 static struct spi_driver lattice_ecp3_driver = {
        .driver = {
                .name = "lattice-ecp3",
-               .owner = THIS_MODULE,
        },
        .probe = lattice_ecp3_probe,
        .remove = lattice_ecp3_remove,
index b2f6e1651ac941a37d5ff57bfde8ab0b286442da..e575475123c838e0ed2fe2a1dc51832ea9c2c873 100644 (file)
@@ -138,7 +138,6 @@ static SIMPLE_DEV_PM_OPS(lis3lv02d_spi_pm, lis3lv02d_spi_suspend,
 static struct spi_driver lis302dl_spi_driver = {
        .driver  = {
                .name   = DRV_NAME,
-               .owner  = THIS_MODULE,
                .pm     = &lis3lv02d_spi_pm,
                .of_match_table = of_match_ptr(lis302dl_spi_dt_ids),
        },
index cb0289b44a179150a4cc267fceb2b69fef379779..f5456fb7d773a29f33b2a9cb272c7b899f581918 100644 (file)
@@ -89,7 +89,6 @@ MODULE_DEVICE_TABLE(of, dac7512_of_match);
 static struct spi_driver dac7512_driver = {
        .driver = {
                .name   = "dac7512",
-               .owner  = THIS_MODULE,
                .of_match_table = of_match_ptr(dac7512_of_match),
        },
        .probe  = dac7512_probe,
index 8ee11f4120fcae295756118c492b9cdef150eadf..1c1b45ef3faf847d4087d61904ed18c1a6f7ce5e 100644 (file)
@@ -1516,7 +1516,6 @@ MODULE_DEVICE_TABLE(of, mmc_spi_of_match_table);
 static struct spi_driver mmc_spi_driver = {
        .driver = {
                .name =         "mmc_spi",
-               .owner =        THIS_MODULE,
                .of_match_table = mmc_spi_of_match_table,
        },
        .probe =        mmc_spi_probe,
index 4b5d7a4655fd46bdac14ba04e51de56be91af2fe..fe9ceb7b5405adc029842ebc444e8c82e690ec89 100644 (file)
@@ -301,7 +301,6 @@ MODULE_DEVICE_TABLE(of, m25p_of_table);
 static struct spi_driver m25p80_driver = {
        .driver = {
                .name   = "m25p80",
-               .owner  = THIS_MODULE,
                .of_match_table = m25p_of_table,
        },
        .id_table       = m25p_ids,
index 39666d552682e9d607025f3d01ba0afd513dd260..e4a88715a844952b73a62bd5427af89b46935cd4 100644 (file)
@@ -910,7 +910,6 @@ static int dataflash_remove(struct spi_device *spi)
 static struct spi_driver dataflash_driver = {
        .driver = {
                .name           = "mtd_dataflash",
-               .owner          = THIS_MODULE,
                .of_match_table = of_match_ptr(dataflash_dt_ids),
        },
 
index 3928014f83ac050325c52fbd7d9949b11a9a37e5..5b84d71efb3642f179b5128ae2d4c6c76a4cdc31 100644 (file)
@@ -416,7 +416,6 @@ static int sst25l_remove(struct spi_device *spi)
 static struct spi_driver sst25l_driver = {
        .driver = {
                .name   = "sst25l",
-               .owner  = THIS_MODULE,
        },
        .probe          = sst25l_probe,
        .remove         = sst25l_remove,
index b7e83c2120235e133141422ebe037a3bf43e7a15..575790e8a75af8e6184f5611fe133b1d73825679 100644 (file)
@@ -1243,7 +1243,6 @@ static SIMPLE_DEV_PM_OPS(mcp251x_can_pm_ops, mcp251x_can_suspend,
 static struct spi_driver mcp251x_can_driver = {
        .driver = {
                .name = DEVICE_NAME,
-               .owner = THIS_MODULE,
                .of_match_table = mcp251x_of_match,
                .pm = &mcp251x_can_pm_ops,
        },
index 60f43ec2217532abae6c7d4e9529c7db4eb23b4b..1edc973df4c41d893608c08dae1ebbb7e7c07ac3 100644 (file)
@@ -1607,7 +1607,6 @@ static struct spi_driver ks8851_driver = {
        .driver = {
                .name = "ks8851",
                .of_match_table = ks8851_match_table,
-               .owner = THIS_MODULE,
                .pm = &ks8851_pm_ops,
        },
        .probe = ks8851_probe,
index b1b5f66b8b6910ad2dc38c2157d8b12aba1668c1..86ea17e7ba7bff17f40755663e1b10b7d7b4cbcc 100644 (file)
@@ -1633,7 +1633,6 @@ static int enc28j60_remove(struct spi_device *spi)
 static struct spi_driver enc28j60_driver = {
        .driver = {
                   .name = DRV_NAME,
-                  .owner = THIS_MODULE,
         },
        .probe = enc28j60_probe,
        .remove = enc28j60_remove,
index 2f87909f51866f1b219552d3c3f062f9338a32fc..ddb2c6c6ec94013efb5ada465d2c6446c34de5f0 100644 (file)
@@ -974,7 +974,6 @@ MODULE_DEVICE_TABLE(spi, qca_spi_id);
 static struct spi_driver qca_spi_driver = {
        .driver = {
                .name   = QCASPI_DRV_NAME,
-               .owner  = THIS_MODULE,
                .of_match_table = qca_spi_of_match,
        },
        .id_table = qca_spi_id,
index de6e4fa2d6aafd24cd53ce7b8a7eb5f272c3d804..0fbbba7a0cae38afe5fc6dfa122489c1a3271fdf 100644 (file)
@@ -1816,7 +1816,6 @@ static struct spi_driver at86rf230_driver = {
        .driver = {
                .of_match_table = of_match_ptr(at86rf230_of_match),
                .name   = "at86rf230",
-               .owner  = THIS_MODULE,
        },
        .probe      = at86rf230_probe,
        .remove     = at86rf230_remove,
index c5b54a15fc4cb2b59584a492a5b4a9bca190e687..e65b60591317baf7f1b43759f9ced78a30c192aa 100644 (file)
@@ -1152,7 +1152,6 @@ MODULE_DEVICE_TABLE(of, cc2520_of_ids);
 static struct spi_driver cc2520_driver = {
        .driver = {
                .name = "cc2520",
-               .owner = THIS_MODULE,
                .of_match_table = of_match_ptr(cc2520_of_ids),
        },
        .id_table = cc2520_ids,
index aca0fb3cccbf5f294e689daae6722638356badab..4cdf51638972095644204eebccf46c8c77421ef2 100644 (file)
@@ -1382,7 +1382,6 @@ static struct spi_driver mrf24j40_driver = {
        .driver = {
                .of_match_table = of_match_ptr(mrf24j40_of_match),
                .name = "mrf24j40",
-               .owner = THIS_MODULE,
        },
        .id_table = mrf24j40_ids,
        .probe = mrf24j40_probe,
index f091d691cf6f1d1961f8e92d6107abdc7e9de9b0..c72c422068504382e36b584668badca552fdefe1 100644 (file)
@@ -343,7 +343,6 @@ static int ks8995_remove(struct spi_device *spi)
 static struct spi_driver ks8995_driver = {
        .driver = {
                .name       = "spi-ks8995",
-               .owner     = THIS_MODULE,
        },
        .probe    = ks8995_probe,
        .remove   = ks8995_remove,
index 29185aeccba8b721d3d9c18177f5f86b10d145a2..a740083634d83b1c4543d5d6024f533810f34397 100644 (file)
@@ -467,7 +467,6 @@ static struct spi_driver spi_driver = {
        .remove         = cw1200_spi_disconnect,
        .driver = {
                .name           = "cw1200_wlan_spi",
-               .owner          = THIS_MODULE,
 #ifdef CONFIG_PM
                .pm             = &cw1200_pm_ops,
 #endif
index f11728a866ff3129b44e33ae6aa8597171c7005b..82c0796377aa52b11e55462cd562f25ba1461805 100644 (file)
@@ -1283,7 +1283,6 @@ static struct spi_driver libertas_spi_driver = {
        .remove = libertas_spi_remove,
        .driver = {
                .name   = "libertas_spi",
-               .owner  = THIS_MODULE,
                .pm     = &if_spi_pm_ops,
        },
 };
index 63de5eed25cf9309f6f86a869481632b59ec892d..7ab2f43ab42512e7da0c87c37574b8ed534f2b08 100644 (file)
@@ -705,7 +705,6 @@ static int p54spi_remove(struct spi_device *spi)
 static struct spi_driver p54spi_driver = {
        .driver = {
                .name           = "p54spi",
-               .owner          = THIS_MODULE,
        },
 
        .probe          = p54spi_probe,
index 735be5352143e9a1e757d6953f708a3ce5fd9e54..8de9d4444a6a072372b674e88e05fd1741ac235e 100644 (file)
@@ -354,7 +354,6 @@ static int wl1251_spi_remove(struct spi_device *spi)
 static struct spi_driver wl1251_spi_driver = {
        .driver = {
                .name           = DRIVER_NAME,
-               .owner          = THIS_MODULE,
        },
 
        .probe          = wl1251_spi_probe,
index f1ac2839d97cb22fc20a96f9a8fe07e70eda9012..236b41090827695bc5329e474254d3ca2da3c847 100644 (file)
@@ -408,7 +408,6 @@ static int wl1271_remove(struct spi_device *spi)
 static struct spi_driver wl1271_spi_driver = {
        .driver = {
                .name           = "wl1271_spi",
-               .owner          = THIS_MODULE,
        },
 
        .probe          = wl1271_probe,
index cf7ad8121e1139b9c14376fbf2afaf113ab00cf3..d6519bb9dba5100dd8a8fdb199b318d479247cab 100644 (file)
@@ -384,7 +384,6 @@ MODULE_DEVICE_TABLE(of, of_st_nci_spi_match);
 
 static struct spi_driver st_nci_spi_driver = {
        .driver = {
-               .owner = THIS_MODULE,
                .name = ST_NCI_SPI_DRIVER_NAME,
                .of_match_table = of_match_ptr(of_st_nci_spi_match),
        },
index 123aa981c9d87844932b769cd3949ef6a1416a4c..f857feb2b573e7bb98e008f44527ed762d82b7a8 100644 (file)
@@ -2230,7 +2230,6 @@ static struct spi_driver trf7970a_spi_driver = {
        .driver         = {
                .name   = "trf7970a",
                .of_match_table = of_match_ptr(trf7970a_of_match),
-               .owner  = THIS_MODULE,
                .pm     = &trf7970a_pm_ops,
        },
 };
index 5b494db9f95c90aba642c44f8af58910c71b1711..9d6ea3a4dccd1c3bc2d35052c72ea374652b6045 100644 (file)
@@ -629,7 +629,6 @@ static struct spi_driver pmic_driver = {
        .probe          = pmic_probe,
        .driver         = {
                .name   = "tps6524x",
-               .owner  = THIS_MODULE,
        },
 };
 
index baa5d047f9c826bbd8da5111e421d6e564ed89e8..85706a9f82c99429bcc7cefdc2760138c11193a2 100644 (file)
@@ -772,7 +772,6 @@ static int ds1305_remove(struct spi_device *spi)
 
 static struct spi_driver ds1305_driver = {
        .driver.name    = "rtc-ds1305",
-       .driver.owner   = THIS_MODULE,
        .probe          = ds1305_probe,
        .remove         = ds1305_remove,
        /* REVISIT add suspend/resume */
index 79a06dd3c1856be19f6bbf4caa17666511e0e2c8..07371a9e37936b7290febc3a0ec08a3c30e37da2 100644 (file)
@@ -731,7 +731,6 @@ static SIMPLE_DEV_PM_OPS(ds1343_pm, ds1343_suspend, ds1343_resume);
 static struct spi_driver ds1343_driver = {
        .driver = {
                .name = "ds1343",
-               .owner = THIS_MODULE,
                .pm = &ds1343_pm,
        },
        .probe = ds1343_probe,
index c82b4c0503264031938095353d2129acff16f846..641e8e8a0dd7251f677e9146c098e7ce475fa516 100644 (file)
@@ -154,7 +154,6 @@ static int ds1347_probe(struct spi_device *spi)
 static struct spi_driver ds1347_driver = {
        .driver = {
                .name = "ds1347",
-               .owner = THIS_MODULE,
        },
        .probe = ds1347_probe,
 };
index e67bfcb3a1aa227a3d4fe1b25bef269dc990240c..4c229c97ef9749ea844685d7923f4cf7fc7f3596 100644 (file)
@@ -156,7 +156,6 @@ static int ds1390_probe(struct spi_device *spi)
 static struct spi_driver ds1390_driver = {
        .driver = {
                .name   = "rtc-ds1390",
-               .owner  = THIS_MODULE,
        },
        .probe  = ds1390_probe,
 };
index 4c9ba53684643e2b1b1babc71b1cb968862af68a..570ab28fc35427e29728a51bb59f396d0d5b38d9 100644 (file)
@@ -159,7 +159,6 @@ static int ds3234_probe(struct spi_device *spi)
 static struct spi_driver ds3234_driver = {
        .driver = {
                .name    = "ds3234",
-               .owner  = THIS_MODULE,
        },
        .probe   = ds3234_probe,
 };
index 4698c7e344e4be907590565a89880218367dbd4b..5ac45fc1a7873f2a7a44560980b8c47152ff146a 100644 (file)
@@ -197,7 +197,6 @@ static int m41t93_probe(struct spi_device *spi)
 static struct spi_driver m41t93_driver = {
        .driver = {
                .name   = "rtc-m41t93",
-               .owner  = THIS_MODULE,
        },
        .probe  = m41t93_probe,
 };
index 8d800b1bf87b7cc61ec6c56a5a282bb56e1beeeb..1f0eb79e69f90e279c33be8efc771a357c7ede91 100644 (file)
@@ -137,7 +137,6 @@ static int m41t94_probe(struct spi_device *spi)
 static struct spi_driver m41t94_driver = {
        .driver = {
                .name   = "rtc-m41t94",
-               .owner  = THIS_MODULE,
        },
        .probe  = m41t94_probe,
 };
index ac3f4191864f026103c7b9b26cafee8716d9ed2a..315d09e0f2c1b930bfcf7c1ecc5c5f0181be322c 100644 (file)
@@ -146,7 +146,6 @@ static int max6902_probe(struct spi_device *spi)
 static struct spi_driver max6902_driver = {
        .driver = {
                .name   = "rtc-max6902",
-               .owner  = THIS_MODULE,
        },
        .probe  = max6902_probe,
 };
index 34295bf0041651dc60221635e6e631bed683c2c9..1c91ce8a6d75f339ff04e483e43fa6a1637e5484 100644 (file)
@@ -186,7 +186,6 @@ static int mcp795_probe(struct spi_device *spi)
 static struct spi_driver mcp795_driver = {
                .driver = {
                                .name = "rtc-mcp795",
-                               .owner = THIS_MODULE,
                },
                .probe = mcp795_probe,
 };
index 1c47650fe624fea3bd9e7b709f6c50e4ff2d8eea..ea8a31c91641d46a7a5b44a2225a98e03c4317a3 100644 (file)
@@ -346,7 +346,6 @@ MODULE_DEVICE_TABLE(of, pcf2123_dt_ids);
 static struct spi_driver pcf2123_driver = {
        .driver = {
                        .name   = "rtc-pcf2123",
-                       .owner  = THIS_MODULE,
                        .of_match_table = of_match_ptr(pcf2123_dt_ids),
        },
        .probe  = pcf2123_probe,
index feeedbd82000322b62278724a07f44361591746a..83d2bcca6a8f0b065c923dff058484dd0cc5379a 100644 (file)
@@ -172,7 +172,6 @@ static int r9701_remove(struct spi_device *spi)
 static struct spi_driver r9701_driver = {
        .driver = {
                .name   = "rtc-r9701",
-               .owner  = THIS_MODULE,
        },
        .probe  = r9701_probe,
        .remove = r9701_remove,
index 090a101c1c813813fc0aa26497e251dbd65d984a..1162fecab8cfc566e93feaaca22f291617be1d06 100644 (file)
@@ -221,7 +221,6 @@ static int rs5c348_probe(struct spi_device *spi)
 static struct spi_driver rs5c348_driver = {
        .driver = {
                .name   = "rtc-rs5c348",
-               .owner  = THIS_MODULE,
        },
        .probe  = rs5c348_probe,
 };
index 6889222f9ed64e8f991047aca26dfdcc30fd2d73..de3fe4f8d133d6924dccc6f39b81483b71ff0847 100644 (file)
@@ -291,7 +291,6 @@ MODULE_DEVICE_TABLE(spi, rx4581_id);
 static struct spi_driver rx4581_driver = {
        .driver = {
                .name   = "rtc-rx4581",
-               .owner  = THIS_MODULE,
        },
        .probe  = rx4581_probe,
        .id_table = rx4581_id,
index 4887f317ea58f7c5566fcb1481559831b7f81180..8b9c2a38d1ccd8ae00d9f2642026438d349c8be1 100644 (file)
@@ -88,6 +88,17 @@ config SPI_BCM2835
          is for the regular SPI controller. Slave mode operation is not also
          not supported.
 
+config SPI_BCM2835AUX
+       tristate "BCM2835 SPI auxiliary controller"
+       depends on ARCH_BCM2835 || COMPILE_TEST
+       depends on GPIOLIB
+       help
+         This selects a driver for the Broadcom BCM2835 SPI aux master.
+
+         The BCM2835 contains two types of SPI master controller; the
+         "universal SPI master", and the regular SPI controller.
+         This driver is for the universal/auxiliary SPI controller.
+
 config SPI_BFIN5XX
        tristate "SPI controller driver for ADI Blackfin5xx"
        depends on BLACKFIN && !BF60x
@@ -125,7 +136,7 @@ config SPI_BCM53XX
 
 config SPI_BCM63XX
        tristate "Broadcom BCM63xx SPI controller"
-       depends on BCM63XX
+       depends on BCM63XX || COMPILE_TEST
        help
           Enable support for the SPI controller on the Broadcom BCM63xx SoCs.
 
@@ -304,7 +315,7 @@ config SPI_FSL_SPI
 config SPI_FSL_DSPI
        tristate "Freescale DSPI controller"
        select REGMAP_MMIO
-       depends on SOC_VF610 || SOC_LS1021A || COMPILE_TEST
+       depends on SOC_VF610 || SOC_LS1021A || ARCH_LAYERSCAPE || COMPILE_TEST
        help
          This enables support for the Freescale DSPI controller in master
          mode. VF610 platform uses the controller.
index 6a7f6f9d0d1c8cd7dbb89cbd1a902d2997264baa..31fb7fb2a0b698dee2dee7e03a733150857f7363 100644 (file)
@@ -15,6 +15,7 @@ obj-$(CONFIG_SPI_ATMEL)                       += spi-atmel.o
 obj-$(CONFIG_SPI_ATH79)                        += spi-ath79.o
 obj-$(CONFIG_SPI_AU1550)               += spi-au1550.o
 obj-$(CONFIG_SPI_BCM2835)              += spi-bcm2835.o
+obj-$(CONFIG_SPI_BCM2835AUX)           += spi-bcm2835aux.o
 obj-$(CONFIG_SPI_BCM53XX)              += spi-bcm53xx.o
 obj-$(CONFIG_SPI_BCM63XX)              += spi-bcm63xx.o
 obj-$(CONFIG_SPI_BCM63XX_HSSPI)                += spi-bcm63xx-hsspi.o
index bf1f9b32c597b502f0d1c51b7f33f64a4996fb25..6165bf21d42750af1f765f2e79bc9a9a51ea734c 100644 (file)
@@ -240,14 +240,9 @@ static int ath79_spi_probe(struct platform_device *pdev)
        sp->bitbang.flags = SPI_CS_HIGH;
 
        r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (r == NULL) {
-               ret = -ENOENT;
-               goto err_put_master;
-       }
-
-       sp->base = devm_ioremap(&pdev->dev, r->start, resource_size(r));
-       if (!sp->base) {
-               ret = -ENXIO;
+       sp->base = devm_ioremap_resource(&pdev->dev, r);
+       if (IS_ERR(sp->base)) {
+               ret = PTR_ERR(sp->base);
                goto err_put_master;
        }
 
index 41e37a6a1368b273e19fd8eec798f2458e6ae1e4..aebad36391c93b36658c52222e761366c111216f 100644 (file)
@@ -773,7 +773,8 @@ static int atmel_spi_next_xfer_dma_submit(struct spi_master *master,
 
        *plen = len;
 
-       if (atmel_spi_dma_slave_config(as, &slave_config, 8))
+       if (atmel_spi_dma_slave_config(as, &slave_config,
+                                      xfer->bits_per_word))
                goto err_exit;
 
        /* Send both scatterlists */
index f45e085c01a616436f7a6b115e69bb8144012463..afd239d6dec1432350b1fdc5cf3e58c43562dff6 100644 (file)
@@ -233,13 +233,12 @@ static int au1550_spi_setupxfer(struct spi_device *spi, struct spi_transfer *t)
        unsigned bpw, hz;
        u32 cfg, stat;
 
-       bpw = spi->bits_per_word;
-       hz = spi->max_speed_hz;
        if (t) {
-               if (t->bits_per_word)
-                       bpw = t->bits_per_word;
-               if (t->speed_hz)
-                       hz = t->speed_hz;
+               bpw = t->bits_per_word;
+               hz = t->speed_hz;
+       } else {
+               bpw = spi->bits_per_word;
+               hz = spi->max_speed_hz;
        }
 
        if (!hz)
index 3e8eeb23d4e9c4e8d9c91084181a6c0ad2e51cd2..cf04960cc3e6ca1f5a87ad24f3d88cdbcfaa8a36 100644 (file)
@@ -777,7 +777,7 @@ static int bcm2835_spi_probe(struct platform_device *pdev)
                goto out_master_put;
        }
 
-       bs->irq = irq_of_parse_and_map(pdev->dev.of_node, 0);
+       bs->irq = platform_get_irq(pdev, 0);
        if (bs->irq <= 0) {
                dev_err(&pdev->dev, "could not get IRQ: %d\n", bs->irq);
                err = bs->irq ? bs->irq : -ENODEV;
@@ -786,6 +786,12 @@ static int bcm2835_spi_probe(struct platform_device *pdev)
 
        clk_prepare_enable(bs->clk);
 
+       bcm2835_dma_init(master, &pdev->dev);
+
+       /* initialise the hardware with the default polarities */
+       bcm2835_wr(bs, BCM2835_SPI_CS,
+                  BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX);
+
        err = devm_request_irq(&pdev->dev, bs->irq, bcm2835_spi_interrupt, 0,
                               dev_name(&pdev->dev), master);
        if (err) {
@@ -793,12 +799,6 @@ static int bcm2835_spi_probe(struct platform_device *pdev)
                goto out_clk_disable;
        }
 
-       bcm2835_dma_init(master, &pdev->dev);
-
-       /* initialise the hardware with the default polarities */
-       bcm2835_wr(bs, BCM2835_SPI_CS,
-                  BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX);
-
        err = devm_spi_register_master(&pdev->dev, master);
        if (err) {
                dev_err(&pdev->dev, "could not register SPI master: %d\n", err);
diff --git a/drivers/spi/spi-bcm2835aux.c b/drivers/spi/spi-bcm2835aux.c
new file mode 100644 (file)
index 0000000..7de6f84
--- /dev/null
@@ -0,0 +1,512 @@
+/*
+ * Driver for Broadcom BCM2835 auxiliary SPI Controllers
+ *
+ * the driver does not rely on the native chipselects at all
+ * but only uses the gpio type chipselects
+ *
+ * Based on: spi-bcm2835.c
+ *
+ * Copyright (C) 2015 Martin Sperl
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/clk.h>
+#include <linux/completion.h>
+#include <linux/delay.h>
+#include <linux/err.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_device.h>
+#include <linux/of_gpio.h>
+#include <linux/of_irq.h>
+#include <linux/regmap.h>
+#include <linux/spi/spi.h>
+#include <linux/spinlock.h>
+
+/*
+ * spi register defines
+ *
+ * note there is garbage in the "official" documentation,
+ * so some data is taken from the file:
+ *   brcm_usrlib/dag/vmcsx/vcinclude/bcm2708_chip/aux_io.h
+ * inside of:
+ *   http://www.broadcom.com/docs/support/videocore/Brcm_Android_ICS_Graphics_Stack.tar.gz
+ */
+
+/* SPI register offsets */
+#define BCM2835_AUX_SPI_CNTL0  0x00
+#define BCM2835_AUX_SPI_CNTL1  0x04
+#define BCM2835_AUX_SPI_STAT   0x08
+#define BCM2835_AUX_SPI_PEEK   0x0C
+#define BCM2835_AUX_SPI_IO     0x20
+#define BCM2835_AUX_SPI_TXHOLD 0x30
+
+/* Bitfields in CNTL0 */
+#define BCM2835_AUX_SPI_CNTL0_SPEED    0xFFF00000
+#define BCM2835_AUX_SPI_CNTL0_SPEED_MAX        0xFFF
+#define BCM2835_AUX_SPI_CNTL0_SPEED_SHIFT      20
+#define BCM2835_AUX_SPI_CNTL0_CS       0x000E0000
+#define BCM2835_AUX_SPI_CNTL0_POSTINPUT        0x00010000
+#define BCM2835_AUX_SPI_CNTL0_VAR_CS   0x00008000
+#define BCM2835_AUX_SPI_CNTL0_VAR_WIDTH        0x00004000
+#define BCM2835_AUX_SPI_CNTL0_DOUTHOLD 0x00003000
+#define BCM2835_AUX_SPI_CNTL0_ENABLE   0x00000800
+#define BCM2835_AUX_SPI_CNTL0_CPHA_IN  0x00000400
+#define BCM2835_AUX_SPI_CNTL0_CLEARFIFO        0x00000200
+#define BCM2835_AUX_SPI_CNTL0_CPHA_OUT 0x00000100
+#define BCM2835_AUX_SPI_CNTL0_CPOL     0x00000080
+#define BCM2835_AUX_SPI_CNTL0_MSBF_OUT 0x00000040
+#define BCM2835_AUX_SPI_CNTL0_SHIFTLEN 0x0000003F
+
+/* Bitfields in CNTL1 */
+#define BCM2835_AUX_SPI_CNTL1_CSHIGH   0x00000700
+#define BCM2835_AUX_SPI_CNTL1_IDLE     0x00000080
+#define BCM2835_AUX_SPI_CNTL1_TXEMPTY  0x00000040
+#define BCM2835_AUX_SPI_CNTL1_MSBF_IN  0x00000002
+#define BCM2835_AUX_SPI_CNTL1_KEEP_IN  0x00000001
+
+/* Bitfields in STAT */
+#define BCM2835_AUX_SPI_STAT_TX_LVL    0xFF000000
+#define BCM2835_AUX_SPI_STAT_RX_LVL    0x00FF0000
+#define BCM2835_AUX_SPI_STAT_TX_FULL   0x00000400
+#define BCM2835_AUX_SPI_STAT_TX_EMPTY  0x00000200
+#define BCM2835_AUX_SPI_STAT_RX_FULL   0x00000100
+#define BCM2835_AUX_SPI_STAT_RX_EMPTY  0x00000080
+#define BCM2835_AUX_SPI_STAT_BUSY      0x00000040
+#define BCM2835_AUX_SPI_STAT_BITCOUNT  0x0000003F
+
+/* timeout values */
+#define BCM2835_AUX_SPI_POLLING_LIMIT_US       30
+#define BCM2835_AUX_SPI_POLLING_JIFFIES                2
+
+#define BCM2835_AUX_SPI_MODE_BITS (SPI_CPOL | SPI_CPHA | SPI_CS_HIGH \
+                                 | SPI_NO_CS)
+
+struct bcm2835aux_spi {
+       void __iomem *regs;
+       struct clk *clk;
+       int irq;
+       u32 cntl[2];
+       const u8 *tx_buf;
+       u8 *rx_buf;
+       int tx_len;
+       int rx_len;
+       int pending;
+};
+
+static inline u32 bcm2835aux_rd(struct bcm2835aux_spi *bs, unsigned reg)
+{
+       return readl(bs->regs + reg);
+}
+
+static inline void bcm2835aux_wr(struct bcm2835aux_spi *bs, unsigned reg,
+                                u32 val)
+{
+       writel(val, bs->regs + reg);
+}
+
+static inline void bcm2835aux_rd_fifo(struct bcm2835aux_spi *bs)
+{
+       u32 data;
+       int count = min(bs->rx_len, 3);
+
+       data = bcm2835aux_rd(bs, BCM2835_AUX_SPI_IO);
+       if (bs->rx_buf) {
+               switch (count) {
+               case 4:
+                       *bs->rx_buf++ = (data >> 24) & 0xff;
+                       /* fallthrough */
+               case 3:
+                       *bs->rx_buf++ = (data >> 16) & 0xff;
+                       /* fallthrough */
+               case 2:
+                       *bs->rx_buf++ = (data >> 8) & 0xff;
+                       /* fallthrough */
+               case 1:
+                       *bs->rx_buf++ = (data >> 0) & 0xff;
+                       /* fallthrough - no default */
+               }
+       }
+       bs->rx_len -= count;
+       bs->pending -= count;
+}
+
+static inline void bcm2835aux_wr_fifo(struct bcm2835aux_spi *bs)
+{
+       u32 data;
+       u8 byte;
+       int count;
+       int i;
+
+       /* gather up to 3 bytes to write to the FIFO */
+       count = min(bs->tx_len, 3);
+       data = 0;
+       for (i = 0; i < count; i++) {
+               byte = bs->tx_buf ? *bs->tx_buf++ : 0;
+               data |= byte << (8 * (2 - i));
+       }
+
+       /* and set the variable bit-length */
+       data |= (count * 8) << 24;
+
+       /* and decrement length */
+       bs->tx_len -= count;
+       bs->pending += count;
+
+       /* write to the correct TX-register */
+       if (bs->tx_len)
+               bcm2835aux_wr(bs, BCM2835_AUX_SPI_TXHOLD, data);
+       else
+               bcm2835aux_wr(bs, BCM2835_AUX_SPI_IO, data);
+}
+
+static void bcm2835aux_spi_reset_hw(struct bcm2835aux_spi *bs)
+{
+       /* disable spi clearing fifo and interrupts */
+       bcm2835aux_wr(bs, BCM2835_AUX_SPI_CNTL1, 0);
+       bcm2835aux_wr(bs, BCM2835_AUX_SPI_CNTL0,
+                     BCM2835_AUX_SPI_CNTL0_CLEARFIFO);
+}
+
+static irqreturn_t bcm2835aux_spi_interrupt(int irq, void *dev_id)
+{
+       struct spi_master *master = dev_id;
+       struct bcm2835aux_spi *bs = spi_master_get_devdata(master);
+       irqreturn_t ret = IRQ_NONE;
+
+       /* check if we have data to read */
+       while (bs->rx_len &&
+              (!(bcm2835aux_rd(bs, BCM2835_AUX_SPI_STAT) &
+                 BCM2835_AUX_SPI_STAT_RX_EMPTY))) {
+               bcm2835aux_rd_fifo(bs);
+               ret = IRQ_HANDLED;
+       }
+
+       /* check if we have data to write */
+       while (bs->tx_len &&
+              (bs->pending < 12) &&
+              (!(bcm2835aux_rd(bs, BCM2835_AUX_SPI_STAT) &
+                 BCM2835_AUX_SPI_STAT_TX_FULL))) {
+               bcm2835aux_wr_fifo(bs);
+               ret = IRQ_HANDLED;
+       }
+
+       /* and check if we have reached "done" */
+       while (bs->rx_len &&
+              (!(bcm2835aux_rd(bs, BCM2835_AUX_SPI_STAT) &
+                 BCM2835_AUX_SPI_STAT_BUSY))) {
+               bcm2835aux_rd_fifo(bs);
+               ret = IRQ_HANDLED;
+       }
+
+       /* and if rx_len is 0 then wake up completion and disable spi */
+       if (!bs->rx_len) {
+               bcm2835aux_spi_reset_hw(bs);
+               complete(&master->xfer_completion);
+       }
+
+       /* and return */
+       return ret;
+}
+
+static int __bcm2835aux_spi_transfer_one_irq(struct spi_master *master,
+                                            struct spi_device *spi,
+                                            struct spi_transfer *tfr)
+{
+       struct bcm2835aux_spi *bs = spi_master_get_devdata(master);
+
+       /* enable interrupts */
+       bcm2835aux_wr(bs, BCM2835_AUX_SPI_CNTL1, bs->cntl[1] |
+               BCM2835_AUX_SPI_CNTL1_TXEMPTY |
+               BCM2835_AUX_SPI_CNTL1_IDLE);
+
+       /* and wait for finish... */
+       return 1;
+}
+
+static int bcm2835aux_spi_transfer_one_irq(struct spi_master *master,
+                                          struct spi_device *spi,
+                                          struct spi_transfer *tfr)
+{
+       struct bcm2835aux_spi *bs = spi_master_get_devdata(master);
+
+       /* fill in registers and fifos before enabling interrupts */
+       bcm2835aux_wr(bs, BCM2835_AUX_SPI_CNTL1, bs->cntl[1]);
+       bcm2835aux_wr(bs, BCM2835_AUX_SPI_CNTL0, bs->cntl[0]);
+
+       /* fill in tx fifo with data before enabling interrupts */
+       while ((bs->tx_len) &&
+              (bs->pending < 12) &&
+              (!(bcm2835aux_rd(bs, BCM2835_AUX_SPI_STAT) &
+                 BCM2835_AUX_SPI_STAT_TX_FULL))) {
+               bcm2835aux_wr_fifo(bs);
+       }
+
+       /* now run the interrupt mode */
+       return __bcm2835aux_spi_transfer_one_irq(master, spi, tfr);
+}
+
+static int bcm2835aux_spi_transfer_one_poll(struct spi_master *master,
+                                           struct spi_device *spi,
+                                       struct spi_transfer *tfr)
+{
+       struct bcm2835aux_spi *bs = spi_master_get_devdata(master);
+       unsigned long timeout;
+       u32 stat;
+
+       /* configure spi */
+       bcm2835aux_wr(bs, BCM2835_AUX_SPI_CNTL1, bs->cntl[1]);
+       bcm2835aux_wr(bs, BCM2835_AUX_SPI_CNTL0, bs->cntl[0]);
+
+       /* set the timeout */
+       timeout = jiffies + BCM2835_AUX_SPI_POLLING_JIFFIES;
+
+       /* loop until finished the transfer */
+       while (bs->rx_len) {
+               /* read status */
+               stat = bcm2835aux_rd(bs, BCM2835_AUX_SPI_STAT);
+
+               /* fill in tx fifo with remaining data */
+               if ((bs->tx_len) && (!(stat & BCM2835_AUX_SPI_STAT_TX_FULL))) {
+                       bcm2835aux_wr_fifo(bs);
+                       continue;
+               }
+
+               /* read data from fifo for both cases */
+               if (!(stat & BCM2835_AUX_SPI_STAT_RX_EMPTY)) {
+                       bcm2835aux_rd_fifo(bs);
+                       continue;
+               }
+               if (!(stat & BCM2835_AUX_SPI_STAT_BUSY)) {
+                       bcm2835aux_rd_fifo(bs);
+                       continue;
+               }
+
+               /* there is still data pending to read check the timeout */
+               if (bs->rx_len && time_after(jiffies, timeout)) {
+                       dev_dbg_ratelimited(&spi->dev,
+                                           "timeout period reached: jiffies: %lu remaining tx/rx: %d/%d - falling back to interrupt mode\n",
+                                           jiffies - timeout,
+                                           bs->tx_len, bs->rx_len);
+                       /* forward to interrupt handler */
+                       return __bcm2835aux_spi_transfer_one_irq(master,
+                                                              spi, tfr);
+               }
+       }
+
+       /* Transfer complete - reset SPI HW */
+       bcm2835aux_spi_reset_hw(bs);
+
+       /* and return without waiting for completion */
+       return 0;
+}
+
+static int bcm2835aux_spi_transfer_one(struct spi_master *master,
+                                      struct spi_device *spi,
+                                      struct spi_transfer *tfr)
+{
+       struct bcm2835aux_spi *bs = spi_master_get_devdata(master);
+       unsigned long spi_hz, clk_hz, speed;
+       unsigned long spi_used_hz;
+       unsigned long long xfer_time_us;
+
+       /* calculate the registers to handle
+        *
+        * note that we use the variable data mode, which
+        * is not optimal for longer transfers as we waste registers
+        * resulting (potentially) in more interrupts when transferring
+        * more than 12 bytes
+        */
+       bs->cntl[0] = BCM2835_AUX_SPI_CNTL0_ENABLE |
+                     BCM2835_AUX_SPI_CNTL0_VAR_WIDTH |
+                     BCM2835_AUX_SPI_CNTL0_MSBF_OUT;
+       bs->cntl[1] = BCM2835_AUX_SPI_CNTL1_MSBF_IN;
+
+       /* set clock */
+       spi_hz = tfr->speed_hz;
+       clk_hz = clk_get_rate(bs->clk);
+
+       if (spi_hz >= clk_hz / 2) {
+               speed = 0;
+       } else if (spi_hz) {
+               speed = DIV_ROUND_UP(clk_hz, 2 * spi_hz) - 1;
+               if (speed >  BCM2835_AUX_SPI_CNTL0_SPEED_MAX)
+                       speed = BCM2835_AUX_SPI_CNTL0_SPEED_MAX;
+       } else { /* the slowest we can go */
+               speed = BCM2835_AUX_SPI_CNTL0_SPEED_MAX;
+       }
+       bs->cntl[0] |= speed << BCM2835_AUX_SPI_CNTL0_SPEED_SHIFT;
+
+       spi_used_hz = clk_hz / (2 * (speed + 1));
+
+       /* handle all the modes */
+       if (spi->mode & SPI_CPOL)
+               bs->cntl[0] |= BCM2835_AUX_SPI_CNTL0_CPOL;
+       if (spi->mode & SPI_CPHA)
+               bs->cntl[0] |= BCM2835_AUX_SPI_CNTL0_CPHA_OUT |
+                              BCM2835_AUX_SPI_CNTL0_CPHA_IN;
+
+       /* set transmit buffers and length */
+       bs->tx_buf = tfr->tx_buf;
+       bs->rx_buf = tfr->rx_buf;
+       bs->tx_len = tfr->len;
+       bs->rx_len = tfr->len;
+       bs->pending = 0;
+
+       /* calculate the estimated time in us the transfer runs
+        * note that there are are 2 idle clocks after each
+        * chunk getting transferred - in our case the chunk size
+        * is 3 bytes, so we approximate this by 9 bits/byte
+        */
+       xfer_time_us = tfr->len * 9 * 1000000;
+       do_div(xfer_time_us, spi_used_hz);
+
+       /* run in polling mode for short transfers */
+       if (xfer_time_us < BCM2835_AUX_SPI_POLLING_LIMIT_US)
+               return bcm2835aux_spi_transfer_one_poll(master, spi, tfr);
+
+       /* run in interrupt mode for all others */
+       return bcm2835aux_spi_transfer_one_irq(master, spi, tfr);
+}
+
+static void bcm2835aux_spi_handle_err(struct spi_master *master,
+                                     struct spi_message *msg)
+{
+       struct bcm2835aux_spi *bs = spi_master_get_devdata(master);
+
+       bcm2835aux_spi_reset_hw(bs);
+}
+
+static int bcm2835aux_spi_probe(struct platform_device *pdev)
+{
+       struct spi_master *master;
+       struct bcm2835aux_spi *bs;
+       struct resource *res;
+       unsigned long clk_hz;
+       int err;
+
+       master = spi_alloc_master(&pdev->dev, sizeof(*bs));
+       if (!master) {
+               dev_err(&pdev->dev, "spi_alloc_master() failed\n");
+               return -ENOMEM;
+       }
+
+       platform_set_drvdata(pdev, master);
+       master->mode_bits = BCM2835_AUX_SPI_MODE_BITS;
+       master->bits_per_word_mask = SPI_BPW_MASK(8);
+       master->num_chipselect = -1;
+       master->transfer_one = bcm2835aux_spi_transfer_one;
+       master->handle_err = bcm2835aux_spi_handle_err;
+       master->dev.of_node = pdev->dev.of_node;
+
+       bs = spi_master_get_devdata(master);
+
+       /* the main area */
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       bs->regs = devm_ioremap_resource(&pdev->dev, res);
+       if (IS_ERR(bs->regs)) {
+               err = PTR_ERR(bs->regs);
+               goto out_master_put;
+       }
+
+       bs->clk = devm_clk_get(&pdev->dev, NULL);
+       if ((!bs->clk) || (IS_ERR(bs->clk))) {
+               err = PTR_ERR(bs->clk);
+               dev_err(&pdev->dev, "could not get clk: %d\n", err);
+               goto out_master_put;
+       }
+
+       bs->irq = platform_get_irq(pdev, 0);
+       if (bs->irq <= 0) {
+               dev_err(&pdev->dev, "could not get IRQ: %d\n", bs->irq);
+               err = bs->irq ? bs->irq : -ENODEV;
+               goto out_master_put;
+       }
+
+       /* this also enables the HW block */
+       err = clk_prepare_enable(bs->clk);
+       if (err) {
+               dev_err(&pdev->dev, "could not prepare clock: %d\n", err);
+               goto out_master_put;
+       }
+
+       /* just checking if the clock returns a sane value */
+       clk_hz = clk_get_rate(bs->clk);
+       if (!clk_hz) {
+               dev_err(&pdev->dev, "clock returns 0 Hz\n");
+               err = -ENODEV;
+               goto out_clk_disable;
+       }
+
+       /* reset SPI-HW block */
+       bcm2835aux_spi_reset_hw(bs);
+
+       err = devm_request_irq(&pdev->dev, bs->irq,
+                              bcm2835aux_spi_interrupt,
+                              IRQF_SHARED,
+                              dev_name(&pdev->dev), master);
+       if (err) {
+               dev_err(&pdev->dev, "could not request IRQ: %d\n", err);
+               goto out_clk_disable;
+       }
+
+       err = devm_spi_register_master(&pdev->dev, master);
+       if (err) {
+               dev_err(&pdev->dev, "could not register SPI master: %d\n", err);
+               goto out_clk_disable;
+       }
+
+       return 0;
+
+out_clk_disable:
+       clk_disable_unprepare(bs->clk);
+out_master_put:
+       spi_master_put(master);
+       return err;
+}
+
+static int bcm2835aux_spi_remove(struct platform_device *pdev)
+{
+       struct spi_master *master = platform_get_drvdata(pdev);
+       struct bcm2835aux_spi *bs = spi_master_get_devdata(master);
+
+       bcm2835aux_spi_reset_hw(bs);
+
+       /* disable the HW block by releasing the clock */
+       clk_disable_unprepare(bs->clk);
+
+       return 0;
+}
+
+static const struct of_device_id bcm2835aux_spi_match[] = {
+       { .compatible = "brcm,bcm2835-aux-spi", },
+       {}
+};
+MODULE_DEVICE_TABLE(of, bcm2835aux_spi_match);
+
+static struct platform_driver bcm2835aux_spi_driver = {
+       .driver         = {
+               .name           = "spi-bcm2835aux",
+               .of_match_table = bcm2835aux_spi_match,
+       },
+       .probe          = bcm2835aux_spi_probe,
+       .remove         = bcm2835aux_spi_remove,
+};
+module_platform_driver(bcm2835aux_spi_driver);
+
+MODULE_DESCRIPTION("SPI controller driver for Broadcom BCM2835 aux");
+MODULE_AUTHOR("Martin Sperl <kernel@martin.sperl.org>");
+MODULE_LICENSE("GPL v2");
index 1520554978a31373126829025a45f37b75a73702..cc3f938f0a6b67632515ee0606f67417779043e9 100644 (file)
@@ -247,28 +247,19 @@ static int bcm53xxspi_bcma_probe(struct bcma_device *core)
        if (err) {
                spi_master_put(master);
                bcma_set_drvdata(core, NULL);
-               goto out;
+               return err;
        }
 
        /* Broadcom SoCs (at least with the CC rev 42) use SPI for flash only */
        spi_new_device(master, &bcm53xx_info);
 
-out:
-       return err;
-}
-
-static void bcm53xxspi_bcma_remove(struct bcma_device *core)
-{
-       struct bcm53xxspi *b53spi = bcma_get_drvdata(core);
-
-       spi_unregister_master(b53spi->master);
+       return 0;
 }
 
 static struct bcma_driver bcm53xxspi_bcma_driver = {
        .name           = KBUILD_MODNAME,
        .id_table       = bcm53xxspi_bcma_tbl,
        .probe          = bcm53xxspi_bcma_probe,
-       .remove         = bcm53xxspi_bcma_remove,
 };
 
 /**************************************************
index e73e2b052c9ccf0ca3ff2ef46950600aa5ff9f3f..06858e04ec59a8f2e290c398f6f06e2d1b15e28a 100644 (file)
 #include <linux/err.h>
 #include <linux/pm_runtime.h>
 
-#include <bcm63xx_dev_spi.h>
+/* BCM 6338/6348 SPI core */
+#define SPI_6348_RSET_SIZE             64
+#define SPI_6348_CMD                   0x00    /* 16-bits register */
+#define SPI_6348_INT_STATUS            0x02
+#define SPI_6348_INT_MASK_ST           0x03
+#define SPI_6348_INT_MASK              0x04
+#define SPI_6348_ST                    0x05
+#define SPI_6348_CLK_CFG               0x06
+#define SPI_6348_FILL_BYTE             0x07
+#define SPI_6348_MSG_TAIL              0x09
+#define SPI_6348_RX_TAIL               0x0b
+#define SPI_6348_MSG_CTL               0x40    /* 8-bits register */
+#define SPI_6348_MSG_CTL_WIDTH         8
+#define SPI_6348_MSG_DATA              0x41
+#define SPI_6348_MSG_DATA_SIZE         0x3f
+#define SPI_6348_RX_DATA               0x80
+#define SPI_6348_RX_DATA_SIZE          0x3f
+
+/* BCM 3368/6358/6262/6368 SPI core */
+#define SPI_6358_RSET_SIZE             1804
+#define SPI_6358_MSG_CTL               0x00    /* 16-bits register */
+#define SPI_6358_MSG_CTL_WIDTH         16
+#define SPI_6358_MSG_DATA              0x02
+#define SPI_6358_MSG_DATA_SIZE         0x21e
+#define SPI_6358_RX_DATA               0x400
+#define SPI_6358_RX_DATA_SIZE          0x220
+#define SPI_6358_CMD                   0x700   /* 16-bits register */
+#define SPI_6358_INT_STATUS            0x702
+#define SPI_6358_INT_MASK_ST           0x703
+#define SPI_6358_INT_MASK              0x704
+#define SPI_6358_ST                    0x705
+#define SPI_6358_CLK_CFG               0x706
+#define SPI_6358_FILL_BYTE             0x707
+#define SPI_6358_MSG_TAIL              0x709
+#define SPI_6358_RX_TAIL               0x70B
+
+/* Shared SPI definitions */
+
+/* Message configuration */
+#define SPI_FD_RW                      0x00
+#define SPI_HD_W                       0x01
+#define SPI_HD_R                       0x02
+#define SPI_BYTE_CNT_SHIFT             0
+#define SPI_6348_MSG_TYPE_SHIFT                6
+#define SPI_6358_MSG_TYPE_SHIFT                14
+
+/* Command */
+#define SPI_CMD_NOOP                   0x00
+#define SPI_CMD_SOFT_RESET             0x01
+#define SPI_CMD_HARD_RESET             0x02
+#define SPI_CMD_START_IMMEDIATE                0x03
+#define SPI_CMD_COMMAND_SHIFT          0
+#define SPI_CMD_COMMAND_MASK           0x000f
+#define SPI_CMD_DEVICE_ID_SHIFT                4
+#define SPI_CMD_PREPEND_BYTE_CNT_SHIFT 8
+#define SPI_CMD_ONE_BYTE_SHIFT         11
+#define SPI_CMD_ONE_WIRE_SHIFT         12
+#define SPI_DEV_ID_0                   0
+#define SPI_DEV_ID_1                   1
+#define SPI_DEV_ID_2                   2
+#define SPI_DEV_ID_3                   3
+
+/* Interrupt mask */
+#define SPI_INTR_CMD_DONE              0x01
+#define SPI_INTR_RX_OVERFLOW           0x02
+#define SPI_INTR_TX_UNDERFLOW          0x04
+#define SPI_INTR_TX_OVERFLOW           0x08
+#define SPI_INTR_RX_UNDERFLOW          0x10
+#define SPI_INTR_CLEAR_ALL             0x1f
+
+/* Status */
+#define SPI_RX_EMPTY                   0x02
+#define SPI_CMD_BUSY                   0x04
+#define SPI_SERIAL_BUSY                        0x08
+
+/* Clock configuration */
+#define SPI_CLK_20MHZ                  0x00
+#define SPI_CLK_0_391MHZ               0x01
+#define SPI_CLK_0_781MHZ               0x02    /* default */
+#define SPI_CLK_1_563MHZ               0x03
+#define SPI_CLK_3_125MHZ               0x04
+#define SPI_CLK_6_250MHZ               0x05
+#define SPI_CLK_12_50MHZ               0x06
+#define SPI_CLK_MASK                   0x07
+#define SPI_SSOFFTIME_MASK             0x38
+#define SPI_SSOFFTIME_SHIFT            3
+#define SPI_BYTE_SWAP                  0x80
+
+enum bcm63xx_regs_spi {
+       SPI_CMD,
+       SPI_INT_STATUS,
+       SPI_INT_MASK_ST,
+       SPI_INT_MASK,
+       SPI_ST,
+       SPI_CLK_CFG,
+       SPI_FILL_BYTE,
+       SPI_MSG_TAIL,
+       SPI_RX_TAIL,
+       SPI_MSG_CTL,
+       SPI_MSG_DATA,
+       SPI_RX_DATA,
+       SPI_MSG_TYPE_SHIFT,
+       SPI_MSG_CTL_WIDTH,
+       SPI_MSG_DATA_SIZE,
+};
 
 #define BCM63XX_SPI_MAX_PREPEND                15
 
+#define BCM63XX_SPI_MAX_CS             8
+#define BCM63XX_SPI_BUS_NUM            0
+
 struct bcm63xx_spi {
        struct completion       done;
 
@@ -38,6 +145,7 @@ struct bcm63xx_spi {
        int                     irq;
 
        /* Platform data */
+       const unsigned long     *reg_offsets;
        unsigned                fifo_size;
        unsigned int            msg_type_shift;
        unsigned int            msg_ctl_width;
@@ -51,27 +159,35 @@ struct bcm63xx_spi {
 };
 
 static inline u8 bcm_spi_readb(struct bcm63xx_spi *bs,
-                               unsigned int offset)
+                              unsigned int offset)
 {
-       return bcm_readb(bs->regs + bcm63xx_spireg(offset));
+       return readb(bs->regs + bs->reg_offsets[offset]);
 }
 
 static inline u16 bcm_spi_readw(struct bcm63xx_spi *bs,
                                unsigned int offset)
 {
-       return bcm_readw(bs->regs + bcm63xx_spireg(offset));
+#ifdef CONFIG_CPU_BIG_ENDIAN
+       return ioread16be(bs->regs + bs->reg_offsets[offset]);
+#else
+       return readw(bs->regs + bs->reg_offsets[offset]);
+#endif
 }
 
 static inline void bcm_spi_writeb(struct bcm63xx_spi *bs,
                                  u8 value, unsigned int offset)
 {
-       bcm_writeb(value, bs->regs + bcm63xx_spireg(offset));
+       writeb(value, bs->regs + bs->reg_offsets[offset]);
 }
 
 static inline void bcm_spi_writew(struct bcm63xx_spi *bs,
                                  u16 value, unsigned int offset)
 {
-       bcm_writew(value, bs->regs + bcm63xx_spireg(offset));
+#ifdef CONFIG_CPU_BIG_ENDIAN
+       iowrite16be(value, bs->regs + bs->reg_offsets[offset]);
+#else
+       writew(value, bs->regs + bs->reg_offsets[offset]);
+#endif
 }
 
 static const unsigned bcm63xx_spi_freq_table[SPI_CLK_MASK][2] = {
@@ -122,7 +238,6 @@ static int bcm63xx_txrx_bufs(struct spi_device *spi, struct spi_transfer *first,
        struct bcm63xx_spi *bs = spi_master_get_devdata(spi->master);
        u16 msg_ctl;
        u16 cmd;
-       u8 rx_tail;
        unsigned int i, timeout = 0, prepend_len = 0, len = 0;
        struct spi_transfer *t = first;
        bool do_rx = false;
@@ -314,18 +429,71 @@ static irqreturn_t bcm63xx_spi_interrupt(int irq, void *dev_id)
        return IRQ_HANDLED;
 }
 
+static const unsigned long bcm6348_spi_reg_offsets[] = {
+       [SPI_CMD]               = SPI_6348_CMD,
+       [SPI_INT_STATUS]        = SPI_6348_INT_STATUS,
+       [SPI_INT_MASK_ST]       = SPI_6348_INT_MASK_ST,
+       [SPI_INT_MASK]          = SPI_6348_INT_MASK,
+       [SPI_ST]                = SPI_6348_ST,
+       [SPI_CLK_CFG]           = SPI_6348_CLK_CFG,
+       [SPI_FILL_BYTE]         = SPI_6348_FILL_BYTE,
+       [SPI_MSG_TAIL]          = SPI_6348_MSG_TAIL,
+       [SPI_RX_TAIL]           = SPI_6348_RX_TAIL,
+       [SPI_MSG_CTL]           = SPI_6348_MSG_CTL,
+       [SPI_MSG_DATA]          = SPI_6348_MSG_DATA,
+       [SPI_RX_DATA]           = SPI_6348_RX_DATA,
+       [SPI_MSG_TYPE_SHIFT]    = SPI_6348_MSG_TYPE_SHIFT,
+       [SPI_MSG_CTL_WIDTH]     = SPI_6348_MSG_CTL_WIDTH,
+       [SPI_MSG_DATA_SIZE]     = SPI_6348_MSG_DATA_SIZE,
+};
+
+static const unsigned long bcm6358_spi_reg_offsets[] = {
+       [SPI_CMD]               = SPI_6358_CMD,
+       [SPI_INT_STATUS]        = SPI_6358_INT_STATUS,
+       [SPI_INT_MASK_ST]       = SPI_6358_INT_MASK_ST,
+       [SPI_INT_MASK]          = SPI_6358_INT_MASK,
+       [SPI_ST]                = SPI_6358_ST,
+       [SPI_CLK_CFG]           = SPI_6358_CLK_CFG,
+       [SPI_FILL_BYTE]         = SPI_6358_FILL_BYTE,
+       [SPI_MSG_TAIL]          = SPI_6358_MSG_TAIL,
+       [SPI_RX_TAIL]           = SPI_6358_RX_TAIL,
+       [SPI_MSG_CTL]           = SPI_6358_MSG_CTL,
+       [SPI_MSG_DATA]          = SPI_6358_MSG_DATA,
+       [SPI_RX_DATA]           = SPI_6358_RX_DATA,
+       [SPI_MSG_TYPE_SHIFT]    = SPI_6358_MSG_TYPE_SHIFT,
+       [SPI_MSG_CTL_WIDTH]     = SPI_6358_MSG_CTL_WIDTH,
+       [SPI_MSG_DATA_SIZE]     = SPI_6358_MSG_DATA_SIZE,
+};
+
+static const struct platform_device_id bcm63xx_spi_dev_match[] = {
+       {
+               .name = "bcm6348-spi",
+               .driver_data = (unsigned long)bcm6348_spi_reg_offsets,
+       },
+       {
+               .name = "bcm6358-spi",
+               .driver_data = (unsigned long)bcm6358_spi_reg_offsets,
+       },
+       {
+       },
+};
 
 static int bcm63xx_spi_probe(struct platform_device *pdev)
 {
        struct resource *r;
+       const unsigned long *bcm63xx_spireg;
        struct device *dev = &pdev->dev;
-       struct bcm63xx_spi_pdata *pdata = dev_get_platdata(&pdev->dev);
        int irq;
        struct spi_master *master;
        struct clk *clk;
        struct bcm63xx_spi *bs;
        int ret;
 
+       if (!pdev->id_entry->driver_data)
+               return -EINVAL;
+
+       bcm63xx_spireg = (const unsigned long *)pdev->id_entry->driver_data;
+
        irq = platform_get_irq(pdev, 0);
        if (irq < 0) {
                dev_err(dev, "no irq\n");
@@ -359,7 +527,8 @@ static int bcm63xx_spi_probe(struct platform_device *pdev)
 
        bs->irq = irq;
        bs->clk = clk;
-       bs->fifo_size = pdata->fifo_size;
+       bs->reg_offsets = bcm63xx_spireg;
+       bs->fifo_size = bs->reg_offsets[SPI_MSG_DATA_SIZE];
 
        ret = devm_request_irq(&pdev->dev, irq, bcm63xx_spi_interrupt, 0,
                                                        pdev->name, master);
@@ -368,26 +537,16 @@ static int bcm63xx_spi_probe(struct platform_device *pdev)
                goto out_err;
        }
 
-       master->bus_num = pdata->bus_num;
-       master->num_chipselect = pdata->num_chipselect;
+       master->bus_num = BCM63XX_SPI_BUS_NUM;
+       master->num_chipselect = BCM63XX_SPI_MAX_CS;
        master->transfer_one_message = bcm63xx_spi_transfer_one;
        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->tx_io = (u8 *)(bs->regs + bcm63xx_spireg(SPI_MSG_DATA));
-       bs->rx_io = (const u8 *)(bs->regs + bcm63xx_spireg(SPI_RX_DATA));
-
-       switch (bs->msg_ctl_width) {
-       case 8:
-       case 16:
-               break;
-       default:
-               dev_err(dev, "unsupported MSG_CTL width: %d\n",
-                        bs->msg_ctl_width);
-               goto out_err;
-       }
+       bs->msg_type_shift = bs->reg_offsets[SPI_MSG_TYPE_SHIFT];
+       bs->msg_ctl_width = bs->reg_offsets[SPI_MSG_CTL_WIDTH];
+       bs->tx_io = (u8 *)(bs->regs + bs->reg_offsets[SPI_MSG_DATA]);
+       bs->rx_io = (const u8 *)(bs->regs + bs->reg_offsets[SPI_RX_DATA]);
 
        /* Initialize hardware */
        ret = clk_prepare_enable(bs->clk);
@@ -467,6 +626,7 @@ static struct platform_driver bcm63xx_spi_driver = {
                .name   = "bcm63xx-spi",
                .pm     = &bcm63xx_spi_pm_ops,
        },
+       .id_table       = bcm63xx_spi_dev_match,
        .probe          = bcm63xx_spi_probe,
        .remove         = bcm63xx_spi_remove,
 };
index a78693189f4580c2929266feed8958fb1e7ea38e..6c967555a56a4d3a030bd374c2ef94151039e44a 100644 (file)
@@ -352,10 +352,7 @@ bfin_sport_spi_pump_transfers(unsigned long data)
        transfer = drv_data->cur_transfer;
        chip = drv_data->cur_chip;
 
-       if (transfer->speed_hz)
-               transfer_speed = bfin_sport_hz_to_spi_baud(transfer->speed_hz);
-       else
-               transfer_speed = chip->baud;
+       transfer_speed = bfin_sport_hz_to_spi_baud(transfer->speed_hz);
        bfin_write(&drv_data->regs->tclkdiv, transfer_speed);
        SSYNC();
 
index a3d65b4f49445d144fcba077ce3413630300e8c8..1e91325bf39c20f0b5fdc368680de06d566fdb6f 100644 (file)
@@ -661,11 +661,7 @@ static void bfin_spi_pump_transfers(unsigned long data)
        message->state = RUNNING_STATE;
        dma_config = 0;
 
-       /* Speed setup (surely valid because already checked) */
-       if (transfer->speed_hz)
-               bfin_write(&drv_data->regs->baud, hz_to_spi_baud(transfer->speed_hz));
-       else
-               bfin_write(&drv_data->regs->baud, chip->baud);
+       bfin_write(&drv_data->regs->baud, hz_to_spi_baud(transfer->speed_hz));
 
        bfin_write(&drv_data->regs->stat, BIT_STAT_CLR);
        bfin_spi_cs_active(drv_data, chip);
index 840a4984d3650e27dcf98713235a67e040b8ca1a..3aa9e6e3dac82d63f1abf58e5b7eb4aacbb8f212 100644 (file)
@@ -24,6 +24,8 @@
 #include <linux/spi/spi.h>
 #include <linux/spi/spi_bitbang.h>
 
+#define SPI_BITBANG_CS_DELAY   100
+
 
 /*----------------------------------------------------------------------*/
 
@@ -180,7 +182,6 @@ int spi_bitbang_setup(struct spi_device *spi)
 {
        struct spi_bitbang_cs   *cs = spi->controller_state;
        struct spi_bitbang      *bitbang;
-       unsigned long           flags;
 
        bitbang = spi_master_get_devdata(spi->master);
 
@@ -210,12 +211,12 @@ int spi_bitbang_setup(struct spi_device *spi)
         */
 
        /* deselect chip (low or high) */
-       spin_lock_irqsave(&bitbang->lock, flags);
+       mutex_lock(&bitbang->lock);
        if (!bitbang->busy) {
                bitbang->chipselect(spi, BITBANG_CS_INACTIVE);
                ndelay(cs->nsecs);
        }
-       spin_unlock_irqrestore(&bitbang->lock, flags);
+       mutex_unlock(&bitbang->lock);
 
        return 0;
 }
@@ -255,122 +256,39 @@ static int spi_bitbang_bufs(struct spi_device *spi, struct spi_transfer *t)
 static int spi_bitbang_prepare_hardware(struct spi_master *spi)
 {
        struct spi_bitbang      *bitbang;
-       unsigned long           flags;
 
        bitbang = spi_master_get_devdata(spi);
 
-       spin_lock_irqsave(&bitbang->lock, flags);
+       mutex_lock(&bitbang->lock);
        bitbang->busy = 1;
-       spin_unlock_irqrestore(&bitbang->lock, flags);
+       mutex_unlock(&bitbang->lock);
 
        return 0;
 }
 
 static int spi_bitbang_transfer_one(struct spi_master *master,
-                                   struct spi_message *m)
+                                   struct spi_device *spi,
+                                   struct spi_transfer *transfer)
 {
-       struct spi_bitbang      *bitbang;
-       unsigned                nsecs;
-       struct spi_transfer     *t = NULL;
-       unsigned                cs_change;
-       int                     status;
-       int                     do_setup = -1;
-       struct spi_device       *spi = m->spi;
-
-       bitbang = spi_master_get_devdata(master);
-
-       /* FIXME this is made-up ... the correct value is known to
-        * word-at-a-time bitbang code, and presumably chipselect()
-        * should enforce these requirements too?
-        */
-       nsecs = 100;
-
-       cs_change = 1;
-       status = 0;
-
-       list_for_each_entry(t, &m->transfers, transfer_list) {
-
-               /* override speed or wordsize? */
-               if (t->speed_hz || t->bits_per_word)
-                       do_setup = 1;
-
-               /* init (-1) or override (1) transfer params */
-               if (do_setup != 0) {
-                       if (bitbang->setup_transfer) {
-                               status = bitbang->setup_transfer(spi, t);
-                               if (status < 0)
-                                       break;
-                       }
-                       if (do_setup == -1)
-                               do_setup = 0;
-               }
-
-               /* set up default clock polarity, and activate chip;
-                * this implicitly updates clock and spi modes as
-                * previously recorded for this device via setup().
-                * (and also deselects any other chip that might be
-                * selected ...)
-                */
-               if (cs_change) {
-                       bitbang->chipselect(spi, BITBANG_CS_ACTIVE);
-                       ndelay(nsecs);
-               }
-               cs_change = t->cs_change;
-               if (!t->tx_buf && !t->rx_buf && t->len) {
-                       status = -EINVAL;
-                       break;
-               }
-
-               /* transfer data.  the lower level code handles any
-                * new dma mappings it needs. our caller always gave
-                * us dma-safe buffers.
-                */
-               if (t->len) {
-                       /* REVISIT dma API still needs a designated
-                        * DMA_ADDR_INVALID; ~0 might be better.
-                        */
-                       if (!m->is_dma_mapped)
-                               t->rx_dma = t->tx_dma = 0;
-                       status = bitbang->txrx_bufs(spi, t);
-               }
-               if (status > 0)
-                       m->actual_length += status;
-               if (status != t->len) {
-                       /* always report some kind of error */
-                       if (status >= 0)
-                               status = -EREMOTEIO;
-                       break;
-               }
-               status = 0;
+       struct spi_bitbang *bitbang = spi_master_get_devdata(master);
+       int status = 0;
 
-               /* protocol tweaks before next transfer */
-               if (t->delay_usecs)
-                       udelay(t->delay_usecs);
-
-               if (cs_change &&
-                   !list_is_last(&t->transfer_list, &m->transfers)) {
-                       /* sometimes a short mid-message deselect of the chip
-                        * may be needed to terminate a mode or command
-                        */
-                       ndelay(nsecs);
-                       bitbang->chipselect(spi, BITBANG_CS_INACTIVE);
-                       ndelay(nsecs);
-               }
+       if (bitbang->setup_transfer) {
+               status = bitbang->setup_transfer(spi, transfer);
+               if (status < 0)
+                       goto out;
        }
 
-       m->status = status;
+       if (transfer->len)
+               status = bitbang->txrx_bufs(spi, transfer);
 
-       /* normally deactivate chipselect ... unless no error and
-        * cs_change has hinted that the next message will probably
-        * be for this chip too.
-        */
-       if (!(status == 0 && cs_change)) {
-               ndelay(nsecs);
-               bitbang->chipselect(spi, BITBANG_CS_INACTIVE);
-               ndelay(nsecs);
-       }
+       if (status == transfer->len)
+               status = 0;
+       else if (status >= 0)
+               status = -EREMOTEIO;
 
-       spi_finalize_current_message(master);
+out:
+       spi_finalize_current_transfer(master);
 
        return status;
 }
@@ -378,17 +296,32 @@ static int spi_bitbang_transfer_one(struct spi_master *master,
 static int spi_bitbang_unprepare_hardware(struct spi_master *spi)
 {
        struct spi_bitbang      *bitbang;
-       unsigned long           flags;
 
        bitbang = spi_master_get_devdata(spi);
 
-       spin_lock_irqsave(&bitbang->lock, flags);
+       mutex_lock(&bitbang->lock);
        bitbang->busy = 0;
-       spin_unlock_irqrestore(&bitbang->lock, flags);
+       mutex_unlock(&bitbang->lock);
 
        return 0;
 }
 
+static void spi_bitbang_set_cs(struct spi_device *spi, bool enable)
+{
+       struct spi_bitbang *bitbang = spi_master_get_devdata(spi->master);
+
+       /* SPI core provides CS high / low, but bitbang driver
+        * expects CS active
+        * spi device driver takes care of handling SPI_CS_HIGH
+        */
+       enable = (!!(spi->mode & SPI_CS_HIGH) == enable);
+
+       ndelay(SPI_BITBANG_CS_DELAY);
+       bitbang->chipselect(spi, enable ? BITBANG_CS_ACTIVE :
+                           BITBANG_CS_INACTIVE);
+       ndelay(SPI_BITBANG_CS_DELAY);
+}
+
 /*----------------------------------------------------------------------*/
 
 /**
@@ -427,7 +360,7 @@ int spi_bitbang_start(struct spi_bitbang *bitbang)
        if (!master || !bitbang->chipselect)
                return -EINVAL;
 
-       spin_lock_init(&bitbang->lock);
+       mutex_init(&bitbang->lock);
 
        if (!master->mode_bits)
                master->mode_bits = SPI_CPOL | SPI_CPHA | bitbang->flags;
@@ -437,7 +370,8 @@ int spi_bitbang_start(struct spi_bitbang *bitbang)
 
        master->prepare_transfer_hardware = spi_bitbang_prepare_hardware;
        master->unprepare_transfer_hardware = spi_bitbang_unprepare_hardware;
-       master->transfer_one_message = spi_bitbang_transfer_one;
+       master->transfer_one = spi_bitbang_transfer_one;
+       master->set_cs = spi_bitbang_set_cs;
 
        if (!bitbang->txrx_bufs) {
                bitbang->use_dma = 0;
index 688956ff5095c26a8c1101dc4740b310627ed294..23f6fffd75e111ee4a77240293e582c7b66446a0 100644 (file)
@@ -420,19 +420,20 @@ static int mcfqspi_probe(struct platform_device *pdev)
        master->auto_runtime_pm = true;
 
        platform_set_drvdata(pdev, master);
+       pm_runtime_enable(&pdev->dev);
 
        status = devm_spi_register_master(&pdev->dev, master);
        if (status) {
                dev_dbg(&pdev->dev, "spi_register_master failed\n");
                goto fail2;
        }
-       pm_runtime_enable(&pdev->dev);
 
        dev_info(&pdev->dev, "Coldfire QSPI bus driver\n");
 
        return 0;
 
 fail2:
+       pm_runtime_disable(&pdev->dev);
        mcfqspi_cs_teardown(mcfqspi);
 fail1:
        clk_disable(mcfqspi->clk);
index a85d863d4a442f2f30633db5de0ff469ee9c6348..7d3af3eacf57d7c7e82722fadf2f1fdece1a8ed2 100644 (file)
@@ -215,18 +215,10 @@ static void davinci_spi_chipselect(struct spi_device *spi, int value)
        struct davinci_spi_config *spicfg = spi->controller_data;
        u8 chip_sel = spi->chip_select;
        u16 spidat1 = CS_DEFAULT;
-       bool gpio_chipsel = false;
-       int gpio;
 
        dspi = spi_master_get_devdata(spi->master);
        pdata = &dspi->pdata;
 
-       if (spi->cs_gpio >= 0) {
-               /* SPI core parse and update master->cs_gpio */
-               gpio_chipsel = true;
-               gpio = spi->cs_gpio;
-       }
-
        /* program delay transfers if tx_delay is non zero */
        if (spicfg->wdelay)
                spidat1 |= SPIDAT1_WDEL;
@@ -235,11 +227,12 @@ static void davinci_spi_chipselect(struct spi_device *spi, int value)
         * Board specific chip select logic decides the polarity and cs
         * line for the controller
         */
-       if (gpio_chipsel) {
+       if (spi->cs_gpio >= 0) {
                if (value == BITBANG_CS_ACTIVE)
-                       gpio_set_value(gpio, spi->mode & SPI_CS_HIGH);
+                       gpio_set_value(spi->cs_gpio, spi->mode & SPI_CS_HIGH);
                else
-                       gpio_set_value(gpio, !(spi->mode & SPI_CS_HIGH));
+                       gpio_set_value(spi->cs_gpio,
+                               !(spi->mode & SPI_CS_HIGH));
        } else {
                if (value == BITBANG_CS_ACTIVE) {
                        spidat1 |= SPIDAT1_CSHOLD_MASK;
index 7edede6e024ba493ce0dfc7038d83e03eb88ef85..a6d7029a85ac8655ce44423751f2ded3b63b8816 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/of.h>
 #include <linux/of_gpio.h>
 #include <linux/of_platform.h>
+#include <linux/property.h>
 
 #include "spi-dw.h"
 
@@ -74,13 +75,11 @@ static int dw_spi_mmio_probe(struct platform_device *pdev)
 
        dws->max_freq = clk_get_rate(dwsmmio->clk);
 
-       of_property_read_u32(pdev->dev.of_node, "reg-io-width",
-                            &dws->reg_io_width);
+       device_property_read_u32(&pdev->dev, "reg-io-width", &dws->reg_io_width);
 
        num_cs = 4;
 
-       if (pdev->dev.of_node)
-               of_property_read_u32(pdev->dev.of_node, "num-cs", &num_cs);
+       device_property_read_u32(&pdev->dev, "num-cs", &num_cs);
 
        dws->num_cs = num_cs;
 
index 6d331e0db33122b23cfa17f6602618a510efcde1..332ccb0539a77710e3c4783cf2468acd25a8c04f 100644 (file)
 
 #define DRIVER_NAME "dw_spi_pci"
 
-struct dw_spi_pci {
-       struct pci_dev  *pdev;
-       struct dw_spi   dws;
-};
-
 struct spi_pci_desc {
        int     (*setup)(struct dw_spi *);
        u16     num_cs;
@@ -48,7 +43,6 @@ static struct spi_pci_desc spi_pci_mid_desc_2 = {
 
 static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
-       struct dw_spi_pci *dwpci;
        struct dw_spi *dws;
        struct spi_pci_desc *desc = (struct spi_pci_desc *)ent->driver_data;
        int pci_bar = 0;
@@ -58,14 +52,10 @@ static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        if (ret)
                return ret;
 
-       dwpci = devm_kzalloc(&pdev->dev, sizeof(struct dw_spi_pci),
-                       GFP_KERNEL);
-       if (!dwpci)
+       dws = devm_kzalloc(&pdev->dev, sizeof(*dws), GFP_KERNEL);
+       if (!dws)
                return -ENOMEM;
 
-       dwpci->pdev = pdev;
-       dws = &dwpci->dws;
-
        /* Get basic io resource and map it */
        dws->paddr = pci_resource_start(pdev, pci_bar);
 
@@ -74,7 +64,6 @@ static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                return ret;
 
        dws->regs = pcim_iomap_table(pdev)[pci_bar];
-
        dws->irq = pdev->irq;
 
        /*
@@ -99,7 +88,7 @@ static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                return ret;
 
        /* PCI hook and SPI hook use the same drv data */
-       pci_set_drvdata(pdev, dwpci);
+       pci_set_drvdata(pdev, dws);
 
        dev_info(&pdev->dev, "found PCI SPI controller(ID: %04x:%04x)\n",
                pdev->vendor, pdev->device);
@@ -109,26 +98,26 @@ static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 static void spi_pci_remove(struct pci_dev *pdev)
 {
-       struct dw_spi_pci *dwpci = pci_get_drvdata(pdev);
+       struct dw_spi *dws = pci_get_drvdata(pdev);
 
-       dw_spi_remove_host(&dwpci->dws);
+       dw_spi_remove_host(dws);
 }
 
 #ifdef CONFIG_PM_SLEEP
 static int spi_suspend(struct device *dev)
 {
        struct pci_dev *pdev = to_pci_dev(dev);
-       struct dw_spi_pci *dwpci = pci_get_drvdata(pdev);
+       struct dw_spi *dws = pci_get_drvdata(pdev);
 
-       return dw_spi_suspend_host(&dwpci->dws);
+       return dw_spi_suspend_host(dws);
 }
 
 static int spi_resume(struct device *dev)
 {
        struct pci_dev *pdev = to_pci_dev(dev);
-       struct dw_spi_pci *dwpci = pci_get_drvdata(pdev);
+       struct dw_spi *dws = pci_get_drvdata(pdev);
 
-       return dw_spi_resume_host(&dwpci->dws);
+       return dw_spi_resume_host(dws);
 }
 #endif
 
index 4fbfcdc5cb244d6e9f2a7edaba603b7ccd269fb0..882cd6618cd5d0f1225eb6a8e7bbd66d80882f01 100644 (file)
 
 /* Slave spi_dev related */
 struct chip_data {
-       u16 cr0;
        u8 cs;                  /* chip select pin */
-       u8 n_bytes;             /* current is a 1/2/4 byte op */
        u8 tmode;               /* TR/TO/RO/EEPROM */
        u8 type;                /* SPI/SSP/MicroWire */
 
        u8 poll_mode;           /* 1 means use poll mode */
 
-       u32 dma_width;
-       u32 rx_threshold;
-       u32 tx_threshold;
        u8 enable_dma;
-       u8 bits_per_word;
        u16 clk_div;            /* baud rate divider */
        u32 speed_hz;           /* baud rate */
        void (*cs_control)(u32 command);
@@ -289,14 +283,11 @@ static int dw_spi_transfer_one(struct spi_master *master,
        struct chip_data *chip = spi_get_ctldata(spi);
        u8 imask = 0;
        u16 txlevel = 0;
-       u16 clk_div = 0;
-       u32 speed = 0;
-       u32 cr0 = 0;
+       u16 clk_div;
+       u32 cr0;
        int ret;
 
        dws->dma_mapped = 0;
-       dws->n_bytes = chip->n_bytes;
-       dws->dma_width = chip->dma_width;
 
        dws->tx = (void *)transfer->tx_buf;
        dws->tx_end = dws->tx + transfer->len;
@@ -306,37 +297,30 @@ static int dw_spi_transfer_one(struct spi_master *master,
 
        spi_enable_chip(dws, 0);
 
-       cr0 = chip->cr0;
-
        /* Handle per transfer options for bpw and speed */
-       if (transfer->speed_hz) {
-               speed = chip->speed_hz;
-
-               if ((transfer->speed_hz != speed) || !chip->clk_div) {
-                       speed = transfer->speed_hz;
-
-                       /* clk_div doesn't support odd number */
-                       clk_div = (dws->max_freq / speed + 1) & 0xfffe;
+       if (transfer->speed_hz != chip->speed_hz) {
+               /* clk_div doesn't support odd number */
+               clk_div = (dws->max_freq / transfer->speed_hz + 1) & 0xfffe;
 
-                       chip->speed_hz = speed;
-                       chip->clk_div = clk_div;
+               chip->speed_hz = transfer->speed_hz;
+               chip->clk_div = clk_div;
 
-                       spi_set_clk(dws, chip->clk_div);
-               }
+               spi_set_clk(dws, chip->clk_div);
        }
-       if (transfer->bits_per_word) {
-               if (transfer->bits_per_word == 8) {
-                       dws->n_bytes = 1;
-                       dws->dma_width = 1;
-               } else if (transfer->bits_per_word == 16) {
-                       dws->n_bytes = 2;
-                       dws->dma_width = 2;
-               }
-               cr0 = (transfer->bits_per_word - 1)
-                       | (chip->type << SPI_FRF_OFFSET)
-                       | (spi->mode << SPI_MODE_OFFSET)
-                       | (chip->tmode << SPI_TMOD_OFFSET);
+       if (transfer->bits_per_word == 8) {
+               dws->n_bytes = 1;
+               dws->dma_width = 1;
+       } else if (transfer->bits_per_word == 16) {
+               dws->n_bytes = 2;
+               dws->dma_width = 2;
+       } else {
+               return -EINVAL;
        }
+       /* Default SPI mode is SCPOL = 0, SCPH = 0 */
+       cr0 = (transfer->bits_per_word - 1)
+               | (chip->type << SPI_FRF_OFFSET)
+               | (spi->mode << SPI_MODE_OFFSET)
+               | (chip->tmode << SPI_TMOD_OFFSET);
 
        /*
         * Adjust transfer mode if necessary. Requires platform dependent
@@ -439,34 +423,9 @@ static int dw_spi_setup(struct spi_device *spi)
 
                chip->poll_mode = chip_info->poll_mode;
                chip->type = chip_info->type;
-
-               chip->rx_threshold = 0;
-               chip->tx_threshold = 0;
-       }
-
-       if (spi->bits_per_word == 8) {
-               chip->n_bytes = 1;
-               chip->dma_width = 1;
-       } else if (spi->bits_per_word == 16) {
-               chip->n_bytes = 2;
-               chip->dma_width = 2;
-       }
-       chip->bits_per_word = spi->bits_per_word;
-
-       if (!spi->max_speed_hz) {
-               dev_err(&spi->dev, "No max speed HZ parameter\n");
-               return -EINVAL;
        }
 
        chip->tmode = 0; /* Tx & Rx */
-       /* Default SPI mode is SCPOL = 0, SCPH = 0 */
-       chip->cr0 = (chip->bits_per_word - 1)
-                       | (chip->type << SPI_FRF_OFFSET)
-                       | (spi->mode  << SPI_MODE_OFFSET)
-                       | (chip->tmode << SPI_TMOD_OFFSET);
-
-       if (spi->mode & SPI_LOOP)
-               chip->cr0 |= 1 << SPI_SRL_OFFSET;
 
        if (gpio_is_valid(spi->cs_gpio)) {
                ret = gpio_direction_output(spi->cs_gpio,
@@ -524,13 +483,12 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws)
        dws->master = master;
        dws->type = SSI_MOTO_SPI;
        dws->dma_inited = 0;
-       dws->dma_addr = (dma_addr_t)(dws->paddr + 0x60);
+       dws->dma_addr = (dma_addr_t)(dws->paddr + DW_SPI_DR);
        snprintf(dws->name, sizeof(dws->name), "dw_spi%d", dws->bus_num);
 
-       ret = devm_request_irq(dev, dws->irq, dw_spi_irq, IRQF_SHARED,
-                       dws->name, master);
+       ret = request_irq(dws->irq, dw_spi_irq, IRQF_SHARED, dws->name, master);
        if (ret < 0) {
-               dev_err(&master->dev, "can not get IRQ\n");
+               dev_err(dev, "can not get IRQ\n");
                goto err_free_master;
        }
 
@@ -573,6 +531,7 @@ err_dma_exit:
        if (dws->dma_ops && dws->dma_ops->dma_exit)
                dws->dma_ops->dma_exit(dws);
        spi_enable_chip(dws, 0);
+       free_irq(dws->irq, master);
 err_free_master:
        spi_master_put(master);
        return ret;
@@ -581,28 +540,27 @@ EXPORT_SYMBOL_GPL(dw_spi_add_host);
 
 void dw_spi_remove_host(struct dw_spi *dws)
 {
-       if (!dws)
-               return;
        dw_spi_debugfs_remove(dws);
 
        if (dws->dma_ops && dws->dma_ops->dma_exit)
                dws->dma_ops->dma_exit(dws);
-       spi_enable_chip(dws, 0);
-       /* Disable clk */
-       spi_set_clk(dws, 0);
+
+       spi_shutdown_chip(dws);
+
+       free_irq(dws->irq, dws->master);
 }
 EXPORT_SYMBOL_GPL(dw_spi_remove_host);
 
 int dw_spi_suspend_host(struct dw_spi *dws)
 {
-       int ret = 0;
+       int ret;
 
        ret = spi_master_suspend(dws->master);
        if (ret)
                return ret;
-       spi_enable_chip(dws, 0);
-       spi_set_clk(dws, 0);
-       return ret;
+
+       spi_shutdown_chip(dws);
+       return 0;
 }
 EXPORT_SYMBOL_GPL(dw_spi_suspend_host);
 
index b75ed327d5a29832ad3461cb28da1089ade94cba..35589a270468d6f2dcd7f57ef0c4073cd6fe5721 100644 (file)
@@ -225,6 +225,12 @@ static inline void spi_reset_chip(struct dw_spi *dws)
        spi_enable_chip(dws, 1);
 }
 
+static inline void spi_shutdown_chip(struct dw_spi *dws)
+{
+       spi_enable_chip(dws, 0);
+       spi_set_clk(dws, 0);
+}
+
 /*
  * Each SPI slave device to work with dw_api controller should
  * has such a structure claiming its working mode (poll or PIO/DMA),
index 86bcdd68c1fe09f1640fc352cc2d94f0aa53566d..59a11437db7090f9c8464f8ca0584c789be2e997 100644 (file)
@@ -409,9 +409,6 @@ static int dspi_transfer_one_message(struct spi_master *master,
                                SPI_MCR_CLR_TXF | SPI_MCR_CLR_RXF);
                regmap_write(dspi->regmap, SPI_CTAR(dspi->cs),
                                dspi->cur_chip->ctar_val);
-               if (transfer->speed_hz)
-                       regmap_write(dspi->regmap, SPI_CTAR(dspi->cs),
-                                       dspi->cur_chip->ctar_val);
 
                trans_mode = dspi->devtype_data->trans_mode;
                switch (trans_mode) {
index f9deb84e4e551bdd9c42c8ac204c80c18f0f8579..0e5723ab47f0ce023db657c5be0e2274d825c149 100644 (file)
@@ -336,13 +336,20 @@ static int __maybe_unused mx51_ecspi_config(struct spi_imx_data *spi_imx,
 
        if (config->mode & SPI_CPHA)
                cfg |= MX51_ECSPI_CONFIG_SCLKPHA(config->cs);
+       else
+               cfg &= ~MX51_ECSPI_CONFIG_SCLKPHA(config->cs);
 
        if (config->mode & SPI_CPOL) {
                cfg |= MX51_ECSPI_CONFIG_SCLKPOL(config->cs);
                cfg |= MX51_ECSPI_CONFIG_SCLKCTL(config->cs);
+       } else {
+               cfg &= ~MX51_ECSPI_CONFIG_SCLKPOL(config->cs);
+               cfg &= ~MX51_ECSPI_CONFIG_SCLKCTL(config->cs);
        }
        if (config->mode & SPI_CS_HIGH)
                cfg |= MX51_ECSPI_CONFIG_SSBPOL(config->cs);
+       else
+               cfg &= ~MX51_ECSPI_CONFIG_SSBPOL(config->cs);
 
        writel(ctrl, spi_imx->base + MX51_ECSPI_CTRL);
        writel(cfg, spi_imx->base + MX51_ECSPI_CONFIG);
index 1e75341689a622916bad62e4429d4ed4c5315fc2..c3ec46cd9f916ea5d362d43b655047b1dd0bff72 100644 (file)
@@ -302,11 +302,9 @@ static int mpc512x_psc_spi_msg_xfer(struct spi_master *master,
        cs_change = 1;
        status = 0;
        list_for_each_entry(t, &m->transfers, transfer_list) {
-               if (t->bits_per_word || t->speed_hz) {
-                       status = mpc512x_psc_spi_transfer_setup(spi, t);
-                       if (status < 0)
-                               break;
-               }
+               status = mpc512x_psc_spi_transfer_setup(spi, t);
+               if (status < 0)
+                       break;
 
                if (cs_change)
                        mpc512x_psc_spi_activate_cs(spi);
index ecb6c58238c4f56867e73e3f074ddf90f1b04ee3..563954a614242718bd125f16f9a3549f783346b8 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/ioport.h>
 #include <linux/module.h>
 #include <linux/of.h>
+#include <linux/of_gpio.h>
 #include <linux/platform_device.h>
 #include <linux/platform_data/spi-mt65xx.h>
 #include <linux/pm_runtime.h>
@@ -84,7 +85,8 @@ struct mtk_spi_compatible {
 struct mtk_spi {
        void __iomem *base;
        u32 state;
-       u32 pad_sel;
+       int pad_num;
+       u32 *pad_sel;
        struct clk *parent_clk, *sel_clk, *spi_clk;
        struct spi_transfer *cur_transfer;
        u32 xfer_len;
@@ -131,10 +133,28 @@ static void mtk_spi_reset(struct mtk_spi *mdata)
        writel(reg_val, mdata->base + SPI_CMD_REG);
 }
 
-static void mtk_spi_config(struct mtk_spi *mdata,
-                          struct mtk_chip_config *chip_config)
+static int mtk_spi_prepare_message(struct spi_master *master,
+                                  struct spi_message *msg)
 {
+       u16 cpha, cpol;
        u32 reg_val;
+       struct spi_device *spi = msg->spi;
+       struct mtk_chip_config *chip_config = spi->controller_data;
+       struct mtk_spi *mdata = spi_master_get_devdata(master);
+
+       cpha = spi->mode & SPI_CPHA ? 1 : 0;
+       cpol = spi->mode & SPI_CPOL ? 1 : 0;
+
+       reg_val = readl(mdata->base + SPI_CMD_REG);
+       if (cpha)
+               reg_val |= SPI_CMD_CPHA;
+       else
+               reg_val &= ~SPI_CMD_CPHA;
+       if (cpol)
+               reg_val |= SPI_CMD_CPOL;
+       else
+               reg_val &= ~SPI_CMD_CPOL;
+       writel(reg_val, mdata->base + SPI_CMD_REG);
 
        reg_val = readl(mdata->base + SPI_CMD_REG);
 
@@ -170,38 +190,8 @@ static void mtk_spi_config(struct mtk_spi *mdata,
 
        /* pad select */
        if (mdata->dev_comp->need_pad_sel)
-               writel(mdata->pad_sel, mdata->base + SPI_PAD_SEL_REG);
-}
-
-static int mtk_spi_prepare_message(struct spi_master *master,
-                                  struct spi_message *msg)
-{
-       u32 reg_val;
-       u8 cpha, cpol;
-       struct mtk_chip_config *chip_config;
-       struct spi_device *spi = msg->spi;
-       struct mtk_spi *mdata = spi_master_get_devdata(master);
-
-       cpha = spi->mode & SPI_CPHA ? 1 : 0;
-       cpol = spi->mode & SPI_CPOL ? 1 : 0;
-
-       reg_val = readl(mdata->base + SPI_CMD_REG);
-       if (cpha)
-               reg_val |= SPI_CMD_CPHA;
-       else
-               reg_val &= ~SPI_CMD_CPHA;
-       if (cpol)
-               reg_val |= SPI_CMD_CPOL;
-       else
-               reg_val &= ~SPI_CMD_CPOL;
-       writel(reg_val, mdata->base + SPI_CMD_REG);
-
-       chip_config = spi->controller_data;
-       if (!chip_config) {
-               chip_config = (void *)&mtk_default_chip_info;
-               spi->controller_data = chip_config;
-       }
-       mtk_spi_config(mdata, chip_config);
+               writel(mdata->pad_sel[spi->chip_select],
+                      mdata->base + SPI_PAD_SEL_REG);
 
        return 0;
 }
@@ -413,6 +403,19 @@ static bool mtk_spi_can_dma(struct spi_master *master,
        return xfer->len > MTK_SPI_MAX_FIFO_SIZE;
 }
 
+static int mtk_spi_setup(struct spi_device *spi)
+{
+       struct mtk_spi *mdata = spi_master_get_devdata(spi->master);
+
+       if (!spi->controller_data)
+               spi->controller_data = (void *)&mtk_default_chip_info;
+
+       if (mdata->dev_comp->need_pad_sel)
+               gpio_direction_output(spi->cs_gpio, !(spi->mode & SPI_CS_HIGH));
+
+       return 0;
+}
+
 static irqreturn_t mtk_spi_interrupt(int irq, void *dev_id)
 {
        u32 cmd, reg_val, cnt;
@@ -484,7 +487,7 @@ static int mtk_spi_probe(struct platform_device *pdev)
        struct mtk_spi *mdata;
        const struct of_device_id *of_id;
        struct resource *res;
-       int irq, ret;
+       int i, irq, ret;
 
        master = spi_alloc_master(&pdev->dev, sizeof(*mdata));
        if (!master) {
@@ -500,6 +503,7 @@ static int mtk_spi_probe(struct platform_device *pdev)
        master->prepare_message = mtk_spi_prepare_message;
        master->transfer_one = mtk_spi_transfer_one;
        master->can_dma = mtk_spi_can_dma;
+       master->setup = mtk_spi_setup;
 
        of_id = of_match_node(mtk_spi_of_match, pdev->dev.of_node);
        if (!of_id) {
@@ -514,21 +518,34 @@ static int mtk_spi_probe(struct platform_device *pdev)
                master->flags = SPI_MASTER_MUST_TX;
 
        if (mdata->dev_comp->need_pad_sel) {
-               ret = of_property_read_u32(pdev->dev.of_node,
-                                          "mediatek,pad-select",
-                                          &mdata->pad_sel);
-               if (ret) {
-                       dev_err(&pdev->dev, "failed to read pad select: %d\n",
-                               ret);
+               mdata->pad_num = of_property_count_u32_elems(
+                       pdev->dev.of_node,
+                       "mediatek,pad-select");
+               if (mdata->pad_num < 0) {
+                       dev_err(&pdev->dev,
+                               "No 'mediatek,pad-select' property\n");
+                       ret = -EINVAL;
                        goto err_put_master;
                }
 
-               if (mdata->pad_sel > MT8173_SPI_MAX_PAD_SEL) {
-                       dev_err(&pdev->dev, "wrong pad-select: %u\n",
-                               mdata->pad_sel);
-                       ret = -EINVAL;
+               mdata->pad_sel = devm_kmalloc_array(&pdev->dev, mdata->pad_num,
+                                                   sizeof(u32), GFP_KERNEL);
+               if (!mdata->pad_sel) {
+                       ret = -ENOMEM;
                        goto err_put_master;
                }
+
+               for (i = 0; i < mdata->pad_num; i++) {
+                       of_property_read_u32_index(pdev->dev.of_node,
+                                                  "mediatek,pad-select",
+                                                  i, &mdata->pad_sel[i]);
+                       if (mdata->pad_sel[i] > MT8173_SPI_MAX_PAD_SEL) {
+                               dev_err(&pdev->dev, "wrong pad-sel[%d]: %u\n",
+                                       i, mdata->pad_sel[i]);
+                               ret = -EINVAL;
+                               goto err_put_master;
+                       }
+               }
        }
 
        platform_set_drvdata(pdev, master);
@@ -606,6 +623,26 @@ static int mtk_spi_probe(struct platform_device *pdev)
                goto err_put_master;
        }
 
+       if (mdata->dev_comp->need_pad_sel) {
+               if (mdata->pad_num != master->num_chipselect) {
+                       dev_err(&pdev->dev,
+                               "pad_num does not match num_chipselect(%d != %d)\n",
+                               mdata->pad_num, master->num_chipselect);
+                       ret = -EINVAL;
+                       goto err_put_master;
+               }
+
+               for (i = 0; i < master->num_chipselect; i++) {
+                       ret = devm_gpio_request(&pdev->dev, master->cs_gpios[i],
+                                               dev_name(&pdev->dev));
+                       if (ret) {
+                               dev_err(&pdev->dev,
+                                       "can't get CS GPIO %i\n", i);
+                               goto err_put_master;
+                       }
+               }
+       }
+
        return 0;
 
 err_disable_clk:
index 76656a77ec1213d1db70d6ee98d546bc0f760da9..b5911282a61116c47b0237071df40261831f94ab 100644 (file)
@@ -207,8 +207,7 @@ static int tiny_spi_of_probe(struct platform_device *pdev)
        struct tiny_spi *hw = platform_get_drvdata(pdev);
        struct device_node *np = pdev->dev.of_node;
        unsigned int i;
-       const __be32 *val;
-       int len;
+       u32 val;
 
        if (!np)
                return 0;
@@ -226,13 +225,10 @@ static int tiny_spi_of_probe(struct platform_device *pdev)
                        return -ENODEV;
        }
        hw->bitbang.master->dev.of_node = pdev->dev.of_node;
-       val = of_get_property(pdev->dev.of_node,
-                             "clock-frequency", &len);
-       if (val && len >= sizeof(__be32))
-               hw->freq = be32_to_cpup(val);
-       val = of_get_property(pdev->dev.of_node, "baud-width", &len);
-       if (val && len >= sizeof(__be32))
-               hw->baudwidth = be32_to_cpup(val);
+       if (!of_property_read_u32(np, "clock-frequency", &val))
+               hw->freq = val;
+       if (!of_property_read_u32(np, "baud-width", &val))
+               hw->baudwidth = val;
        return 0;
 }
 #else /* !CONFIG_OF */
index e99d6a93d3943c8b578fbd4a00ecba152d0881c5..07e4ce8273df56533aee2e8adf563c6026a956c0 100644 (file)
@@ -65,7 +65,7 @@ static int octeon_spi_do_transfer(struct octeon_spi *p,
        cpha = mode & SPI_CPHA;
        cpol = mode & SPI_CPOL;
 
-       speed_hz = xfer->speed_hz ? : spi->max_speed_hz;
+       speed_hz = xfer->speed_hz;
 
        clkdiv = octeon_get_io_clock_rate() / (2 * speed_hz);
 
index 35b332dacb13a1e7d91c868dab37ac8a5abc4dac..76a8425be227bdb5494bd255917a50f7460b007d 100644 (file)
@@ -244,12 +244,12 @@ static int omap1_spi100k_setup_transfer(struct spi_device *spi,
 {
        struct omap1_spi100k *spi100k = spi_master_get_devdata(spi->master);
        struct omap1_spi100k_cs *cs = spi->controller_state;
-       u8 word_len = spi->bits_per_word;
+       u8 word_len;
 
-       if (t != NULL && t->bits_per_word)
+       if (t != NULL)
                word_len = t->bits_per_word;
-       if (!word_len)
-               word_len = 8;
+       else
+               word_len = spi->bits_per_word;
 
        if (spi->bits_per_word > 32)
                return -EINVAL;
@@ -302,7 +302,6 @@ static int omap1_spi100k_transfer_one_message(struct spi_master *master,
        struct spi_device *spi = m->spi;
        struct spi_transfer *t = NULL;
        int cs_active = 0;
-       int par_override = 0;
        int status = 0;
 
        list_for_each_entry(t, &m->transfers, transfer_list) {
@@ -310,14 +309,9 @@ static int omap1_spi100k_transfer_one_message(struct spi_master *master,
                        status = -EINVAL;
                        break;
                }
-               if (par_override || t->speed_hz || t->bits_per_word) {
-                       par_override = 1;
-                       status = omap1_spi100k_setup_transfer(spi, t);
-                       if (status < 0)
-                               break;
-                       if (!t->speed_hz && !t->bits_per_word)
-                               par_override = 0;
-               }
+               status = omap1_spi100k_setup_transfer(spi, t);
+               if (status < 0)
+                       break;
 
                if (!cs_active) {
                        omap1_spi100k_force_cs(spi100k, 1);
@@ -347,11 +341,7 @@ static int omap1_spi100k_transfer_one_message(struct spi_master *master,
                }
        }
 
-       /* Restore defaults if they were overriden */
-       if (par_override) {
-               par_override = 0;
-               status = omap1_spi100k_setup_transfer(spi, NULL);
-       }
+       status = omap1_spi100k_setup_transfer(spi, NULL);
 
        if (cs_active)
                omap1_spi100k_force_cs(spi100k, 0);
index 55576db315497379d73d6f2513b2bbfadb32d2d0..ce8dbdbce312d53bef216006a554a3c0019aa4be 100644 (file)
@@ -205,7 +205,7 @@ static void uwire_chipselect(struct spi_device *spi, int value)
 static int uwire_txrx(struct spi_device *spi, struct spi_transfer *t)
 {
        unsigned        len = t->len;
-       unsigned        bits = t->bits_per_word ? : spi->bits_per_word;
+       unsigned        bits = t->bits_per_word;
        unsigned        bytes;
        u16             val, w;
        int             status = 0;
@@ -344,9 +344,10 @@ static int uwire_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
        /* assume it's already enabled */
        rate = clk_get_rate(uwire->ck);
 
-       hz = spi->max_speed_hz;
-       if (t != NULL && t->speed_hz)
+       if (t != NULL)
                hz = t->speed_hz;
+       else
+               hz = spi->max_speed_hz;
 
        if (!hz) {
                pr_debug("%s: zero speed?\n", dev_name(&spi->dev));
index 3d09e0b69b73241c58d50e788dbdaf5cd16bf7ea..1f8903d356e5581f48d6935177906bba6bc7e302 100644 (file)
@@ -1217,6 +1217,33 @@ out:
        return status;
 }
 
+static int omap2_mcspi_prepare_message(struct spi_master *master,
+                                      struct spi_message *msg)
+{
+       struct omap2_mcspi      *mcspi = spi_master_get_devdata(master);
+       struct omap2_mcspi_regs *ctx = &mcspi->ctx;
+       struct omap2_mcspi_cs   *cs;
+
+       /* Only a single channel can have the FORCE bit enabled
+        * in its chconf0 register.
+        * Scan all channels and disable them except the current one.
+        * A FORCE can remain from a last transfer having cs_change enabled
+        */
+       list_for_each_entry(cs, &ctx->cs, node) {
+               if (msg->spi->controller_state == cs)
+                       continue;
+
+               if ((cs->chconf0 & OMAP2_MCSPI_CHCONF_FORCE)) {
+                       cs->chconf0 &= ~OMAP2_MCSPI_CHCONF_FORCE;
+                       writel_relaxed(cs->chconf0,
+                                       cs->base + OMAP2_MCSPI_CHCONF0);
+                       readl_relaxed(cs->base + OMAP2_MCSPI_CHCONF0);
+               }
+       }
+
+       return 0;
+}
+
 static int omap2_mcspi_transfer_one(struct spi_master *master,
                struct spi_device *spi, struct spi_transfer *t)
 {
@@ -1344,6 +1371,7 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
        master->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 32);
        master->setup = omap2_mcspi_setup;
        master->auto_runtime_pm = true;
+       master->prepare_message = omap2_mcspi_prepare_message;
        master->transfer_one = omap2_mcspi_transfer_one;
        master->set_cs = omap2_mcspi_set_cs;
        master->cleanup = omap2_mcspi_cleanup;
index 54fb984a3e1748157af2ecd230d605f60aee0bc4..dd3d0a218d8b1ffc2299595fc55adadaaa3bdeeb 100644 (file)
@@ -210,12 +210,12 @@ static int spi_ppc4xx_setupxfer(struct spi_device *spi, struct spi_transfer *t)
        if (in_8(&hw->regs->cdm) != cdm)
                out_8(&hw->regs->cdm, cdm);
 
-       spin_lock(&hw->bitbang.lock);
+       mutex_lock(&hw->bitbang.lock);
        if (!hw->bitbang.busy) {
                hw->bitbang.chipselect(spi, BITBANG_CS_INACTIVE);
                /* Need to ndelay here? */
        }
-       spin_unlock(&hw->bitbang.lock);
+       mutex_unlock(&hw->bitbang.lock);
 
        return 0;
 }
index 66a173939be81e5f4b944b287991c7c99957ae49..bd8b369a343c98e0c98141295c9f73d63d65ce72 100644 (file)
@@ -344,10 +344,6 @@ void pxa2xx_spi_dma_release(struct driver_data *drv_data)
        }
 }
 
-void pxa2xx_spi_dma_resume(struct driver_data *drv_data)
-{
-}
-
 int pxa2xx_spi_set_dma_burst_and_threshold(struct chip_data *chip,
                                           struct spi_device *spi,
                                           u8 bits_per_word, u32 *burst_code,
index a8ef38ebb9c9db551191b2e80be567990a20817b..b25dc71b0ea918de43184625c8d359be43684dad 100644 (file)
@@ -13,6 +13,7 @@
  * GNU General Public License for more details.
  */
 
+#include <linux/bitops.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/device.h>
@@ -61,9 +62,13 @@ MODULE_ALIAS("platform:pxa2xx-spi");
                                | QUARK_X1000_SSCR1_TFT         \
                                | SSCR1_SPH | SSCR1_SPO | SSCR1_LBM)
 
-#define GENERAL_REG_RXTO_HOLDOFF_DISABLE BIT(24)
-#define SPI_CS_CONTROL_SW_MODE BIT(0)
-#define SPI_CS_CONTROL_CS_HIGH BIT(1)
+#define LPSS_GENERAL_REG_RXTO_HOLDOFF_DISABLE  BIT(24)
+#define LPSS_CS_CONTROL_SW_MODE                        BIT(0)
+#define LPSS_CS_CONTROL_CS_HIGH                        BIT(1)
+#define LPSS_CS_CONTROL_CS_SEL_SHIFT           8
+#define LPSS_CS_CONTROL_CS_SEL_MASK            (3 << LPSS_CS_CONTROL_CS_SEL_SHIFT)
+#define LPSS_CAPS_CS_EN_SHIFT                  9
+#define LPSS_CAPS_CS_EN_MASK                   (0xf << LPSS_CAPS_CS_EN_SHIFT)
 
 struct lpss_config {
        /* LPSS offset from drv_data->ioaddr */
@@ -72,6 +77,7 @@ struct lpss_config {
        int reg_general;
        int reg_ssp;
        int reg_cs_ctrl;
+       int reg_capabilities;
        /* FIFO thresholds */
        u32 rx_threshold;
        u32 tx_threshold_lo;
@@ -85,6 +91,7 @@ static const struct lpss_config lpss_platforms[] = {
                .reg_general = 0x08,
                .reg_ssp = 0x0c,
                .reg_cs_ctrl = 0x18,
+               .reg_capabilities = -1,
                .rx_threshold = 64,
                .tx_threshold_lo = 160,
                .tx_threshold_hi = 224,
@@ -94,6 +101,7 @@ static const struct lpss_config lpss_platforms[] = {
                .reg_general = 0x08,
                .reg_ssp = 0x0c,
                .reg_cs_ctrl = 0x18,
+               .reg_capabilities = -1,
                .rx_threshold = 64,
                .tx_threshold_lo = 160,
                .tx_threshold_hi = 224,
@@ -103,10 +111,21 @@ static const struct lpss_config lpss_platforms[] = {
                .reg_general = -1,
                .reg_ssp = 0x20,
                .reg_cs_ctrl = 0x24,
+               .reg_capabilities = 0xfc,
                .rx_threshold = 1,
                .tx_threshold_lo = 32,
                .tx_threshold_hi = 56,
        },
+       {       /* LPSS_BXT_SSP */
+               .offset = 0x200,
+               .reg_general = -1,
+               .reg_ssp = 0x20,
+               .reg_cs_ctrl = 0x24,
+               .reg_capabilities = 0xfc,
+               .rx_threshold = 1,
+               .tx_threshold_lo = 16,
+               .tx_threshold_hi = 48,
+       },
 };
 
 static inline const struct lpss_config
@@ -121,6 +140,7 @@ static bool is_lpss_ssp(const struct driver_data *drv_data)
        case LPSS_LPT_SSP:
        case LPSS_BYT_SSP:
        case LPSS_SPT_SSP:
+       case LPSS_BXT_SSP:
                return true;
        default:
                return false;
@@ -249,7 +269,9 @@ static void lpss_ssp_setup(struct driver_data *drv_data)
        drv_data->lpss_base = drv_data->ioaddr + config->offset;
 
        /* Enable software chip select control */
-       value = SPI_CS_CONTROL_SW_MODE | SPI_CS_CONTROL_CS_HIGH;
+       value = __lpss_ssp_read_priv(drv_data, config->reg_cs_ctrl);
+       value &= ~(LPSS_CS_CONTROL_SW_MODE | LPSS_CS_CONTROL_CS_HIGH);
+       value |= LPSS_CS_CONTROL_SW_MODE | LPSS_CS_CONTROL_CS_HIGH;
        __lpss_ssp_write_priv(drv_data, config->reg_cs_ctrl, value);
 
        /* Enable multiblock DMA transfers */
@@ -259,7 +281,7 @@ static void lpss_ssp_setup(struct driver_data *drv_data)
                if (config->reg_general >= 0) {
                        value = __lpss_ssp_read_priv(drv_data,
                                                     config->reg_general);
-                       value |= GENERAL_REG_RXTO_HOLDOFF_DISABLE;
+                       value |= LPSS_GENERAL_REG_RXTO_HOLDOFF_DISABLE;
                        __lpss_ssp_write_priv(drv_data,
                                              config->reg_general, value);
                }
@@ -269,15 +291,34 @@ static void lpss_ssp_setup(struct driver_data *drv_data)
 static void lpss_ssp_cs_control(struct driver_data *drv_data, bool enable)
 {
        const struct lpss_config *config;
-       u32 value;
+       u32 value, cs;
 
        config = lpss_get_config(drv_data);
 
        value = __lpss_ssp_read_priv(drv_data, config->reg_cs_ctrl);
-       if (enable)
-               value &= ~SPI_CS_CONTROL_CS_HIGH;
-       else
-               value |= SPI_CS_CONTROL_CS_HIGH;
+       if (enable) {
+               cs = drv_data->cur_msg->spi->chip_select;
+               cs <<= LPSS_CS_CONTROL_CS_SEL_SHIFT;
+               if (cs != (value & LPSS_CS_CONTROL_CS_SEL_MASK)) {
+                       /*
+                        * When switching another chip select output active
+                        * the output must be selected first and wait 2 ssp_clk
+                        * cycles before changing state to active. Otherwise
+                        * a short glitch will occur on the previous chip
+                        * select since output select is latched but state
+                        * control is not.
+                        */
+                       value &= ~LPSS_CS_CONTROL_CS_SEL_MASK;
+                       value |= cs;
+                       __lpss_ssp_write_priv(drv_data,
+                                             config->reg_cs_ctrl, value);
+                       ndelay(1000000000 /
+                              (drv_data->master->max_speed_hz / 2));
+               }
+               value &= ~LPSS_CS_CONTROL_CS_HIGH;
+       } else {
+               value |= LPSS_CS_CONTROL_CS_HIGH;
+       }
        __lpss_ssp_write_priv(drv_data, config->reg_cs_ctrl, value);
 }
 
@@ -734,7 +775,7 @@ static unsigned int quark_x1000_get_clk_div(int rate, u32 *dds)
        mul = (1 << 24) >> 1;
 
        /* Calculate initial quot */
-       q1 = DIV_ROUND_CLOSEST(fref1, rate);
+       q1 = DIV_ROUND_UP(fref1, rate);
 
        /* Scale q1 if it's too big */
        if (q1 > 256) {
@@ -759,7 +800,7 @@ static unsigned int quark_x1000_get_clk_div(int rate, u32 *dds)
 
        /* Case 2 */
 
-       q2 = DIV_ROUND_CLOSEST(fref2, rate);
+       q2 = DIV_ROUND_UP(fref2, rate);
        r2 = abs(fref2 / q2 - rate);
 
        /*
@@ -778,13 +819,13 @@ static unsigned int quark_x1000_get_clk_div(int rate, u32 *dds)
                mul = (1 << 24) * 2 / 5;
        }
 
-       /* Check case 3 only If the divisor is big enough */
+       /* Check case 3 only if the divisor is big enough */
        if (fref / rate >= 80) {
                u64 fssp;
                u32 m;
 
                /* Calculate initial quot */
-               q1 = DIV_ROUND_CLOSEST(fref, rate);
+               q1 = DIV_ROUND_UP(fref, rate);
                m = (1 << 24) / q1;
 
                /* Get the remainder */
@@ -806,7 +847,7 @@ static unsigned int quark_x1000_get_clk_div(int rate, u32 *dds)
 
 static unsigned int ssp_get_clk_div(struct driver_data *drv_data, int rate)
 {
-       unsigned long ssp_clk = drv_data->max_clk_rate;
+       unsigned long ssp_clk = drv_data->master->max_speed_hz;
        const struct ssp_device *ssp = drv_data->ssp;
 
        rate = min_t(int, ssp_clk, rate);
@@ -818,8 +859,9 @@ static unsigned int ssp_get_clk_div(struct driver_data *drv_data, int rate)
 }
 
 static unsigned int pxa2xx_ssp_get_clk_div(struct driver_data *drv_data,
-                                          struct chip_data *chip, int rate)
+                                          int rate)
 {
+       struct chip_data *chip = drv_data->cur_chip;
        unsigned int clk_div;
 
        switch (drv_data->ssp_type) {
@@ -922,52 +964,55 @@ static void pump_transfers(unsigned long data)
        drv_data->read = drv_data->rx ? chip->read : null_reader;
 
        /* Change speed and bit per word on a per transfer */
-       cr0 = chip->cr0;
-       if (transfer->speed_hz || transfer->bits_per_word) {
-
-               bits = chip->bits_per_word;
-               speed = chip->speed_hz;
-
-               if (transfer->speed_hz)
-                       speed = transfer->speed_hz;
-
-               if (transfer->bits_per_word)
-                       bits = transfer->bits_per_word;
-
-               clk_div = pxa2xx_ssp_get_clk_div(drv_data, chip, speed);
-
-               if (bits <= 8) {
-                       drv_data->n_bytes = 1;
-                       drv_data->read = drv_data->read != null_reader ?
-                                               u8_reader : null_reader;
-                       drv_data->write = drv_data->write != null_writer ?
-                                               u8_writer : null_writer;
-               } else if (bits <= 16) {
-                       drv_data->n_bytes = 2;
-                       drv_data->read = drv_data->read != null_reader ?
-                                               u16_reader : null_reader;
-                       drv_data->write = drv_data->write != null_writer ?
-                                               u16_writer : null_writer;
-               } else if (bits <= 32) {
-                       drv_data->n_bytes = 4;
-                       drv_data->read = drv_data->read != null_reader ?
-                                               u32_reader : null_reader;
-                       drv_data->write = drv_data->write != null_writer ?
-                                               u32_writer : null_writer;
-               }
-               /* if bits/word is changed in dma mode, then must check the
-                * thresholds and burst also */
-               if (chip->enable_dma) {
-                       if (pxa2xx_spi_set_dma_burst_and_threshold(chip,
-                                                       message->spi,
-                                                       bits, &dma_burst,
-                                                       &dma_thresh))
-                               dev_warn_ratelimited(&message->spi->dev,
-                                                    "pump_transfers: DMA burst size reduced to match bits_per_word\n");
-               }
-
-               cr0 = pxa2xx_configure_sscr0(drv_data, clk_div, bits);
+       bits = transfer->bits_per_word;
+       speed = transfer->speed_hz;
+
+       clk_div = pxa2xx_ssp_get_clk_div(drv_data, speed);
+
+       if (bits <= 8) {
+               drv_data->n_bytes = 1;
+               drv_data->read = drv_data->read != null_reader ?
+                                       u8_reader : null_reader;
+               drv_data->write = drv_data->write != null_writer ?
+                                       u8_writer : null_writer;
+       } else if (bits <= 16) {
+               drv_data->n_bytes = 2;
+               drv_data->read = drv_data->read != null_reader ?
+                                       u16_reader : null_reader;
+               drv_data->write = drv_data->write != null_writer ?
+                                       u16_writer : null_writer;
+       } else if (bits <= 32) {
+               drv_data->n_bytes = 4;
+               drv_data->read = drv_data->read != null_reader ?
+                                       u32_reader : null_reader;
+               drv_data->write = drv_data->write != null_writer ?
+                                       u32_writer : null_writer;
        }
+       /*
+        * if bits/word is changed in dma mode, then must check the
+        * thresholds and burst also
+        */
+       if (chip->enable_dma) {
+               if (pxa2xx_spi_set_dma_burst_and_threshold(chip,
+                                               message->spi,
+                                               bits, &dma_burst,
+                                               &dma_thresh))
+                       dev_warn_ratelimited(&message->spi->dev,
+                                            "pump_transfers: DMA burst size reduced to match bits_per_word\n");
+       }
+
+       /* NOTE:  PXA25x_SSP _could_ use external clocking ... */
+       cr0 = pxa2xx_configure_sscr0(drv_data, clk_div, bits);
+       if (!pxa25x_ssp_comp(drv_data))
+               dev_dbg(&message->spi->dev, "%u Hz actual, %s\n",
+                       drv_data->master->max_speed_hz
+                               / (1 + ((cr0 & SSCR0_SCR(0xfff)) >> 8)),
+                       chip->enable_dma ? "DMA" : "PIO");
+       else
+               dev_dbg(&message->spi->dev, "%u Hz actual, %s\n",
+                       drv_data->master->max_speed_hz / 2
+                               / (1 + ((cr0 & SSCR0_SCR(0x0ff)) >> 8)),
+                       chip->enable_dma ? "DMA" : "PIO");
 
        message->state = RUNNING_STATE;
 
@@ -1111,7 +1156,6 @@ static int setup(struct spi_device *spi)
        struct chip_data *chip;
        const struct lpss_config *config;
        struct driver_data *drv_data = spi_master_get_devdata(spi->master);
-       unsigned int clk_div;
        uint tx_thres, tx_hi_thres, rx_thres;
 
        switch (drv_data->ssp_type) {
@@ -1123,6 +1167,7 @@ static int setup(struct spi_device *spi)
        case LPSS_LPT_SSP:
        case LPSS_BYT_SSP:
        case LPSS_SPT_SSP:
+       case LPSS_BXT_SSP:
                config = lpss_get_config(drv_data);
                tx_thres = config->tx_threshold_lo;
                tx_hi_thres = config->tx_threshold_hi;
@@ -1203,11 +1248,6 @@ static int setup(struct spi_device *spi)
                }
        }
 
-       clk_div = pxa2xx_ssp_get_clk_div(drv_data, chip, spi->max_speed_hz);
-       chip->speed_hz = spi->max_speed_hz;
-
-       chip->cr0 = pxa2xx_configure_sscr0(drv_data, clk_div,
-                                          spi->bits_per_word);
        switch (drv_data->ssp_type) {
        case QUARK_X1000_SSP:
                chip->threshold = (QUARK_X1000_SSCR1_RxTresh(rx_thres)
@@ -1228,18 +1268,6 @@ static int setup(struct spi_device *spi)
        if (spi->mode & SPI_LOOP)
                chip->cr1 |= SSCR1_LBM;
 
-       /* NOTE:  PXA25x_SSP _could_ use external clocking ... */
-       if (!pxa25x_ssp_comp(drv_data))
-               dev_dbg(&spi->dev, "%ld Hz actual, %s\n",
-                       drv_data->max_clk_rate
-                               / (1 + ((chip->cr0 & SSCR0_SCR(0xfff)) >> 8)),
-                       chip->enable_dma ? "DMA" : "PIO");
-       else
-               dev_dbg(&spi->dev, "%ld Hz actual, %s\n",
-                       drv_data->max_clk_rate / 2
-                               / (1 + ((chip->cr0 & SSCR0_SCR(0x0ff)) >> 8)),
-                       chip->enable_dma ? "DMA" : "PIO");
-
        if (spi->bits_per_word <= 8) {
                chip->n_bytes = 1;
                chip->read = u8_reader;
@@ -1249,13 +1277,10 @@ static int setup(struct spi_device *spi)
                chip->read = u16_reader;
                chip->write = u16_writer;
        } else if (spi->bits_per_word <= 32) {
-               if (!is_quark_x1000_ssp(drv_data))
-                       chip->cr0 |= SSCR0_EDSS;
                chip->n_bytes = 4;
                chip->read = u32_reader;
                chip->write = u32_writer;
        }
-       chip->bits_per_word = spi->bits_per_word;
 
        spi_set_ctldata(spi, chip);
 
@@ -1279,6 +1304,7 @@ static void cleanup(struct spi_device *spi)
        kfree(chip);
 }
 
+#ifdef CONFIG_PCI
 #ifdef CONFIG_ACPI
 
 static const struct acpi_device_id pxa2xx_spi_acpi_match[] = {
@@ -1292,6 +1318,23 @@ static const struct acpi_device_id pxa2xx_spi_acpi_match[] = {
 };
 MODULE_DEVICE_TABLE(acpi, pxa2xx_spi_acpi_match);
 
+static int pxa2xx_spi_get_port_id(struct acpi_device *adev)
+{
+       unsigned int devid;
+       int port_id = -1;
+
+       if (adev && adev->pnp.unique_id &&
+           !kstrtouint(adev->pnp.unique_id, 0, &devid))
+               port_id = devid;
+       return port_id;
+}
+#else /* !CONFIG_ACPI */
+static int pxa2xx_spi_get_port_id(struct acpi_device *adev)
+{
+       return -1;
+}
+#endif
+
 /*
  * PCI IDs of compound devices that integrate both host controller and private
  * integrated DMA engine. Please note these are not used in module
@@ -1304,6 +1347,14 @@ static const struct pci_device_id pxa2xx_spi_pci_compound_match[] = {
        /* SPT-H */
        { PCI_VDEVICE(INTEL, 0xa129), LPSS_SPT_SSP },
        { PCI_VDEVICE(INTEL, 0xa12a), LPSS_SPT_SSP },
+       /* BXT */
+       { PCI_VDEVICE(INTEL, 0x0ac2), LPSS_BXT_SSP },
+       { PCI_VDEVICE(INTEL, 0x0ac4), LPSS_BXT_SSP },
+       { PCI_VDEVICE(INTEL, 0x0ac6), LPSS_BXT_SSP },
+       /* APL */
+       { PCI_VDEVICE(INTEL, 0x5ac2), LPSS_BXT_SSP },
+       { PCI_VDEVICE(INTEL, 0x5ac4), LPSS_BXT_SSP },
+       { PCI_VDEVICE(INTEL, 0x5ac6), LPSS_BXT_SSP },
        { },
 };
 
@@ -1318,7 +1369,7 @@ static bool pxa2xx_spi_idma_filter(struct dma_chan *chan, void *param)
 }
 
 static struct pxa2xx_spi_master *
-pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev)
+pxa2xx_spi_init_pdata(struct platform_device *pdev)
 {
        struct pxa2xx_spi_master *pdata;
        struct acpi_device *adev;
@@ -1326,18 +1377,18 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev)
        struct resource *res;
        const struct acpi_device_id *adev_id = NULL;
        const struct pci_device_id *pcidev_id = NULL;
-       int devid, type;
+       int type;
 
-       if (!ACPI_HANDLE(&pdev->dev) ||
-           acpi_bus_get_device(ACPI_HANDLE(&pdev->dev), &adev))
-               return NULL;
+       adev = ACPI_COMPANION(&pdev->dev);
 
        if (dev_is_pci(pdev->dev.parent))
                pcidev_id = pci_match_id(pxa2xx_spi_pci_compound_match,
                                         to_pci_dev(pdev->dev.parent));
-       else
+       else if (adev)
                adev_id = acpi_match_device(pdev->dev.driver->acpi_match_table,
                                            &pdev->dev);
+       else
+               return NULL;
 
        if (adev_id)
                type = (int)adev_id->driver_data;
@@ -1371,10 +1422,7 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev)
        ssp->irq = platform_get_irq(pdev, 0);
        ssp->type = type;
        ssp->pdev = pdev;
-
-       ssp->port_id = -1;
-       if (adev->pnp.unique_id && !kstrtoint(adev->pnp.unique_id, 0, &devid))
-               ssp->port_id = devid;
+       ssp->port_id = pxa2xx_spi_get_port_id(adev);
 
        pdata->num_chipselect = 1;
        pdata->enable_dma = true;
@@ -1382,9 +1430,9 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev)
        return pdata;
 }
 
-#else
+#else /* !CONFIG_PCI */
 static inline struct pxa2xx_spi_master *
-pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev)
+pxa2xx_spi_init_pdata(struct platform_device *pdev)
 {
        return NULL;
 }
@@ -1397,12 +1445,13 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
        struct spi_master *master;
        struct driver_data *drv_data;
        struct ssp_device *ssp;
+       const struct lpss_config *config;
        int status;
        u32 tmp;
 
        platform_info = dev_get_platdata(dev);
        if (!platform_info) {
-               platform_info = pxa2xx_spi_acpi_get_pdata(pdev);
+               platform_info = pxa2xx_spi_init_pdata(pdev);
                if (!platform_info) {
                        dev_err(&pdev->dev, "missing platform data\n");
                        return -ENODEV;
@@ -1436,7 +1485,6 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
        master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LOOP;
 
        master->bus_num = ssp->port_id;
-       master->num_chipselect = platform_info->num_chipselect;
        master->dma_alignment = DMA_ALIGNMENT;
        master->cleanup = cleanup;
        master->setup = setup;
@@ -1489,7 +1537,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
        /* Enable SOC clock */
        clk_prepare_enable(ssp->clk);
 
-       drv_data->max_clk_rate = clk_get_rate(ssp->clk);
+       master->max_speed_hz = clk_get_rate(ssp->clk);
 
        /* Load default SSP configuration */
        pxa2xx_spi_write(drv_data, SSCR0, 0);
@@ -1522,6 +1570,19 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
        if (is_lpss_ssp(drv_data))
                lpss_ssp_setup(drv_data);
 
+       if (is_lpss_ssp(drv_data)) {
+               lpss_ssp_setup(drv_data);
+               config = lpss_get_config(drv_data);
+               if (config->reg_capabilities >= 0) {
+                       tmp = __lpss_ssp_read_priv(drv_data,
+                                                  config->reg_capabilities);
+                       tmp &= LPSS_CAPS_CS_EN_MASK;
+                       tmp >>= LPSS_CAPS_CS_EN_SHIFT;
+                       platform_info->num_chipselect = ffz(tmp);
+               }
+       }
+       master->num_chipselect = platform_info->num_chipselect;
+
        tasklet_init(&drv_data->pump_transfers, pump_transfers,
                     (unsigned long)drv_data);
 
@@ -1614,8 +1675,6 @@ static int pxa2xx_spi_resume(struct device *dev)
        struct ssp_device *ssp = drv_data->ssp;
        int status = 0;
 
-       pxa2xx_spi_dma_resume(drv_data);
-
        /* Enable the SSP clock */
        if (!pm_runtime_suspended(dev))
                clk_prepare_enable(ssp->clk);
index 0a9b6390a817f60467b03f9e3fa589cc5bddf79f..58efa98313aa0bf5c2aca5d8458032fac566a0eb 100644 (file)
@@ -46,9 +46,6 @@ struct driver_data {
        u32 clear_sr;
        u32 mask_sr;
 
-       /* Maximun clock rate */
-       unsigned long max_clk_rate;
-
        /* Message Transfer pump */
        struct tasklet_struct pump_transfers;
 
@@ -86,10 +83,8 @@ struct driver_data {
 };
 
 struct chip_data {
-       u32 cr0;
        u32 cr1;
        u32 dds_rate;
-       u32 psp;
        u32 timeout;
        u8 n_bytes;
        u32 dma_burst_size;
@@ -98,8 +93,6 @@ struct chip_data {
        u16 lpss_rx_threshold;
        u16 lpss_tx_threshold;
        u8 enable_dma;
-       u8 bits_per_word;
-       u32 speed_hz;
        union {
                int gpio_cs;
                unsigned int frm;
@@ -175,7 +168,6 @@ extern int pxa2xx_spi_dma_prepare(struct driver_data *drv_data, u32 dma_burst);
 extern void pxa2xx_spi_dma_start(struct driver_data *drv_data);
 extern int pxa2xx_spi_dma_setup(struct driver_data *drv_data);
 extern void pxa2xx_spi_dma_release(struct driver_data *drv_data);
-extern void pxa2xx_spi_dma_resume(struct driver_data *drv_data);
 extern int pxa2xx_spi_set_dma_burst_and_threshold(struct chip_data *chip,
                                                  struct spi_device *spi,
                                                  u8 bits_per_word,
@@ -196,7 +188,6 @@ static inline int pxa2xx_spi_dma_setup(struct driver_data *drv_data)
        return 0;
 }
 static inline void pxa2xx_spi_dma_release(struct driver_data *drv_data) {}
-static inline void pxa2xx_spi_dma_resume(struct driver_data *drv_data) {}
 static inline int pxa2xx_spi_set_dma_burst_and_threshold(struct chip_data *chip,
                                                         struct spi_device *spi,
                                                         u8 bits_per_word,
index f36bc320a80799067e6402feeb2ebb64c4f58169..4e7d1bfed7e6b6eaa1cfbf5409232c63c4bdceac 100644 (file)
@@ -198,12 +198,12 @@ static int s3c24xx_spi_setup(struct spi_device *spi)
        if (ret)
                return ret;
 
-       spin_lock(&hw->bitbang.lock);
+       mutex_lock(&hw->bitbang.lock);
        if (!hw->bitbang.busy) {
                hw->bitbang.chipselect(spi, BITBANG_CS_INACTIVE);
                /* need to ndelay for 0.5 clocktick ? */
        }
-       spin_unlock(&hw->bitbang.lock);
+       mutex_unlock(&hw->bitbang.lock);
 
        return 0;
 }
index cd1cfac0447f98343917c31c83564ab1d6cf21b0..8e86e7f6663a1e8409397984dd5b25fab19913b9 100644 (file)
@@ -32,6 +32,7 @@
 #define MAX_SPI_PORTS          6
 #define S3C64XX_SPI_QUIRK_POLL         (1 << 0)
 #define S3C64XX_SPI_QUIRK_CS_AUTO      (1 << 1)
+#define AUTOSUSPEND_TIMEOUT    2000
 
 /* Registers and bit-fields */
 
@@ -682,7 +683,7 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 
        /* Only BPW and Speed may change across transfers */
        bpw = xfer->bits_per_word;
-       speed = xfer->speed_hz ? : spi->max_speed_hz;
+       speed = xfer->speed_hz;
 
        if (bpw != sdd->cur_bpw || speed != sdd->cur_speed) {
                sdd->cur_bpw = bpw;
@@ -859,13 +860,15 @@ static int s3c64xx_spi_setup(struct spi_device *spi)
                }
        }
 
-       pm_runtime_put(&sdd->pdev->dev);
+       pm_runtime_mark_last_busy(&sdd->pdev->dev);
+       pm_runtime_put_autosuspend(&sdd->pdev->dev);
        if (!(sdd->port_conf->quirks & S3C64XX_SPI_QUIRK_CS_AUTO))
                writel(S3C64XX_SPI_SLAVE_SIG_INACT, sdd->regs + S3C64XX_SPI_SLAVE_SEL);
        return 0;
 
 setup_exit:
-       pm_runtime_put(&sdd->pdev->dev);
+       pm_runtime_mark_last_busy(&sdd->pdev->dev);
+       pm_runtime_put_autosuspend(&sdd->pdev->dev);
        /* setup() returns with device de-selected */
        if (!(sdd->port_conf->quirks & S3C64XX_SPI_QUIRK_CS_AUTO))
                writel(S3C64XX_SPI_SLAVE_SIG_INACT, sdd->regs + S3C64XX_SPI_SLAVE_SEL);
@@ -1162,6 +1165,12 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
                goto err2;
        }
 
+       pm_runtime_set_autosuspend_delay(&pdev->dev, AUTOSUSPEND_TIMEOUT);
+       pm_runtime_use_autosuspend(&pdev->dev);
+       pm_runtime_set_active(&pdev->dev);
+       pm_runtime_enable(&pdev->dev);
+       pm_runtime_get_sync(&pdev->dev);
+
        /* Setup Deufult Mode */
        s3c64xx_spi_hwinit(sdd, sdd->port_id);
 
@@ -1180,9 +1189,6 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
               S3C64XX_SPI_INT_TX_OVERRUN_EN | S3C64XX_SPI_INT_TX_UNDERRUN_EN,
               sdd->regs + S3C64XX_SPI_INT_EN);
 
-       pm_runtime_set_active(&pdev->dev);
-       pm_runtime_enable(&pdev->dev);
-
        ret = devm_spi_register_master(&pdev->dev, master);
        if (ret != 0) {
                dev_err(&pdev->dev, "cannot register SPI master: %d\n", ret);
@@ -1195,9 +1201,16 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
                                        mem_res, (FIFO_LVL_MASK(sdd) >> 1) + 1,
                                        sdd->rx_dma.dmach, sdd->tx_dma.dmach);
 
+       pm_runtime_mark_last_busy(&pdev->dev);
+       pm_runtime_put_autosuspend(&pdev->dev);
+
        return 0;
 
 err3:
+       pm_runtime_put_noidle(&pdev->dev);
+       pm_runtime_disable(&pdev->dev);
+       pm_runtime_set_suspended(&pdev->dev);
+
        clk_disable_unprepare(sdd->src_clk);
 err2:
        clk_disable_unprepare(sdd->clk);
@@ -1212,7 +1225,7 @@ static int s3c64xx_spi_remove(struct platform_device *pdev)
        struct spi_master *master = spi_master_get(platform_get_drvdata(pdev));
        struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
 
-       pm_runtime_disable(&pdev->dev);
+       pm_runtime_get_sync(&pdev->dev);
 
        writel(0, sdd->regs + S3C64XX_SPI_INT_EN);
 
@@ -1220,6 +1233,10 @@ static int s3c64xx_spi_remove(struct platform_device *pdev)
 
        clk_disable_unprepare(sdd->clk);
 
+       pm_runtime_put_noidle(&pdev->dev);
+       pm_runtime_disable(&pdev->dev);
+       pm_runtime_set_suspended(&pdev->dev);
+
        return 0;
 }
 
@@ -1233,10 +1250,9 @@ static int s3c64xx_spi_suspend(struct device *dev)
        if (ret)
                return ret;
 
-       if (!pm_runtime_suspended(dev)) {
-               clk_disable_unprepare(sdd->clk);
-               clk_disable_unprepare(sdd->src_clk);
-       }
+       ret = pm_runtime_force_suspend(dev);
+       if (ret < 0)
+               return ret;
 
        sdd->cur_speed = 0; /* Output Clock is stopped */
 
@@ -1248,14 +1264,14 @@ static int s3c64xx_spi_resume(struct device *dev)
        struct spi_master *master = dev_get_drvdata(dev);
        struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
        struct s3c64xx_spi_info *sci = sdd->cntrlr_info;
+       int ret;
 
        if (sci->cfg_gpio)
                sci->cfg_gpio();
 
-       if (!pm_runtime_suspended(dev)) {
-               clk_prepare_enable(sdd->src_clk);
-               clk_prepare_enable(sdd->clk);
-       }
+       ret = pm_runtime_force_resume(dev);
+       if (ret < 0)
+               return ret;
 
        s3c64xx_spi_hwinit(sdd, sdd->port_id);
 
index aa6d284131e0fd99fd19ef92dc0adff73ee18a02..64318fcfacf275c989ebe19d157eb8ff9e523ebf 100644 (file)
@@ -39,8 +39,6 @@ struct ti_qspi_regs {
 };
 
 struct ti_qspi {
-       struct completion       transfer_complete;
-
        /* list synchronization */
        struct mutex            list_lock;
 
@@ -62,10 +60,6 @@ struct ti_qspi {
 
 #define QSPI_PID                       (0x0)
 #define QSPI_SYSCONFIG                 (0x10)
-#define QSPI_INTR_STATUS_RAW_SET       (0x20)
-#define QSPI_INTR_STATUS_ENABLED_CLEAR (0x24)
-#define QSPI_INTR_ENABLE_SET_REG       (0x28)
-#define QSPI_INTR_ENABLE_CLEAR_REG     (0x2c)
 #define QSPI_SPI_CLOCK_CNTRL_REG       (0x40)
 #define QSPI_SPI_DC_REG                        (0x44)
 #define QSPI_SPI_CMD_REG               (0x48)
@@ -97,7 +91,6 @@ struct ti_qspi {
 #define QSPI_RD_DUAL                   (3 << 16)
 #define QSPI_RD_QUAD                   (7 << 16)
 #define QSPI_INVAL                     (4 << 16)
-#define QSPI_WC_CMD_INT_EN                     (1 << 14)
 #define QSPI_FLEN(n)                   ((n - 1) << 0)
 #define QSPI_WLEN_MAX_BITS             128
 #define QSPI_WLEN_MAX_BYTES            16
@@ -106,10 +99,6 @@ struct ti_qspi {
 #define BUSY                           0x01
 #define WC                             0x02
 
-/* INTERRUPT REGISTER */
-#define QSPI_WC_INT_EN                         (1 << 1)
-#define QSPI_WC_INT_DISABLE                    (1 << 1)
-
 /* Device Control */
 #define QSPI_DD(m, n)                  (m << (3 + n * 8))
 #define QSPI_CKPHA(n)                  (1 << (2 + n * 8))
@@ -217,6 +206,24 @@ static inline u32 qspi_is_busy(struct ti_qspi *qspi)
        return stat & BUSY;
 }
 
+static inline int ti_qspi_poll_wc(struct ti_qspi *qspi)
+{
+       u32 stat;
+       unsigned long timeout = jiffies + QSPI_COMPLETION_TIMEOUT;
+
+       do {
+               stat = ti_qspi_read(qspi, QSPI_SPI_STATUS_REG);
+               if (stat & WC)
+                       return 0;
+               cpu_relax();
+       } while (time_after(timeout, jiffies));
+
+       stat = ti_qspi_read(qspi, QSPI_SPI_STATUS_REG);
+       if (stat & WC)
+               return 0;
+       return  -ETIMEDOUT;
+}
+
 static int qspi_write_msg(struct ti_qspi *qspi, struct spi_transfer *t)
 {
        int wlen, count, xfer_len;
@@ -275,8 +282,7 @@ static int qspi_write_msg(struct ti_qspi *qspi, struct spi_transfer *t)
                }
 
                ti_qspi_write(qspi, cmd, QSPI_SPI_CMD_REG);
-               if (!wait_for_completion_timeout(&qspi->transfer_complete,
-                                                QSPI_COMPLETION_TIMEOUT)) {
+               if (ti_qspi_poll_wc(qspi)) {
                        dev_err(qspi->dev, "write timed out\n");
                        return -ETIMEDOUT;
                }
@@ -315,8 +321,7 @@ static int qspi_read_msg(struct ti_qspi *qspi, struct spi_transfer *t)
                        return -EBUSY;
 
                ti_qspi_write(qspi, cmd, QSPI_SPI_CMD_REG);
-               if (!wait_for_completion_timeout(&qspi->transfer_complete,
-                                                QSPI_COMPLETION_TIMEOUT)) {
+               if (ti_qspi_poll_wc(qspi)) {
                        dev_err(qspi->dev, "read timed out\n");
                        return -ETIMEDOUT;
                }
@@ -388,9 +393,7 @@ static int ti_qspi_start_transfer_one(struct spi_master *master,
        qspi->cmd = 0;
        qspi->cmd |= QSPI_EN_CS(spi->chip_select);
        qspi->cmd |= QSPI_FLEN(frame_length);
-       qspi->cmd |= QSPI_WC_CMD_INT_EN;
 
-       ti_qspi_write(qspi, QSPI_WC_INT_EN, QSPI_INTR_ENABLE_SET_REG);
        ti_qspi_write(qspi, qspi->dc, QSPI_SPI_DC_REG);
 
        mutex_lock(&qspi->list_lock);
@@ -410,39 +413,13 @@ static int ti_qspi_start_transfer_one(struct spi_master *master,
 
        mutex_unlock(&qspi->list_lock);
 
+       ti_qspi_write(qspi, qspi->cmd | QSPI_INVAL, QSPI_SPI_CMD_REG);
        m->status = status;
        spi_finalize_current_message(master);
 
-       ti_qspi_write(qspi, qspi->cmd | QSPI_INVAL, QSPI_SPI_CMD_REG);
-
        return status;
 }
 
-static irqreturn_t ti_qspi_isr(int irq, void *dev_id)
-{
-       struct ti_qspi *qspi = dev_id;
-       u16 int_stat;
-       u32 stat;
-
-       irqreturn_t ret = IRQ_HANDLED;
-
-       int_stat = ti_qspi_read(qspi, QSPI_INTR_STATUS_ENABLED_CLEAR);
-       stat = ti_qspi_read(qspi, QSPI_SPI_STATUS_REG);
-
-       if (!int_stat) {
-               dev_dbg(qspi->dev, "No IRQ triggered\n");
-               ret = IRQ_NONE;
-               goto out;
-       }
-
-       ti_qspi_write(qspi, QSPI_WC_INT_DISABLE,
-                               QSPI_INTR_STATUS_ENABLED_CLEAR);
-       if (stat & WC)
-               complete(&qspi->transfer_complete);
-out:
-       return ret;
-}
-
 static int ti_qspi_runtime_resume(struct device *dev)
 {
        struct ti_qspi      *qspi;
@@ -551,22 +528,12 @@ static int ti_qspi_probe(struct platform_device *pdev)
                }
        }
 
-       ret = devm_request_irq(&pdev->dev, irq, ti_qspi_isr, 0,
-                       dev_name(&pdev->dev), qspi);
-       if (ret < 0) {
-               dev_err(&pdev->dev, "Failed to register ISR for IRQ %d\n",
-                               irq);
-               goto free_master;
-       }
-
        qspi->fclk = devm_clk_get(&pdev->dev, "fck");
        if (IS_ERR(qspi->fclk)) {
                ret = PTR_ERR(qspi->fclk);
                dev_err(&pdev->dev, "could not get clk: %d\n", ret);
        }
 
-       init_completion(&qspi->transfer_complete);
-
        pm_runtime_use_autosuspend(&pdev->dev);
        pm_runtime_set_autosuspend_delay(&pdev->dev, QSPI_AUTOSUSPEND_TIMEOUT);
        pm_runtime_enable(&pdev->dev);
@@ -587,18 +554,7 @@ free_master:
 
 static int ti_qspi_remove(struct platform_device *pdev)
 {
-       struct ti_qspi *qspi = platform_get_drvdata(pdev);
-       int ret;
-
-       ret = pm_runtime_get_sync(qspi->dev);
-       if (ret < 0) {
-               dev_err(qspi->dev, "pm_runtime_get_sync() failed\n");
-               return ret;
-       }
-
-       ti_qspi_write(qspi, QSPI_WC_INT_DISABLE, QSPI_INTR_ENABLE_CLEAR_REG);
-
-       pm_runtime_put(qspi->dev);
+       pm_runtime_put_sync(&pdev->dev);
        pm_runtime_disable(&pdev->dev);
 
        return 0;
index daf5aa1c24c385d80d32a91531c06476564fec87..c6ae775289e59080fe11de62854ce95ea6536a8b 100644 (file)
@@ -307,7 +307,6 @@ static int tle62x0_remove(struct spi_device *spi)
 static struct spi_driver tle62x0_driver = {
        .driver = {
                .name   = "tle62x0",
-               .owner  = THIS_MODULE,
        },
        .probe          = tle62x0_probe,
        .remove         = tle62x0_remove,
index 9190124b6d9095c653b8f51ac92e915ade8c2e22..d69f8f8f3fa698d1eb34c744ea25e0058035ad82 100644 (file)
@@ -181,7 +181,7 @@ static void txx9spi_work_one(struct txx9spi *c, struct spi_message *m)
                u32 data;
                unsigned int len = t->len;
                unsigned int wsize;
-               u32 speed_hz = t->speed_hz ? : spi->max_speed_hz;
+               u32 speed_hz = t->speed_hz;
                u8 bits_per_word = t->bits_per_word;
 
                wsize = bits_per_word >> 3; /* in bytes */
index a339c1e9997a93a431cf5ce9be5947b6333ac3e9..3009121173cdbc9ad1a0537a4cf19a029ceb86b8 100644 (file)
@@ -270,6 +270,7 @@ static int xilinx_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t)
 
        while (remaining_words) {
                int n_words, tx_words, rx_words;
+               u32 sr;
 
                n_words = min(remaining_words, xspi->buffer_size);
 
@@ -284,24 +285,33 @@ static int xilinx_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t)
                if (use_irq) {
                        xspi->write_fn(cr, xspi->regs + XSPI_CR_OFFSET);
                        wait_for_completion(&xspi->done);
-               } else
-                       while (!(xspi->read_fn(xspi->regs + XSPI_SR_OFFSET) &
-                                               XSPI_SR_TX_EMPTY_MASK))
-                               ;
-
-               /* A transmit has just completed. Process received data and
-                * check for more data to transmit. Always inhibit the
-                * transmitter while the Isr refills the transmit register/FIFO,
-                * or make sure it is stopped if we're done.
-                */
-               if (use_irq)
+                       /* A transmit has just completed. Process received data
+                        * and check for more data to transmit. Always inhibit
+                        * the transmitter while the Isr refills the transmit
+                        * register/FIFO, or make sure it is stopped if we're
+                        * done.
+                        */
                        xspi->write_fn(cr | XSPI_CR_TRANS_INHIBIT,
-                              xspi->regs + XSPI_CR_OFFSET);
+                                      xspi->regs + XSPI_CR_OFFSET);
+                       sr = XSPI_SR_TX_EMPTY_MASK;
+               } else
+                       sr = xspi->read_fn(xspi->regs + XSPI_SR_OFFSET);
 
                /* Read out all the data from the Rx FIFO */
                rx_words = n_words;
-               while (rx_words--)
-                       xilinx_spi_rx(xspi);
+               while (rx_words) {
+                       if ((sr & XSPI_SR_TX_EMPTY_MASK) && (rx_words > 1)) {
+                               xilinx_spi_rx(xspi);
+                               rx_words--;
+                               continue;
+                       }
+
+                       sr = xspi->read_fn(xspi->regs + XSPI_SR_OFFSET);
+                       if (!(sr & XSPI_SR_RX_EMPTY_MASK)) {
+                               xilinx_spi_rx(xspi);
+                               rx_words--;
+                       }
+               }
 
                remaining_words -= n_words;
        }
index a5f53de813d337bc86fd36ed3b837d299ab11b99..e2415be209d5a77e9224add30db37d65244fabda 100644 (file)
@@ -123,6 +123,28 @@ SPI_STATISTICS_SHOW(bytes, "%llu");
 SPI_STATISTICS_SHOW(bytes_rx, "%llu");
 SPI_STATISTICS_SHOW(bytes_tx, "%llu");
 
+#define SPI_STATISTICS_TRANSFER_BYTES_HISTO(index, number)             \
+       SPI_STATISTICS_SHOW_NAME(transfer_bytes_histo##index,           \
+                                "transfer_bytes_histo_" number,        \
+                                transfer_bytes_histo[index],  "%lu")
+SPI_STATISTICS_TRANSFER_BYTES_HISTO(0,  "0-1");
+SPI_STATISTICS_TRANSFER_BYTES_HISTO(1,  "2-3");
+SPI_STATISTICS_TRANSFER_BYTES_HISTO(2,  "4-7");
+SPI_STATISTICS_TRANSFER_BYTES_HISTO(3,  "8-15");
+SPI_STATISTICS_TRANSFER_BYTES_HISTO(4,  "16-31");
+SPI_STATISTICS_TRANSFER_BYTES_HISTO(5,  "32-63");
+SPI_STATISTICS_TRANSFER_BYTES_HISTO(6,  "64-127");
+SPI_STATISTICS_TRANSFER_BYTES_HISTO(7,  "128-255");
+SPI_STATISTICS_TRANSFER_BYTES_HISTO(8,  "256-511");
+SPI_STATISTICS_TRANSFER_BYTES_HISTO(9,  "512-1023");
+SPI_STATISTICS_TRANSFER_BYTES_HISTO(10, "1024-2047");
+SPI_STATISTICS_TRANSFER_BYTES_HISTO(11, "2048-4095");
+SPI_STATISTICS_TRANSFER_BYTES_HISTO(12, "4096-8191");
+SPI_STATISTICS_TRANSFER_BYTES_HISTO(13, "8192-16383");
+SPI_STATISTICS_TRANSFER_BYTES_HISTO(14, "16384-32767");
+SPI_STATISTICS_TRANSFER_BYTES_HISTO(15, "32768-65535");
+SPI_STATISTICS_TRANSFER_BYTES_HISTO(16, "65536+");
+
 static struct attribute *spi_dev_attrs[] = {
        &dev_attr_modalias.attr,
        NULL,
@@ -143,6 +165,23 @@ static struct attribute *spi_device_statistics_attrs[] = {
        &dev_attr_spi_device_bytes.attr,
        &dev_attr_spi_device_bytes_rx.attr,
        &dev_attr_spi_device_bytes_tx.attr,
+       &dev_attr_spi_device_transfer_bytes_histo0.attr,
+       &dev_attr_spi_device_transfer_bytes_histo1.attr,
+       &dev_attr_spi_device_transfer_bytes_histo2.attr,
+       &dev_attr_spi_device_transfer_bytes_histo3.attr,
+       &dev_attr_spi_device_transfer_bytes_histo4.attr,
+       &dev_attr_spi_device_transfer_bytes_histo5.attr,
+       &dev_attr_spi_device_transfer_bytes_histo6.attr,
+       &dev_attr_spi_device_transfer_bytes_histo7.attr,
+       &dev_attr_spi_device_transfer_bytes_histo8.attr,
+       &dev_attr_spi_device_transfer_bytes_histo9.attr,
+       &dev_attr_spi_device_transfer_bytes_histo10.attr,
+       &dev_attr_spi_device_transfer_bytes_histo11.attr,
+       &dev_attr_spi_device_transfer_bytes_histo12.attr,
+       &dev_attr_spi_device_transfer_bytes_histo13.attr,
+       &dev_attr_spi_device_transfer_bytes_histo14.attr,
+       &dev_attr_spi_device_transfer_bytes_histo15.attr,
+       &dev_attr_spi_device_transfer_bytes_histo16.attr,
        NULL,
 };
 
@@ -168,6 +207,23 @@ static struct attribute *spi_master_statistics_attrs[] = {
        &dev_attr_spi_master_bytes.attr,
        &dev_attr_spi_master_bytes_rx.attr,
        &dev_attr_spi_master_bytes_tx.attr,
+       &dev_attr_spi_master_transfer_bytes_histo0.attr,
+       &dev_attr_spi_master_transfer_bytes_histo1.attr,
+       &dev_attr_spi_master_transfer_bytes_histo2.attr,
+       &dev_attr_spi_master_transfer_bytes_histo3.attr,
+       &dev_attr_spi_master_transfer_bytes_histo4.attr,
+       &dev_attr_spi_master_transfer_bytes_histo5.attr,
+       &dev_attr_spi_master_transfer_bytes_histo6.attr,
+       &dev_attr_spi_master_transfer_bytes_histo7.attr,
+       &dev_attr_spi_master_transfer_bytes_histo8.attr,
+       &dev_attr_spi_master_transfer_bytes_histo9.attr,
+       &dev_attr_spi_master_transfer_bytes_histo10.attr,
+       &dev_attr_spi_master_transfer_bytes_histo11.attr,
+       &dev_attr_spi_master_transfer_bytes_histo12.attr,
+       &dev_attr_spi_master_transfer_bytes_histo13.attr,
+       &dev_attr_spi_master_transfer_bytes_histo14.attr,
+       &dev_attr_spi_master_transfer_bytes_histo15.attr,
+       &dev_attr_spi_master_transfer_bytes_histo16.attr,
        NULL,
 };
 
@@ -186,10 +242,15 @@ void spi_statistics_add_transfer_stats(struct spi_statistics *stats,
                                       struct spi_master *master)
 {
        unsigned long flags;
+       int l2len = min(fls(xfer->len), SPI_STATISTICS_HISTO_SIZE) - 1;
+
+       if (l2len < 0)
+               l2len = 0;
 
        spin_lock_irqsave(&stats->lock, flags);
 
        stats->transfers++;
+       stats->transfer_bytes_histo[l2len]++;
 
        stats->bytes += xfer->len;
        if ((xfer->tx_buf) &&
@@ -270,15 +331,24 @@ EXPORT_SYMBOL_GPL(spi_bus_type);
 static int spi_drv_probe(struct device *dev)
 {
        const struct spi_driver         *sdrv = to_spi_driver(dev->driver);
+       struct spi_device               *spi = to_spi_device(dev);
        int ret;
 
        ret = of_clk_set_defaults(dev->of_node, false);
        if (ret)
                return ret;
 
+       if (dev->of_node) {
+               spi->irq = of_irq_get(dev->of_node, 0);
+               if (spi->irq == -EPROBE_DEFER)
+                       return -EPROBE_DEFER;
+               if (spi->irq < 0)
+                       spi->irq = 0;
+       }
+
        ret = dev_pm_domain_attach(dev, true);
        if (ret != -EPROBE_DEFER) {
-               ret = sdrv->probe(to_spi_device(dev));
+               ret = sdrv->probe(spi);
                if (ret)
                        dev_pm_domain_detach(dev, true);
        }
@@ -305,12 +375,15 @@ static void spi_drv_shutdown(struct device *dev)
 }
 
 /**
- * spi_register_driver - register a SPI driver
+ * __spi_register_driver - register a SPI driver
  * @sdrv: the driver to register
  * Context: can sleep
+ *
+ * Return: zero on success, else a negative error code.
  */
-int spi_register_driver(struct spi_driver *sdrv)
+int __spi_register_driver(struct module *owner, struct spi_driver *sdrv)
 {
+       sdrv->driver.owner = owner;
        sdrv->driver.bus = &spi_bus_type;
        if (sdrv->probe)
                sdrv->driver.probe = spi_drv_probe;
@@ -320,7 +393,7 @@ int spi_register_driver(struct spi_driver *sdrv)
                sdrv->driver.shutdown = spi_drv_shutdown;
        return driver_register(&sdrv->driver);
 }
-EXPORT_SYMBOL_GPL(spi_register_driver);
+EXPORT_SYMBOL_GPL(__spi_register_driver);
 
 /*-------------------------------------------------------------------------*/
 
@@ -359,7 +432,7 @@ static DEFINE_MUTEX(board_lock);
  * needs to discard the spi_device without adding it, then it should
  * call spi_dev_put() on it.
  *
- * Returns a pointer to the new device, or NULL.
+ * Return: a pointer to the new device, or NULL.
  */
 struct spi_device *spi_alloc_device(struct spi_master *master)
 {
@@ -418,7 +491,7 @@ static int spi_dev_check(struct device *dev, void *data)
  * Companion function to spi_alloc_device.  Devices allocated with
  * spi_alloc_device can be added onto the spi bus with this function.
  *
- * Returns 0 on success; negative errno on failure
+ * Return: 0 on success; negative errno on failure
  */
 int spi_add_device(struct spi_device *spi)
 {
@@ -491,7 +564,7 @@ EXPORT_SYMBOL_GPL(spi_add_device);
  * this is exported so that for example a USB or parport based adapter
  * driver could add devices (which it would learn about out-of-band).
  *
- * Returns the new device, or NULL.
+ * Return: the new device, or NULL.
  */
 struct spi_device *spi_new_device(struct spi_master *master,
                                  struct spi_board_info *chip)
@@ -563,6 +636,8 @@ static void spi_match_master_to_boardinfo(struct spi_master *master,
  *
  * The board info passed can safely be __initdata ... but be careful of
  * any embedded pointers (platform_data, etc), they're copied as-is.
+ *
+ * Return: zero on success, else a negative error code.
  */
 int spi_register_board_info(struct spi_board_info const *info, unsigned n)
 {
@@ -597,7 +672,7 @@ static void spi_set_cs(struct spi_device *spi, bool enable)
        if (spi->mode & SPI_CS_HIGH)
                enable = !enable;
 
-       if (spi->cs_gpio >= 0)
+       if (gpio_is_valid(spi->cs_gpio))
                gpio_set_value(spi->cs_gpio, !enable);
        else if (spi->master->set_cs)
                spi->master->set_cs(spi, !enable);
@@ -1140,6 +1215,8 @@ static int spi_init_queue(struct spi_master *master)
  *
  * If there are more messages in the queue, the next message is returned from
  * this call.
+ *
+ * Return: the next message in the queue, else NULL if the queue is empty.
  */
 struct spi_message *spi_get_next_queued_message(struct spi_master *master)
 {
@@ -1303,6 +1380,8 @@ static int __spi_queued_transfer(struct spi_device *spi,
  * spi_queued_transfer - transfer function for queued transfers
  * @spi: spi device which is requesting transfer
  * @msg: spi message which is to handled is queued to driver queue
+ *
+ * Return: zero on success, else a negative error code.
  */
 static int spi_queued_transfer(struct spi_device *spi, struct spi_message *msg)
 {
@@ -1433,9 +1512,6 @@ of_register_spi_device(struct spi_master *master, struct device_node *nc)
        }
        spi->max_speed_hz = value;
 
-       /* IRQ */
-       spi->irq = irq_of_parse_and_map(nc, 0);
-
        /* Store a pointer to the node in the device structure */
        of_node_get(nc);
        spi->dev.of_node = nc;
@@ -1605,12 +1681,13 @@ static struct class spi_master_class = {
  * only ones directly touching chip registers.  It's how they allocate
  * an spi_master structure, prior to calling spi_register_master().
  *
- * This must be called from context that can sleep.  It returns the SPI
- * master structure on success, else NULL.
+ * This must be called from context that can sleep.
  *
  * The caller is responsible for assigning the bus number and initializing
  * the master's methods before calling spi_register_master(); and (after errors
  * adding the device) calling spi_master_put() to prevent a memory leak.
+ *
+ * Return: the SPI master structure on success, else NULL.
  */
 struct spi_master *spi_alloc_master(struct device *dev, unsigned size)
 {
@@ -1694,6 +1771,8 @@ static int of_spi_register_master(struct spi_master *master)
  * success, else a negative error code (dropping the master's refcount).
  * After a successful return, the caller is responsible for calling
  * spi_unregister_master().
+ *
+ * Return: zero on success, else a negative error code.
  */
 int spi_register_master(struct spi_master *master)
 {
@@ -1787,6 +1866,8 @@ static void devm_spi_unregister(struct device *dev, void *res)
  *
  * Register a SPI device as with spi_register_master() which will
  * automatically be unregister
+ *
+ * Return: zero on success, else a negative error code.
  */
 int devm_spi_register_master(struct device *dev, struct spi_master *master)
 {
@@ -1892,6 +1973,8 @@ static int __spi_master_match(struct device *dev, const void *data)
  * arch init time.  It returns a refcounted pointer to the relevant
  * spi_master (which the caller must release), or NULL if there is
  * no such master registered.
+ *
+ * Return: the SPI master structure on success, else NULL.
  */
 struct spi_master *spi_busnum_to_master(u16 bus_num)
 {
@@ -1945,11 +2028,13 @@ static int __spi_validate_bits_per_word(struct spi_master *master, u8 bits_per_w
  * that the underlying controller or its driver does not support.  For
  * example, not all hardware supports wire transfers using nine bit words,
  * LSB-first wire encoding, or active-high chipselects.
+ *
+ * Return: zero on success, else a negative error code.
  */
 int spi_setup(struct spi_device *spi)
 {
        unsigned        bad_bits, ugly_bits;
-       int             status = 0;
+       int             status;
 
        /* check mode to prevent that DUAL and QUAD set at the same time
         */
@@ -1986,17 +2071,18 @@ int spi_setup(struct spi_device *spi)
        if (!spi->bits_per_word)
                spi->bits_per_word = 8;
 
-       if (__spi_validate_bits_per_word(spi->master, spi->bits_per_word))
-               return -EINVAL;
+       status = __spi_validate_bits_per_word(spi->master, spi->bits_per_word);
+       if (status)
+               return status;
 
        if (!spi->max_speed_hz)
                spi->max_speed_hz = spi->master->max_speed_hz;
 
-       spi_set_cs(spi, false);
-
        if (spi->master->setup)
                status = spi->master->setup(spi);
 
+       spi_set_cs(spi, false);
+
        dev_dbg(&spi->dev, "setup mode %d, %s%s%s%s%u bits/w, %u Hz max --> %d\n",
                        (int) (spi->mode & (SPI_CPOL | SPI_CPHA)),
                        (spi->mode & SPI_CS_HIGH) ? "cs_high, " : "",
@@ -2162,6 +2248,8 @@ static int __spi_async(struct spi_device *spi, struct spi_message *message)
  * no other spi_message queued to that device will be processed.
  * (This rule applies equally to all the synchronous transfer calls,
  * which are wrappers around this core asynchronous primitive.)
+ *
+ * Return: zero on success, else a negative error code.
  */
 int spi_async(struct spi_device *spi, struct spi_message *message)
 {
@@ -2214,6 +2302,8 @@ EXPORT_SYMBOL_GPL(spi_async);
  * no other spi_message queued to that device will be processed.
  * (This rule applies equally to all the synchronous transfer calls,
  * which are wrappers around this core asynchronous primitive.)
+ *
+ * Return: zero on success, else a negative error code.
  */
 int spi_async_locked(struct spi_device *spi, struct spi_message *message)
 {
@@ -2329,7 +2419,7 @@ static int __spi_sync(struct spi_device *spi, struct spi_message *message,
  * Also, the caller is guaranteeing that the memory associated with the
  * message will not be freed before this call returns.
  *
- * It returns zero on success, else a negative error code.
+ * Return: zero on success, else a negative error code.
  */
 int spi_sync(struct spi_device *spi, struct spi_message *message)
 {
@@ -2351,7 +2441,7 @@ EXPORT_SYMBOL_GPL(spi_sync);
  * SPI bus. It has to be preceded by a spi_bus_lock call. The SPI bus must
  * be released by a spi_bus_unlock call when the exclusive access is over.
  *
- * It returns zero on success, else a negative error code.
+ * Return: zero on success, else a negative error code.
  */
 int spi_sync_locked(struct spi_device *spi, struct spi_message *message)
 {
@@ -2372,7 +2462,7 @@ EXPORT_SYMBOL_GPL(spi_sync_locked);
  * exclusive access is over. Data transfer must be done by spi_sync_locked
  * and spi_async_locked calls when the SPI bus lock is held.
  *
- * It returns zero on success, else a negative error code.
+ * Return: always zero.
  */
 int spi_bus_lock(struct spi_master *master)
 {
@@ -2401,7 +2491,7 @@ EXPORT_SYMBOL_GPL(spi_bus_lock);
  * This call releases an SPI bus lock previously obtained by an spi_bus_lock
  * call.
  *
- * It returns zero on success, else a negative error code.
+ * Return: always zero.
  */
 int spi_bus_unlock(struct spi_master *master)
 {
@@ -2436,6 +2526,8 @@ static u8 *buf;
  * portable code should never use this for more than 32 bytes.
  * Performance-sensitive or bulk transfer code should instead use
  * spi_{async,sync}() calls with dma-safe buffers.
+ *
+ * Return: zero on success, else a negative error code.
  */
 int spi_write_then_read(struct spi_device *spi,
                const void *txbuf, unsigned n_tx,
index ef008e52f9537e788389b641f1707c72e0212ec9..91a0fcd72423080900c6c733f6aeb7e800a85538 100644 (file)
@@ -788,7 +788,6 @@ static int spidev_remove(struct spi_device *spi)
 static struct spi_driver spidev_spi_driver = {
        .driver = {
                .name =         "spidev",
-               .owner =        THIS_MODULE,
                .of_match_table = of_match_ptr(spidev_dt_ids),
        },
        .probe =        spidev_probe,
index 7e9a506d65f91dcdd93b2ab271811b0df01be9d9..0d27daf23228adaeee72dac0027ebd2194f77d9c 100644 (file)
@@ -333,7 +333,6 @@ MODULE_DEVICE_TABLE(of, dt_ids);                                           \
 static struct spi_driver fbtft_driver_spi_driver = {                       \
        .driver = {                                                        \
                .name   = _name,                                           \
-               .owner  = THIS_MODULE,                                     \
                .of_match_table = of_match_ptr(dt_ids),                    \
        },                                                                 \
        .probe  = fbtft_driver_probe_spi,                                  \
index 3f380a0086c3d191b21e5f6889232bf23f190413..86d9223e4e0c273abbe195ab44b5d5c96591733f 100644 (file)
@@ -583,7 +583,6 @@ static int flexfb_remove_pdev(struct platform_device *pdev)
 static struct spi_driver flexfb_spi_driver = {
        .driver = {
                .name   = DRVNAME,
-               .owner  = THIS_MODULE,
        },
        .probe  = flexfb_probe_spi,
        .remove = flexfb_remove_spi,
index 10db685813c9b839a9f837726eeab1ed56fae13c..06c0b75ed26a96426dcbd2dcc79498aca4fa2207 100644 (file)
@@ -235,7 +235,6 @@ static int adis16201_remove(struct spi_device *spi)
 static struct spi_driver adis16201_driver = {
        .driver = {
                .name = "adis16201",
-               .owner = THIS_MODULE,
        },
        .probe = adis16201_probe,
        .remove = adis16201_remove,
index fb593d23d5bcbccb6e9084145e04adc7b9360f9e..de5b84ac842bdf4feeac3083e66a3b7304fecf60 100644 (file)
@@ -203,7 +203,6 @@ static int adis16203_remove(struct spi_device *spi)
 static struct spi_driver adis16203_driver = {
        .driver = {
                .name = "adis16203",
-               .owner = THIS_MODULE,
        },
        .probe = adis16203_probe,
        .remove = adis16203_remove,
index ea0ac2467ac2d1c28a029d3891685c183e4f397f..20a9df64f1edea152265a53a81eb6700f56bde24 100644 (file)
@@ -241,7 +241,6 @@ static int adis16204_remove(struct spi_device *spi)
 static struct spi_driver adis16204_driver = {
        .driver = {
                .name = "adis16204",
-               .owner = THIS_MODULE,
        },
        .probe = adis16204_probe,
        .remove = adis16204_remove,
index d1dc1a3cb3ce64e82b74ff2bba256838edba1bb1..8b42bf8c3f607d9216650a59d9eb530a17460150 100644 (file)
@@ -235,7 +235,6 @@ static int adis16209_remove(struct spi_device *spi)
 static struct spi_driver adis16209_driver = {
        .driver = {
                .name = "adis16209",
-               .owner = THIS_MODULE,
        },
        .probe = adis16209_probe,
        .remove = adis16209_remove,
index e46a91c69a3170a5f42d3eb867492541d2fbdc85..d0165218b60c3c29856dae002e3d786c37e4cd57 100644 (file)
@@ -482,7 +482,6 @@ static int adis16220_remove(struct spi_device *spi)
 static struct spi_driver adis16220_driver = {
        .driver = {
                .name = "adis16220",
-               .owner = THIS_MODULE,
        },
        .probe = adis16220_probe,
        .remove = adis16220_remove,
index cb074e864408abc1ff33f4fc4b4725526b49e836..1b5b685a86919c8f9d08633f96780f28277d4090 100644 (file)
@@ -288,7 +288,6 @@ static int adis16240_remove(struct spi_device *spi)
 static struct spi_driver adis16240_driver = {
        .driver = {
                .name = "adis16240",
-               .owner = THIS_MODULE,
        },
        .probe = adis16240_probe,
        .remove = adis16240_remove,
index ebcab56c81b9c641bbfa1de413ec0dfa1ec2ad99..24d90b35d669898bf39522405397f9a6fb6796c9 100644 (file)
@@ -800,7 +800,6 @@ static int lis3l02dq_remove(struct spi_device *spi)
 static struct spi_driver lis3l02dq_driver = {
        .driver = {
                .name = "lis3l02dq",
-               .owner = THIS_MODULE,
        },
        .probe = lis3l02dq_probe,
        .remove = lis3l02dq_remove,
index b614f272b5f4b1b40071d4ea5e11678453a1f431..fda646246215c2c3180610c59c86a6f286f9838d 100644 (file)
@@ -1196,7 +1196,6 @@ MODULE_DEVICE_TABLE(spi, sca3000_id);
 static struct spi_driver sca3000_driver = {
        .driver = {
                .name = "sca3000",
-               .owner = THIS_MODULE,
        },
        .probe = sca3000_probe,
        .remove = sca3000_remove,
index fe56fb6c7d3030979a3070c38411d8b132a53ddd..a3b76559a4f02d03f06da581078bb5d351927f62 100644 (file)
@@ -707,7 +707,6 @@ MODULE_DEVICE_TABLE(spi, ad7192_id);
 static struct spi_driver ad7192_driver = {
        .driver = {
                .name   = "ad7192",
-               .owner  = THIS_MODULE,
        },
        .probe          = ad7192_probe,
        .remove         = ad7192_remove,
index d98e229c46bfd4047e2799457e62aa1528acec4e..8a7c8737adc4d1cd2c0589cab9fed297241ce6aa 100644 (file)
@@ -972,7 +972,6 @@ MODULE_DEVICE_TABLE(spi, ad7280_id);
 static struct spi_driver ad7280_driver = {
        .driver = {
                .name   = "ad7280",
-               .owner  = THIS_MODULE,
        },
        .probe          = ad7280_probe,
        .remove         = ad7280_remove,
index 7303983e64a7262653ba95611ff8a30ce8d743c8..06b59cbca4438e1f43b466277457a8d7a17719e2 100644 (file)
@@ -102,7 +102,6 @@ MODULE_DEVICE_TABLE(spi, ad7606_id);
 static struct spi_driver ad7606_driver = {
        .driver = {
                .name = "ad7606",
-               .owner = THIS_MODULE,
                .pm    = AD7606_SPI_PM_OPS,
        },
        .probe = ad7606_spi_probe,
index 9f03fe3ee3d93ee34c78ca23be867fdc59d7f706..b76dd15427f5affb5795c539e004ff79398b3640 100644 (file)
@@ -263,7 +263,6 @@ MODULE_DEVICE_TABLE(spi, ad7780_id);
 static struct spi_driver ad7780_driver = {
        .driver = {
                .name   = "ad7780",
-               .owner  = THIS_MODULE,
        },
        .probe          = ad7780_probe,
        .remove         = ad7780_remove,
index 48b1c37400306b1e5145164cc579436326d2aae5..f3bbb38cdbe48d4d6d75a38513a18e68a76d536e 100644 (file)
@@ -434,7 +434,6 @@ MODULE_DEVICE_TABLE(spi, ad7816_id);
 static struct spi_driver ad7816_driver = {
        .driver = {
                .name = "ad7816",
-               .owner = THIS_MODULE,
        },
        .probe = ad7816_probe,
        .id_table = ad7816_id,
index e480abb72e4a495e772a02fd7ce7896b5f69cc43..5cd22743e1406c77c28256e79e1b5de1432b2c08 100644 (file)
@@ -132,7 +132,6 @@ static struct spi_driver adt7316_driver = {
        .driver = {
                .name = "adt7316",
                .pm = ADT7316_PM_OPS,
-               .owner = THIS_MODULE,
        },
        .probe = adt7316_spi_probe,
        .id_table = adt7316_spi_id,
index a861fe0149b1b3f8e706acece201d760942ba71f..2b65faa6296a80f680dc666422973416161c7db8 100644 (file)
@@ -339,7 +339,6 @@ MODULE_DEVICE_TABLE(spi, ad9832_id);
 static struct spi_driver ad9832_driver = {
        .driver = {
                .name   = "ad9832",
-               .owner  = THIS_MODULE,
        },
        .probe          = ad9832_probe,
        .remove         = ad9832_remove,
index d02bb44fb8fc1bbec82882bf7a4910bc1b7f94c7..15f0cc3b4d3172bb6127b29c4527d9a5c9fa4503 100644 (file)
@@ -446,7 +446,6 @@ MODULE_DEVICE_TABLE(spi, ad9834_id);
 static struct spi_driver ad9834_driver = {
        .driver = {
                .name   = "ad9834",
-               .owner  = THIS_MODULE,
        },
        .probe          = ad9834_probe,
        .remove         = ad9834_remove,
index 4c5869dd82231aaaef6dc4d3d4d5a87b4461eb2f..b8776d638e662a72a013b302dd811a9b608e09b1 100644 (file)
@@ -202,7 +202,6 @@ static int adis16060_w_remove(struct spi_device *spi)
 static struct spi_driver adis16060_r_driver = {
        .driver = {
                .name = "adis16060_r",
-               .owner = THIS_MODULE,
        },
        .probe = adis16060_r_probe,
 };
@@ -210,7 +209,6 @@ static struct spi_driver adis16060_r_driver = {
 static struct spi_driver adis16060_w_driver = {
        .driver = {
                .name = "adis16060_w",
-               .owner = THIS_MODULE,
        },
        .probe = adis16060_w_probe,
        .remove = adis16060_w_remove,
index 8e658f736e1f6278d33eb13ec3ae256e1ad2c1d7..070c918dadcfa1e5887dfe528687f4396036e9db 100644 (file)
@@ -86,7 +86,6 @@ static struct spi_driver hmc5843_driver = {
                .driver = {
                                .name = "hmc5843",
                                .pm = HMC5843_PM_OPS,
-                               .owner = THIS_MODULE,
                },
                .id_table = hmc5843_id,
                .probe = hmc5843_spi_probe,
index ffc7f0ddff14c7cc24eee0c109b6f6beefa1a928..9ca9fef4b8bac7ffa23484550e3449ac24519ffd 100644 (file)
@@ -534,7 +534,6 @@ static int ade7753_remove(struct spi_device *spi)
 static struct spi_driver ade7753_driver = {
        .driver = {
                .name = "ade7753",
-               .owner = THIS_MODULE,
        },
        .probe = ade7753_probe,
        .remove = ade7753_remove,
index f12b2e50329b6a209af4e95cebaa10a8722ad74b..5609872532f11b4a0a6fc8a5d69098dfabd48aea 100644 (file)
@@ -575,7 +575,6 @@ static int ade7754_remove(struct spi_device *spi)
 static struct spi_driver ade7754_driver = {
        .driver = {
                .name = "ade7754",
-               .owner = THIS_MODULE,
        },
        .probe = ade7754_probe,
        .remove = ade7754_remove,
index 77141ae1349dfdb9e359d1976254ddc351b110a6..d348e161c8484a17ddd6bffc9306844078ba9752 100644 (file)
@@ -904,7 +904,6 @@ MODULE_DEVICE_TABLE(spi, ade7758_id);
 static struct spi_driver ade7758_driver = {
        .driver = {
                .name = "ade7758",
-               .owner = THIS_MODULE,
        },
        .probe = ade7758_probe,
        .remove = ade7758_remove,
index dbceda1e67eaba530687b131bdfddb014d86181d..f774a62cad4ef945d63f605c3185fd6c73329d17 100644 (file)
@@ -490,7 +490,6 @@ static int ade7759_remove(struct spi_device *spi)
 static struct spi_driver ade7759_driver = {
        .driver = {
                .name = "ade7759",
-               .owner = THIS_MODULE,
        },
        .probe = ade7759_probe,
        .remove = ade7759_remove,
index 9b255a5f62c33822ecb8d255799887c6a4ee7cf6..16f288d8b8f6dc1d9647a0282b5832b29ccff2fc 100644 (file)
@@ -314,7 +314,6 @@ MODULE_DEVICE_TABLE(spi, ade7854_id);
 static struct spi_driver ade7854_driver = {
        .driver = {
                .name = "ade7854",
-               .owner = THIS_MODULE,
        },
        .probe = ade7854_spi_probe,
        .remove = ade7854_spi_remove,
index c17893b4918c82bf176e9ecfac235cd6439e7763..595e711d35a6c33ee4123597b1fd02e278c449e1 100644 (file)
@@ -155,7 +155,6 @@ MODULE_DEVICE_TABLE(spi, ad2s1200_id);
 static struct spi_driver ad2s1200_driver = {
        .driver = {
                .name = DRV_NAME,
-               .owner = THIS_MODULE,
        },
        .probe = ad2s1200_probe,
        .id_table = ad2s1200_id,
index 7bc3e4a73834d5e305b47d93f83e8d2e96e95f4f..95f5426a14d90a449a27433cc29fb48202aefed2 100644 (file)
@@ -735,7 +735,6 @@ MODULE_DEVICE_TABLE(spi, ad2s1210_id);
 static struct spi_driver ad2s1210_driver = {
        .driver = {
                .name = DRV_NAME,
-               .owner = THIS_MODULE,
        },
        .probe = ad2s1210_probe,
        .remove = ad2s1210_remove,
index e24c5890652f8d1c1b0280875f25cde6fb0050a5..cfeedfb7c774e1177a546c370a2ff1747e9dd2cf 100644 (file)
@@ -107,7 +107,6 @@ MODULE_DEVICE_TABLE(spi, ad2s90_id);
 static struct spi_driver ad2s90_driver = {
        .driver = {
                .name = "ad2s90",
-               .owner = THIS_MODULE,
        },
        .probe = ad2s90_probe,
        .remove = ad2s90_remove,
index 405b643189fd5cac9148e45e5f9d1c0d4bd94b90..b2e6237ae913722e67eaf342d2302b85504d836c 100644 (file)
@@ -948,7 +948,6 @@ static const struct of_device_id spinand_dt[] = {
 static struct spi_driver spinand_driver = {
        .driver = {
                .name           = "mt29f",
-               .owner          = THIS_MODULE,
                .of_match_table = spinand_dt,
        },
        .probe          = spinand_probe,
index 536a33b99be9bb9d7630e6115e017682763b9ec3..88246f7e435aefcc47bff72bf356b63051adcbbe 100644 (file)
@@ -1362,7 +1362,7 @@ static struct spi_driver ifx_spi_driver = {
        .driver = {
                .name = DRVNAME,
                .pm = &ifx_spi_pm,
-               .owner = THIS_MODULE},
+       },
        .probe = ifx_spi_spi_probe,
        .shutdown = ifx_spi_spi_shutdown,
        .remove = ifx_spi_spi_remove,
index 077377259a2ce459f515c41da7f4e016d2804459..5c4c280b3207a612ab810dae798dfdec87d8c7ae 100644 (file)
@@ -904,7 +904,6 @@ static SIMPLE_DEV_PM_OPS(max3100_pm_ops, max3100_suspend, max3100_resume);
 static struct spi_driver max3100_driver = {
        .driver = {
                .name           = "max3100",
-               .owner          = THIS_MODULE,
                .pm             = MAX3100_PM_OPS,
        },
        .probe          = max3100_probe,
index 182549f559049cfdbf08ae0594561c077a84522b..d45133056f51d5d114d3aab23849d4b3a1b240cf 100644 (file)
@@ -1338,7 +1338,6 @@ MODULE_DEVICE_TABLE(spi, max310x_id_table);
 static struct spi_driver max310x_uart_driver = {
        .driver = {
                .name           = MAX310X_NAME,
-               .owner          = THIS_MODULE,
                .of_match_table = of_match_ptr(max310x_dt_ids),
                .pm             = &max310x_pm_ops,
        },
index 72ffd0dcab78459106abd44dc8da667c180c01b1..55b61d79e75770ada22902588106beee0411720b 100644 (file)
@@ -1357,7 +1357,6 @@ MODULE_DEVICE_TABLE(spi, sc16is7xx_spi_id_table);
 static struct spi_driver sc16is7xx_spi_uart_driver = {
        .driver = {
                .name           = SC16IS7XX_NAME,
-               .owner          = THIS_MODULE,
                .of_match_table = of_match_ptr(sc16is7xx_dt_ids),
        },
        .probe          = sc16is7xx_spi_probe,
index fc1fd403973a8aa992ad7b61a88efe5dd301143d..bd98706d1ce9def735fe83442302c366a0fda74c 100644 (file)
@@ -1944,7 +1944,6 @@ static struct spi_driver max3421_driver = {
        .remove         = max3421_remove,
        .driver         = {
                .name   = "max3421-hcd",
-               .owner  = THIS_MODULE,
        },
 };
 
index 5f897f99cc9b68c154207bfaad4461137977ea97..5cca8ce45d4dc178592a749cd67654b683c3b9a2 100644 (file)
@@ -556,7 +556,6 @@ static void ams369fg06_shutdown(struct spi_device *spi)
 static struct spi_driver ams369fg06_driver = {
        .driver = {
                .name   = "ams369fg06",
-               .owner  = THIS_MODULE,
                .pm     = &ams369fg06_pm_ops,
        },
        .probe          = ams369fg06_probe,
index d7c37a8ccd1fbabe00063ded2bb0337e184e73db..d7c239ea3d09f5f47aefca8cd4d9157608f250f3 100644 (file)
@@ -598,7 +598,6 @@ static int corgi_lcd_remove(struct spi_device *spi)
 static struct spi_driver corgi_lcd_driver = {
        .driver         = {
                .name   = "corgi-lcd",
-               .owner  = THIS_MODULE,
                .pm     = &corgi_lcd_pm_ops,
        },
        .probe          = corgi_lcd_probe,
index e7f0890cc21142f947eaf41e6975e5007ecf96ce..a9e9cef20ed65aed131e0ab412fb73574876a66e 100644 (file)
@@ -536,7 +536,6 @@ static int ili922x_remove(struct spi_device *spi)
 static struct spi_driver ili922x_driver = {
        .driver = {
                .name = "ili922x",
-               .owner = THIS_MODULE,
        },
        .probe = ili922x_probe,
        .remove = ili922x_remove,
index 5fa2649c96311ff96785f5c87780e08f262e7b2e..e6054e2492c543d0b6e88229bd1bb3c2588c2f51 100644 (file)
@@ -255,7 +255,6 @@ static void l4f00242t03_shutdown(struct spi_device *spi)
 static struct spi_driver l4f00242t03_driver = {
        .driver = {
                .name   = "l4f00242t03",
-               .owner  = THIS_MODULE,
        },
        .probe          = l4f00242t03_probe,
        .remove         = l4f00242t03_remove,
index f71eaf10c4ebddac11a32b5ec5baf03519743dc0..677f8abba27c9765bd10a2d1e7816d890369a03f 100644 (file)
@@ -797,7 +797,6 @@ static void ld9040_shutdown(struct spi_device *spi)
 static struct spi_driver ld9040_driver = {
        .driver = {
                .name   = "ld9040",
-               .owner  = THIS_MODULE,
                .pm     = &ld9040_pm_ops,
        },
        .probe          = ld9040_probe,
index 14590c54aedf3bf50e843c85b65b6a33eae43b14..4237aaa7f26907c8b27e3c12d1d3770510cff6b7 100644 (file)
@@ -192,7 +192,6 @@ static int lms283gf05_probe(struct spi_device *spi)
 static struct spi_driver lms283gf05_driver = {
        .driver = {
                .name   = "lms283gf05",
-               .owner  = THIS_MODULE,
        },
        .probe          = lms283gf05_probe,
 };
index 7e3810308c3e456e56d5f5e6512fbef0bbc2d7dd..8aa3e7662496b3d1e6098dc6c1b9dad3900f9e66 100644 (file)
@@ -422,7 +422,6 @@ static void lms501kf03_shutdown(struct spi_device *spi)
 static struct spi_driver lms501kf03_driver = {
        .driver = {
                .name   = "lms501kf03",
-               .owner  = THIS_MODULE,
                .pm     = &lms501kf03_pm_ops,
        },
        .probe          = lms501kf03_probe,
index 383f550e165ec0070809bf56799cdb3e0a52ac44..885612cc10082dc1cc162661c10446cc590c9782 100644 (file)
@@ -295,7 +295,6 @@ static void ltv350qv_shutdown(struct spi_device *spi)
 static struct spi_driver ltv350qv_driver = {
        .driver = {
                .name           = "ltv350qv",
-               .owner          = THIS_MODULE,
                .pm             = &ltv350qv_pm_ops,
        },
 
index 28bfa127fee45aca7a0bd4c193efa47cb8d80e58..3c4a22a3063a9c27920bf02b76bba779948b7c8f 100644 (file)
@@ -842,7 +842,6 @@ static void s6e63m0_shutdown(struct spi_device *spi)
 static struct spi_driver s6e63m0_driver = {
        .driver = {
                .name   = "s6e63m0",
-               .owner  = THIS_MODULE,
                .pm     = &s6e63m0_pm_ops,
        },
        .probe          = s6e63m0_probe,
index 30afce33ef2afcfa364e3aa622d09a48b152d94e..eab1f842f9c01c1fa74d944e72ec7c6547da12cc 100644 (file)
@@ -437,7 +437,6 @@ static void tdo24m_shutdown(struct spi_device *spi)
 static struct spi_driver tdo24m_driver = {
        .driver = {
                .name           = "tdo24m",
-               .owner          = THIS_MODULE,
                .pm             = &tdo24m_pm_ops,
        },
        .probe          = tdo24m_probe,
index f08d641ccd0103d49ad6421f9473368e1053317b..6a41ea92737a30590ac1bb5d9bd7e93f683bb4d8 100644 (file)
@@ -263,7 +263,6 @@ static SIMPLE_DEV_PM_OPS(tosa_lcd_pm_ops, tosa_lcd_suspend, tosa_lcd_resume);
 static struct spi_driver tosa_lcd_driver = {
        .driver = {
                .name           = "tosa-lcd",
-               .owner          = THIS_MODULE,
                .pm             = &tosa_lcd_pm_ops,
        },
        .probe          = tosa_lcd_probe,
index d538947a67d3e58708cdad2ee264922378eeab75..242a9948f57f5e99c531ee44195208f4c66c728b 100644 (file)
@@ -251,7 +251,6 @@ static SIMPLE_DEV_PM_OPS(vgg2432a4_pm_ops, vgg2432a4_suspend, vgg2432a4_resume);
 static struct spi_driver vgg2432a4_driver = {
        .driver = {
                .name           = "VGG2432A4",
-               .owner          = THIS_MODULE,
                .pm             = &vgg2432a4_pm_ops,
        },
        .probe          = vgg2432a4_probe,
index 998978b08f5e61fa798ddeacce65a572ef4109c0..f7e85d1c9f9ce5de66619e08966ca21acb5559c8 100644 (file)
@@ -175,7 +175,6 @@ static int tpohvga_probe(struct spi_device *spi)
 static struct spi_driver panel_tpohvga_driver = {
        .driver         = {
                .name   = "tpo-hvga",
-               .owner  = THIS_MODULE,
        },
        .probe          = tpohvga_probe,
 };
index 803fee618d57dbf31db2138b0ea6fd6ca346e084..0e4cee9a8d796b70ae5eefb585cff35bba292a01 100644 (file)
@@ -603,7 +603,6 @@ static int mipid_spi_remove(struct spi_device *spi)
 static struct spi_driver mipid_spi_driver = {
        .driver = {
                .name   = MIPID_MODULE_NAME,
-               .owner  = THIS_MODULE,
        },
        .probe  = mipid_spi_probe,
        .remove = mipid_spi_remove,
index 6a1b6a89a92868994c1adcffd1644db3063572ae..18eb60e9c9ecf5f09d9e17865a7d4f5f3c04c823 100644 (file)
@@ -391,7 +391,6 @@ static struct spi_driver lb035q02_spi_driver = {
        .remove         = lb035q02_panel_spi_remove,
        .driver         = {
                .name   = "panel_lgphilips_lb035q02",
-               .owner  = THIS_MODULE,
                .of_match_table = lb035q02_of_match,
                .suppress_bind_attrs = true,
        },
index ccf3f4f3c70355580ee62dabaf62b6c09e7d4f5c..8a928c9a2fc9a72fb5bacb78ec8926b4d7160ed0 100644 (file)
@@ -421,7 +421,6 @@ MODULE_DEVICE_TABLE(of, nec_8048_of_match);
 static struct spi_driver nec_8048_driver = {
        .driver = {
                .name   = "panel-nec-nl8048hl11",
-               .owner  = THIS_MODULE,
                .pm     = NEC_8048_PM_OPS,
                .of_match_table = nec_8048_of_match,
                .suppress_bind_attrs = true,
index c581231c74a53bb837dcc24da190202ed56cb648..31efcca801bdce78f68b6e963a4c80694f85b7d1 100644 (file)
@@ -903,7 +903,6 @@ MODULE_DEVICE_TABLE(of, acx565akm_of_match);
 static struct spi_driver acx565akm_driver = {
        .driver = {
                .name   = "acx565akm",
-               .owner  = THIS_MODULE,
                .of_match_table = acx565akm_of_match,
                .suppress_bind_attrs = true,
        },
index 9edc51133c59c112088df6325164d3e958804fe2..4d657f3ab67914f0e5e5d77c450aaf4c2f6be048 100644 (file)
@@ -498,7 +498,6 @@ static struct spi_driver td028ttec1_spi_driver = {
 
        .driver         = {
                .name   = "panel-tpo-td028ttec1",
-               .owner  = THIS_MODULE,
                .of_match_table = td028ttec1_of_match,
                .suppress_bind_attrs = true,
        },
index 79e4a029aab90658ef52f4921345a18c50005b7b..68e3b68a29200675aed79653af0c6ccf4a27e852 100644 (file)
@@ -670,7 +670,6 @@ MODULE_DEVICE_TABLE(of, tpo_td043_of_match);
 static struct spi_driver tpo_td043_spi_driver = {
        .driver = {
                .name   = "panel-tpo-td043mtea1",
-               .owner  = THIS_MODULE,
                .pm     = &tpo_td043_spi_pm,
                .of_match_table = tpo_td043_of_match,
                .suppress_bind_attrs = true,
index 92273776bce6ba9845ab2584644718cbabcb0dd6..c2f2574ff61ceebbe4729df6d577722b391d0600 100644 (file)
@@ -198,6 +198,7 @@ enum pxa_ssp_type {
        LPSS_LPT_SSP, /* Keep LPSS types sorted with lpss_platforms[] */
        LPSS_BYT_SSP,
        LPSS_SPT_SSP,
+       LPSS_BXT_SSP,
 };
 
 struct ssp_device {
index 6b00f18f5e6b725cabca142137be4eb58eb3df48..cce80e6dc7d115960d8e2ac8833c752ce4a4369a 100644 (file)
@@ -51,6 +51,8 @@ extern struct bus_type spi_bus_type;
  * @bytes_tx:      number of bytes sent to device
  * @bytes_rx:      number of bytes received from device
  *
+ * @transfer_bytes_histo:
+ *                 transfer bytes histogramm
  */
 struct spi_statistics {
        spinlock_t              lock; /* lock for the whole structure */
@@ -68,6 +70,8 @@ struct spi_statistics {
        unsigned long long      bytes_rx;
        unsigned long long      bytes_tx;
 
+#define SPI_STATISTICS_HISTO_SIZE 17
+       unsigned long transfer_bytes_histo[SPI_STATISTICS_HISTO_SIZE];
 };
 
 void spi_statistics_add_transfer_stats(struct spi_statistics *stats,
@@ -250,7 +254,7 @@ static inline struct spi_driver *to_spi_driver(struct device_driver *drv)
        return drv ? container_of(drv, struct spi_driver, driver) : NULL;
 }
 
-extern int spi_register_driver(struct spi_driver *sdrv);
+extern int __spi_register_driver(struct module *owner, struct spi_driver *sdrv);
 
 /**
  * spi_unregister_driver - reverse effect of spi_register_driver
@@ -263,6 +267,10 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
                driver_unregister(&sdrv->driver);
 }
 
+/* use a define to avoid include chaining to get THIS_MODULE */
+#define spi_register_driver(driver) \
+       __spi_register_driver(THIS_MODULE, driver)
+
 /**
  * module_spi_driver() - Helper macro for registering a SPI driver
  * @__spi_driver: spi_driver struct
@@ -843,8 +851,10 @@ extern int spi_bus_unlock(struct spi_master *master);
  * @len: data buffer size
  * Context: can sleep
  *
- * This writes the buffer and returns zero or a negative error code.
+ * This function writes the buffer @buf.
  * Callable only from contexts that can sleep.
+ *
+ * Return: zero on success, else a negative error code.
  */
 static inline int
 spi_write(struct spi_device *spi, const void *buf, size_t len)
@@ -867,8 +877,10 @@ spi_write(struct spi_device *spi, const void *buf, size_t len)
  * @len: data buffer size
  * Context: can sleep
  *
- * This reads the buffer and returns zero or a negative error code.
+ * This function reads the buffer @buf.
  * Callable only from contexts that can sleep.
+ *
+ * Return: zero on success, else a negative error code.
  */
 static inline int
 spi_read(struct spi_device *spi, void *buf, size_t len)
@@ -895,7 +907,7 @@ spi_read(struct spi_device *spi, void *buf, size_t len)
  *
  * For more specific semantics see spi_sync().
  *
- * It returns zero on success, else a negative error code.
+ * Return: Return: zero on success, else a negative error code.
  */
 static inline int
 spi_sync_transfer(struct spi_device *spi, struct spi_transfer *xfers,
@@ -919,9 +931,10 @@ extern int spi_write_then_read(struct spi_device *spi,
  * @cmd: command to be written before data is read back
  * Context: can sleep
  *
- * This returns the (unsigned) eight bit number returned by the
- * device, or else a negative error code.  Callable only from
- * contexts that can sleep.
+ * Callable only from contexts that can sleep.
+ *
+ * Return: the (unsigned) eight bit number returned by the
+ * device, or else a negative error code.
  */
 static inline ssize_t spi_w8r8(struct spi_device *spi, u8 cmd)
 {
@@ -940,12 +953,13 @@ static inline ssize_t spi_w8r8(struct spi_device *spi, u8 cmd)
  * @cmd: command to be written before data is read back
  * Context: can sleep
  *
- * This returns the (unsigned) sixteen bit number returned by the
- * device, or else a negative error code.  Callable only from
- * contexts that can sleep.
- *
  * The number is returned in wire-order, which is at least sometimes
  * big-endian.
+ *
+ * Callable only from contexts that can sleep.
+ *
+ * Return: the (unsigned) sixteen bit number returned by the
+ * device, or else a negative error code.
  */
 static inline ssize_t spi_w8r16(struct spi_device *spi, u8 cmd)
 {
@@ -964,13 +978,13 @@ static inline ssize_t spi_w8r16(struct spi_device *spi, u8 cmd)
  * @cmd: command to be written before data is read back
  * Context: can sleep
  *
- * This returns the (unsigned) sixteen bit number returned by the device in cpu
- * endianness, or else a negative error code. Callable only from contexts that
- * can sleep.
- *
  * This function is similar to spi_w8r16, with the exception that it will
  * convert the read 16 bit data word from big-endian to native endianness.
  *
+ * Callable only from contexts that can sleep.
+ *
+ * Return: the (unsigned) sixteen bit number returned by the device in cpu
+ * endianness, or else a negative error code.
  */
 static inline ssize_t spi_w8r16be(struct spi_device *spi, u8 cmd)
 
index 85578d4be0343ce9ac0bd3f1a9bbb2d349533b44..154788ed218c501d515b55b53b5e2ddcbe4f84a0 100644 (file)
@@ -4,7 +4,7 @@
 #include <linux/workqueue.h>
 
 struct spi_bitbang {
-       spinlock_t              lock;
+       struct mutex            lock;
        u8                      busy;
        u8                      use_dma;
        u8                      flags;          /* extra spi->mode support */
index 95f0bec26a1bce16150f5465f3d86b373222b817..e2ce6c4d7ece402548102e3f12ad61164e3689ae 100644 (file)
@@ -404,7 +404,6 @@ MODULE_DEVICE_TABLE(spi, ad1836_ids);
 static struct spi_driver ad1836_spi_driver = {
        .driver = {
                .name   = "ad1836",
-               .owner  = THIS_MODULE,
        },
        .probe          = ad1836_spi_probe,
        .remove         = ad1836_spi_remove,
index 431f95da1de1f9b0eff5bab82ac2daa07da200dd..23c28573bdb7057356c569cb0d6054cd041611b0 100644 (file)
@@ -49,7 +49,6 @@ MODULE_DEVICE_TABLE(spi, ad193x_spi_id);
 static struct spi_driver ad193x_spi_driver = {
        .driver = {
                .name   = "ad193x",
-               .owner  = THIS_MODULE,
        },
        .probe          = ad193x_spi_probe,
        .remove         = ad193x_spi_remove,
index cce2f11f1ffb6959df61207f78430d954457e698..8bc1fbd25fccccd1c31c66f7a0bcb31eff07af01 100644 (file)
@@ -64,7 +64,6 @@ MODULE_DEVICE_TABLE(spi, adau1761_spi_id);
 static struct spi_driver adau1761_spi_driver = {
        .driver = {
                .name = "adau1761",
-               .owner = THIS_MODULE,
        },
        .probe = adau1761_spi_probe,
        .remove = adau1761_spi_remove,
index 194686716bbed192a3d264f227fa3b9acd73446b..33a73ff78de4d2a980146c78b6374f67c0cabb80 100644 (file)
@@ -62,7 +62,6 @@ MODULE_DEVICE_TABLE(spi, adau1781_spi_id);
 static struct spi_driver adau1781_spi_driver = {
        .driver = {
                .name = "adau1781",
-               .owner = THIS_MODULE,
        },
        .probe = adau1781_spi_probe,
        .remove = adau1781_spi_remove,
index b05cf5da3a9452e0c14a9a4412aedeb31175398e..0b46d88b481ca7ce90a56b7cb819340071d229d4 100644 (file)
@@ -63,7 +63,6 @@ MODULE_DEVICE_TABLE(spi, adau1977_spi_ids);
 static struct spi_driver adau1977_spi_driver = {
        .driver = {
                .name = "adau1977",
-               .owner = THIS_MODULE,
        },
        .probe = adau1977_spi_probe,
        .remove = adau1977_spi_remove,
index 790fce33ab10fb5318258a7b5e2d829e0d007594..055f1228c2b47676418c12ffb3e3a795ec902d4f 100644 (file)
@@ -39,7 +39,6 @@ static int adav80x_spi_remove(struct spi_device *spi)
 static struct spi_driver adav80x_spi_driver = {
        .driver = {
                .name   = "adav801",
-               .owner  = THIS_MODULE,
        },
        .probe          = adav80x_spi_probe,
        .remove         = adav80x_spi_remove,
index 1fd7f72b2a62a05f99567e02e634328f65bc5fce..595d02d7602c9f53aff29d6c86e7af1923109360 100644 (file)
@@ -344,7 +344,6 @@ MODULE_DEVICE_TABLE(spi, ak4104_id_table);
 static struct spi_driver ak4104_spi_driver = {
        .driver  = {
                .name   = "ak4104",
-               .owner  = THIS_MODULE,
                .of_match_table = ak4104_of_match,
        },
        .id_table = ak4104_id_table,
index acd49d86e70646b568dd785ccb05e62e942a7bc8..1ff5f520196af3c9ee901ac2a430ab21c6c39122 100644 (file)
@@ -42,7 +42,6 @@ static int cs4271_spi_remove(struct spi_device *spi)
 static struct spi_driver cs4271_spi_driver = {
        .driver = {
                .name   = "cs4271",
-               .owner  = THIS_MODULE,
                .of_match_table = of_match_ptr(cs4271_dt_ids),
        },
        .probe          = cs4271_spi_probe,
index 7dc52fe67c80b212c06acf2a1bc296277c880f11..af23a61b7b283aacd7a8950b5b42cd440151d843 100644 (file)
@@ -1339,7 +1339,6 @@ static int da7210_spi_remove(struct spi_device *spi)
 static struct spi_driver da7210_spi_driver = {
        .driver = {
                .name = "da7210",
-               .owner = THIS_MODULE,
        },
        .probe = da7210_spi_probe,
        .remove = da7210_spi_remove
index 57b0c94a710b781953c482308e5d9755e968da43..08bb4863e96f869bfb0e25eb7a7e4dd759701079 100644 (file)
@@ -257,7 +257,6 @@ MODULE_DEVICE_TABLE(spi, pcm1792a_spi_ids);
 static struct spi_driver pcm1792a_codec_driver = {
        .driver = {
                .name = "pcm1792a",
-               .owner = THIS_MODULE,
                .of_match_table = of_match_ptr(pcm1792a_of_match),
        },
        .id_table = pcm1792a_spi_ids,
index 7b64a9cef70481bab82875f4589f68e4fb63508f..712ed6598c4827c5c4780d3df8d341fc7b39fd9c 100644 (file)
@@ -64,7 +64,6 @@ static struct spi_driver pcm512x_spi_driver = {
        .id_table       = pcm512x_spi_id,
        .driver = {
                .name   = "pcm512x",
-               .owner  = THIS_MODULE,
                .of_match_table = pcm512x_of_match,
                .pm     = &pcm512x_pm_ops,
        },
index 3505aafbade49d16d9ba4a3da17c14f03c897577..91879ea9541535113f6a5dbe53ee4a0816b6b4c5 100644 (file)
@@ -232,7 +232,6 @@ static int rt5677_spi_probe(struct spi_device *spi)
 static struct spi_driver rt5677_spi_driver = {
        .driver = {
                .name = "rt5677",
-               .owner = THIS_MODULE,
        },
        .probe = rt5677_spi_probe,
 };
index b5df14fbe3adabd9f0604b0af536caa4df6182e6..842f373045c607299972923861cfff1bf7287af7 100644 (file)
@@ -35,7 +35,6 @@ MODULE_DEVICE_TABLE(of, ssm2602_of_match);
 static struct spi_driver ssm2602_spi_driver = {
        .driver = {
                .name   = "ssm2602",
-               .owner  = THIS_MODULE,
                .of_match_table = ssm2602_of_match,
        },
        .probe          = ssm2602_spi_probe,
index 3b387e41d75d065edec38019c59ceaa88f9a3a1f..f801ae05165876300a234d5c8d81194e1275b308 100644 (file)
@@ -43,7 +43,6 @@ static int aic23_spi_remove(struct spi_device *spi)
 static struct spi_driver aic23_spi = {
        .driver = {
                .name = "tlv320aic23",
-               .owner = THIS_MODULE,
        },
        .probe = aic23_spi_probe,
        .remove = aic23_spi_remove,
index 620ab9ea1ef0ec0ed7ca69d7d1f75841031e8bb3..2c904d7150ad7968b0f15928ba68c4e6ddcc16b5 100644 (file)
@@ -373,7 +373,6 @@ static int aic26_spi_remove(struct spi_device *spi)
 static struct spi_driver aic26_spi = {
        .driver = {
                .name = "tlv320aic26-codec",
-               .owner = THIS_MODULE,
        },
        .probe = aic26_spi_probe,
        .remove = aic26_spi_remove,
index 581ec1502228ff7d3d367b2582ead6d3af619b21..e3c34bdc277272cac380e0e0b6a8765f4749ab32 100644 (file)
@@ -998,7 +998,6 @@ static int wm0010_spi_remove(struct spi_device *spi)
 static struct spi_driver wm0010_spi_driver = {
        .driver = {
                .name   = "wm0010",
-               .owner  = THIS_MODULE,
        },
        .probe          = wm0010_spi_probe,
        .remove         = wm0010_spi_remove,
index b098a83a44d8cafc4e82742e35239d53d8ad50a7..99e40e629cca878aa643f32fecfe53e9d85c3f08 100644 (file)
@@ -644,7 +644,6 @@ static int wm8510_spi_remove(struct spi_device *spi)
 static struct spi_driver wm8510_spi_driver = {
        .driver = {
                .name   = "wm8510",
-               .owner  = THIS_MODULE,
                .of_match_table = wm8510_of_match,
        },
        .probe          = wm8510_spi_probe,
index 44b9e0ae745181ccd2f0e3029619171999923ca5..c759ec068e976cb732cad35ea83a508beaa6d03b 100644 (file)
@@ -431,7 +431,6 @@ static int wm8711_spi_remove(struct spi_device *spi)
 static struct spi_driver wm8711_spi_driver = {
        .driver = {
                .name   = "wm8711",
-               .owner  = THIS_MODULE,
                .of_match_table = wm8711_of_match,
        },
        .probe          = wm8711_spi_probe,
index cd7b02413ccf2ed80e8d233ddbf4580ece621e1f..1564e6926527f05ed892332f8ad38aea14382cef 100644 (file)
@@ -272,7 +272,6 @@ static int wm8728_spi_remove(struct spi_device *spi)
 static struct spi_driver wm8728_spi_driver = {
        .driver = {
                .name   = "wm8728",
-               .owner  = THIS_MODULE,
                .of_match_table = wm8728_of_match,
        },
        .probe          = wm8728_spi_probe,
index 07cf1bd7913a8dfe4667e310fcb44536f8e4004c..4bcf5f8ece50f3681948a9fbc47b85400d9a8b51 100644 (file)
@@ -718,7 +718,6 @@ static int wm8731_spi_remove(struct spi_device *spi)
 static struct spi_driver wm8731_spi_driver = {
        .driver = {
                .name   = "wm8731",
-               .owner  = THIS_MODULE,
                .of_match_table = wm8731_of_match,
        },
        .probe          = wm8731_spi_probe,
index e4a03d98aed439e3154ae027af93d42be48dba10..e7807601e675c7fc288fd3f03aa1bb70a21ee960 100644 (file)
@@ -707,7 +707,6 @@ static int wm8737_spi_remove(struct spi_device *spi)
 static struct spi_driver wm8737_spi_driver = {
        .driver = {
                .name   = "wm8737",
-               .owner  = THIS_MODULE,
                .of_match_table = wm8737_of_match,
        },
        .probe          = wm8737_spi_probe,
index de42c0388772404cf0223644a14b09521fb4ac7b..36ef91fe05116438d6a59b9da9bb38abe0bf5fd7 100644 (file)
@@ -657,7 +657,6 @@ static int wm8741_spi_remove(struct spi_device *spi)
 static struct spi_driver wm8741_spi_driver = {
        .driver = {
                .name   = "wm8741",
-               .owner  = THIS_MODULE,
                .of_match_table = wm8741_of_match,
        },
        .probe          = wm8741_spi_probe,
index 873933a7966f92a6dcbc0e153192b5039ce48d79..bd9dcd2161bc9cb394d9aa40833b6221a44420a1 100644 (file)
@@ -777,7 +777,6 @@ MODULE_DEVICE_TABLE(spi, wm8750_spi_ids);
 static struct spi_driver wm8750_spi_driver = {
        .driver = {
                .name   = "wm8750",
-               .owner  = THIS_MODULE,
                .of_match_table = wm8750_of_match,
        },
        .id_table       = wm8750_spi_ids,
index a801c6d754367de81e4951606a2f8df42ac35ddd..61299ca372ffc1fc3f83dd88fe823151da7b09b8 100644 (file)
@@ -1549,7 +1549,6 @@ static int wm8753_spi_remove(struct spi_device *spi)
 static struct spi_driver wm8753_spi_driver = {
        .driver = {
                .name   = "wm8753",
-               .owner  = THIS_MODULE,
                .of_match_table = wm8753_of_match,
        },
        .probe          = wm8753_spi_probe,
index 66c1f151071de81f0e275a13ec8bbd9b2127e6e1..df6178464b008cb0ab57ec424d32e2389baad63d 100644 (file)
@@ -703,7 +703,6 @@ static int wm8770_spi_remove(struct spi_device *spi)
 static struct spi_driver wm8770_spi_driver = {
        .driver = {
                .name = "wm8770",
-               .owner = THIS_MODULE,
                .of_match_table = wm8770_of_match,
        },
        .probe = wm8770_spi_probe,
index 183c9a4966c51b091f239c5fcdbaffc69d5dcfdb..5af44f9a8cf2395f78ba70b8e1d2d911452d2618 100644 (file)
@@ -488,7 +488,6 @@ static int wm8776_spi_remove(struct spi_device *spi)
 static struct spi_driver wm8776_spi_driver = {
        .driver = {
                .name   = "wm8776",
-               .owner  = THIS_MODULE,
                .of_match_table = wm8776_of_match,
        },
        .probe          = wm8776_spi_probe,
index 407a3cf391e505d889f99691766e246c8506a678..9998c78a2325a2c717aa15eb14e65270f64a5116 100644 (file)
@@ -42,7 +42,6 @@ MODULE_DEVICE_TABLE(of, wm8804_of_match);
 static struct spi_driver wm8804_spi_driver = {
        .driver = {
                .name = "wm8804",
-               .owner = THIS_MODULE,
                .pm = &wm8804_pm,
                .of_match_table = wm8804_of_match,
        },
index 98900aa66dc30cc65afa0f75af2d191799de4959..5d8dca88d612b3ecdd04e180fc4473dd3ed1d3c6 100644 (file)
@@ -1266,7 +1266,6 @@ static int wm8900_spi_remove(struct spi_device *spi)
 static struct spi_driver wm8900_spi_driver = {
        .driver = {
                .name   = "wm8900",
-               .owner  = THIS_MODULE,
        },
        .probe          = wm8900_spi_probe,
        .remove         = wm8900_spi_remove,
index f3193fb751cc4e6cb93555fbbcfb8678be159ede..7350ff654bbf37fe660e2b7a75cc5a15b5d63c68 100644 (file)
@@ -1033,7 +1033,6 @@ static int wm8983_spi_remove(struct spi_device *spi)
 static struct spi_driver wm8983_spi_driver = {
        .driver = {
                .name = "wm8983",
-               .owner = THIS_MODULE,
        },
        .probe = wm8983_spi_probe,
        .remove = wm8983_spi_remove
index 9c3c1517a4f3a4d8afcbff6394ddc492119f509a..9918152a03c7518e5c0c2e299a35145abd808a14 100644 (file)
@@ -1096,7 +1096,6 @@ static int wm8985_spi_remove(struct spi_device *spi)
 static struct spi_driver wm8985_spi_driver = {
        .driver = {
                .name = "wm8985",
-               .owner = THIS_MODULE,
        },
        .probe = wm8985_spi_probe,
        .remove = wm8985_spi_remove
index c88ce99ce9e17e144a14c51e197f280bd075d0f7..895721a256f048259ad2ee596a33316f5115c1c6 100644 (file)
@@ -871,7 +871,6 @@ static int wm8988_spi_remove(struct spi_device *spi)
 static struct spi_driver wm8988_spi_driver = {
        .driver = {
                .name   = "wm8988",
-               .owner  = THIS_MODULE,
        },
        .probe          = wm8988_spi_probe,
        .remove         = wm8988_spi_remove,
index eda52a96c1fa5ef4c1b802f77075158dd0619d70..24500bafb0a89708edf155862b0d7a1e0fb93029 100644 (file)
@@ -2246,7 +2246,6 @@ static int wm8995_spi_remove(struct spi_device *spi)
 static struct spi_driver wm8995_spi_driver = {
        .driver = {
                .name = "wm8995",
-               .owner = THIS_MODULE,
        },
        .probe = wm8995_spi_probe,
        .remove = wm8995_spi_remove