Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'spi-v4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi updates from Mark Brown:
"Quite a lot of activity in SPI this cycle, almost all of it in drivers
with a few minor improvements and tweaks in the core.

- Updates to pxa2xx to support Intel Broxton and multiple chip selects.
- Support for big endian in the bcm63xx driver.
- Multiple slave support for the mt8173
- New driver for the auxiliary SPI controller in bcm2835 SoCs.
- Support for Layerscale SoCs in the Freescale DSPI driver"

* tag 'spi-v4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (87 commits)
spi: pxa2xx: Rework self-initiated platform data creation for non-ACPI
spi: pxa2xx: Add support for Intel Broxton
spi: pxa2xx: Detect number of enabled Intel LPSS SPI chip select signals
spi: pxa2xx: Add output control for multiple Intel LPSS chip selects
spi: pxa2xx: Use LPSS prefix for defines that are Intel LPSS specific
spi: Add DSPI support for layerscape family
spi: ti-qspi: improve ->remove() callback
spi/spi-xilinx: Fix race condition on last word read
spi: Drop owner assignment from spi_drivers
spi: Add THIS_MODULE to spi_driver in SPI core
spi: Setup the master controller driver before setting the chipselect
spi: dw: replace magic constant by DW_SPI_DR
spi: mediatek: mt8173 spi multiple devices support
spi: mediatek: handle controller_data in mtk_spi_setup
spi: mediatek: remove mtk_spi_config
spi: mediatek: Update document devicetree bindings to support multiple devices
spi: fix kernel-doc warnings about missing return desc in spi.c
spi: fix kernel-doc warnings about missing return desc in spi.h
spi: pxa2xx: Align a few defines
spi: pxa2xx: Save other reg_cs_ctrl bits when configuring chip select
...

+1407 -929
+38
Documentation/devicetree/bindings/spi/brcm,bcm2835-aux-spi.txt
··· 1 + Broadcom BCM2835 auxiliar SPI1/2 controller 2 + 3 + The BCM2835 contains two forms of SPI master controller, one known simply as 4 + SPI0, and the other known as the "Universal SPI Master"; part of the 5 + auxiliary block. This binding applies to the SPI1/2 controller. 6 + 7 + Required properties: 8 + - compatible: Should be "brcm,bcm2835-aux-spi". 9 + - reg: Should contain register location and length for the spi block 10 + - interrupts: Should contain shared interrupt of the aux block 11 + - clocks: The clock feeding the SPI controller - needs to 12 + point to the auxiliar clock driver of the bcm2835, 13 + as this clock will enable the output gate for the specific 14 + clock. 15 + - cs-gpios: the cs-gpios (native cs is NOT supported) 16 + see also spi-bus.txt 17 + 18 + Example: 19 + 20 + spi1@7e215080 { 21 + compatible = "brcm,bcm2835-aux-spi"; 22 + reg = <0x7e215080 0x40>; 23 + interrupts = <1 29>; 24 + clocks = <&aux_clocks BCM2835_AUX_CLOCK_SPI1>; 25 + #address-cells = <1>; 26 + #size-cells = <0>; 27 + cs-gpios = <&gpio 18>, <&gpio 17>, <&gpio 16>; 28 + }; 29 + 30 + spi2@7e2150c0 { 31 + compatible = "brcm,bcm2835-aux-spi"; 32 + reg = <0x7e2150c0 0x40>; 33 + interrupts = <1 29>; 34 + clocks = <&aux_clocks BCM2835_AUX_CLOCK_SPI2>; 35 + #address-cells = <1>; 36 + #size-cells = <0>; 37 + cs-gpios = <&gpio 43>, <&gpio 44>, <&gpio 45>; 38 + };
+6 -3
Documentation/devicetree/bindings/spi/spi-mt65xx.txt
··· 29 29 muxes clock, and "spi-clk" for the clock gate. 30 30 31 31 Optional properties: 32 + -cs-gpios: see spi-bus.txt, only required for MT8173. 33 + 32 34 - mediatek,pad-select: specify which pins group(ck/mi/mo/cs) spi 33 - controller used, this value should be 0~3, only required for MT8173. 35 + controller used. This is a array, the element value should be 0~3, 36 + only required for MT8173. 34 37 0: specify GPIO69,70,71,72 for spi pins. 35 38 1: specify GPIO102,103,104,105 for spi pins. 36 39 2: specify GPIO128,129,130,131 for spi pins. ··· 52 49 <&topckgen CLK_TOP_SPI_SEL>, 53 50 <&pericfg CLK_PERI_SPI0>; 54 51 clock-names = "parent-clk", "sel-clk", "spi-clk"; 55 - 56 - mediatek,pad-select = <0>; 52 + cs-gpios = <&pio 105 GPIO_ACTIVE_LOW>, <&pio 72 GPIO_ACTIVE_LOW>; 53 + mediatek,pad-select = <1>, <0>; 57 54 status = "disabled"; 58 55 };
-1
arch/arm/mach-u300/dummyspichip.c
··· 264 264 static struct spi_driver pl022_dummy_driver = { 265 265 .driver = { 266 266 .name = "spi-dummy", 267 - .owner = THIS_MODULE, 268 267 .of_match_table = pl022_dummy_dt_match, 269 268 }, 270 269 .probe = pl022_dummy_probe,
+2 -40
arch/mips/bcm63xx/dev-spi.c
··· 18 18 #include <bcm63xx_dev_spi.h> 19 19 #include <bcm63xx_regs.h> 20 20 21 - /* 22 - * register offsets 23 - */ 24 - static const unsigned long bcm6348_regs_spi[] = { 25 - __GEN_SPI_REGS_TABLE(6348) 26 - }; 27 - 28 - static const unsigned long bcm6358_regs_spi[] = { 29 - __GEN_SPI_REGS_TABLE(6358) 30 - }; 31 - 32 - const unsigned long *bcm63xx_regs_spi; 33 - EXPORT_SYMBOL(bcm63xx_regs_spi); 34 - 35 - static __init void bcm63xx_spi_regs_init(void) 36 - { 37 - if (BCMCPU_IS_6338() || BCMCPU_IS_6348()) 38 - bcm63xx_regs_spi = bcm6348_regs_spi; 39 - if (BCMCPU_IS_3368() || BCMCPU_IS_6358() || 40 - BCMCPU_IS_6362() || BCMCPU_IS_6368()) 41 - bcm63xx_regs_spi = bcm6358_regs_spi; 42 - } 43 - 44 21 static struct resource spi_resources[] = { 45 22 { 46 23 .start = -1, /* filled at runtime */ ··· 30 53 }, 31 54 }; 32 55 33 - static struct bcm63xx_spi_pdata spi_pdata = { 34 - .bus_num = 0, 35 - .num_chipselect = 8, 36 - }; 37 - 38 56 static struct platform_device bcm63xx_spi_device = { 39 - .name = "bcm63xx-spi", 40 57 .id = -1, 41 58 .num_resources = ARRAY_SIZE(spi_resources), 42 59 .resource = spi_resources, 43 - .dev = { 44 - .platform_data = &spi_pdata, 45 - }, 46 60 }; 47 61 48 62 int __init bcm63xx_spi_register(void) ··· 46 78 spi_resources[1].start = bcm63xx_get_irq_number(IRQ_SPI); 47 79 48 80 if (BCMCPU_IS_6338() || BCMCPU_IS_6348()) { 81 + bcm63xx_spi_device.name = "bcm6348-spi", 49 82 spi_resources[0].end += BCM_6348_RSET_SPI_SIZE - 1; 50 - spi_pdata.fifo_size = SPI_6348_MSG_DATA_SIZE; 51 - spi_pdata.msg_type_shift = SPI_6348_MSG_TYPE_SHIFT; 52 - spi_pdata.msg_ctl_width = SPI_6348_MSG_CTL_WIDTH; 53 83 } 54 84 55 85 if (BCMCPU_IS_3368() || BCMCPU_IS_6358() || BCMCPU_IS_6362() || 56 86 BCMCPU_IS_6368()) { 87 + bcm63xx_spi_device.name = "bcm6358-spi", 57 88 spi_resources[0].end += BCM_6358_RSET_SPI_SIZE - 1; 58 - spi_pdata.fifo_size = SPI_6358_MSG_DATA_SIZE; 59 - spi_pdata.msg_type_shift = SPI_6358_MSG_TYPE_SHIFT; 60 - spi_pdata.msg_ctl_width = SPI_6358_MSG_CTL_WIDTH; 61 89 } 62 - 63 - bcm63xx_spi_regs_init(); 64 90 65 91 return platform_device_register(&bcm63xx_spi_device); 66 92 }
-44
arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_spi.h
··· 7 7 8 8 int __init bcm63xx_spi_register(void); 9 9 10 - struct bcm63xx_spi_pdata { 11 - unsigned int fifo_size; 12 - unsigned int msg_type_shift; 13 - unsigned int msg_ctl_width; 14 - int bus_num; 15 - int num_chipselect; 16 - }; 17 - 18 - enum bcm63xx_regs_spi { 19 - SPI_CMD, 20 - SPI_INT_STATUS, 21 - SPI_INT_MASK_ST, 22 - SPI_INT_MASK, 23 - SPI_ST, 24 - SPI_CLK_CFG, 25 - SPI_FILL_BYTE, 26 - SPI_MSG_TAIL, 27 - SPI_RX_TAIL, 28 - SPI_MSG_CTL, 29 - SPI_MSG_DATA, 30 - SPI_RX_DATA, 31 - }; 32 - 33 - #define __GEN_SPI_REGS_TABLE(__cpu) \ 34 - [SPI_CMD] = SPI_## __cpu ##_CMD, \ 35 - [SPI_INT_STATUS] = SPI_## __cpu ##_INT_STATUS, \ 36 - [SPI_INT_MASK_ST] = SPI_## __cpu ##_INT_MASK_ST, \ 37 - [SPI_INT_MASK] = SPI_## __cpu ##_INT_MASK, \ 38 - [SPI_ST] = SPI_## __cpu ##_ST, \ 39 - [SPI_CLK_CFG] = SPI_## __cpu ##_CLK_CFG, \ 40 - [SPI_FILL_BYTE] = SPI_## __cpu ##_FILL_BYTE, \ 41 - [SPI_MSG_TAIL] = SPI_## __cpu ##_MSG_TAIL, \ 42 - [SPI_RX_TAIL] = SPI_## __cpu ##_RX_TAIL, \ 43 - [SPI_MSG_CTL] = SPI_## __cpu ##_MSG_CTL, \ 44 - [SPI_MSG_DATA] = SPI_## __cpu ##_MSG_DATA, \ 45 - [SPI_RX_DATA] = SPI_## __cpu ##_RX_DATA, 46 - 47 - static inline unsigned long bcm63xx_spireg(enum bcm63xx_regs_spi reg) 48 - { 49 - extern const unsigned long *bcm63xx_regs_spi; 50 - 51 - return bcm63xx_regs_spi[reg]; 52 - } 53 - 54 10 #endif /* BCM63XX_DEV_SPI_H */
-1
arch/mips/txx9/generic/spi_eeprom.c
··· 80 80 static struct spi_driver early_seeprom_driver __initdata = { 81 81 .driver = { 82 82 .name = "at25", 83 - .owner = THIS_MODULE, 84 83 }, 85 84 .probe = early_seeprom_probe, 86 85 };
-1
drivers/char/tpm/st33zp24/spi.c
··· 381 381 382 382 static struct spi_driver tpm_st33_spi_driver = { 383 383 .driver = { 384 - .owner = THIS_MODULE, 385 384 .name = TPM_ST33_SPI, 386 385 .pm = &st33zp24_spi_ops, 387 386 .of_match_table = of_match_ptr(of_st33zp24_spi_match),
-1
drivers/gpio/gpio-74x164.c
··· 183 183 static struct spi_driver gen_74x164_driver = { 184 184 .driver = { 185 185 .name = "74x164", 186 - .owner = THIS_MODULE, 187 186 .of_match_table = gen_74x164_dt_ids, 188 187 }, 189 188 .probe = gen_74x164_probe,
-1
drivers/gpio/gpio-max7301.c
··· 87 87 static struct spi_driver max7301_driver = { 88 88 .driver = { 89 89 .name = "max7301", 90 - .owner = THIS_MODULE, 91 90 }, 92 91 .probe = max7301_probe, 93 92 .remove = max7301_remove,
-1
drivers/gpio/gpio-mc33880.c
··· 163 163 static struct spi_driver mc33880_driver = { 164 164 .driver = { 165 165 .name = DRIVER_NAME, 166 - .owner = THIS_MODULE, 167 166 }, 168 167 .probe = mc33880_probe, 169 168 .remove = mc33880_remove,
-2
drivers/gpio/gpio-mcp23s08.c
··· 848 848 static struct i2c_driver mcp230xx_driver = { 849 849 .driver = { 850 850 .name = "mcp230xx", 851 - .owner = THIS_MODULE, 852 851 .of_match_table = of_match_ptr(mcp23s08_i2c_of_match), 853 852 }, 854 853 .probe = mcp230xx_probe, ··· 1020 1021 .id_table = mcp23s08_ids, 1021 1022 .driver = { 1022 1023 .name = "mcp23s08", 1023 - .owner = THIS_MODULE, 1024 1024 .of_match_table = of_match_ptr(mcp23s08_spi_of_match), 1025 1025 }, 1026 1026 };
-1
drivers/gpu/drm/panel/panel-lg-lg4573.c
··· 287 287 .remove = lg4573_remove, 288 288 .driver = { 289 289 .name = "lg4573", 290 - .owner = THIS_MODULE, 291 290 .of_match_table = lg4573_of_match, 292 291 }, 293 292 };
-1
drivers/gpu/drm/panel/panel-samsung-ld9040.c
··· 378 378 .remove = ld9040_remove, 379 379 .driver = { 380 380 .name = "panel-samsung-ld9040", 381 - .owner = THIS_MODULE, 382 381 .of_match_table = ld9040_of_match, 383 382 }, 384 383 };
-1
drivers/hwmon/ad7314.c
··· 157 157 static struct spi_driver ad7314_driver = { 158 158 .driver = { 159 159 .name = "ad7314", 160 - .owner = THIS_MODULE, 161 160 }, 162 161 .probe = ad7314_probe, 163 162 .remove = ad7314_remove,
-1
drivers/hwmon/adcxx.c
··· 234 234 static struct spi_driver adcxx_driver = { 235 235 .driver = { 236 236 .name = "adcxx", 237 - .owner = THIS_MODULE, 238 237 }, 239 238 .id_table = adcxx_ids, 240 239 .probe = adcxx_probe,
-1
drivers/hwmon/ads7871.c
··· 237 237 static struct spi_driver ads7871_driver = { 238 238 .driver = { 239 239 .name = DEVICE_NAME, 240 - .owner = THIS_MODULE, 241 240 }, 242 241 243 242 .probe = ads7871_probe,
-1
drivers/hwmon/adt7310.c
··· 104 104 static struct spi_driver adt7310_driver = { 105 105 .driver = { 106 106 .name = "adt7310", 107 - .owner = THIS_MODULE, 108 107 .pm = ADT7X10_DEV_PM_OPS, 109 108 }, 110 109 .probe = adt7310_spi_probe,
-1
drivers/hwmon/lm70.c
··· 199 199 static struct spi_driver lm70_driver = { 200 200 .driver = { 201 201 .name = "lm70", 202 - .owner = THIS_MODULE, 203 202 .of_match_table = of_match_ptr(lm70_of_ids), 204 203 }, 205 204 .id_table = lm70_ids,
-1
drivers/hwmon/max1111.c
··· 277 277 static struct spi_driver max1111_driver = { 278 278 .driver = { 279 279 .name = "max1111", 280 - .owner = THIS_MODULE, 281 280 }, 282 281 .id_table = max1111_ids, 283 282 .probe = max1111_probe,
-1
drivers/iio/accel/kxsd9.c
··· 263 263 static struct spi_driver kxsd9_driver = { 264 264 .driver = { 265 265 .name = "kxsd9", 266 - .owner = THIS_MODULE, 267 266 }, 268 267 .probe = kxsd9_probe, 269 268 .remove = kxsd9_remove,
-1
drivers/iio/accel/st_accel_spi.c
··· 64 64 65 65 static struct spi_driver st_accel_driver = { 66 66 .driver = { 67 - .owner = THIS_MODULE, 68 67 .name = "st-accel-spi", 69 68 }, 70 69 .probe = st_accel_spi_probe,
-1
drivers/iio/adc/ad7266.c
··· 509 509 static struct spi_driver ad7266_driver = { 510 510 .driver = { 511 511 .name = "ad7266", 512 - .owner = THIS_MODULE, 513 512 }, 514 513 .probe = ad7266_probe, 515 514 .remove = ad7266_remove,
-1
drivers/iio/adc/ad7298.c
··· 378 378 static struct spi_driver ad7298_driver = { 379 379 .driver = { 380 380 .name = "ad7298", 381 - .owner = THIS_MODULE, 382 381 }, 383 382 .probe = ad7298_probe, 384 383 .remove = ad7298_remove,
-1
drivers/iio/adc/ad7476.c
··· 302 302 static struct spi_driver ad7476_driver = { 303 303 .driver = { 304 304 .name = "ad7476", 305 - .owner = THIS_MODULE, 306 305 }, 307 306 .probe = ad7476_probe, 308 307 .remove = ad7476_remove,
-1
drivers/iio/adc/ad7791.c
··· 440 440 static struct spi_driver ad7791_driver = { 441 441 .driver = { 442 442 .name = "ad7791", 443 - .owner = THIS_MODULE, 444 443 }, 445 444 .probe = ad7791_probe, 446 445 .remove = ad7791_remove,
-1
drivers/iio/adc/ad7793.c
··· 852 852 static struct spi_driver ad7793_driver = { 853 853 .driver = { 854 854 .name = "ad7793", 855 - .owner = THIS_MODULE, 856 855 }, 857 856 .probe = ad7793_probe, 858 857 .remove = ad7793_remove,
-1
drivers/iio/adc/ad7887.c
··· 356 356 static struct spi_driver ad7887_driver = { 357 357 .driver = { 358 358 .name = "ad7887", 359 - .owner = THIS_MODULE, 360 359 }, 361 360 .probe = ad7887_probe, 362 361 .remove = ad7887_remove,
-1
drivers/iio/adc/ad7923.c
··· 357 357 static struct spi_driver ad7923_driver = { 358 358 .driver = { 359 359 .name = "ad7923", 360 - .owner = THIS_MODULE, 361 360 }, 362 361 .probe = ad7923_probe, 363 362 .remove = ad7923_remove,
-1
drivers/iio/adc/max1027.c
··· 509 509 .driver = { 510 510 .name = "max1027", 511 511 .of_match_table = of_match_ptr(max1027_adc_dt_ids), 512 - .owner = THIS_MODULE, 513 512 }, 514 513 .probe = max1027_probe, 515 514 .remove = max1027_remove,
-1
drivers/iio/adc/mcp320x.c
··· 405 405 .driver = { 406 406 .name = "mcp320x", 407 407 .of_match_table = of_match_ptr(mcp320x_dt_ids), 408 - .owner = THIS_MODULE, 409 408 }, 410 409 .probe = mcp320x_probe, 411 410 .remove = mcp320x_remove,
-1
drivers/iio/adc/ti-adc128s052.c
··· 192 192 .driver = { 193 193 .name = "adc128s052", 194 194 .of_match_table = of_match_ptr(adc128_of_match), 195 - .owner = THIS_MODULE, 196 195 }, 197 196 .probe = adc128_probe, 198 197 .remove = adc128_remove,
-1
drivers/iio/amplifiers/ad8366.c
··· 200 200 static struct spi_driver ad8366_driver = { 201 201 .driver = { 202 202 .name = KBUILD_MODNAME, 203 - .owner = THIS_MODULE, 204 203 }, 205 204 .probe = ad8366_probe, 206 205 .remove = ad8366_remove,
-1
drivers/iio/common/ssp_sensors/ssp_dev.c
··· 700 700 .remove = ssp_remove, 701 701 .driver = { 702 702 .pm = &ssp_pm_ops, 703 - .owner = THIS_MODULE, 704 703 .of_match_table = of_match_ptr(ssp_of_match), 705 704 .name = "sensorhub" 706 705 },
-1
drivers/iio/dac/ad5064.c
··· 568 568 static struct spi_driver ad5064_spi_driver = { 569 569 .driver = { 570 570 .name = "ad5064", 571 - .owner = THIS_MODULE, 572 571 }, 573 572 .probe = ad5064_spi_probe, 574 573 .remove = ad5064_spi_remove,
-1
drivers/iio/dac/ad5360.c
··· 549 549 static struct spi_driver ad5360_driver = { 550 550 .driver = { 551 551 .name = "ad5360", 552 - .owner = THIS_MODULE, 553 552 }, 554 553 .probe = ad5360_probe, 555 554 .remove = ad5360_remove,
-1
drivers/iio/dac/ad5380.c
··· 519 519 static struct spi_driver ad5380_spi_driver = { 520 520 .driver = { 521 521 .name = "ad5380", 522 - .owner = THIS_MODULE, 523 522 }, 524 523 .probe = ad5380_spi_probe, 525 524 .remove = ad5380_spi_remove,
-1
drivers/iio/dac/ad5421.c
··· 524 524 static struct spi_driver ad5421_driver = { 525 525 .driver = { 526 526 .name = "ad5421", 527 - .owner = THIS_MODULE, 528 527 }, 529 528 .probe = ad5421_probe, 530 529 };
-1
drivers/iio/dac/ad5446.c
··· 481 481 static struct spi_driver ad5446_spi_driver = { 482 482 .driver = { 483 483 .name = "ad5446", 484 - .owner = THIS_MODULE, 485 484 }, 486 485 .probe = ad5446_spi_probe, 487 486 .remove = ad5446_spi_remove,
-1
drivers/iio/dac/ad5449.c
··· 356 356 static struct spi_driver ad5449_spi_driver = { 357 357 .driver = { 358 358 .name = "ad5449", 359 - .owner = THIS_MODULE, 360 359 }, 361 360 .probe = ad5449_spi_probe, 362 361 .remove = ad5449_spi_remove,
-1
drivers/iio/dac/ad5504.c
··· 363 363 static struct spi_driver ad5504_driver = { 364 364 .driver = { 365 365 .name = "ad5504", 366 - .owner = THIS_MODULE, 367 366 }, 368 367 .probe = ad5504_probe, 369 368 .remove = ad5504_remove,
-1
drivers/iio/dac/ad5624r_spi.c
··· 306 306 static struct spi_driver ad5624r_driver = { 307 307 .driver = { 308 308 .name = "ad5624r", 309 - .owner = THIS_MODULE, 310 309 }, 311 310 .probe = ad5624r_probe, 312 311 .remove = ad5624r_remove,
-1
drivers/iio/dac/ad5686.c
··· 395 395 static struct spi_driver ad5686_driver = { 396 396 .driver = { 397 397 .name = "ad5686", 398 - .owner = THIS_MODULE, 399 398 }, 400 399 .probe = ad5686_probe, 401 400 .remove = ad5686_remove,
-1
drivers/iio/dac/ad5755.c
··· 610 610 static struct spi_driver ad5755_driver = { 611 611 .driver = { 612 612 .name = "ad5755", 613 - .owner = THIS_MODULE, 614 613 }, 615 614 .probe = ad5755_probe, 616 615 .id_table = ad5755_id,
-1
drivers/iio/dac/ad5764.c
··· 357 357 static struct spi_driver ad5764_driver = { 358 358 .driver = { 359 359 .name = "ad5764", 360 - .owner = THIS_MODULE, 361 360 }, 362 361 .probe = ad5764_probe, 363 362 .remove = ad5764_remove,
-1
drivers/iio/dac/ad5791.c
··· 461 461 static struct spi_driver ad5791_driver = { 462 462 .driver = { 463 463 .name = "ad5791", 464 - .owner = THIS_MODULE, 465 464 }, 466 465 .probe = ad5791_probe, 467 466 .remove = ad5791_remove,
-1
drivers/iio/dac/ad7303.c
··· 297 297 .driver = { 298 298 .name = "ad7303", 299 299 .of_match_table = of_match_ptr(ad7303_spi_of_match), 300 - .owner = THIS_MODULE, 301 300 }, 302 301 .probe = ad7303_probe, 303 302 .remove = ad7303_remove,
-1
drivers/iio/dac/mcp4922.c
··· 203 203 static struct spi_driver mcp4922_driver = { 204 204 .driver = { 205 205 .name = "mcp4922", 206 - .owner = THIS_MODULE, 207 206 }, 208 207 .probe = mcp4922_probe, 209 208 .remove = mcp4922_remove,
-1
drivers/iio/frequency/ad9523.c
··· 1027 1027 static struct spi_driver ad9523_driver = { 1028 1028 .driver = { 1029 1029 .name = "ad9523", 1030 - .owner = THIS_MODULE, 1031 1030 }, 1032 1031 .probe = ad9523_probe, 1033 1032 .remove = ad9523_remove,
-1
drivers/iio/frequency/adf4350.c
··· 634 634 .driver = { 635 635 .name = "adf4350", 636 636 .of_match_table = of_match_ptr(adf4350_of_match), 637 - .owner = THIS_MODULE, 638 637 }, 639 638 .probe = adf4350_probe, 640 639 .remove = adf4350_remove,
-1
drivers/iio/gyro/adis16080.c
··· 228 228 static struct spi_driver adis16080_driver = { 229 229 .driver = { 230 230 .name = "adis16080", 231 - .owner = THIS_MODULE, 232 231 }, 233 232 .probe = adis16080_probe, 234 233 .remove = adis16080_remove,
-1
drivers/iio/gyro/adis16130.c
··· 167 167 static struct spi_driver adis16130_driver = { 168 168 .driver = { 169 169 .name = "adis16130", 170 - .owner = THIS_MODULE, 171 170 }, 172 171 .probe = adis16130_probe, 173 172 };
-1
drivers/iio/gyro/adis16136.c
··· 570 570 static struct spi_driver adis16136_driver = { 571 571 .driver = { 572 572 .name = "adis16136", 573 - .owner = THIS_MODULE, 574 573 }, 575 574 .id_table = adis16136_ids, 576 575 .probe = adis16136_probe,
-1
drivers/iio/gyro/adis16260.c
··· 435 435 static struct spi_driver adis16260_driver = { 436 436 .driver = { 437 437 .name = "adis16260", 438 - .owner = THIS_MODULE, 439 438 }, 440 439 .probe = adis16260_probe, 441 440 .remove = adis16260_remove,
-1
drivers/iio/gyro/adxrs450.c
··· 456 456 static struct spi_driver adxrs450_driver = { 457 457 .driver = { 458 458 .name = "adxrs450", 459 - .owner = THIS_MODULE, 460 459 }, 461 460 .probe = adxrs450_probe, 462 461 .id_table = adxrs450_id,
-1
drivers/iio/gyro/st_gyro_spi.c
··· 60 60 61 61 static struct spi_driver st_gyro_driver = { 62 62 .driver = { 63 - .owner = THIS_MODULE, 64 63 .name = "st-gyro-spi", 65 64 }, 66 65 .probe = st_gyro_spi_probe,
-1
drivers/iio/imu/adis16400_core.c
··· 986 986 static struct spi_driver adis16400_driver = { 987 987 .driver = { 988 988 .name = "adis16400", 989 - .owner = THIS_MODULE, 990 989 }, 991 990 .id_table = adis16400_id, 992 991 .probe = adis16400_probe,
-1
drivers/iio/imu/adis16480.c
··· 896 896 static struct spi_driver adis16480_driver = { 897 897 .driver = { 898 898 .name = "adis16480", 899 - .owner = THIS_MODULE, 900 899 }, 901 900 .id_table = adis16480_ids, 902 901 .probe = adis16480_probe,
-1
drivers/iio/magnetometer/st_magn_spi.c
··· 58 58 59 59 static struct spi_driver st_magn_driver = { 60 60 .driver = { 61 - .owner = THIS_MODULE, 62 61 .name = "st-magn-spi", 63 62 }, 64 63 .probe = st_magn_spi_probe,
-1
drivers/iio/pressure/ms5611_spi.c
··· 117 117 static struct spi_driver ms5611_driver = { 118 118 .driver = { 119 119 .name = "ms5611", 120 - .owner = THIS_MODULE, 121 120 }, 122 121 .id_table = ms5611_id, 123 122 .probe = ms5611_spi_probe,
-1
drivers/iio/pressure/st_pressure_spi.c
··· 56 56 57 57 static struct spi_driver st_press_driver = { 58 58 .driver = { 59 - .owner = THIS_MODULE, 60 59 .name = "st-press-spi", 61 60 }, 62 61 .probe = st_press_spi_probe,
-1
drivers/iio/proximity/as3935.c
··· 450 450 .driver = { 451 451 .name = "as3935", 452 452 .of_match_table = of_match_ptr(as3935_of_match), 453 - .owner = THIS_MODULE, 454 453 .pm = AS3935_PM_OPS, 455 454 }, 456 455 .probe = as3935_probe,
-1
drivers/input/misc/ad714x-spi.c
··· 113 113 static struct spi_driver ad714x_spi_driver = { 114 114 .driver = { 115 115 .name = "ad714x_captouch", 116 - .owner = THIS_MODULE, 117 116 .pm = &ad714x_spi_pm, 118 117 }, 119 118 .probe = ad714x_spi_probe,
-1
drivers/input/misc/adxl34x-spi.c
··· 120 120 static struct spi_driver adxl34x_driver = { 121 121 .driver = { 122 122 .name = "adxl34x", 123 - .owner = THIS_MODULE, 124 123 .pm = &adxl34x_spi_pm, 125 124 }, 126 125 .probe = adxl34x_spi_probe,
-1
drivers/input/touchscreen/ad7877.c
··· 843 843 static struct spi_driver ad7877_driver = { 844 844 .driver = { 845 845 .name = "ad7877", 846 - .owner = THIS_MODULE, 847 846 .pm = &ad7877_pm, 848 847 }, 849 848 .probe = ad7877_probe,
-1
drivers/input/touchscreen/ad7879-spi.c
··· 149 149 static struct spi_driver ad7879_spi_driver = { 150 150 .driver = { 151 151 .name = "ad7879", 152 - .owner = THIS_MODULE, 153 152 .pm = &ad7879_pm_ops, 154 153 }, 155 154 .probe = ad7879_spi_probe,
-1
drivers/input/touchscreen/ads7846.c
··· 1500 1500 static struct spi_driver ads7846_driver = { 1501 1501 .driver = { 1502 1502 .name = "ads7846", 1503 - .owner = THIS_MODULE, 1504 1503 .pm = &ads7846_pm, 1505 1504 .of_match_table = of_match_ptr(ads7846_dt_ids), 1506 1505 },
-1
drivers/input/touchscreen/cyttsp4_spi.c
··· 185 185 static struct spi_driver cyttsp4_spi_driver = { 186 186 .driver = { 187 187 .name = CYTTSP4_SPI_NAME, 188 - .owner = THIS_MODULE, 189 188 .pm = &cyttsp4_pm_ops, 190 189 }, 191 190 .probe = cyttsp4_spi_probe,
-1
drivers/input/touchscreen/cyttsp_spi.c
··· 182 182 static struct spi_driver cyttsp_spi_driver = { 183 183 .driver = { 184 184 .name = CY_SPI_NAME, 185 - .owner = THIS_MODULE, 186 185 .pm = &cyttsp_pm_ops, 187 186 }, 188 187 .probe = cyttsp_spi_probe,
-1
drivers/input/touchscreen/tsc2005.c
··· 752 752 static struct spi_driver tsc2005_driver = { 753 753 .driver = { 754 754 .name = "tsc2005", 755 - .owner = THIS_MODULE, 756 755 .pm = &tsc2005_pm_ops, 757 756 }, 758 757 .probe = tsc2005_probe,
-1
drivers/leds/leds-dac124s085.c
··· 122 122 .remove = dac124s085_remove, 123 123 .driver = { 124 124 .name = "dac124s085", 125 - .owner = THIS_MODULE, 126 125 }, 127 126 }; 128 127
-1
drivers/media/i2c/s5c73m3/s5c73m3-spi.c
··· 150 150 spidrv->remove = s5c73m3_spi_remove; 151 151 spidrv->probe = s5c73m3_spi_probe; 152 152 spidrv->driver.name = S5C73M3_SPI_DRV_NAME; 153 - spidrv->driver.owner = THIS_MODULE; 154 153 spidrv->driver.of_match_table = s5c73m3_spi_ids; 155 154 156 155 return spi_register_driver(spidrv);
-1
drivers/media/tuners/msi001.c
··· 513 513 static struct spi_driver msi001_driver = { 514 514 .driver = { 515 515 .name = "msi001", 516 - .owner = THIS_MODULE, 517 516 .suppress_bind_attrs = true, 518 517 }, 519 518 .probe = msi001_probe,
-1
drivers/mfd/arizona-spi.c
··· 93 93 static struct spi_driver arizona_spi_driver = { 94 94 .driver = { 95 95 .name = "arizona", 96 - .owner = THIS_MODULE, 97 96 .pm = &arizona_pm_ops, 98 97 .of_match_table = of_match_ptr(arizona_of_match), 99 98 },
-1
drivers/mfd/cros_ec_spi.c
··· 717 717 .driver = { 718 718 .name = "cros-ec-spi", 719 719 .of_match_table = of_match_ptr(cros_ec_spi_of_match), 720 - .owner = THIS_MODULE, 721 720 .pm = &cros_ec_spi_pm_ops, 722 721 }, 723 722 .probe = cros_ec_spi_probe,
-1
drivers/mfd/da9052-spi.c
··· 86 86 .id_table = da9052_spi_id, 87 87 .driver = { 88 88 .name = "da9052", 89 - .owner = THIS_MODULE, 90 89 }, 91 90 }; 92 91
-1
drivers/mfd/ezx-pcap.c
··· 513 513 .remove = ezx_pcap_remove, 514 514 .driver = { 515 515 .name = "ezx-pcap", 516 - .owner = THIS_MODULE, 517 516 }, 518 517 }; 519 518
-1
drivers/mfd/mc13xxx-spi.c
··· 177 177 .id_table = mc13xxx_device_id, 178 178 .driver = { 179 179 .name = "mc13xxx", 180 - .owner = THIS_MODULE, 181 180 .of_match_table = mc13xxx_dt_ids, 182 181 }, 183 182 .probe = mc13xxx_spi_probe,
-1
drivers/mfd/stmpe-spi.c
··· 135 135 .driver = { 136 136 .name = "stmpe-spi", 137 137 .of_match_table = of_match_ptr(stmpe_spi_of_match), 138 - .owner = THIS_MODULE, 139 138 #ifdef CONFIG_PM 140 139 .pm = &stmpe_dev_pm_ops, 141 140 #endif
-1
drivers/mfd/tps65912-spi.c
··· 111 111 static struct spi_driver tps65912_spi_driver = { 112 112 .driver = { 113 113 .name = "tps65912", 114 - .owner = THIS_MODULE, 115 114 }, 116 115 .probe = tps65912_spi_probe, 117 116 .remove = tps65912_spi_remove,
-1
drivers/mfd/wm831x-spi.c
··· 96 96 static struct spi_driver wm831x_spi_driver = { 97 97 .driver = { 98 98 .name = "wm831x", 99 - .owner = THIS_MODULE, 100 99 .pm = &wm831x_spi_pm, 101 100 }, 102 101 .id_table = wm831x_spi_ids,
-1
drivers/misc/ad525x_dpot-spi.c
··· 132 132 static struct spi_driver ad_dpot_spi_driver = { 133 133 .driver = { 134 134 .name = "ad_dpot", 135 - .owner = THIS_MODULE, 136 135 }, 137 136 .probe = ad_dpot_spi_probe, 138 137 .remove = ad_dpot_spi_remove,
-1
drivers/misc/bmp085-spi.c
··· 64 64 65 65 static struct spi_driver bmp085_spi_driver = { 66 66 .driver = { 67 - .owner = THIS_MODULE, 68 67 .name = BMP085_NAME, 69 68 .of_match_table = bmp085_of_match 70 69 },
-1
drivers/misc/eeprom/at25.c
··· 462 462 static struct spi_driver at25_driver = { 463 463 .driver = { 464 464 .name = "at25", 465 - .owner = THIS_MODULE, 466 465 .of_match_table = at25_of_match, 467 466 }, 468 467 .probe = at25_probe,
-1
drivers/misc/eeprom/eeprom_93xx46.c
··· 370 370 static struct spi_driver eeprom_93xx46_driver = { 371 371 .driver = { 372 372 .name = "93xx46", 373 - .owner = THIS_MODULE, 374 373 }, 375 374 .probe = eeprom_93xx46_probe, 376 375 .remove = eeprom_93xx46_remove,
-1
drivers/misc/lattice-ecp3-config.c
··· 235 235 static struct spi_driver lattice_ecp3_driver = { 236 236 .driver = { 237 237 .name = "lattice-ecp3", 238 - .owner = THIS_MODULE, 239 238 }, 240 239 .probe = lattice_ecp3_probe, 241 240 .remove = lattice_ecp3_remove,
-1
drivers/misc/lis3lv02d/lis3lv02d_spi.c
··· 138 138 static struct spi_driver lis302dl_spi_driver = { 139 139 .driver = { 140 140 .name = DRV_NAME, 141 - .owner = THIS_MODULE, 142 141 .pm = &lis3lv02d_spi_pm, 143 142 .of_match_table = of_match_ptr(lis302dl_spi_dt_ids), 144 143 },
-1
drivers/misc/ti_dac7512.c
··· 89 89 static struct spi_driver dac7512_driver = { 90 90 .driver = { 91 91 .name = "dac7512", 92 - .owner = THIS_MODULE, 93 92 .of_match_table = of_match_ptr(dac7512_of_match), 94 93 }, 95 94 .probe = dac7512_probe,
-1
drivers/mmc/host/mmc_spi.c
··· 1516 1516 static struct spi_driver mmc_spi_driver = { 1517 1517 .driver = { 1518 1518 .name = "mmc_spi", 1519 - .owner = THIS_MODULE, 1520 1519 .of_match_table = mmc_spi_of_match_table, 1521 1520 }, 1522 1521 .probe = mmc_spi_probe,
-1
drivers/mtd/devices/m25p80.c
··· 304 304 static struct spi_driver m25p80_driver = { 305 305 .driver = { 306 306 .name = "m25p80", 307 - .owner = THIS_MODULE, 308 307 .of_match_table = m25p_of_table, 309 308 }, 310 309 .id_table = m25p_ids,
-1
drivers/mtd/devices/mtd_dataflash.c
··· 911 911 static struct spi_driver dataflash_driver = { 912 912 .driver = { 913 913 .name = "mtd_dataflash", 914 - .owner = THIS_MODULE, 915 914 .of_match_table = of_match_ptr(dataflash_dt_ids), 916 915 }, 917 916
-1
drivers/mtd/devices/sst25l.c
··· 417 417 static struct spi_driver sst25l_driver = { 418 418 .driver = { 419 419 .name = "sst25l", 420 - .owner = THIS_MODULE, 421 420 }, 422 421 .probe = sst25l_probe, 423 422 .remove = sst25l_remove,
-1
drivers/net/can/spi/mcp251x.c
··· 1243 1243 static struct spi_driver mcp251x_can_driver = { 1244 1244 .driver = { 1245 1245 .name = DEVICE_NAME, 1246 - .owner = THIS_MODULE, 1247 1246 .of_match_table = mcp251x_of_match, 1248 1247 .pm = &mcp251x_can_pm_ops, 1249 1248 },
-1
drivers/net/ethernet/micrel/ks8851.c
··· 1607 1607 .driver = { 1608 1608 .name = "ks8851", 1609 1609 .of_match_table = ks8851_match_table, 1610 - .owner = THIS_MODULE, 1611 1610 .pm = &ks8851_pm_ops, 1612 1611 }, 1613 1612 .probe = ks8851_probe,
-1
drivers/net/ethernet/microchip/enc28j60.c
··· 1633 1633 static struct spi_driver enc28j60_driver = { 1634 1634 .driver = { 1635 1635 .name = DRV_NAME, 1636 - .owner = THIS_MODULE, 1637 1636 }, 1638 1637 .probe = enc28j60_probe, 1639 1638 .remove = enc28j60_remove,
-1
drivers/net/ethernet/qualcomm/qca_spi.c
··· 974 974 static struct spi_driver qca_spi_driver = { 975 975 .driver = { 976 976 .name = QCASPI_DRV_NAME, 977 - .owner = THIS_MODULE, 978 977 .of_match_table = qca_spi_of_match, 979 978 }, 980 979 .id_table = qca_spi_id,
-1
drivers/net/ieee802154/at86rf230.c
··· 1816 1816 .driver = { 1817 1817 .of_match_table = of_match_ptr(at86rf230_of_match), 1818 1818 .name = "at86rf230", 1819 - .owner = THIS_MODULE, 1820 1819 }, 1821 1820 .probe = at86rf230_probe, 1822 1821 .remove = at86rf230_remove,
-1
drivers/net/ieee802154/cc2520.c
··· 1152 1152 static struct spi_driver cc2520_driver = { 1153 1153 .driver = { 1154 1154 .name = "cc2520", 1155 - .owner = THIS_MODULE, 1156 1155 .of_match_table = of_match_ptr(cc2520_of_ids), 1157 1156 }, 1158 1157 .id_table = cc2520_ids,
-1
drivers/net/ieee802154/mrf24j40.c
··· 1382 1382 .driver = { 1383 1383 .of_match_table = of_match_ptr(mrf24j40_of_match), 1384 1384 .name = "mrf24j40", 1385 - .owner = THIS_MODULE, 1386 1385 }, 1387 1386 .id_table = mrf24j40_ids, 1388 1387 .probe = mrf24j40_probe,
-1
drivers/net/phy/spi_ks8995.c
··· 343 343 static struct spi_driver ks8995_driver = { 344 344 .driver = { 345 345 .name = "spi-ks8995", 346 - .owner = THIS_MODULE, 347 346 }, 348 347 .probe = ks8995_probe, 349 348 .remove = ks8995_remove,
-1
drivers/net/wireless/cw1200/cw1200_spi.c
··· 467 467 .remove = cw1200_spi_disconnect, 468 468 .driver = { 469 469 .name = "cw1200_wlan_spi", 470 - .owner = THIS_MODULE, 471 470 #ifdef CONFIG_PM 472 471 .pm = &cw1200_pm_ops, 473 472 #endif
-1
drivers/net/wireless/libertas/if_spi.c
··· 1283 1283 .remove = libertas_spi_remove, 1284 1284 .driver = { 1285 1285 .name = "libertas_spi", 1286 - .owner = THIS_MODULE, 1287 1286 .pm = &if_spi_pm_ops, 1288 1287 }, 1289 1288 };
-1
drivers/net/wireless/p54/p54spi.c
··· 705 705 static struct spi_driver p54spi_driver = { 706 706 .driver = { 707 707 .name = "p54spi", 708 - .owner = THIS_MODULE, 709 708 }, 710 709 711 710 .probe = p54spi_probe,
-1
drivers/net/wireless/ti/wl1251/spi.c
··· 354 354 static struct spi_driver wl1251_spi_driver = { 355 355 .driver = { 356 356 .name = DRIVER_NAME, 357 - .owner = THIS_MODULE, 358 357 }, 359 358 360 359 .probe = wl1251_spi_probe,
-1
drivers/net/wireless/ti/wlcore/spi.c
··· 408 408 static struct spi_driver wl1271_spi_driver = { 409 409 .driver = { 410 410 .name = "wl1271_spi", 411 - .owner = THIS_MODULE, 412 411 }, 413 412 414 413 .probe = wl1271_probe,
-1
drivers/nfc/st-nci/spi.c
··· 384 384 385 385 static struct spi_driver st_nci_spi_driver = { 386 386 .driver = { 387 - .owner = THIS_MODULE, 388 387 .name = ST_NCI_SPI_DRIVER_NAME, 389 388 .of_match_table = of_match_ptr(of_st_nci_spi_match), 390 389 },
-1
drivers/nfc/trf7970a.c
··· 2230 2230 .driver = { 2231 2231 .name = "trf7970a", 2232 2232 .of_match_table = of_match_ptr(trf7970a_of_match), 2233 - .owner = THIS_MODULE, 2234 2233 .pm = &trf7970a_pm_ops, 2235 2234 }, 2236 2235 };
-1
drivers/regulator/tps6524x-regulator.c
··· 629 629 .probe = pmic_probe, 630 630 .driver = { 631 631 .name = "tps6524x", 632 - .owner = THIS_MODULE, 633 632 }, 634 633 }; 635 634
-1
drivers/rtc/rtc-ds1305.c
··· 772 772 773 773 static struct spi_driver ds1305_driver = { 774 774 .driver.name = "rtc-ds1305", 775 - .driver.owner = THIS_MODULE, 776 775 .probe = ds1305_probe, 777 776 .remove = ds1305_remove, 778 777 /* REVISIT add suspend/resume */
-1
drivers/rtc/rtc-ds1343.c
··· 731 731 static struct spi_driver ds1343_driver = { 732 732 .driver = { 733 733 .name = "ds1343", 734 - .owner = THIS_MODULE, 735 734 .pm = &ds1343_pm, 736 735 }, 737 736 .probe = ds1343_probe,
-1
drivers/rtc/rtc-ds1347.c
··· 154 154 static struct spi_driver ds1347_driver = { 155 155 .driver = { 156 156 .name = "ds1347", 157 - .owner = THIS_MODULE, 158 157 }, 159 158 .probe = ds1347_probe, 160 159 };
-1
drivers/rtc/rtc-ds1390.c
··· 156 156 static struct spi_driver ds1390_driver = { 157 157 .driver = { 158 158 .name = "rtc-ds1390", 159 - .owner = THIS_MODULE, 160 159 }, 161 160 .probe = ds1390_probe, 162 161 };
-1
drivers/rtc/rtc-ds3234.c
··· 159 159 static struct spi_driver ds3234_driver = { 160 160 .driver = { 161 161 .name = "ds3234", 162 - .owner = THIS_MODULE, 163 162 }, 164 163 .probe = ds3234_probe, 165 164 };
-1
drivers/rtc/rtc-m41t93.c
··· 197 197 static struct spi_driver m41t93_driver = { 198 198 .driver = { 199 199 .name = "rtc-m41t93", 200 - .owner = THIS_MODULE, 201 200 }, 202 201 .probe = m41t93_probe, 203 202 };
-1
drivers/rtc/rtc-m41t94.c
··· 137 137 static struct spi_driver m41t94_driver = { 138 138 .driver = { 139 139 .name = "rtc-m41t94", 140 - .owner = THIS_MODULE, 141 140 }, 142 141 .probe = m41t94_probe, 143 142 };
-1
drivers/rtc/rtc-max6902.c
··· 146 146 static struct spi_driver max6902_driver = { 147 147 .driver = { 148 148 .name = "rtc-max6902", 149 - .owner = THIS_MODULE, 150 149 }, 151 150 .probe = max6902_probe, 152 151 };
-1
drivers/rtc/rtc-mcp795.c
··· 186 186 static struct spi_driver mcp795_driver = { 187 187 .driver = { 188 188 .name = "rtc-mcp795", 189 - .owner = THIS_MODULE, 190 189 }, 191 190 .probe = mcp795_probe, 192 191 };
-1
drivers/rtc/rtc-pcf2123.c
··· 346 346 static struct spi_driver pcf2123_driver = { 347 347 .driver = { 348 348 .name = "rtc-pcf2123", 349 - .owner = THIS_MODULE, 350 349 .of_match_table = of_match_ptr(pcf2123_dt_ids), 351 350 }, 352 351 .probe = pcf2123_probe,
-1
drivers/rtc/rtc-r9701.c
··· 172 172 static struct spi_driver r9701_driver = { 173 173 .driver = { 174 174 .name = "rtc-r9701", 175 - .owner = THIS_MODULE, 176 175 }, 177 176 .probe = r9701_probe, 178 177 .remove = r9701_remove,
-1
drivers/rtc/rtc-rs5c348.c
··· 221 221 static struct spi_driver rs5c348_driver = { 222 222 .driver = { 223 223 .name = "rtc-rs5c348", 224 - .owner = THIS_MODULE, 225 224 }, 226 225 .probe = rs5c348_probe, 227 226 };
-1
drivers/rtc/rtc-rx4581.c
··· 291 291 static struct spi_driver rx4581_driver = { 292 292 .driver = { 293 293 .name = "rtc-rx4581", 294 - .owner = THIS_MODULE, 295 294 }, 296 295 .probe = rx4581_probe, 297 296 .id_table = rx4581_id,
+13 -2
drivers/spi/Kconfig
··· 88 88 is for the regular SPI controller. Slave mode operation is not also 89 89 not supported. 90 90 91 + config SPI_BCM2835AUX 92 + tristate "BCM2835 SPI auxiliary controller" 93 + depends on ARCH_BCM2835 || COMPILE_TEST 94 + depends on GPIOLIB 95 + help 96 + This selects a driver for the Broadcom BCM2835 SPI aux master. 97 + 98 + The BCM2835 contains two types of SPI master controller; the 99 + "universal SPI master", and the regular SPI controller. 100 + This driver is for the universal/auxiliary SPI controller. 101 + 91 102 config SPI_BFIN5XX 92 103 tristate "SPI controller driver for ADI Blackfin5xx" 93 104 depends on BLACKFIN && !BF60x ··· 136 125 137 126 config SPI_BCM63XX 138 127 tristate "Broadcom BCM63xx SPI controller" 139 - depends on BCM63XX 128 + depends on BCM63XX || COMPILE_TEST 140 129 help 141 130 Enable support for the SPI controller on the Broadcom BCM63xx SoCs. 142 131 ··· 315 304 config SPI_FSL_DSPI 316 305 tristate "Freescale DSPI controller" 317 306 select REGMAP_MMIO 318 - depends on SOC_VF610 || SOC_LS1021A || COMPILE_TEST 307 + depends on SOC_VF610 || SOC_LS1021A || ARCH_LAYERSCAPE || COMPILE_TEST 319 308 help 320 309 This enables support for the Freescale DSPI controller in master 321 310 mode. VF610 platform uses the controller.
+1
drivers/spi/Makefile
··· 15 15 obj-$(CONFIG_SPI_ATH79) += spi-ath79.o 16 16 obj-$(CONFIG_SPI_AU1550) += spi-au1550.o 17 17 obj-$(CONFIG_SPI_BCM2835) += spi-bcm2835.o 18 + obj-$(CONFIG_SPI_BCM2835AUX) += spi-bcm2835aux.o 18 19 obj-$(CONFIG_SPI_BCM53XX) += spi-bcm53xx.o 19 20 obj-$(CONFIG_SPI_BCM63XX) += spi-bcm63xx.o 20 21 obj-$(CONFIG_SPI_BCM63XX_HSSPI) += spi-bcm63xx-hsspi.o
+3 -8
drivers/spi/spi-ath79.c
··· 240 240 sp->bitbang.flags = SPI_CS_HIGH; 241 241 242 242 r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 243 - if (r == NULL) { 244 - ret = -ENOENT; 245 - goto err_put_master; 246 - } 247 - 248 - sp->base = devm_ioremap(&pdev->dev, r->start, resource_size(r)); 249 - if (!sp->base) { 250 - ret = -ENXIO; 243 + sp->base = devm_ioremap_resource(&pdev->dev, r); 244 + if (IS_ERR(sp->base)) { 245 + ret = PTR_ERR(sp->base); 251 246 goto err_put_master; 252 247 } 253 248
+8 -16
drivers/spi/spi-atmel.c
··· 773 773 774 774 *plen = len; 775 775 776 - if (atmel_spi_dma_slave_config(as, &slave_config, 8)) 776 + if (atmel_spi_dma_slave_config(as, &slave_config, 777 + xfer->bits_per_word)) 777 778 goto err_exit; 778 779 779 780 /* Send both scatterlists */ ··· 872 871 * Calculate the lowest divider that satisfies the 873 872 * constraint, assuming div32/fdiv/mbz == 0. 874 873 */ 875 - if (xfer->speed_hz) 876 - scbr = DIV_ROUND_UP(bus_hz, xfer->speed_hz); 877 - else 878 - /* 879 - * This can happend if max_speed is null. 880 - * In this case, we set the lowest possible speed 881 - */ 882 - scbr = 0xff; 874 + scbr = DIV_ROUND_UP(bus_hz, xfer->speed_hz); 883 875 884 876 /* 885 877 * If the resulting divider doesn't fit into the ··· 1294 1300 return -EINVAL; 1295 1301 } 1296 1302 1297 - if (xfer->bits_per_word) { 1298 - asd = spi->controller_state; 1299 - bits = (asd->csr >> 4) & 0xf; 1300 - if (bits != xfer->bits_per_word - 8) { 1301 - dev_dbg(&spi->dev, 1303 + asd = spi->controller_state; 1304 + bits = (asd->csr >> 4) & 0xf; 1305 + if (bits != xfer->bits_per_word - 8) { 1306 + dev_dbg(&spi->dev, 1302 1307 "you can't yet change bits_per_word in transfers\n"); 1303 - return -ENOPROTOOPT; 1304 - } 1308 + return -ENOPROTOOPT; 1305 1309 } 1306 1310 1307 1311 /*
+5 -6
drivers/spi/spi-au1550.c
··· 233 233 unsigned bpw, hz; 234 234 u32 cfg, stat; 235 235 236 - bpw = spi->bits_per_word; 237 - hz = spi->max_speed_hz; 238 236 if (t) { 239 - if (t->bits_per_word) 240 - bpw = t->bits_per_word; 241 - if (t->speed_hz) 242 - hz = t->speed_hz; 237 + bpw = t->bits_per_word; 238 + hz = t->speed_hz; 239 + } else { 240 + bpw = spi->bits_per_word; 241 + hz = spi->max_speed_hz; 243 242 } 244 243 245 244 if (!hz)
+7 -7
drivers/spi/spi-bcm2835.c
··· 777 777 goto out_master_put; 778 778 } 779 779 780 - bs->irq = irq_of_parse_and_map(pdev->dev.of_node, 0); 780 + bs->irq = platform_get_irq(pdev, 0); 781 781 if (bs->irq <= 0) { 782 782 dev_err(&pdev->dev, "could not get IRQ: %d\n", bs->irq); 783 783 err = bs->irq ? bs->irq : -ENODEV; ··· 786 786 787 787 clk_prepare_enable(bs->clk); 788 788 789 + bcm2835_dma_init(master, &pdev->dev); 790 + 791 + /* initialise the hardware with the default polarities */ 792 + bcm2835_wr(bs, BCM2835_SPI_CS, 793 + BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX); 794 + 789 795 err = devm_request_irq(&pdev->dev, bs->irq, bcm2835_spi_interrupt, 0, 790 796 dev_name(&pdev->dev), master); 791 797 if (err) { 792 798 dev_err(&pdev->dev, "could not request IRQ: %d\n", err); 793 799 goto out_clk_disable; 794 800 } 795 - 796 - bcm2835_dma_init(master, &pdev->dev); 797 - 798 - /* initialise the hardware with the default polarities */ 799 - bcm2835_wr(bs, BCM2835_SPI_CS, 800 - BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX); 801 801 802 802 err = devm_spi_register_master(&pdev->dev, master); 803 803 if (err) {
+512
drivers/spi/spi-bcm2835aux.c
··· 1 + /* 2 + * Driver for Broadcom BCM2835 auxiliary SPI Controllers 3 + * 4 + * the driver does not rely on the native chipselects at all 5 + * but only uses the gpio type chipselects 6 + * 7 + * Based on: spi-bcm2835.c 8 + * 9 + * Copyright (C) 2015 Martin Sperl 10 + * 11 + * This program is free software; you can redistribute it and/or modify 12 + * it under the terms of the GNU General Public License as published by 13 + * the Free Software Foundation; either version 2 of the License, or 14 + * (at your option) any later version. 15 + * 16 + * This program is distributed in the hope that it will be useful, 17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 + * GNU General Public License for more details. 20 + */ 21 + 22 + #include <linux/clk.h> 23 + #include <linux/completion.h> 24 + #include <linux/delay.h> 25 + #include <linux/err.h> 26 + #include <linux/interrupt.h> 27 + #include <linux/io.h> 28 + #include <linux/kernel.h> 29 + #include <linux/module.h> 30 + #include <linux/of.h> 31 + #include <linux/of_address.h> 32 + #include <linux/of_device.h> 33 + #include <linux/of_gpio.h> 34 + #include <linux/of_irq.h> 35 + #include <linux/regmap.h> 36 + #include <linux/spi/spi.h> 37 + #include <linux/spinlock.h> 38 + 39 + /* 40 + * spi register defines 41 + * 42 + * note there is garbage in the "official" documentation, 43 + * so some data is taken from the file: 44 + * brcm_usrlib/dag/vmcsx/vcinclude/bcm2708_chip/aux_io.h 45 + * inside of: 46 + * http://www.broadcom.com/docs/support/videocore/Brcm_Android_ICS_Graphics_Stack.tar.gz 47 + */ 48 + 49 + /* SPI register offsets */ 50 + #define BCM2835_AUX_SPI_CNTL0 0x00 51 + #define BCM2835_AUX_SPI_CNTL1 0x04 52 + #define BCM2835_AUX_SPI_STAT 0x08 53 + #define BCM2835_AUX_SPI_PEEK 0x0C 54 + #define BCM2835_AUX_SPI_IO 0x20 55 + #define BCM2835_AUX_SPI_TXHOLD 0x30 56 + 57 + /* Bitfields in CNTL0 */ 58 + #define BCM2835_AUX_SPI_CNTL0_SPEED 0xFFF00000 59 + #define BCM2835_AUX_SPI_CNTL0_SPEED_MAX 0xFFF 60 + #define BCM2835_AUX_SPI_CNTL0_SPEED_SHIFT 20 61 + #define BCM2835_AUX_SPI_CNTL0_CS 0x000E0000 62 + #define BCM2835_AUX_SPI_CNTL0_POSTINPUT 0x00010000 63 + #define BCM2835_AUX_SPI_CNTL0_VAR_CS 0x00008000 64 + #define BCM2835_AUX_SPI_CNTL0_VAR_WIDTH 0x00004000 65 + #define BCM2835_AUX_SPI_CNTL0_DOUTHOLD 0x00003000 66 + #define BCM2835_AUX_SPI_CNTL0_ENABLE 0x00000800 67 + #define BCM2835_AUX_SPI_CNTL0_CPHA_IN 0x00000400 68 + #define BCM2835_AUX_SPI_CNTL0_CLEARFIFO 0x00000200 69 + #define BCM2835_AUX_SPI_CNTL0_CPHA_OUT 0x00000100 70 + #define BCM2835_AUX_SPI_CNTL0_CPOL 0x00000080 71 + #define BCM2835_AUX_SPI_CNTL0_MSBF_OUT 0x00000040 72 + #define BCM2835_AUX_SPI_CNTL0_SHIFTLEN 0x0000003F 73 + 74 + /* Bitfields in CNTL1 */ 75 + #define BCM2835_AUX_SPI_CNTL1_CSHIGH 0x00000700 76 + #define BCM2835_AUX_SPI_CNTL1_IDLE 0x00000080 77 + #define BCM2835_AUX_SPI_CNTL1_TXEMPTY 0x00000040 78 + #define BCM2835_AUX_SPI_CNTL1_MSBF_IN 0x00000002 79 + #define BCM2835_AUX_SPI_CNTL1_KEEP_IN 0x00000001 80 + 81 + /* Bitfields in STAT */ 82 + #define BCM2835_AUX_SPI_STAT_TX_LVL 0xFF000000 83 + #define BCM2835_AUX_SPI_STAT_RX_LVL 0x00FF0000 84 + #define BCM2835_AUX_SPI_STAT_TX_FULL 0x00000400 85 + #define BCM2835_AUX_SPI_STAT_TX_EMPTY 0x00000200 86 + #define BCM2835_AUX_SPI_STAT_RX_FULL 0x00000100 87 + #define BCM2835_AUX_SPI_STAT_RX_EMPTY 0x00000080 88 + #define BCM2835_AUX_SPI_STAT_BUSY 0x00000040 89 + #define BCM2835_AUX_SPI_STAT_BITCOUNT 0x0000003F 90 + 91 + /* timeout values */ 92 + #define BCM2835_AUX_SPI_POLLING_LIMIT_US 30 93 + #define BCM2835_AUX_SPI_POLLING_JIFFIES 2 94 + 95 + #define BCM2835_AUX_SPI_MODE_BITS (SPI_CPOL | SPI_CPHA | SPI_CS_HIGH \ 96 + | SPI_NO_CS) 97 + 98 + struct bcm2835aux_spi { 99 + void __iomem *regs; 100 + struct clk *clk; 101 + int irq; 102 + u32 cntl[2]; 103 + const u8 *tx_buf; 104 + u8 *rx_buf; 105 + int tx_len; 106 + int rx_len; 107 + int pending; 108 + }; 109 + 110 + static inline u32 bcm2835aux_rd(struct bcm2835aux_spi *bs, unsigned reg) 111 + { 112 + return readl(bs->regs + reg); 113 + } 114 + 115 + static inline void bcm2835aux_wr(struct bcm2835aux_spi *bs, unsigned reg, 116 + u32 val) 117 + { 118 + writel(val, bs->regs + reg); 119 + } 120 + 121 + static inline void bcm2835aux_rd_fifo(struct bcm2835aux_spi *bs) 122 + { 123 + u32 data; 124 + int count = min(bs->rx_len, 3); 125 + 126 + data = bcm2835aux_rd(bs, BCM2835_AUX_SPI_IO); 127 + if (bs->rx_buf) { 128 + switch (count) { 129 + case 4: 130 + *bs->rx_buf++ = (data >> 24) & 0xff; 131 + /* fallthrough */ 132 + case 3: 133 + *bs->rx_buf++ = (data >> 16) & 0xff; 134 + /* fallthrough */ 135 + case 2: 136 + *bs->rx_buf++ = (data >> 8) & 0xff; 137 + /* fallthrough */ 138 + case 1: 139 + *bs->rx_buf++ = (data >> 0) & 0xff; 140 + /* fallthrough - no default */ 141 + } 142 + } 143 + bs->rx_len -= count; 144 + bs->pending -= count; 145 + } 146 + 147 + static inline void bcm2835aux_wr_fifo(struct bcm2835aux_spi *bs) 148 + { 149 + u32 data; 150 + u8 byte; 151 + int count; 152 + int i; 153 + 154 + /* gather up to 3 bytes to write to the FIFO */ 155 + count = min(bs->tx_len, 3); 156 + data = 0; 157 + for (i = 0; i < count; i++) { 158 + byte = bs->tx_buf ? *bs->tx_buf++ : 0; 159 + data |= byte << (8 * (2 - i)); 160 + } 161 + 162 + /* and set the variable bit-length */ 163 + data |= (count * 8) << 24; 164 + 165 + /* and decrement length */ 166 + bs->tx_len -= count; 167 + bs->pending += count; 168 + 169 + /* write to the correct TX-register */ 170 + if (bs->tx_len) 171 + bcm2835aux_wr(bs, BCM2835_AUX_SPI_TXHOLD, data); 172 + else 173 + bcm2835aux_wr(bs, BCM2835_AUX_SPI_IO, data); 174 + } 175 + 176 + static void bcm2835aux_spi_reset_hw(struct bcm2835aux_spi *bs) 177 + { 178 + /* disable spi clearing fifo and interrupts */ 179 + bcm2835aux_wr(bs, BCM2835_AUX_SPI_CNTL1, 0); 180 + bcm2835aux_wr(bs, BCM2835_AUX_SPI_CNTL0, 181 + BCM2835_AUX_SPI_CNTL0_CLEARFIFO); 182 + } 183 + 184 + static irqreturn_t bcm2835aux_spi_interrupt(int irq, void *dev_id) 185 + { 186 + struct spi_master *master = dev_id; 187 + struct bcm2835aux_spi *bs = spi_master_get_devdata(master); 188 + irqreturn_t ret = IRQ_NONE; 189 + 190 + /* check if we have data to read */ 191 + while (bs->rx_len && 192 + (!(bcm2835aux_rd(bs, BCM2835_AUX_SPI_STAT) & 193 + BCM2835_AUX_SPI_STAT_RX_EMPTY))) { 194 + bcm2835aux_rd_fifo(bs); 195 + ret = IRQ_HANDLED; 196 + } 197 + 198 + /* check if we have data to write */ 199 + while (bs->tx_len && 200 + (bs->pending < 12) && 201 + (!(bcm2835aux_rd(bs, BCM2835_AUX_SPI_STAT) & 202 + BCM2835_AUX_SPI_STAT_TX_FULL))) { 203 + bcm2835aux_wr_fifo(bs); 204 + ret = IRQ_HANDLED; 205 + } 206 + 207 + /* and check if we have reached "done" */ 208 + while (bs->rx_len && 209 + (!(bcm2835aux_rd(bs, BCM2835_AUX_SPI_STAT) & 210 + BCM2835_AUX_SPI_STAT_BUSY))) { 211 + bcm2835aux_rd_fifo(bs); 212 + ret = IRQ_HANDLED; 213 + } 214 + 215 + /* and if rx_len is 0 then wake up completion and disable spi */ 216 + if (!bs->rx_len) { 217 + bcm2835aux_spi_reset_hw(bs); 218 + complete(&master->xfer_completion); 219 + } 220 + 221 + /* and return */ 222 + return ret; 223 + } 224 + 225 + static int __bcm2835aux_spi_transfer_one_irq(struct spi_master *master, 226 + struct spi_device *spi, 227 + struct spi_transfer *tfr) 228 + { 229 + struct bcm2835aux_spi *bs = spi_master_get_devdata(master); 230 + 231 + /* enable interrupts */ 232 + bcm2835aux_wr(bs, BCM2835_AUX_SPI_CNTL1, bs->cntl[1] | 233 + BCM2835_AUX_SPI_CNTL1_TXEMPTY | 234 + BCM2835_AUX_SPI_CNTL1_IDLE); 235 + 236 + /* and wait for finish... */ 237 + return 1; 238 + } 239 + 240 + static int bcm2835aux_spi_transfer_one_irq(struct spi_master *master, 241 + struct spi_device *spi, 242 + struct spi_transfer *tfr) 243 + { 244 + struct bcm2835aux_spi *bs = spi_master_get_devdata(master); 245 + 246 + /* fill in registers and fifos before enabling interrupts */ 247 + bcm2835aux_wr(bs, BCM2835_AUX_SPI_CNTL1, bs->cntl[1]); 248 + bcm2835aux_wr(bs, BCM2835_AUX_SPI_CNTL0, bs->cntl[0]); 249 + 250 + /* fill in tx fifo with data before enabling interrupts */ 251 + while ((bs->tx_len) && 252 + (bs->pending < 12) && 253 + (!(bcm2835aux_rd(bs, BCM2835_AUX_SPI_STAT) & 254 + BCM2835_AUX_SPI_STAT_TX_FULL))) { 255 + bcm2835aux_wr_fifo(bs); 256 + } 257 + 258 + /* now run the interrupt mode */ 259 + return __bcm2835aux_spi_transfer_one_irq(master, spi, tfr); 260 + } 261 + 262 + static int bcm2835aux_spi_transfer_one_poll(struct spi_master *master, 263 + struct spi_device *spi, 264 + struct spi_transfer *tfr) 265 + { 266 + struct bcm2835aux_spi *bs = spi_master_get_devdata(master); 267 + unsigned long timeout; 268 + u32 stat; 269 + 270 + /* configure spi */ 271 + bcm2835aux_wr(bs, BCM2835_AUX_SPI_CNTL1, bs->cntl[1]); 272 + bcm2835aux_wr(bs, BCM2835_AUX_SPI_CNTL0, bs->cntl[0]); 273 + 274 + /* set the timeout */ 275 + timeout = jiffies + BCM2835_AUX_SPI_POLLING_JIFFIES; 276 + 277 + /* loop until finished the transfer */ 278 + while (bs->rx_len) { 279 + /* read status */ 280 + stat = bcm2835aux_rd(bs, BCM2835_AUX_SPI_STAT); 281 + 282 + /* fill in tx fifo with remaining data */ 283 + if ((bs->tx_len) && (!(stat & BCM2835_AUX_SPI_STAT_TX_FULL))) { 284 + bcm2835aux_wr_fifo(bs); 285 + continue; 286 + } 287 + 288 + /* read data from fifo for both cases */ 289 + if (!(stat & BCM2835_AUX_SPI_STAT_RX_EMPTY)) { 290 + bcm2835aux_rd_fifo(bs); 291 + continue; 292 + } 293 + if (!(stat & BCM2835_AUX_SPI_STAT_BUSY)) { 294 + bcm2835aux_rd_fifo(bs); 295 + continue; 296 + } 297 + 298 + /* there is still data pending to read check the timeout */ 299 + if (bs->rx_len && time_after(jiffies, timeout)) { 300 + dev_dbg_ratelimited(&spi->dev, 301 + "timeout period reached: jiffies: %lu remaining tx/rx: %d/%d - falling back to interrupt mode\n", 302 + jiffies - timeout, 303 + bs->tx_len, bs->rx_len); 304 + /* forward to interrupt handler */ 305 + return __bcm2835aux_spi_transfer_one_irq(master, 306 + spi, tfr); 307 + } 308 + } 309 + 310 + /* Transfer complete - reset SPI HW */ 311 + bcm2835aux_spi_reset_hw(bs); 312 + 313 + /* and return without waiting for completion */ 314 + return 0; 315 + } 316 + 317 + static int bcm2835aux_spi_transfer_one(struct spi_master *master, 318 + struct spi_device *spi, 319 + struct spi_transfer *tfr) 320 + { 321 + struct bcm2835aux_spi *bs = spi_master_get_devdata(master); 322 + unsigned long spi_hz, clk_hz, speed; 323 + unsigned long spi_used_hz; 324 + unsigned long long xfer_time_us; 325 + 326 + /* calculate the registers to handle 327 + * 328 + * note that we use the variable data mode, which 329 + * is not optimal for longer transfers as we waste registers 330 + * resulting (potentially) in more interrupts when transferring 331 + * more than 12 bytes 332 + */ 333 + bs->cntl[0] = BCM2835_AUX_SPI_CNTL0_ENABLE | 334 + BCM2835_AUX_SPI_CNTL0_VAR_WIDTH | 335 + BCM2835_AUX_SPI_CNTL0_MSBF_OUT; 336 + bs->cntl[1] = BCM2835_AUX_SPI_CNTL1_MSBF_IN; 337 + 338 + /* set clock */ 339 + spi_hz = tfr->speed_hz; 340 + clk_hz = clk_get_rate(bs->clk); 341 + 342 + if (spi_hz >= clk_hz / 2) { 343 + speed = 0; 344 + } else if (spi_hz) { 345 + speed = DIV_ROUND_UP(clk_hz, 2 * spi_hz) - 1; 346 + if (speed > BCM2835_AUX_SPI_CNTL0_SPEED_MAX) 347 + speed = BCM2835_AUX_SPI_CNTL0_SPEED_MAX; 348 + } else { /* the slowest we can go */ 349 + speed = BCM2835_AUX_SPI_CNTL0_SPEED_MAX; 350 + } 351 + bs->cntl[0] |= speed << BCM2835_AUX_SPI_CNTL0_SPEED_SHIFT; 352 + 353 + spi_used_hz = clk_hz / (2 * (speed + 1)); 354 + 355 + /* handle all the modes */ 356 + if (spi->mode & SPI_CPOL) 357 + bs->cntl[0] |= BCM2835_AUX_SPI_CNTL0_CPOL; 358 + if (spi->mode & SPI_CPHA) 359 + bs->cntl[0] |= BCM2835_AUX_SPI_CNTL0_CPHA_OUT | 360 + BCM2835_AUX_SPI_CNTL0_CPHA_IN; 361 + 362 + /* set transmit buffers and length */ 363 + bs->tx_buf = tfr->tx_buf; 364 + bs->rx_buf = tfr->rx_buf; 365 + bs->tx_len = tfr->len; 366 + bs->rx_len = tfr->len; 367 + bs->pending = 0; 368 + 369 + /* calculate the estimated time in us the transfer runs 370 + * note that there are are 2 idle clocks after each 371 + * chunk getting transferred - in our case the chunk size 372 + * is 3 bytes, so we approximate this by 9 bits/byte 373 + */ 374 + xfer_time_us = tfr->len * 9 * 1000000; 375 + do_div(xfer_time_us, spi_used_hz); 376 + 377 + /* run in polling mode for short transfers */ 378 + if (xfer_time_us < BCM2835_AUX_SPI_POLLING_LIMIT_US) 379 + return bcm2835aux_spi_transfer_one_poll(master, spi, tfr); 380 + 381 + /* run in interrupt mode for all others */ 382 + return bcm2835aux_spi_transfer_one_irq(master, spi, tfr); 383 + } 384 + 385 + static void bcm2835aux_spi_handle_err(struct spi_master *master, 386 + struct spi_message *msg) 387 + { 388 + struct bcm2835aux_spi *bs = spi_master_get_devdata(master); 389 + 390 + bcm2835aux_spi_reset_hw(bs); 391 + } 392 + 393 + static int bcm2835aux_spi_probe(struct platform_device *pdev) 394 + { 395 + struct spi_master *master; 396 + struct bcm2835aux_spi *bs; 397 + struct resource *res; 398 + unsigned long clk_hz; 399 + int err; 400 + 401 + master = spi_alloc_master(&pdev->dev, sizeof(*bs)); 402 + if (!master) { 403 + dev_err(&pdev->dev, "spi_alloc_master() failed\n"); 404 + return -ENOMEM; 405 + } 406 + 407 + platform_set_drvdata(pdev, master); 408 + master->mode_bits = BCM2835_AUX_SPI_MODE_BITS; 409 + master->bits_per_word_mask = SPI_BPW_MASK(8); 410 + master->num_chipselect = -1; 411 + master->transfer_one = bcm2835aux_spi_transfer_one; 412 + master->handle_err = bcm2835aux_spi_handle_err; 413 + master->dev.of_node = pdev->dev.of_node; 414 + 415 + bs = spi_master_get_devdata(master); 416 + 417 + /* the main area */ 418 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 419 + bs->regs = devm_ioremap_resource(&pdev->dev, res); 420 + if (IS_ERR(bs->regs)) { 421 + err = PTR_ERR(bs->regs); 422 + goto out_master_put; 423 + } 424 + 425 + bs->clk = devm_clk_get(&pdev->dev, NULL); 426 + if ((!bs->clk) || (IS_ERR(bs->clk))) { 427 + err = PTR_ERR(bs->clk); 428 + dev_err(&pdev->dev, "could not get clk: %d\n", err); 429 + goto out_master_put; 430 + } 431 + 432 + bs->irq = platform_get_irq(pdev, 0); 433 + if (bs->irq <= 0) { 434 + dev_err(&pdev->dev, "could not get IRQ: %d\n", bs->irq); 435 + err = bs->irq ? bs->irq : -ENODEV; 436 + goto out_master_put; 437 + } 438 + 439 + /* this also enables the HW block */ 440 + err = clk_prepare_enable(bs->clk); 441 + if (err) { 442 + dev_err(&pdev->dev, "could not prepare clock: %d\n", err); 443 + goto out_master_put; 444 + } 445 + 446 + /* just checking if the clock returns a sane value */ 447 + clk_hz = clk_get_rate(bs->clk); 448 + if (!clk_hz) { 449 + dev_err(&pdev->dev, "clock returns 0 Hz\n"); 450 + err = -ENODEV; 451 + goto out_clk_disable; 452 + } 453 + 454 + /* reset SPI-HW block */ 455 + bcm2835aux_spi_reset_hw(bs); 456 + 457 + err = devm_request_irq(&pdev->dev, bs->irq, 458 + bcm2835aux_spi_interrupt, 459 + IRQF_SHARED, 460 + dev_name(&pdev->dev), master); 461 + if (err) { 462 + dev_err(&pdev->dev, "could not request IRQ: %d\n", err); 463 + goto out_clk_disable; 464 + } 465 + 466 + err = devm_spi_register_master(&pdev->dev, master); 467 + if (err) { 468 + dev_err(&pdev->dev, "could not register SPI master: %d\n", err); 469 + goto out_clk_disable; 470 + } 471 + 472 + return 0; 473 + 474 + out_clk_disable: 475 + clk_disable_unprepare(bs->clk); 476 + out_master_put: 477 + spi_master_put(master); 478 + return err; 479 + } 480 + 481 + static int bcm2835aux_spi_remove(struct platform_device *pdev) 482 + { 483 + struct spi_master *master = platform_get_drvdata(pdev); 484 + struct bcm2835aux_spi *bs = spi_master_get_devdata(master); 485 + 486 + bcm2835aux_spi_reset_hw(bs); 487 + 488 + /* disable the HW block by releasing the clock */ 489 + clk_disable_unprepare(bs->clk); 490 + 491 + return 0; 492 + } 493 + 494 + static const struct of_device_id bcm2835aux_spi_match[] = { 495 + { .compatible = "brcm,bcm2835-aux-spi", }, 496 + {} 497 + }; 498 + MODULE_DEVICE_TABLE(of, bcm2835aux_spi_match); 499 + 500 + static struct platform_driver bcm2835aux_spi_driver = { 501 + .driver = { 502 + .name = "spi-bcm2835aux", 503 + .of_match_table = bcm2835aux_spi_match, 504 + }, 505 + .probe = bcm2835aux_spi_probe, 506 + .remove = bcm2835aux_spi_remove, 507 + }; 508 + module_platform_driver(bcm2835aux_spi_driver); 509 + 510 + MODULE_DESCRIPTION("SPI controller driver for Broadcom BCM2835 aux"); 511 + MODULE_AUTHOR("Martin Sperl <kernel@martin.sperl.org>"); 512 + MODULE_LICENSE("GPL v2");
+2 -11
drivers/spi/spi-bcm53xx.c
··· 247 247 if (err) { 248 248 spi_master_put(master); 249 249 bcma_set_drvdata(core, NULL); 250 - goto out; 250 + return err; 251 251 } 252 252 253 253 /* Broadcom SoCs (at least with the CC rev 42) use SPI for flash only */ 254 254 spi_new_device(master, &bcm53xx_info); 255 255 256 - out: 257 - return err; 258 - } 259 - 260 - static void bcm53xxspi_bcma_remove(struct bcma_device *core) 261 - { 262 - struct bcm53xxspi *b53spi = bcma_get_drvdata(core); 263 - 264 - spi_unregister_master(b53spi->master); 256 + return 0; 265 257 } 266 258 267 259 static struct bcma_driver bcm53xxspi_bcma_driver = { 268 260 .name = KBUILD_MODNAME, 269 261 .id_table = bcm53xxspi_bcma_tbl, 270 262 .probe = bcm53xxspi_bcma_probe, 271 - .remove = bcm53xxspi_bcma_remove, 272 263 }; 273 264 274 265 /**************************************************
+185 -25
drivers/spi/spi-bcm63xx.c
··· 27 27 #include <linux/err.h> 28 28 #include <linux/pm_runtime.h> 29 29 30 - #include <bcm63xx_dev_spi.h> 30 + /* BCM 6338/6348 SPI core */ 31 + #define SPI_6348_RSET_SIZE 64 32 + #define SPI_6348_CMD 0x00 /* 16-bits register */ 33 + #define SPI_6348_INT_STATUS 0x02 34 + #define SPI_6348_INT_MASK_ST 0x03 35 + #define SPI_6348_INT_MASK 0x04 36 + #define SPI_6348_ST 0x05 37 + #define SPI_6348_CLK_CFG 0x06 38 + #define SPI_6348_FILL_BYTE 0x07 39 + #define SPI_6348_MSG_TAIL 0x09 40 + #define SPI_6348_RX_TAIL 0x0b 41 + #define SPI_6348_MSG_CTL 0x40 /* 8-bits register */ 42 + #define SPI_6348_MSG_CTL_WIDTH 8 43 + #define SPI_6348_MSG_DATA 0x41 44 + #define SPI_6348_MSG_DATA_SIZE 0x3f 45 + #define SPI_6348_RX_DATA 0x80 46 + #define SPI_6348_RX_DATA_SIZE 0x3f 47 + 48 + /* BCM 3368/6358/6262/6368 SPI core */ 49 + #define SPI_6358_RSET_SIZE 1804 50 + #define SPI_6358_MSG_CTL 0x00 /* 16-bits register */ 51 + #define SPI_6358_MSG_CTL_WIDTH 16 52 + #define SPI_6358_MSG_DATA 0x02 53 + #define SPI_6358_MSG_DATA_SIZE 0x21e 54 + #define SPI_6358_RX_DATA 0x400 55 + #define SPI_6358_RX_DATA_SIZE 0x220 56 + #define SPI_6358_CMD 0x700 /* 16-bits register */ 57 + #define SPI_6358_INT_STATUS 0x702 58 + #define SPI_6358_INT_MASK_ST 0x703 59 + #define SPI_6358_INT_MASK 0x704 60 + #define SPI_6358_ST 0x705 61 + #define SPI_6358_CLK_CFG 0x706 62 + #define SPI_6358_FILL_BYTE 0x707 63 + #define SPI_6358_MSG_TAIL 0x709 64 + #define SPI_6358_RX_TAIL 0x70B 65 + 66 + /* Shared SPI definitions */ 67 + 68 + /* Message configuration */ 69 + #define SPI_FD_RW 0x00 70 + #define SPI_HD_W 0x01 71 + #define SPI_HD_R 0x02 72 + #define SPI_BYTE_CNT_SHIFT 0 73 + #define SPI_6348_MSG_TYPE_SHIFT 6 74 + #define SPI_6358_MSG_TYPE_SHIFT 14 75 + 76 + /* Command */ 77 + #define SPI_CMD_NOOP 0x00 78 + #define SPI_CMD_SOFT_RESET 0x01 79 + #define SPI_CMD_HARD_RESET 0x02 80 + #define SPI_CMD_START_IMMEDIATE 0x03 81 + #define SPI_CMD_COMMAND_SHIFT 0 82 + #define SPI_CMD_COMMAND_MASK 0x000f 83 + #define SPI_CMD_DEVICE_ID_SHIFT 4 84 + #define SPI_CMD_PREPEND_BYTE_CNT_SHIFT 8 85 + #define SPI_CMD_ONE_BYTE_SHIFT 11 86 + #define SPI_CMD_ONE_WIRE_SHIFT 12 87 + #define SPI_DEV_ID_0 0 88 + #define SPI_DEV_ID_1 1 89 + #define SPI_DEV_ID_2 2 90 + #define SPI_DEV_ID_3 3 91 + 92 + /* Interrupt mask */ 93 + #define SPI_INTR_CMD_DONE 0x01 94 + #define SPI_INTR_RX_OVERFLOW 0x02 95 + #define SPI_INTR_TX_UNDERFLOW 0x04 96 + #define SPI_INTR_TX_OVERFLOW 0x08 97 + #define SPI_INTR_RX_UNDERFLOW 0x10 98 + #define SPI_INTR_CLEAR_ALL 0x1f 99 + 100 + /* Status */ 101 + #define SPI_RX_EMPTY 0x02 102 + #define SPI_CMD_BUSY 0x04 103 + #define SPI_SERIAL_BUSY 0x08 104 + 105 + /* Clock configuration */ 106 + #define SPI_CLK_20MHZ 0x00 107 + #define SPI_CLK_0_391MHZ 0x01 108 + #define SPI_CLK_0_781MHZ 0x02 /* default */ 109 + #define SPI_CLK_1_563MHZ 0x03 110 + #define SPI_CLK_3_125MHZ 0x04 111 + #define SPI_CLK_6_250MHZ 0x05 112 + #define SPI_CLK_12_50MHZ 0x06 113 + #define SPI_CLK_MASK 0x07 114 + #define SPI_SSOFFTIME_MASK 0x38 115 + #define SPI_SSOFFTIME_SHIFT 3 116 + #define SPI_BYTE_SWAP 0x80 117 + 118 + enum bcm63xx_regs_spi { 119 + SPI_CMD, 120 + SPI_INT_STATUS, 121 + SPI_INT_MASK_ST, 122 + SPI_INT_MASK, 123 + SPI_ST, 124 + SPI_CLK_CFG, 125 + SPI_FILL_BYTE, 126 + SPI_MSG_TAIL, 127 + SPI_RX_TAIL, 128 + SPI_MSG_CTL, 129 + SPI_MSG_DATA, 130 + SPI_RX_DATA, 131 + SPI_MSG_TYPE_SHIFT, 132 + SPI_MSG_CTL_WIDTH, 133 + SPI_MSG_DATA_SIZE, 134 + }; 31 135 32 136 #define BCM63XX_SPI_MAX_PREPEND 15 137 + 138 + #define BCM63XX_SPI_MAX_CS 8 139 + #define BCM63XX_SPI_BUS_NUM 0 33 140 34 141 struct bcm63xx_spi { 35 142 struct completion done; ··· 145 38 int irq; 146 39 147 40 /* Platform data */ 41 + const unsigned long *reg_offsets; 148 42 unsigned fifo_size; 149 43 unsigned int msg_type_shift; 150 44 unsigned int msg_ctl_width; ··· 159 51 }; 160 52 161 53 static inline u8 bcm_spi_readb(struct bcm63xx_spi *bs, 162 - unsigned int offset) 54 + unsigned int offset) 163 55 { 164 - return bcm_readb(bs->regs + bcm63xx_spireg(offset)); 56 + return readb(bs->regs + bs->reg_offsets[offset]); 165 57 } 166 58 167 59 static inline u16 bcm_spi_readw(struct bcm63xx_spi *bs, 168 60 unsigned int offset) 169 61 { 170 - return bcm_readw(bs->regs + bcm63xx_spireg(offset)); 62 + #ifdef CONFIG_CPU_BIG_ENDIAN 63 + return ioread16be(bs->regs + bs->reg_offsets[offset]); 64 + #else 65 + return readw(bs->regs + bs->reg_offsets[offset]); 66 + #endif 171 67 } 172 68 173 69 static inline void bcm_spi_writeb(struct bcm63xx_spi *bs, 174 70 u8 value, unsigned int offset) 175 71 { 176 - bcm_writeb(value, bs->regs + bcm63xx_spireg(offset)); 72 + writeb(value, bs->regs + bs->reg_offsets[offset]); 177 73 } 178 74 179 75 static inline void bcm_spi_writew(struct bcm63xx_spi *bs, 180 76 u16 value, unsigned int offset) 181 77 { 182 - bcm_writew(value, bs->regs + bcm63xx_spireg(offset)); 78 + #ifdef CONFIG_CPU_BIG_ENDIAN 79 + iowrite16be(value, bs->regs + bs->reg_offsets[offset]); 80 + #else 81 + writew(value, bs->regs + bs->reg_offsets[offset]); 82 + #endif 183 83 } 184 84 185 85 static const unsigned bcm63xx_spi_freq_table[SPI_CLK_MASK][2] = { ··· 238 122 struct bcm63xx_spi *bs = spi_master_get_devdata(spi->master); 239 123 u16 msg_ctl; 240 124 u16 cmd; 241 - u8 rx_tail; 242 125 unsigned int i, timeout = 0, prepend_len = 0, len = 0; 243 126 struct spi_transfer *t = first; 244 127 bool do_rx = false; ··· 429 314 return IRQ_HANDLED; 430 315 } 431 316 317 + static const unsigned long bcm6348_spi_reg_offsets[] = { 318 + [SPI_CMD] = SPI_6348_CMD, 319 + [SPI_INT_STATUS] = SPI_6348_INT_STATUS, 320 + [SPI_INT_MASK_ST] = SPI_6348_INT_MASK_ST, 321 + [SPI_INT_MASK] = SPI_6348_INT_MASK, 322 + [SPI_ST] = SPI_6348_ST, 323 + [SPI_CLK_CFG] = SPI_6348_CLK_CFG, 324 + [SPI_FILL_BYTE] = SPI_6348_FILL_BYTE, 325 + [SPI_MSG_TAIL] = SPI_6348_MSG_TAIL, 326 + [SPI_RX_TAIL] = SPI_6348_RX_TAIL, 327 + [SPI_MSG_CTL] = SPI_6348_MSG_CTL, 328 + [SPI_MSG_DATA] = SPI_6348_MSG_DATA, 329 + [SPI_RX_DATA] = SPI_6348_RX_DATA, 330 + [SPI_MSG_TYPE_SHIFT] = SPI_6348_MSG_TYPE_SHIFT, 331 + [SPI_MSG_CTL_WIDTH] = SPI_6348_MSG_CTL_WIDTH, 332 + [SPI_MSG_DATA_SIZE] = SPI_6348_MSG_DATA_SIZE, 333 + }; 334 + 335 + static const unsigned long bcm6358_spi_reg_offsets[] = { 336 + [SPI_CMD] = SPI_6358_CMD, 337 + [SPI_INT_STATUS] = SPI_6358_INT_STATUS, 338 + [SPI_INT_MASK_ST] = SPI_6358_INT_MASK_ST, 339 + [SPI_INT_MASK] = SPI_6358_INT_MASK, 340 + [SPI_ST] = SPI_6358_ST, 341 + [SPI_CLK_CFG] = SPI_6358_CLK_CFG, 342 + [SPI_FILL_BYTE] = SPI_6358_FILL_BYTE, 343 + [SPI_MSG_TAIL] = SPI_6358_MSG_TAIL, 344 + [SPI_RX_TAIL] = SPI_6358_RX_TAIL, 345 + [SPI_MSG_CTL] = SPI_6358_MSG_CTL, 346 + [SPI_MSG_DATA] = SPI_6358_MSG_DATA, 347 + [SPI_RX_DATA] = SPI_6358_RX_DATA, 348 + [SPI_MSG_TYPE_SHIFT] = SPI_6358_MSG_TYPE_SHIFT, 349 + [SPI_MSG_CTL_WIDTH] = SPI_6358_MSG_CTL_WIDTH, 350 + [SPI_MSG_DATA_SIZE] = SPI_6358_MSG_DATA_SIZE, 351 + }; 352 + 353 + static const struct platform_device_id bcm63xx_spi_dev_match[] = { 354 + { 355 + .name = "bcm6348-spi", 356 + .driver_data = (unsigned long)bcm6348_spi_reg_offsets, 357 + }, 358 + { 359 + .name = "bcm6358-spi", 360 + .driver_data = (unsigned long)bcm6358_spi_reg_offsets, 361 + }, 362 + { 363 + }, 364 + }; 432 365 433 366 static int bcm63xx_spi_probe(struct platform_device *pdev) 434 367 { 435 368 struct resource *r; 369 + const unsigned long *bcm63xx_spireg; 436 370 struct device *dev = &pdev->dev; 437 - struct bcm63xx_spi_pdata *pdata = dev_get_platdata(&pdev->dev); 438 371 int irq; 439 372 struct spi_master *master; 440 373 struct clk *clk; 441 374 struct bcm63xx_spi *bs; 442 375 int ret; 376 + 377 + if (!pdev->id_entry->driver_data) 378 + return -EINVAL; 379 + 380 + bcm63xx_spireg = (const unsigned long *)pdev->id_entry->driver_data; 443 381 444 382 irq = platform_get_irq(pdev, 0); 445 383 if (irq < 0) { ··· 527 359 528 360 bs->irq = irq; 529 361 bs->clk = clk; 530 - bs->fifo_size = pdata->fifo_size; 362 + bs->reg_offsets = bcm63xx_spireg; 363 + bs->fifo_size = bs->reg_offsets[SPI_MSG_DATA_SIZE]; 531 364 532 365 ret = devm_request_irq(&pdev->dev, irq, bcm63xx_spi_interrupt, 0, 533 366 pdev->name, master); ··· 537 368 goto out_err; 538 369 } 539 370 540 - master->bus_num = pdata->bus_num; 541 - master->num_chipselect = pdata->num_chipselect; 371 + master->bus_num = BCM63XX_SPI_BUS_NUM; 372 + master->num_chipselect = BCM63XX_SPI_MAX_CS; 542 373 master->transfer_one_message = bcm63xx_spi_transfer_one; 543 374 master->mode_bits = MODEBITS; 544 375 master->bits_per_word_mask = SPI_BPW_MASK(8); 545 376 master->auto_runtime_pm = true; 546 - bs->msg_type_shift = pdata->msg_type_shift; 547 - bs->msg_ctl_width = pdata->msg_ctl_width; 548 - bs->tx_io = (u8 *)(bs->regs + bcm63xx_spireg(SPI_MSG_DATA)); 549 - bs->rx_io = (const u8 *)(bs->regs + bcm63xx_spireg(SPI_RX_DATA)); 550 - 551 - switch (bs->msg_ctl_width) { 552 - case 8: 553 - case 16: 554 - break; 555 - default: 556 - dev_err(dev, "unsupported MSG_CTL width: %d\n", 557 - bs->msg_ctl_width); 558 - goto out_err; 559 - } 377 + bs->msg_type_shift = bs->reg_offsets[SPI_MSG_TYPE_SHIFT]; 378 + bs->msg_ctl_width = bs->reg_offsets[SPI_MSG_CTL_WIDTH]; 379 + bs->tx_io = (u8 *)(bs->regs + bs->reg_offsets[SPI_MSG_DATA]); 380 + bs->rx_io = (const u8 *)(bs->regs + bs->reg_offsets[SPI_RX_DATA]); 560 381 561 382 /* Initialize hardware */ 562 383 ret = clk_prepare_enable(bs->clk); ··· 626 467 .name = "bcm63xx-spi", 627 468 .pm = &bcm63xx_spi_pm_ops, 628 469 }, 470 + .id_table = bcm63xx_spi_dev_match, 629 471 .probe = bcm63xx_spi_probe, 630 472 .remove = bcm63xx_spi_remove, 631 473 };
+1 -4
drivers/spi/spi-bfin-sport.c
··· 352 352 transfer = drv_data->cur_transfer; 353 353 chip = drv_data->cur_chip; 354 354 355 - if (transfer->speed_hz) 356 - transfer_speed = bfin_sport_hz_to_spi_baud(transfer->speed_hz); 357 - else 358 - transfer_speed = chip->baud; 355 + transfer_speed = bfin_sport_hz_to_spi_baud(transfer->speed_hz); 359 356 bfin_write(&drv_data->regs->tclkdiv, transfer_speed); 360 357 SSYNC(); 361 358
+1 -5
drivers/spi/spi-bfin5xx.c
··· 661 661 message->state = RUNNING_STATE; 662 662 dma_config = 0; 663 663 664 - /* Speed setup (surely valid because already checked) */ 665 - if (transfer->speed_hz) 666 - bfin_write(&drv_data->regs->baud, hz_to_spi_baud(transfer->speed_hz)); 667 - else 668 - bfin_write(&drv_data->regs->baud, chip->baud); 664 + bfin_write(&drv_data->regs->baud, hz_to_spi_baud(transfer->speed_hz)); 669 665 670 666 bfin_write(&drv_data->regs->stat, BIT_STAT_CLR); 671 667 bfin_spi_cs_active(drv_data, chip);
+43 -109
drivers/spi/spi-bitbang.c
··· 24 24 #include <linux/spi/spi.h> 25 25 #include <linux/spi/spi_bitbang.h> 26 26 27 + #define SPI_BITBANG_CS_DELAY 100 28 + 27 29 28 30 /*----------------------------------------------------------------------*/ 29 31 ··· 182 180 { 183 181 struct spi_bitbang_cs *cs = spi->controller_state; 184 182 struct spi_bitbang *bitbang; 185 - unsigned long flags; 186 183 187 184 bitbang = spi_master_get_devdata(spi->master); 188 185 ··· 211 210 */ 212 211 213 212 /* deselect chip (low or high) */ 214 - spin_lock_irqsave(&bitbang->lock, flags); 213 + mutex_lock(&bitbang->lock); 215 214 if (!bitbang->busy) { 216 215 bitbang->chipselect(spi, BITBANG_CS_INACTIVE); 217 216 ndelay(cs->nsecs); 218 217 } 219 - spin_unlock_irqrestore(&bitbang->lock, flags); 218 + mutex_unlock(&bitbang->lock); 220 219 221 220 return 0; 222 221 } ··· 256 255 static int spi_bitbang_prepare_hardware(struct spi_master *spi) 257 256 { 258 257 struct spi_bitbang *bitbang; 259 - unsigned long flags; 260 258 261 259 bitbang = spi_master_get_devdata(spi); 262 260 263 - spin_lock_irqsave(&bitbang->lock, flags); 261 + mutex_lock(&bitbang->lock); 264 262 bitbang->busy = 1; 265 - spin_unlock_irqrestore(&bitbang->lock, flags); 263 + mutex_unlock(&bitbang->lock); 266 264 267 265 return 0; 268 266 } 269 267 270 268 static int spi_bitbang_transfer_one(struct spi_master *master, 271 - struct spi_message *m) 269 + struct spi_device *spi, 270 + struct spi_transfer *transfer) 272 271 { 273 - struct spi_bitbang *bitbang; 274 - unsigned nsecs; 275 - struct spi_transfer *t = NULL; 276 - unsigned cs_change; 277 - int status; 278 - int do_setup = -1; 279 - struct spi_device *spi = m->spi; 272 + struct spi_bitbang *bitbang = spi_master_get_devdata(master); 273 + int status = 0; 280 274 281 - bitbang = spi_master_get_devdata(master); 275 + if (bitbang->setup_transfer) { 276 + status = bitbang->setup_transfer(spi, transfer); 277 + if (status < 0) 278 + goto out; 279 + } 282 280 283 - /* FIXME this is made-up ... the correct value is known to 284 - * word-at-a-time bitbang code, and presumably chipselect() 285 - * should enforce these requirements too? 286 - */ 287 - nsecs = 100; 281 + if (transfer->len) 282 + status = bitbang->txrx_bufs(spi, transfer); 288 283 289 - cs_change = 1; 290 - status = 0; 291 - 292 - list_for_each_entry(t, &m->transfers, transfer_list) { 293 - 294 - /* override speed or wordsize? */ 295 - if (t->speed_hz || t->bits_per_word) 296 - do_setup = 1; 297 - 298 - /* init (-1) or override (1) transfer params */ 299 - if (do_setup != 0) { 300 - if (bitbang->setup_transfer) { 301 - status = bitbang->setup_transfer(spi, t); 302 - if (status < 0) 303 - break; 304 - } 305 - if (do_setup == -1) 306 - do_setup = 0; 307 - } 308 - 309 - /* set up default clock polarity, and activate chip; 310 - * this implicitly updates clock and spi modes as 311 - * previously recorded for this device via setup(). 312 - * (and also deselects any other chip that might be 313 - * selected ...) 314 - */ 315 - if (cs_change) { 316 - bitbang->chipselect(spi, BITBANG_CS_ACTIVE); 317 - ndelay(nsecs); 318 - } 319 - cs_change = t->cs_change; 320 - if (!t->tx_buf && !t->rx_buf && t->len) { 321 - status = -EINVAL; 322 - break; 323 - } 324 - 325 - /* transfer data. the lower level code handles any 326 - * new dma mappings it needs. our caller always gave 327 - * us dma-safe buffers. 328 - */ 329 - if (t->len) { 330 - /* REVISIT dma API still needs a designated 331 - * DMA_ADDR_INVALID; ~0 might be better. 332 - */ 333 - if (!m->is_dma_mapped) 334 - t->rx_dma = t->tx_dma = 0; 335 - status = bitbang->txrx_bufs(spi, t); 336 - } 337 - if (status > 0) 338 - m->actual_length += status; 339 - if (status != t->len) { 340 - /* always report some kind of error */ 341 - if (status >= 0) 342 - status = -EREMOTEIO; 343 - break; 344 - } 284 + if (status == transfer->len) 345 285 status = 0; 286 + else if (status >= 0) 287 + status = -EREMOTEIO; 346 288 347 - /* protocol tweaks before next transfer */ 348 - if (t->delay_usecs) 349 - udelay(t->delay_usecs); 350 - 351 - if (cs_change && 352 - !list_is_last(&t->transfer_list, &m->transfers)) { 353 - /* sometimes a short mid-message deselect of the chip 354 - * may be needed to terminate a mode or command 355 - */ 356 - ndelay(nsecs); 357 - bitbang->chipselect(spi, BITBANG_CS_INACTIVE); 358 - ndelay(nsecs); 359 - } 360 - } 361 - 362 - m->status = status; 363 - 364 - /* normally deactivate chipselect ... unless no error and 365 - * cs_change has hinted that the next message will probably 366 - * be for this chip too. 367 - */ 368 - if (!(status == 0 && cs_change)) { 369 - ndelay(nsecs); 370 - bitbang->chipselect(spi, BITBANG_CS_INACTIVE); 371 - ndelay(nsecs); 372 - } 373 - 374 - spi_finalize_current_message(master); 289 + out: 290 + spi_finalize_current_transfer(master); 375 291 376 292 return status; 377 293 } ··· 296 378 static int spi_bitbang_unprepare_hardware(struct spi_master *spi) 297 379 { 298 380 struct spi_bitbang *bitbang; 299 - unsigned long flags; 300 381 301 382 bitbang = spi_master_get_devdata(spi); 302 383 303 - spin_lock_irqsave(&bitbang->lock, flags); 384 + mutex_lock(&bitbang->lock); 304 385 bitbang->busy = 0; 305 - spin_unlock_irqrestore(&bitbang->lock, flags); 386 + mutex_unlock(&bitbang->lock); 306 387 307 388 return 0; 389 + } 390 + 391 + static void spi_bitbang_set_cs(struct spi_device *spi, bool enable) 392 + { 393 + struct spi_bitbang *bitbang = spi_master_get_devdata(spi->master); 394 + 395 + /* SPI core provides CS high / low, but bitbang driver 396 + * expects CS active 397 + * spi device driver takes care of handling SPI_CS_HIGH 398 + */ 399 + enable = (!!(spi->mode & SPI_CS_HIGH) == enable); 400 + 401 + ndelay(SPI_BITBANG_CS_DELAY); 402 + bitbang->chipselect(spi, enable ? BITBANG_CS_ACTIVE : 403 + BITBANG_CS_INACTIVE); 404 + ndelay(SPI_BITBANG_CS_DELAY); 308 405 } 309 406 310 407 /*----------------------------------------------------------------------*/ ··· 360 427 if (!master || !bitbang->chipselect) 361 428 return -EINVAL; 362 429 363 - spin_lock_init(&bitbang->lock); 430 + mutex_init(&bitbang->lock); 364 431 365 432 if (!master->mode_bits) 366 433 master->mode_bits = SPI_CPOL | SPI_CPHA | bitbang->flags; ··· 370 437 371 438 master->prepare_transfer_hardware = spi_bitbang_prepare_hardware; 372 439 master->unprepare_transfer_hardware = spi_bitbang_unprepare_hardware; 373 - master->transfer_one_message = spi_bitbang_transfer_one; 440 + master->transfer_one = spi_bitbang_transfer_one; 441 + master->set_cs = spi_bitbang_set_cs; 374 442 375 443 if (!bitbang->txrx_bufs) { 376 444 bitbang->use_dma = 0;
+2 -1
drivers/spi/spi-coldfire-qspi.c
··· 420 420 master->auto_runtime_pm = true; 421 421 422 422 platform_set_drvdata(pdev, master); 423 + pm_runtime_enable(&pdev->dev); 423 424 424 425 status = devm_spi_register_master(&pdev->dev, master); 425 426 if (status) { 426 427 dev_dbg(&pdev->dev, "spi_register_master failed\n"); 427 428 goto fail2; 428 429 } 429 - pm_runtime_enable(&pdev->dev); 430 430 431 431 dev_info(&pdev->dev, "Coldfire QSPI bus driver\n"); 432 432 433 433 return 0; 434 434 435 435 fail2: 436 + pm_runtime_disable(&pdev->dev); 436 437 mcfqspi_cs_teardown(mcfqspi); 437 438 fail1: 438 439 clk_disable(mcfqspi->clk);
+4 -11
drivers/spi/spi-davinci.c
··· 215 215 struct davinci_spi_config *spicfg = spi->controller_data; 216 216 u8 chip_sel = spi->chip_select; 217 217 u16 spidat1 = CS_DEFAULT; 218 - bool gpio_chipsel = false; 219 - int gpio; 220 218 221 219 dspi = spi_master_get_devdata(spi->master); 222 220 pdata = &dspi->pdata; 223 - 224 - if (spi->cs_gpio >= 0) { 225 - /* SPI core parse and update master->cs_gpio */ 226 - gpio_chipsel = true; 227 - gpio = spi->cs_gpio; 228 - } 229 221 230 222 /* program delay transfers if tx_delay is non zero */ 231 223 if (spicfg->wdelay) ··· 227 235 * Board specific chip select logic decides the polarity and cs 228 236 * line for the controller 229 237 */ 230 - if (gpio_chipsel) { 238 + if (spi->cs_gpio >= 0) { 231 239 if (value == BITBANG_CS_ACTIVE) 232 - gpio_set_value(gpio, spi->mode & SPI_CS_HIGH); 240 + gpio_set_value(spi->cs_gpio, spi->mode & SPI_CS_HIGH); 233 241 else 234 - gpio_set_value(gpio, !(spi->mode & SPI_CS_HIGH)); 242 + gpio_set_value(spi->cs_gpio, 243 + !(spi->mode & SPI_CS_HIGH)); 235 244 } else { 236 245 if (value == BITBANG_CS_ACTIVE) { 237 246 spidat1 |= SPIDAT1_CSHOLD_MASK;
+3 -4
drivers/spi/spi-dw-mmio.c
··· 19 19 #include <linux/of.h> 20 20 #include <linux/of_gpio.h> 21 21 #include <linux/of_platform.h> 22 + #include <linux/property.h> 22 23 23 24 #include "spi-dw.h" 24 25 ··· 75 74 76 75 dws->max_freq = clk_get_rate(dwsmmio->clk); 77 76 78 - of_property_read_u32(pdev->dev.of_node, "reg-io-width", 79 - &dws->reg_io_width); 77 + device_property_read_u32(&pdev->dev, "reg-io-width", &dws->reg_io_width); 80 78 81 79 num_cs = 4; 82 80 83 - if (pdev->dev.of_node) 84 - of_property_read_u32(pdev->dev.of_node, "num-cs", &num_cs); 81 + device_property_read_u32(&pdev->dev, "num-cs", &num_cs); 85 82 86 83 dws->num_cs = num_cs; 87 84
+9 -20
drivers/spi/spi-dw-pci.c
··· 23 23 24 24 #define DRIVER_NAME "dw_spi_pci" 25 25 26 - struct dw_spi_pci { 27 - struct pci_dev *pdev; 28 - struct dw_spi dws; 29 - }; 30 - 31 26 struct spi_pci_desc { 32 27 int (*setup)(struct dw_spi *); 33 28 u16 num_cs; ··· 43 48 44 49 static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 45 50 { 46 - struct dw_spi_pci *dwpci; 47 51 struct dw_spi *dws; 48 52 struct spi_pci_desc *desc = (struct spi_pci_desc *)ent->driver_data; 49 53 int pci_bar = 0; ··· 52 58 if (ret) 53 59 return ret; 54 60 55 - dwpci = devm_kzalloc(&pdev->dev, sizeof(struct dw_spi_pci), 56 - GFP_KERNEL); 57 - if (!dwpci) 61 + dws = devm_kzalloc(&pdev->dev, sizeof(*dws), GFP_KERNEL); 62 + if (!dws) 58 63 return -ENOMEM; 59 - 60 - dwpci->pdev = pdev; 61 - dws = &dwpci->dws; 62 64 63 65 /* Get basic io resource and map it */ 64 66 dws->paddr = pci_resource_start(pdev, pci_bar); ··· 64 74 return ret; 65 75 66 76 dws->regs = pcim_iomap_table(pdev)[pci_bar]; 67 - 68 77 dws->irq = pdev->irq; 69 78 70 79 /* ··· 88 99 return ret; 89 100 90 101 /* PCI hook and SPI hook use the same drv data */ 91 - pci_set_drvdata(pdev, dwpci); 102 + pci_set_drvdata(pdev, dws); 92 103 93 104 dev_info(&pdev->dev, "found PCI SPI controller(ID: %04x:%04x)\n", 94 105 pdev->vendor, pdev->device); ··· 98 109 99 110 static void spi_pci_remove(struct pci_dev *pdev) 100 111 { 101 - struct dw_spi_pci *dwpci = pci_get_drvdata(pdev); 112 + struct dw_spi *dws = pci_get_drvdata(pdev); 102 113 103 - dw_spi_remove_host(&dwpci->dws); 114 + dw_spi_remove_host(dws); 104 115 } 105 116 106 117 #ifdef CONFIG_PM_SLEEP 107 118 static int spi_suspend(struct device *dev) 108 119 { 109 120 struct pci_dev *pdev = to_pci_dev(dev); 110 - struct dw_spi_pci *dwpci = pci_get_drvdata(pdev); 121 + struct dw_spi *dws = pci_get_drvdata(pdev); 111 122 112 - return dw_spi_suspend_host(&dwpci->dws); 123 + return dw_spi_suspend_host(dws); 113 124 } 114 125 115 126 static int spi_resume(struct device *dev) 116 127 { 117 128 struct pci_dev *pdev = to_pci_dev(dev); 118 - struct dw_spi_pci *dwpci = pci_get_drvdata(pdev); 129 + struct dw_spi *dws = pci_get_drvdata(pdev); 119 130 120 - return dw_spi_resume_host(&dwpci->dws); 131 + return dw_spi_resume_host(dws); 121 132 } 122 133 #endif 123 134
+33 -75
drivers/spi/spi-dw.c
··· 30 30 31 31 /* Slave spi_dev related */ 32 32 struct chip_data { 33 - u16 cr0; 34 33 u8 cs; /* chip select pin */ 35 - u8 n_bytes; /* current is a 1/2/4 byte op */ 36 34 u8 tmode; /* TR/TO/RO/EEPROM */ 37 35 u8 type; /* SPI/SSP/MicroWire */ 38 36 39 37 u8 poll_mode; /* 1 means use poll mode */ 40 38 41 - u32 dma_width; 42 - u32 rx_threshold; 43 - u32 tx_threshold; 44 39 u8 enable_dma; 45 - u8 bits_per_word; 46 40 u16 clk_div; /* baud rate divider */ 47 41 u32 speed_hz; /* baud rate */ 48 42 void (*cs_control)(u32 command); ··· 283 289 struct chip_data *chip = spi_get_ctldata(spi); 284 290 u8 imask = 0; 285 291 u16 txlevel = 0; 286 - u16 clk_div = 0; 287 - u32 speed = 0; 288 - u32 cr0 = 0; 292 + u16 clk_div; 293 + u32 cr0; 289 294 int ret; 290 295 291 296 dws->dma_mapped = 0; 292 - dws->n_bytes = chip->n_bytes; 293 - dws->dma_width = chip->dma_width; 294 297 295 298 dws->tx = (void *)transfer->tx_buf; 296 299 dws->tx_end = dws->tx + transfer->len; ··· 297 306 298 307 spi_enable_chip(dws, 0); 299 308 300 - cr0 = chip->cr0; 301 - 302 309 /* Handle per transfer options for bpw and speed */ 303 - if (transfer->speed_hz) { 304 - speed = chip->speed_hz; 310 + if (transfer->speed_hz != chip->speed_hz) { 311 + /* clk_div doesn't support odd number */ 312 + clk_div = (dws->max_freq / transfer->speed_hz + 1) & 0xfffe; 305 313 306 - if ((transfer->speed_hz != speed) || !chip->clk_div) { 307 - speed = transfer->speed_hz; 314 + chip->speed_hz = transfer->speed_hz; 315 + chip->clk_div = clk_div; 308 316 309 - /* clk_div doesn't support odd number */ 310 - clk_div = (dws->max_freq / speed + 1) & 0xfffe; 311 - 312 - chip->speed_hz = speed; 313 - chip->clk_div = clk_div; 314 - 315 - spi_set_clk(dws, chip->clk_div); 316 - } 317 + spi_set_clk(dws, chip->clk_div); 317 318 } 318 - if (transfer->bits_per_word) { 319 - if (transfer->bits_per_word == 8) { 320 - dws->n_bytes = 1; 321 - dws->dma_width = 1; 322 - } else if (transfer->bits_per_word == 16) { 323 - dws->n_bytes = 2; 324 - dws->dma_width = 2; 325 - } 326 - cr0 = (transfer->bits_per_word - 1) 327 - | (chip->type << SPI_FRF_OFFSET) 328 - | (spi->mode << SPI_MODE_OFFSET) 329 - | (chip->tmode << SPI_TMOD_OFFSET); 319 + if (transfer->bits_per_word == 8) { 320 + dws->n_bytes = 1; 321 + dws->dma_width = 1; 322 + } else if (transfer->bits_per_word == 16) { 323 + dws->n_bytes = 2; 324 + dws->dma_width = 2; 325 + } else { 326 + return -EINVAL; 330 327 } 328 + /* Default SPI mode is SCPOL = 0, SCPH = 0 */ 329 + cr0 = (transfer->bits_per_word - 1) 330 + | (chip->type << SPI_FRF_OFFSET) 331 + | (spi->mode << SPI_MODE_OFFSET) 332 + | (chip->tmode << SPI_TMOD_OFFSET); 331 333 332 334 /* 333 335 * Adjust transfer mode if necessary. Requires platform dependent ··· 423 439 424 440 chip->poll_mode = chip_info->poll_mode; 425 441 chip->type = chip_info->type; 426 - 427 - chip->rx_threshold = 0; 428 - chip->tx_threshold = 0; 429 - } 430 - 431 - if (spi->bits_per_word == 8) { 432 - chip->n_bytes = 1; 433 - chip->dma_width = 1; 434 - } else if (spi->bits_per_word == 16) { 435 - chip->n_bytes = 2; 436 - chip->dma_width = 2; 437 - } 438 - chip->bits_per_word = spi->bits_per_word; 439 - 440 - if (!spi->max_speed_hz) { 441 - dev_err(&spi->dev, "No max speed HZ parameter\n"); 442 - return -EINVAL; 443 442 } 444 443 445 444 chip->tmode = 0; /* Tx & Rx */ 446 - /* Default SPI mode is SCPOL = 0, SCPH = 0 */ 447 - chip->cr0 = (chip->bits_per_word - 1) 448 - | (chip->type << SPI_FRF_OFFSET) 449 - | (spi->mode << SPI_MODE_OFFSET) 450 - | (chip->tmode << SPI_TMOD_OFFSET); 451 - 452 - if (spi->mode & SPI_LOOP) 453 - chip->cr0 |= 1 << SPI_SRL_OFFSET; 454 445 455 446 if (gpio_is_valid(spi->cs_gpio)) { 456 447 ret = gpio_direction_output(spi->cs_gpio, ··· 483 524 dws->master = master; 484 525 dws->type = SSI_MOTO_SPI; 485 526 dws->dma_inited = 0; 486 - dws->dma_addr = (dma_addr_t)(dws->paddr + 0x60); 527 + dws->dma_addr = (dma_addr_t)(dws->paddr + DW_SPI_DR); 487 528 snprintf(dws->name, sizeof(dws->name), "dw_spi%d", dws->bus_num); 488 529 489 - ret = devm_request_irq(dev, dws->irq, dw_spi_irq, IRQF_SHARED, 490 - dws->name, master); 530 + ret = request_irq(dws->irq, dw_spi_irq, IRQF_SHARED, dws->name, master); 491 531 if (ret < 0) { 492 - dev_err(&master->dev, "can not get IRQ\n"); 532 + dev_err(dev, "can not get IRQ\n"); 493 533 goto err_free_master; 494 534 } 495 535 ··· 531 573 if (dws->dma_ops && dws->dma_ops->dma_exit) 532 574 dws->dma_ops->dma_exit(dws); 533 575 spi_enable_chip(dws, 0); 576 + free_irq(dws->irq, master); 534 577 err_free_master: 535 578 spi_master_put(master); 536 579 return ret; ··· 540 581 541 582 void dw_spi_remove_host(struct dw_spi *dws) 542 583 { 543 - if (!dws) 544 - return; 545 584 dw_spi_debugfs_remove(dws); 546 585 547 586 if (dws->dma_ops && dws->dma_ops->dma_exit) 548 587 dws->dma_ops->dma_exit(dws); 549 - spi_enable_chip(dws, 0); 550 - /* Disable clk */ 551 - spi_set_clk(dws, 0); 588 + 589 + spi_shutdown_chip(dws); 590 + 591 + free_irq(dws->irq, dws->master); 552 592 } 553 593 EXPORT_SYMBOL_GPL(dw_spi_remove_host); 554 594 555 595 int dw_spi_suspend_host(struct dw_spi *dws) 556 596 { 557 - int ret = 0; 597 + int ret; 558 598 559 599 ret = spi_master_suspend(dws->master); 560 600 if (ret) 561 601 return ret; 562 - spi_enable_chip(dws, 0); 563 - spi_set_clk(dws, 0); 564 - return ret; 602 + 603 + spi_shutdown_chip(dws); 604 + return 0; 565 605 } 566 606 EXPORT_SYMBOL_GPL(dw_spi_suspend_host); 567 607
+6
drivers/spi/spi-dw.h
··· 225 225 spi_enable_chip(dws, 1); 226 226 } 227 227 228 + static inline void spi_shutdown_chip(struct dw_spi *dws) 229 + { 230 + spi_enable_chip(dws, 0); 231 + spi_set_clk(dws, 0); 232 + } 233 + 228 234 /* 229 235 * Each SPI slave device to work with dw_api controller should 230 236 * has such a structure claiming its working mode (poll or PIO/DMA),
-3
drivers/spi/spi-fsl-dspi.c
··· 409 409 SPI_MCR_CLR_TXF | SPI_MCR_CLR_RXF); 410 410 regmap_write(dspi->regmap, SPI_CTAR(dspi->cs), 411 411 dspi->cur_chip->ctar_val); 412 - if (transfer->speed_hz) 413 - regmap_write(dspi->regmap, SPI_CTAR(dspi->cs), 414 - dspi->cur_chip->ctar_val); 415 412 416 413 trans_mode = dspi->devtype_data->trans_mode; 417 414 switch (trans_mode) {
+7
drivers/spi/spi-imx.c
··· 336 336 337 337 if (config->mode & SPI_CPHA) 338 338 cfg |= MX51_ECSPI_CONFIG_SCLKPHA(config->cs); 339 + else 340 + cfg &= ~MX51_ECSPI_CONFIG_SCLKPHA(config->cs); 339 341 340 342 if (config->mode & SPI_CPOL) { 341 343 cfg |= MX51_ECSPI_CONFIG_SCLKPOL(config->cs); 342 344 cfg |= MX51_ECSPI_CONFIG_SCLKCTL(config->cs); 345 + } else { 346 + cfg &= ~MX51_ECSPI_CONFIG_SCLKPOL(config->cs); 347 + cfg &= ~MX51_ECSPI_CONFIG_SCLKCTL(config->cs); 343 348 } 344 349 if (config->mode & SPI_CS_HIGH) 345 350 cfg |= MX51_ECSPI_CONFIG_SSBPOL(config->cs); 351 + else 352 + cfg &= ~MX51_ECSPI_CONFIG_SSBPOL(config->cs); 346 353 347 354 writel(ctrl, spi_imx->base + MX51_ECSPI_CTRL); 348 355 writel(cfg, spi_imx->base + MX51_ECSPI_CONFIG);
+3 -5
drivers/spi/spi-mpc512x-psc.c
··· 302 302 cs_change = 1; 303 303 status = 0; 304 304 list_for_each_entry(t, &m->transfers, transfer_list) { 305 - if (t->bits_per_word || t->speed_hz) { 306 - status = mpc512x_psc_spi_transfer_setup(spi, t); 307 - if (status < 0) 308 - break; 309 - } 305 + status = mpc512x_psc_spi_transfer_setup(spi, t); 306 + if (status < 0) 307 + break; 310 308 311 309 if (cs_change) 312 310 mpc512x_psc_spi_activate_cs(spi);
+83 -46
drivers/spi/spi-mt65xx.c
··· 20 20 #include <linux/ioport.h> 21 21 #include <linux/module.h> 22 22 #include <linux/of.h> 23 + #include <linux/of_gpio.h> 23 24 #include <linux/platform_device.h> 24 25 #include <linux/platform_data/spi-mt65xx.h> 25 26 #include <linux/pm_runtime.h> ··· 85 84 struct mtk_spi { 86 85 void __iomem *base; 87 86 u32 state; 88 - u32 pad_sel; 87 + int pad_num; 88 + u32 *pad_sel; 89 89 struct clk *parent_clk, *sel_clk, *spi_clk; 90 90 struct spi_transfer *cur_transfer; 91 91 u32 xfer_len; ··· 133 131 writel(reg_val, mdata->base + SPI_CMD_REG); 134 132 } 135 133 136 - static void mtk_spi_config(struct mtk_spi *mdata, 137 - struct mtk_chip_config *chip_config) 134 + static int mtk_spi_prepare_message(struct spi_master *master, 135 + struct spi_message *msg) 138 136 { 137 + u16 cpha, cpol; 139 138 u32 reg_val; 139 + struct spi_device *spi = msg->spi; 140 + struct mtk_chip_config *chip_config = spi->controller_data; 141 + struct mtk_spi *mdata = spi_master_get_devdata(master); 142 + 143 + cpha = spi->mode & SPI_CPHA ? 1 : 0; 144 + cpol = spi->mode & SPI_CPOL ? 1 : 0; 145 + 146 + reg_val = readl(mdata->base + SPI_CMD_REG); 147 + if (cpha) 148 + reg_val |= SPI_CMD_CPHA; 149 + else 150 + reg_val &= ~SPI_CMD_CPHA; 151 + if (cpol) 152 + reg_val |= SPI_CMD_CPOL; 153 + else 154 + reg_val &= ~SPI_CMD_CPOL; 155 + writel(reg_val, mdata->base + SPI_CMD_REG); 140 156 141 157 reg_val = readl(mdata->base + SPI_CMD_REG); 142 158 ··· 190 170 191 171 /* pad select */ 192 172 if (mdata->dev_comp->need_pad_sel) 193 - writel(mdata->pad_sel, mdata->base + SPI_PAD_SEL_REG); 194 - } 195 - 196 - static int mtk_spi_prepare_message(struct spi_master *master, 197 - struct spi_message *msg) 198 - { 199 - u32 reg_val; 200 - u8 cpha, cpol; 201 - struct mtk_chip_config *chip_config; 202 - struct spi_device *spi = msg->spi; 203 - struct mtk_spi *mdata = spi_master_get_devdata(master); 204 - 205 - cpha = spi->mode & SPI_CPHA ? 1 : 0; 206 - cpol = spi->mode & SPI_CPOL ? 1 : 0; 207 - 208 - reg_val = readl(mdata->base + SPI_CMD_REG); 209 - if (cpha) 210 - reg_val |= SPI_CMD_CPHA; 211 - else 212 - reg_val &= ~SPI_CMD_CPHA; 213 - if (cpol) 214 - reg_val |= SPI_CMD_CPOL; 215 - else 216 - reg_val &= ~SPI_CMD_CPOL; 217 - writel(reg_val, mdata->base + SPI_CMD_REG); 218 - 219 - chip_config = spi->controller_data; 220 - if (!chip_config) { 221 - chip_config = (void *)&mtk_default_chip_info; 222 - spi->controller_data = chip_config; 223 - } 224 - mtk_spi_config(mdata, chip_config); 173 + writel(mdata->pad_sel[spi->chip_select], 174 + mdata->base + SPI_PAD_SEL_REG); 225 175 226 176 return 0; 227 177 } ··· 403 413 return xfer->len > MTK_SPI_MAX_FIFO_SIZE; 404 414 } 405 415 416 + static int mtk_spi_setup(struct spi_device *spi) 417 + { 418 + struct mtk_spi *mdata = spi_master_get_devdata(spi->master); 419 + 420 + if (!spi->controller_data) 421 + spi->controller_data = (void *)&mtk_default_chip_info; 422 + 423 + if (mdata->dev_comp->need_pad_sel) 424 + gpio_direction_output(spi->cs_gpio, !(spi->mode & SPI_CS_HIGH)); 425 + 426 + return 0; 427 + } 428 + 406 429 static irqreturn_t mtk_spi_interrupt(int irq, void *dev_id) 407 430 { 408 431 u32 cmd, reg_val, cnt; ··· 487 484 struct mtk_spi *mdata; 488 485 const struct of_device_id *of_id; 489 486 struct resource *res; 490 - int irq, ret; 487 + int i, irq, ret; 491 488 492 489 master = spi_alloc_master(&pdev->dev, sizeof(*mdata)); 493 490 if (!master) { ··· 503 500 master->prepare_message = mtk_spi_prepare_message; 504 501 master->transfer_one = mtk_spi_transfer_one; 505 502 master->can_dma = mtk_spi_can_dma; 503 + master->setup = mtk_spi_setup; 506 504 507 505 of_id = of_match_node(mtk_spi_of_match, pdev->dev.of_node); 508 506 if (!of_id) { ··· 518 514 master->flags = SPI_MASTER_MUST_TX; 519 515 520 516 if (mdata->dev_comp->need_pad_sel) { 521 - ret = of_property_read_u32(pdev->dev.of_node, 522 - "mediatek,pad-select", 523 - &mdata->pad_sel); 524 - if (ret) { 525 - dev_err(&pdev->dev, "failed to read pad select: %d\n", 526 - ret); 517 + mdata->pad_num = of_property_count_u32_elems( 518 + pdev->dev.of_node, 519 + "mediatek,pad-select"); 520 + if (mdata->pad_num < 0) { 521 + dev_err(&pdev->dev, 522 + "No 'mediatek,pad-select' property\n"); 523 + ret = -EINVAL; 527 524 goto err_put_master; 528 525 } 529 526 530 - if (mdata->pad_sel > MT8173_SPI_MAX_PAD_SEL) { 531 - dev_err(&pdev->dev, "wrong pad-select: %u\n", 532 - mdata->pad_sel); 533 - ret = -EINVAL; 527 + mdata->pad_sel = devm_kmalloc_array(&pdev->dev, mdata->pad_num, 528 + sizeof(u32), GFP_KERNEL); 529 + if (!mdata->pad_sel) { 530 + ret = -ENOMEM; 534 531 goto err_put_master; 532 + } 533 + 534 + for (i = 0; i < mdata->pad_num; i++) { 535 + of_property_read_u32_index(pdev->dev.of_node, 536 + "mediatek,pad-select", 537 + i, &mdata->pad_sel[i]); 538 + if (mdata->pad_sel[i] > MT8173_SPI_MAX_PAD_SEL) { 539 + dev_err(&pdev->dev, "wrong pad-sel[%d]: %u\n", 540 + i, mdata->pad_sel[i]); 541 + ret = -EINVAL; 542 + goto err_put_master; 543 + } 535 544 } 536 545 } 537 546 ··· 621 604 if (ret) { 622 605 dev_err(&pdev->dev, "failed to register master (%d)\n", ret); 623 606 goto err_put_master; 607 + } 608 + 609 + if (mdata->dev_comp->need_pad_sel) { 610 + if (mdata->pad_num != master->num_chipselect) { 611 + dev_err(&pdev->dev, 612 + "pad_num does not match num_chipselect(%d != %d)\n", 613 + mdata->pad_num, master->num_chipselect); 614 + ret = -EINVAL; 615 + goto err_put_master; 616 + } 617 + 618 + for (i = 0; i < master->num_chipselect; i++) { 619 + ret = devm_gpio_request(&pdev->dev, master->cs_gpios[i], 620 + dev_name(&pdev->dev)); 621 + if (ret) { 622 + dev_err(&pdev->dev, 623 + "can't get CS GPIO %i\n", i); 624 + goto err_put_master; 625 + } 626 + } 624 627 } 625 628 626 629 return 0;
+5 -9
drivers/spi/spi-oc-tiny.c
··· 207 207 struct tiny_spi *hw = platform_get_drvdata(pdev); 208 208 struct device_node *np = pdev->dev.of_node; 209 209 unsigned int i; 210 - const __be32 *val; 211 - int len; 210 + u32 val; 212 211 213 212 if (!np) 214 213 return 0; ··· 225 226 return -ENODEV; 226 227 } 227 228 hw->bitbang.master->dev.of_node = pdev->dev.of_node; 228 - val = of_get_property(pdev->dev.of_node, 229 - "clock-frequency", &len); 230 - if (val && len >= sizeof(__be32)) 231 - hw->freq = be32_to_cpup(val); 232 - val = of_get_property(pdev->dev.of_node, "baud-width", &len); 233 - if (val && len >= sizeof(__be32)) 234 - hw->baudwidth = be32_to_cpup(val); 229 + if (!of_property_read_u32(np, "clock-frequency", &val)) 230 + hw->freq = val; 231 + if (!of_property_read_u32(np, "baud-width", &val)) 232 + hw->baudwidth = val; 235 233 return 0; 236 234 } 237 235 #else /* !CONFIG_OF */
+1 -1
drivers/spi/spi-octeon.c
··· 65 65 cpha = mode & SPI_CPHA; 66 66 cpol = mode & SPI_CPOL; 67 67 68 - speed_hz = xfer->speed_hz ? : spi->max_speed_hz; 68 + speed_hz = xfer->speed_hz; 69 69 70 70 clkdiv = octeon_get_io_clock_rate() / (2 * speed_hz); 71 71
+8 -18
drivers/spi/spi-omap-100k.c
··· 244 244 { 245 245 struct omap1_spi100k *spi100k = spi_master_get_devdata(spi->master); 246 246 struct omap1_spi100k_cs *cs = spi->controller_state; 247 - u8 word_len = spi->bits_per_word; 247 + u8 word_len; 248 248 249 - if (t != NULL && t->bits_per_word) 249 + if (t != NULL) 250 250 word_len = t->bits_per_word; 251 - if (!word_len) 252 - word_len = 8; 251 + else 252 + word_len = spi->bits_per_word; 253 253 254 254 if (spi->bits_per_word > 32) 255 255 return -EINVAL; ··· 302 302 struct spi_device *spi = m->spi; 303 303 struct spi_transfer *t = NULL; 304 304 int cs_active = 0; 305 - int par_override = 0; 306 305 int status = 0; 307 306 308 307 list_for_each_entry(t, &m->transfers, transfer_list) { ··· 309 310 status = -EINVAL; 310 311 break; 311 312 } 312 - if (par_override || t->speed_hz || t->bits_per_word) { 313 - par_override = 1; 314 - status = omap1_spi100k_setup_transfer(spi, t); 315 - if (status < 0) 316 - break; 317 - if (!t->speed_hz && !t->bits_per_word) 318 - par_override = 0; 319 - } 313 + status = omap1_spi100k_setup_transfer(spi, t); 314 + if (status < 0) 315 + break; 320 316 321 317 if (!cs_active) { 322 318 omap1_spi100k_force_cs(spi100k, 1); ··· 341 347 } 342 348 } 343 349 344 - /* Restore defaults if they were overriden */ 345 - if (par_override) { 346 - par_override = 0; 347 - status = omap1_spi100k_setup_transfer(spi, NULL); 348 - } 350 + status = omap1_spi100k_setup_transfer(spi, NULL); 349 351 350 352 if (cs_active) 351 353 omap1_spi100k_force_cs(spi100k, 0);
+4 -3
drivers/spi/spi-omap-uwire.c
··· 205 205 static int uwire_txrx(struct spi_device *spi, struct spi_transfer *t) 206 206 { 207 207 unsigned len = t->len; 208 - unsigned bits = t->bits_per_word ? : spi->bits_per_word; 208 + unsigned bits = t->bits_per_word; 209 209 unsigned bytes; 210 210 u16 val, w; 211 211 int status = 0; ··· 344 344 /* assume it's already enabled */ 345 345 rate = clk_get_rate(uwire->ck); 346 346 347 - hz = spi->max_speed_hz; 348 - if (t != NULL && t->speed_hz) 347 + if (t != NULL) 349 348 hz = t->speed_hz; 349 + else 350 + hz = spi->max_speed_hz; 350 351 351 352 if (!hz) { 352 353 pr_debug("%s: zero speed?\n", dev_name(&spi->dev));
+28
drivers/spi/spi-omap2-mcspi.c
··· 1217 1217 return status; 1218 1218 } 1219 1219 1220 + static int omap2_mcspi_prepare_message(struct spi_master *master, 1221 + struct spi_message *msg) 1222 + { 1223 + struct omap2_mcspi *mcspi = spi_master_get_devdata(master); 1224 + struct omap2_mcspi_regs *ctx = &mcspi->ctx; 1225 + struct omap2_mcspi_cs *cs; 1226 + 1227 + /* Only a single channel can have the FORCE bit enabled 1228 + * in its chconf0 register. 1229 + * Scan all channels and disable them except the current one. 1230 + * A FORCE can remain from a last transfer having cs_change enabled 1231 + */ 1232 + list_for_each_entry(cs, &ctx->cs, node) { 1233 + if (msg->spi->controller_state == cs) 1234 + continue; 1235 + 1236 + if ((cs->chconf0 & OMAP2_MCSPI_CHCONF_FORCE)) { 1237 + cs->chconf0 &= ~OMAP2_MCSPI_CHCONF_FORCE; 1238 + writel_relaxed(cs->chconf0, 1239 + cs->base + OMAP2_MCSPI_CHCONF0); 1240 + readl_relaxed(cs->base + OMAP2_MCSPI_CHCONF0); 1241 + } 1242 + } 1243 + 1244 + return 0; 1245 + } 1246 + 1220 1247 static int omap2_mcspi_transfer_one(struct spi_master *master, 1221 1248 struct spi_device *spi, struct spi_transfer *t) 1222 1249 { ··· 1371 1344 master->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 32); 1372 1345 master->setup = omap2_mcspi_setup; 1373 1346 master->auto_runtime_pm = true; 1347 + master->prepare_message = omap2_mcspi_prepare_message; 1374 1348 master->transfer_one = omap2_mcspi_transfer_one; 1375 1349 master->set_cs = omap2_mcspi_set_cs; 1376 1350 master->cleanup = omap2_mcspi_cleanup;
+2 -2
drivers/spi/spi-ppc4xx.c
··· 210 210 if (in_8(&hw->regs->cdm) != cdm) 211 211 out_8(&hw->regs->cdm, cdm); 212 212 213 - spin_lock(&hw->bitbang.lock); 213 + mutex_lock(&hw->bitbang.lock); 214 214 if (!hw->bitbang.busy) { 215 215 hw->bitbang.chipselect(spi, BITBANG_CS_INACTIVE); 216 216 /* Need to ndelay here? */ 217 217 } 218 - spin_unlock(&hw->bitbang.lock); 218 + mutex_unlock(&hw->bitbang.lock); 219 219 220 220 return 0; 221 221 }
-4
drivers/spi/spi-pxa2xx-dma.c
··· 344 344 } 345 345 } 346 346 347 - void pxa2xx_spi_dma_resume(struct driver_data *drv_data) 348 - { 349 - } 350 - 351 347 int pxa2xx_spi_set_dma_burst_and_threshold(struct chip_data *chip, 352 348 struct spi_device *spi, 353 349 u8 bits_per_word, u32 *burst_code,
+156 -97
drivers/spi/spi-pxa2xx.c
··· 13 13 * GNU General Public License for more details. 14 14 */ 15 15 16 + #include <linux/bitops.h> 16 17 #include <linux/init.h> 17 18 #include <linux/module.h> 18 19 #include <linux/device.h> ··· 62 61 | QUARK_X1000_SSCR1_TFT \ 63 62 | SSCR1_SPH | SSCR1_SPO | SSCR1_LBM) 64 63 65 - #define GENERAL_REG_RXTO_HOLDOFF_DISABLE BIT(24) 66 - #define SPI_CS_CONTROL_SW_MODE BIT(0) 67 - #define SPI_CS_CONTROL_CS_HIGH BIT(1) 64 + #define LPSS_GENERAL_REG_RXTO_HOLDOFF_DISABLE BIT(24) 65 + #define LPSS_CS_CONTROL_SW_MODE BIT(0) 66 + #define LPSS_CS_CONTROL_CS_HIGH BIT(1) 67 + #define LPSS_CS_CONTROL_CS_SEL_SHIFT 8 68 + #define LPSS_CS_CONTROL_CS_SEL_MASK (3 << LPSS_CS_CONTROL_CS_SEL_SHIFT) 69 + #define LPSS_CAPS_CS_EN_SHIFT 9 70 + #define LPSS_CAPS_CS_EN_MASK (0xf << LPSS_CAPS_CS_EN_SHIFT) 68 71 69 72 struct lpss_config { 70 73 /* LPSS offset from drv_data->ioaddr */ ··· 77 72 int reg_general; 78 73 int reg_ssp; 79 74 int reg_cs_ctrl; 75 + int reg_capabilities; 80 76 /* FIFO thresholds */ 81 77 u32 rx_threshold; 82 78 u32 tx_threshold_lo; ··· 91 85 .reg_general = 0x08, 92 86 .reg_ssp = 0x0c, 93 87 .reg_cs_ctrl = 0x18, 88 + .reg_capabilities = -1, 94 89 .rx_threshold = 64, 95 90 .tx_threshold_lo = 160, 96 91 .tx_threshold_hi = 224, ··· 101 94 .reg_general = 0x08, 102 95 .reg_ssp = 0x0c, 103 96 .reg_cs_ctrl = 0x18, 97 + .reg_capabilities = -1, 104 98 .rx_threshold = 64, 105 99 .tx_threshold_lo = 160, 106 100 .tx_threshold_hi = 224, ··· 111 103 .reg_general = -1, 112 104 .reg_ssp = 0x20, 113 105 .reg_cs_ctrl = 0x24, 106 + .reg_capabilities = 0xfc, 114 107 .rx_threshold = 1, 115 108 .tx_threshold_lo = 32, 116 109 .tx_threshold_hi = 56, 110 + }, 111 + { /* LPSS_BXT_SSP */ 112 + .offset = 0x200, 113 + .reg_general = -1, 114 + .reg_ssp = 0x20, 115 + .reg_cs_ctrl = 0x24, 116 + .reg_capabilities = 0xfc, 117 + .rx_threshold = 1, 118 + .tx_threshold_lo = 16, 119 + .tx_threshold_hi = 48, 117 120 }, 118 121 }; 119 122 ··· 140 121 case LPSS_LPT_SSP: 141 122 case LPSS_BYT_SSP: 142 123 case LPSS_SPT_SSP: 124 + case LPSS_BXT_SSP: 143 125 return true; 144 126 default: 145 127 return false; ··· 269 249 drv_data->lpss_base = drv_data->ioaddr + config->offset; 270 250 271 251 /* Enable software chip select control */ 272 - value = SPI_CS_CONTROL_SW_MODE | SPI_CS_CONTROL_CS_HIGH; 252 + value = __lpss_ssp_read_priv(drv_data, config->reg_cs_ctrl); 253 + value &= ~(LPSS_CS_CONTROL_SW_MODE | LPSS_CS_CONTROL_CS_HIGH); 254 + value |= LPSS_CS_CONTROL_SW_MODE | LPSS_CS_CONTROL_CS_HIGH; 273 255 __lpss_ssp_write_priv(drv_data, config->reg_cs_ctrl, value); 274 256 275 257 /* Enable multiblock DMA transfers */ ··· 281 259 if (config->reg_general >= 0) { 282 260 value = __lpss_ssp_read_priv(drv_data, 283 261 config->reg_general); 284 - value |= GENERAL_REG_RXTO_HOLDOFF_DISABLE; 262 + value |= LPSS_GENERAL_REG_RXTO_HOLDOFF_DISABLE; 285 263 __lpss_ssp_write_priv(drv_data, 286 264 config->reg_general, value); 287 265 } ··· 291 269 static void lpss_ssp_cs_control(struct driver_data *drv_data, bool enable) 292 270 { 293 271 const struct lpss_config *config; 294 - u32 value; 272 + u32 value, cs; 295 273 296 274 config = lpss_get_config(drv_data); 297 275 298 276 value = __lpss_ssp_read_priv(drv_data, config->reg_cs_ctrl); 299 - if (enable) 300 - value &= ~SPI_CS_CONTROL_CS_HIGH; 301 - else 302 - value |= SPI_CS_CONTROL_CS_HIGH; 277 + if (enable) { 278 + cs = drv_data->cur_msg->spi->chip_select; 279 + cs <<= LPSS_CS_CONTROL_CS_SEL_SHIFT; 280 + if (cs != (value & LPSS_CS_CONTROL_CS_SEL_MASK)) { 281 + /* 282 + * When switching another chip select output active 283 + * the output must be selected first and wait 2 ssp_clk 284 + * cycles before changing state to active. Otherwise 285 + * a short glitch will occur on the previous chip 286 + * select since output select is latched but state 287 + * control is not. 288 + */ 289 + value &= ~LPSS_CS_CONTROL_CS_SEL_MASK; 290 + value |= cs; 291 + __lpss_ssp_write_priv(drv_data, 292 + config->reg_cs_ctrl, value); 293 + ndelay(1000000000 / 294 + (drv_data->master->max_speed_hz / 2)); 295 + } 296 + value &= ~LPSS_CS_CONTROL_CS_HIGH; 297 + } else { 298 + value |= LPSS_CS_CONTROL_CS_HIGH; 299 + } 303 300 __lpss_ssp_write_priv(drv_data, config->reg_cs_ctrl, value); 304 301 } 305 302 ··· 775 734 mul = (1 << 24) >> 1; 776 735 777 736 /* Calculate initial quot */ 778 - q1 = DIV_ROUND_CLOSEST(fref1, rate); 737 + q1 = DIV_ROUND_UP(fref1, rate); 779 738 780 739 /* Scale q1 if it's too big */ 781 740 if (q1 > 256) { ··· 800 759 801 760 /* Case 2 */ 802 761 803 - q2 = DIV_ROUND_CLOSEST(fref2, rate); 762 + q2 = DIV_ROUND_UP(fref2, rate); 804 763 r2 = abs(fref2 / q2 - rate); 805 764 806 765 /* ··· 819 778 mul = (1 << 24) * 2 / 5; 820 779 } 821 780 822 - /* Check case 3 only If the divisor is big enough */ 781 + /* Check case 3 only if the divisor is big enough */ 823 782 if (fref / rate >= 80) { 824 783 u64 fssp; 825 784 u32 m; 826 785 827 786 /* Calculate initial quot */ 828 - q1 = DIV_ROUND_CLOSEST(fref, rate); 787 + q1 = DIV_ROUND_UP(fref, rate); 829 788 m = (1 << 24) / q1; 830 789 831 790 /* Get the remainder */ ··· 847 806 848 807 static unsigned int ssp_get_clk_div(struct driver_data *drv_data, int rate) 849 808 { 850 - unsigned long ssp_clk = drv_data->max_clk_rate; 809 + unsigned long ssp_clk = drv_data->master->max_speed_hz; 851 810 const struct ssp_device *ssp = drv_data->ssp; 852 811 853 812 rate = min_t(int, ssp_clk, rate); ··· 859 818 } 860 819 861 820 static unsigned int pxa2xx_ssp_get_clk_div(struct driver_data *drv_data, 862 - struct chip_data *chip, int rate) 821 + int rate) 863 822 { 823 + struct chip_data *chip = drv_data->cur_chip; 864 824 unsigned int clk_div; 865 825 866 826 switch (drv_data->ssp_type) { ··· 964 922 drv_data->read = drv_data->rx ? chip->read : null_reader; 965 923 966 924 /* Change speed and bit per word on a per transfer */ 967 - cr0 = chip->cr0; 968 - if (transfer->speed_hz || transfer->bits_per_word) { 925 + bits = transfer->bits_per_word; 926 + speed = transfer->speed_hz; 969 927 970 - bits = chip->bits_per_word; 971 - speed = chip->speed_hz; 928 + clk_div = pxa2xx_ssp_get_clk_div(drv_data, speed); 972 929 973 - if (transfer->speed_hz) 974 - speed = transfer->speed_hz; 975 - 976 - if (transfer->bits_per_word) 977 - bits = transfer->bits_per_word; 978 - 979 - clk_div = pxa2xx_ssp_get_clk_div(drv_data, chip, speed); 980 - 981 - if (bits <= 8) { 982 - drv_data->n_bytes = 1; 983 - drv_data->read = drv_data->read != null_reader ? 984 - u8_reader : null_reader; 985 - drv_data->write = drv_data->write != null_writer ? 986 - u8_writer : null_writer; 987 - } else if (bits <= 16) { 988 - drv_data->n_bytes = 2; 989 - drv_data->read = drv_data->read != null_reader ? 990 - u16_reader : null_reader; 991 - drv_data->write = drv_data->write != null_writer ? 992 - u16_writer : null_writer; 993 - } else if (bits <= 32) { 994 - drv_data->n_bytes = 4; 995 - drv_data->read = drv_data->read != null_reader ? 996 - u32_reader : null_reader; 997 - drv_data->write = drv_data->write != null_writer ? 998 - u32_writer : null_writer; 999 - } 1000 - /* if bits/word is changed in dma mode, then must check the 1001 - * thresholds and burst also */ 1002 - if (chip->enable_dma) { 1003 - if (pxa2xx_spi_set_dma_burst_and_threshold(chip, 1004 - message->spi, 1005 - bits, &dma_burst, 1006 - &dma_thresh)) 1007 - dev_warn_ratelimited(&message->spi->dev, 1008 - "pump_transfers: DMA burst size reduced to match bits_per_word\n"); 1009 - } 1010 - 1011 - cr0 = pxa2xx_configure_sscr0(drv_data, clk_div, bits); 930 + if (bits <= 8) { 931 + drv_data->n_bytes = 1; 932 + drv_data->read = drv_data->read != null_reader ? 933 + u8_reader : null_reader; 934 + drv_data->write = drv_data->write != null_writer ? 935 + u8_writer : null_writer; 936 + } else if (bits <= 16) { 937 + drv_data->n_bytes = 2; 938 + drv_data->read = drv_data->read != null_reader ? 939 + u16_reader : null_reader; 940 + drv_data->write = drv_data->write != null_writer ? 941 + u16_writer : null_writer; 942 + } else if (bits <= 32) { 943 + drv_data->n_bytes = 4; 944 + drv_data->read = drv_data->read != null_reader ? 945 + u32_reader : null_reader; 946 + drv_data->write = drv_data->write != null_writer ? 947 + u32_writer : null_writer; 1012 948 } 949 + /* 950 + * if bits/word is changed in dma mode, then must check the 951 + * thresholds and burst also 952 + */ 953 + if (chip->enable_dma) { 954 + if (pxa2xx_spi_set_dma_burst_and_threshold(chip, 955 + message->spi, 956 + bits, &dma_burst, 957 + &dma_thresh)) 958 + dev_warn_ratelimited(&message->spi->dev, 959 + "pump_transfers: DMA burst size reduced to match bits_per_word\n"); 960 + } 961 + 962 + /* NOTE: PXA25x_SSP _could_ use external clocking ... */ 963 + cr0 = pxa2xx_configure_sscr0(drv_data, clk_div, bits); 964 + if (!pxa25x_ssp_comp(drv_data)) 965 + dev_dbg(&message->spi->dev, "%u Hz actual, %s\n", 966 + drv_data->master->max_speed_hz 967 + / (1 + ((cr0 & SSCR0_SCR(0xfff)) >> 8)), 968 + chip->enable_dma ? "DMA" : "PIO"); 969 + else 970 + dev_dbg(&message->spi->dev, "%u Hz actual, %s\n", 971 + drv_data->master->max_speed_hz / 2 972 + / (1 + ((cr0 & SSCR0_SCR(0x0ff)) >> 8)), 973 + chip->enable_dma ? "DMA" : "PIO"); 1013 974 1014 975 message->state = RUNNING_STATE; 1015 976 ··· 1156 1111 struct chip_data *chip; 1157 1112 const struct lpss_config *config; 1158 1113 struct driver_data *drv_data = spi_master_get_devdata(spi->master); 1159 - unsigned int clk_div; 1160 1114 uint tx_thres, tx_hi_thres, rx_thres; 1161 1115 1162 1116 switch (drv_data->ssp_type) { ··· 1167 1123 case LPSS_LPT_SSP: 1168 1124 case LPSS_BYT_SSP: 1169 1125 case LPSS_SPT_SSP: 1126 + case LPSS_BXT_SSP: 1170 1127 config = lpss_get_config(drv_data); 1171 1128 tx_thres = config->tx_threshold_lo; 1172 1129 tx_hi_thres = config->tx_threshold_hi; ··· 1248 1203 } 1249 1204 } 1250 1205 1251 - clk_div = pxa2xx_ssp_get_clk_div(drv_data, chip, spi->max_speed_hz); 1252 - chip->speed_hz = spi->max_speed_hz; 1253 - 1254 - chip->cr0 = pxa2xx_configure_sscr0(drv_data, clk_div, 1255 - spi->bits_per_word); 1256 1206 switch (drv_data->ssp_type) { 1257 1207 case QUARK_X1000_SSP: 1258 1208 chip->threshold = (QUARK_X1000_SSCR1_RxTresh(rx_thres) ··· 1268 1228 if (spi->mode & SPI_LOOP) 1269 1229 chip->cr1 |= SSCR1_LBM; 1270 1230 1271 - /* NOTE: PXA25x_SSP _could_ use external clocking ... */ 1272 - if (!pxa25x_ssp_comp(drv_data)) 1273 - dev_dbg(&spi->dev, "%ld Hz actual, %s\n", 1274 - drv_data->max_clk_rate 1275 - / (1 + ((chip->cr0 & SSCR0_SCR(0xfff)) >> 8)), 1276 - chip->enable_dma ? "DMA" : "PIO"); 1277 - else 1278 - dev_dbg(&spi->dev, "%ld Hz actual, %s\n", 1279 - drv_data->max_clk_rate / 2 1280 - / (1 + ((chip->cr0 & SSCR0_SCR(0x0ff)) >> 8)), 1281 - chip->enable_dma ? "DMA" : "PIO"); 1282 - 1283 1231 if (spi->bits_per_word <= 8) { 1284 1232 chip->n_bytes = 1; 1285 1233 chip->read = u8_reader; ··· 1277 1249 chip->read = u16_reader; 1278 1250 chip->write = u16_writer; 1279 1251 } else if (spi->bits_per_word <= 32) { 1280 - if (!is_quark_x1000_ssp(drv_data)) 1281 - chip->cr0 |= SSCR0_EDSS; 1282 1252 chip->n_bytes = 4; 1283 1253 chip->read = u32_reader; 1284 1254 chip->write = u32_writer; 1285 1255 } 1286 - chip->bits_per_word = spi->bits_per_word; 1287 1256 1288 1257 spi_set_ctldata(spi, chip); 1289 1258 ··· 1304 1279 kfree(chip); 1305 1280 } 1306 1281 1282 + #ifdef CONFIG_PCI 1307 1283 #ifdef CONFIG_ACPI 1308 1284 1309 1285 static const struct acpi_device_id pxa2xx_spi_acpi_match[] = { ··· 1318 1292 }; 1319 1293 MODULE_DEVICE_TABLE(acpi, pxa2xx_spi_acpi_match); 1320 1294 1295 + static int pxa2xx_spi_get_port_id(struct acpi_device *adev) 1296 + { 1297 + unsigned int devid; 1298 + int port_id = -1; 1299 + 1300 + if (adev && adev->pnp.unique_id && 1301 + !kstrtouint(adev->pnp.unique_id, 0, &devid)) 1302 + port_id = devid; 1303 + return port_id; 1304 + } 1305 + #else /* !CONFIG_ACPI */ 1306 + static int pxa2xx_spi_get_port_id(struct acpi_device *adev) 1307 + { 1308 + return -1; 1309 + } 1310 + #endif 1311 + 1321 1312 /* 1322 1313 * PCI IDs of compound devices that integrate both host controller and private 1323 1314 * integrated DMA engine. Please note these are not used in module ··· 1347 1304 /* SPT-H */ 1348 1305 { PCI_VDEVICE(INTEL, 0xa129), LPSS_SPT_SSP }, 1349 1306 { PCI_VDEVICE(INTEL, 0xa12a), LPSS_SPT_SSP }, 1307 + /* BXT */ 1308 + { PCI_VDEVICE(INTEL, 0x0ac2), LPSS_BXT_SSP }, 1309 + { PCI_VDEVICE(INTEL, 0x0ac4), LPSS_BXT_SSP }, 1310 + { PCI_VDEVICE(INTEL, 0x0ac6), LPSS_BXT_SSP }, 1311 + /* APL */ 1312 + { PCI_VDEVICE(INTEL, 0x5ac2), LPSS_BXT_SSP }, 1313 + { PCI_VDEVICE(INTEL, 0x5ac4), LPSS_BXT_SSP }, 1314 + { PCI_VDEVICE(INTEL, 0x5ac6), LPSS_BXT_SSP }, 1350 1315 { }, 1351 1316 }; 1352 1317 ··· 1369 1318 } 1370 1319 1371 1320 static struct pxa2xx_spi_master * 1372 - pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev) 1321 + pxa2xx_spi_init_pdata(struct platform_device *pdev) 1373 1322 { 1374 1323 struct pxa2xx_spi_master *pdata; 1375 1324 struct acpi_device *adev; ··· 1377 1326 struct resource *res; 1378 1327 const struct acpi_device_id *adev_id = NULL; 1379 1328 const struct pci_device_id *pcidev_id = NULL; 1380 - int devid, type; 1329 + int type; 1381 1330 1382 - if (!ACPI_HANDLE(&pdev->dev) || 1383 - acpi_bus_get_device(ACPI_HANDLE(&pdev->dev), &adev)) 1384 - return NULL; 1331 + adev = ACPI_COMPANION(&pdev->dev); 1385 1332 1386 1333 if (dev_is_pci(pdev->dev.parent)) 1387 1334 pcidev_id = pci_match_id(pxa2xx_spi_pci_compound_match, 1388 1335 to_pci_dev(pdev->dev.parent)); 1389 - else 1336 + else if (adev) 1390 1337 adev_id = acpi_match_device(pdev->dev.driver->acpi_match_table, 1391 1338 &pdev->dev); 1339 + else 1340 + return NULL; 1392 1341 1393 1342 if (adev_id) 1394 1343 type = (int)adev_id->driver_data; ··· 1422 1371 ssp->irq = platform_get_irq(pdev, 0); 1423 1372 ssp->type = type; 1424 1373 ssp->pdev = pdev; 1425 - 1426 - ssp->port_id = -1; 1427 - if (adev->pnp.unique_id && !kstrtoint(adev->pnp.unique_id, 0, &devid)) 1428 - ssp->port_id = devid; 1374 + ssp->port_id = pxa2xx_spi_get_port_id(adev); 1429 1375 1430 1376 pdata->num_chipselect = 1; 1431 1377 pdata->enable_dma = true; ··· 1430 1382 return pdata; 1431 1383 } 1432 1384 1433 - #else 1385 + #else /* !CONFIG_PCI */ 1434 1386 static inline struct pxa2xx_spi_master * 1435 - pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev) 1387 + pxa2xx_spi_init_pdata(struct platform_device *pdev) 1436 1388 { 1437 1389 return NULL; 1438 1390 } ··· 1445 1397 struct spi_master *master; 1446 1398 struct driver_data *drv_data; 1447 1399 struct ssp_device *ssp; 1400 + const struct lpss_config *config; 1448 1401 int status; 1449 1402 u32 tmp; 1450 1403 1451 1404 platform_info = dev_get_platdata(dev); 1452 1405 if (!platform_info) { 1453 - platform_info = pxa2xx_spi_acpi_get_pdata(pdev); 1406 + platform_info = pxa2xx_spi_init_pdata(pdev); 1454 1407 if (!platform_info) { 1455 1408 dev_err(&pdev->dev, "missing platform data\n"); 1456 1409 return -ENODEV; ··· 1485 1436 master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LOOP; 1486 1437 1487 1438 master->bus_num = ssp->port_id; 1488 - master->num_chipselect = platform_info->num_chipselect; 1489 1439 master->dma_alignment = DMA_ALIGNMENT; 1490 1440 master->cleanup = cleanup; 1491 1441 master->setup = setup; ··· 1537 1489 /* Enable SOC clock */ 1538 1490 clk_prepare_enable(ssp->clk); 1539 1491 1540 - drv_data->max_clk_rate = clk_get_rate(ssp->clk); 1492 + master->max_speed_hz = clk_get_rate(ssp->clk); 1541 1493 1542 1494 /* Load default SSP configuration */ 1543 1495 pxa2xx_spi_write(drv_data, SSCR0, 0); ··· 1569 1521 1570 1522 if (is_lpss_ssp(drv_data)) 1571 1523 lpss_ssp_setup(drv_data); 1524 + 1525 + if (is_lpss_ssp(drv_data)) { 1526 + lpss_ssp_setup(drv_data); 1527 + config = lpss_get_config(drv_data); 1528 + if (config->reg_capabilities >= 0) { 1529 + tmp = __lpss_ssp_read_priv(drv_data, 1530 + config->reg_capabilities); 1531 + tmp &= LPSS_CAPS_CS_EN_MASK; 1532 + tmp >>= LPSS_CAPS_CS_EN_SHIFT; 1533 + platform_info->num_chipselect = ffz(tmp); 1534 + } 1535 + } 1536 + master->num_chipselect = platform_info->num_chipselect; 1572 1537 1573 1538 tasklet_init(&drv_data->pump_transfers, pump_transfers, 1574 1539 (unsigned long)drv_data); ··· 1674 1613 struct driver_data *drv_data = dev_get_drvdata(dev); 1675 1614 struct ssp_device *ssp = drv_data->ssp; 1676 1615 int status = 0; 1677 - 1678 - pxa2xx_spi_dma_resume(drv_data); 1679 1616 1680 1617 /* Enable the SSP clock */ 1681 1618 if (!pm_runtime_suspended(dev))
-9
drivers/spi/spi-pxa2xx.h
··· 46 46 u32 clear_sr; 47 47 u32 mask_sr; 48 48 49 - /* Maximun clock rate */ 50 - unsigned long max_clk_rate; 51 - 52 49 /* Message Transfer pump */ 53 50 struct tasklet_struct pump_transfers; 54 51 ··· 83 86 }; 84 87 85 88 struct chip_data { 86 - u32 cr0; 87 89 u32 cr1; 88 90 u32 dds_rate; 89 - u32 psp; 90 91 u32 timeout; 91 92 u8 n_bytes; 92 93 u32 dma_burst_size; ··· 93 98 u16 lpss_rx_threshold; 94 99 u16 lpss_tx_threshold; 95 100 u8 enable_dma; 96 - u8 bits_per_word; 97 - u32 speed_hz; 98 101 union { 99 102 int gpio_cs; 100 103 unsigned int frm; ··· 168 175 extern void pxa2xx_spi_dma_start(struct driver_data *drv_data); 169 176 extern int pxa2xx_spi_dma_setup(struct driver_data *drv_data); 170 177 extern void pxa2xx_spi_dma_release(struct driver_data *drv_data); 171 - extern void pxa2xx_spi_dma_resume(struct driver_data *drv_data); 172 178 extern int pxa2xx_spi_set_dma_burst_and_threshold(struct chip_data *chip, 173 179 struct spi_device *spi, 174 180 u8 bits_per_word, ··· 188 196 return 0; 189 197 } 190 198 static inline void pxa2xx_spi_dma_release(struct driver_data *drv_data) {} 191 - static inline void pxa2xx_spi_dma_resume(struct driver_data *drv_data) {} 192 199 static inline int pxa2xx_spi_set_dma_burst_and_threshold(struct chip_data *chip, 193 200 struct spi_device *spi, 194 201 u8 bits_per_word,
+2 -2
drivers/spi/spi-s3c24xx.c
··· 198 198 if (ret) 199 199 return ret; 200 200 201 - spin_lock(&hw->bitbang.lock); 201 + mutex_lock(&hw->bitbang.lock); 202 202 if (!hw->bitbang.busy) { 203 203 hw->bitbang.chipselect(spi, BITBANG_CS_INACTIVE); 204 204 /* need to ndelay for 0.5 clocktick ? */ 205 205 } 206 - spin_unlock(&hw->bitbang.lock); 206 + mutex_unlock(&hw->bitbang.lock); 207 207 208 208 return 0; 209 209 }
+31 -15
drivers/spi/spi-s3c64xx.c
··· 32 32 #define MAX_SPI_PORTS 6 33 33 #define S3C64XX_SPI_QUIRK_POLL (1 << 0) 34 34 #define S3C64XX_SPI_QUIRK_CS_AUTO (1 << 1) 35 + #define AUTOSUSPEND_TIMEOUT 2000 35 36 36 37 /* Registers and bit-fields */ 37 38 ··· 683 682 684 683 /* Only BPW and Speed may change across transfers */ 685 684 bpw = xfer->bits_per_word; 686 - speed = xfer->speed_hz ? : spi->max_speed_hz; 685 + speed = xfer->speed_hz; 687 686 688 687 if (bpw != sdd->cur_bpw || speed != sdd->cur_speed) { 689 688 sdd->cur_bpw = bpw; ··· 860 859 } 861 860 } 862 861 863 - pm_runtime_put(&sdd->pdev->dev); 862 + pm_runtime_mark_last_busy(&sdd->pdev->dev); 863 + pm_runtime_put_autosuspend(&sdd->pdev->dev); 864 864 if (!(sdd->port_conf->quirks & S3C64XX_SPI_QUIRK_CS_AUTO)) 865 865 writel(S3C64XX_SPI_SLAVE_SIG_INACT, sdd->regs + S3C64XX_SPI_SLAVE_SEL); 866 866 return 0; 867 867 868 868 setup_exit: 869 - pm_runtime_put(&sdd->pdev->dev); 869 + pm_runtime_mark_last_busy(&sdd->pdev->dev); 870 + pm_runtime_put_autosuspend(&sdd->pdev->dev); 870 871 /* setup() returns with device de-selected */ 871 872 if (!(sdd->port_conf->quirks & S3C64XX_SPI_QUIRK_CS_AUTO)) 872 873 writel(S3C64XX_SPI_SLAVE_SIG_INACT, sdd->regs + S3C64XX_SPI_SLAVE_SEL); ··· 1165 1162 goto err2; 1166 1163 } 1167 1164 1165 + pm_runtime_set_autosuspend_delay(&pdev->dev, AUTOSUSPEND_TIMEOUT); 1166 + pm_runtime_use_autosuspend(&pdev->dev); 1167 + pm_runtime_set_active(&pdev->dev); 1168 + pm_runtime_enable(&pdev->dev); 1169 + pm_runtime_get_sync(&pdev->dev); 1170 + 1168 1171 /* Setup Deufult Mode */ 1169 1172 s3c64xx_spi_hwinit(sdd, sdd->port_id); 1170 1173 ··· 1189 1180 S3C64XX_SPI_INT_TX_OVERRUN_EN | S3C64XX_SPI_INT_TX_UNDERRUN_EN, 1190 1181 sdd->regs + S3C64XX_SPI_INT_EN); 1191 1182 1192 - pm_runtime_set_active(&pdev->dev); 1193 - pm_runtime_enable(&pdev->dev); 1194 - 1195 1183 ret = devm_spi_register_master(&pdev->dev, master); 1196 1184 if (ret != 0) { 1197 1185 dev_err(&pdev->dev, "cannot register SPI master: %d\n", ret); ··· 1201 1195 mem_res, (FIFO_LVL_MASK(sdd) >> 1) + 1, 1202 1196 sdd->rx_dma.dmach, sdd->tx_dma.dmach); 1203 1197 1198 + pm_runtime_mark_last_busy(&pdev->dev); 1199 + pm_runtime_put_autosuspend(&pdev->dev); 1200 + 1204 1201 return 0; 1205 1202 1206 1203 err3: 1204 + pm_runtime_put_noidle(&pdev->dev); 1205 + pm_runtime_disable(&pdev->dev); 1206 + pm_runtime_set_suspended(&pdev->dev); 1207 + 1207 1208 clk_disable_unprepare(sdd->src_clk); 1208 1209 err2: 1209 1210 clk_disable_unprepare(sdd->clk); ··· 1225 1212 struct spi_master *master = spi_master_get(platform_get_drvdata(pdev)); 1226 1213 struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master); 1227 1214 1228 - pm_runtime_disable(&pdev->dev); 1215 + pm_runtime_get_sync(&pdev->dev); 1229 1216 1230 1217 writel(0, sdd->regs + S3C64XX_SPI_INT_EN); 1231 1218 1232 1219 clk_disable_unprepare(sdd->src_clk); 1233 1220 1234 1221 clk_disable_unprepare(sdd->clk); 1222 + 1223 + pm_runtime_put_noidle(&pdev->dev); 1224 + pm_runtime_disable(&pdev->dev); 1225 + pm_runtime_set_suspended(&pdev->dev); 1235 1226 1236 1227 return 0; 1237 1228 } ··· 1250 1233 if (ret) 1251 1234 return ret; 1252 1235 1253 - if (!pm_runtime_suspended(dev)) { 1254 - clk_disable_unprepare(sdd->clk); 1255 - clk_disable_unprepare(sdd->src_clk); 1256 - } 1236 + ret = pm_runtime_force_suspend(dev); 1237 + if (ret < 0) 1238 + return ret; 1257 1239 1258 1240 sdd->cur_speed = 0; /* Output Clock is stopped */ 1259 1241 ··· 1264 1248 struct spi_master *master = dev_get_drvdata(dev); 1265 1249 struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master); 1266 1250 struct s3c64xx_spi_info *sci = sdd->cntrlr_info; 1251 + int ret; 1267 1252 1268 1253 if (sci->cfg_gpio) 1269 1254 sci->cfg_gpio(); 1270 1255 1271 - if (!pm_runtime_suspended(dev)) { 1272 - clk_prepare_enable(sdd->src_clk); 1273 - clk_prepare_enable(sdd->clk); 1274 - } 1256 + ret = pm_runtime_force_resume(dev); 1257 + if (ret < 0) 1258 + return ret; 1275 1259 1276 1260 s3c64xx_spi_hwinit(sdd, sdd->port_id); 1277 1261
+22 -66
drivers/spi/spi-ti-qspi.c
··· 39 39 }; 40 40 41 41 struct ti_qspi { 42 - struct completion transfer_complete; 43 - 44 42 /* list synchronization */ 45 43 struct mutex list_lock; 46 44 ··· 60 62 61 63 #define QSPI_PID (0x0) 62 64 #define QSPI_SYSCONFIG (0x10) 63 - #define QSPI_INTR_STATUS_RAW_SET (0x20) 64 - #define QSPI_INTR_STATUS_ENABLED_CLEAR (0x24) 65 - #define QSPI_INTR_ENABLE_SET_REG (0x28) 66 - #define QSPI_INTR_ENABLE_CLEAR_REG (0x2c) 67 65 #define QSPI_SPI_CLOCK_CNTRL_REG (0x40) 68 66 #define QSPI_SPI_DC_REG (0x44) 69 67 #define QSPI_SPI_CMD_REG (0x48) ··· 91 97 #define QSPI_RD_DUAL (3 << 16) 92 98 #define QSPI_RD_QUAD (7 << 16) 93 99 #define QSPI_INVAL (4 << 16) 94 - #define QSPI_WC_CMD_INT_EN (1 << 14) 95 100 #define QSPI_FLEN(n) ((n - 1) << 0) 96 101 #define QSPI_WLEN_MAX_BITS 128 97 102 #define QSPI_WLEN_MAX_BYTES 16 ··· 98 105 /* STATUS REGISTER */ 99 106 #define BUSY 0x01 100 107 #define WC 0x02 101 - 102 - /* INTERRUPT REGISTER */ 103 - #define QSPI_WC_INT_EN (1 << 1) 104 - #define QSPI_WC_INT_DISABLE (1 << 1) 105 108 106 109 /* Device Control */ 107 110 #define QSPI_DD(m, n) (m << (3 + n * 8)) ··· 206 217 return stat & BUSY; 207 218 } 208 219 220 + static inline int ti_qspi_poll_wc(struct ti_qspi *qspi) 221 + { 222 + u32 stat; 223 + unsigned long timeout = jiffies + QSPI_COMPLETION_TIMEOUT; 224 + 225 + do { 226 + stat = ti_qspi_read(qspi, QSPI_SPI_STATUS_REG); 227 + if (stat & WC) 228 + return 0; 229 + cpu_relax(); 230 + } while (time_after(timeout, jiffies)); 231 + 232 + stat = ti_qspi_read(qspi, QSPI_SPI_STATUS_REG); 233 + if (stat & WC) 234 + return 0; 235 + return -ETIMEDOUT; 236 + } 237 + 209 238 static int qspi_write_msg(struct ti_qspi *qspi, struct spi_transfer *t) 210 239 { 211 240 int wlen, count, xfer_len; ··· 282 275 } 283 276 284 277 ti_qspi_write(qspi, cmd, QSPI_SPI_CMD_REG); 285 - if (!wait_for_completion_timeout(&qspi->transfer_complete, 286 - QSPI_COMPLETION_TIMEOUT)) { 278 + if (ti_qspi_poll_wc(qspi)) { 287 279 dev_err(qspi->dev, "write timed out\n"); 288 280 return -ETIMEDOUT; 289 281 } ··· 321 315 return -EBUSY; 322 316 323 317 ti_qspi_write(qspi, cmd, QSPI_SPI_CMD_REG); 324 - if (!wait_for_completion_timeout(&qspi->transfer_complete, 325 - QSPI_COMPLETION_TIMEOUT)) { 318 + if (ti_qspi_poll_wc(qspi)) { 326 319 dev_err(qspi->dev, "read timed out\n"); 327 320 return -ETIMEDOUT; 328 321 } ··· 393 388 qspi->cmd = 0; 394 389 qspi->cmd |= QSPI_EN_CS(spi->chip_select); 395 390 qspi->cmd |= QSPI_FLEN(frame_length); 396 - qspi->cmd |= QSPI_WC_CMD_INT_EN; 397 391 398 - ti_qspi_write(qspi, QSPI_WC_INT_EN, QSPI_INTR_ENABLE_SET_REG); 399 392 ti_qspi_write(qspi, qspi->dc, QSPI_SPI_DC_REG); 400 393 401 394 mutex_lock(&qspi->list_lock); ··· 413 410 414 411 mutex_unlock(&qspi->list_lock); 415 412 413 + ti_qspi_write(qspi, qspi->cmd | QSPI_INVAL, QSPI_SPI_CMD_REG); 416 414 m->status = status; 417 415 spi_finalize_current_message(master); 418 416 419 - ti_qspi_write(qspi, qspi->cmd | QSPI_INVAL, QSPI_SPI_CMD_REG); 420 - 421 417 return status; 422 - } 423 - 424 - static irqreturn_t ti_qspi_isr(int irq, void *dev_id) 425 - { 426 - struct ti_qspi *qspi = dev_id; 427 - u16 int_stat; 428 - u32 stat; 429 - 430 - irqreturn_t ret = IRQ_HANDLED; 431 - 432 - int_stat = ti_qspi_read(qspi, QSPI_INTR_STATUS_ENABLED_CLEAR); 433 - stat = ti_qspi_read(qspi, QSPI_SPI_STATUS_REG); 434 - 435 - if (!int_stat) { 436 - dev_dbg(qspi->dev, "No IRQ triggered\n"); 437 - ret = IRQ_NONE; 438 - goto out; 439 - } 440 - 441 - ti_qspi_write(qspi, QSPI_WC_INT_DISABLE, 442 - QSPI_INTR_STATUS_ENABLED_CLEAR); 443 - if (stat & WC) 444 - complete(&qspi->transfer_complete); 445 - out: 446 - return ret; 447 418 } 448 419 449 420 static int ti_qspi_runtime_resume(struct device *dev) ··· 528 551 } 529 552 } 530 553 531 - ret = devm_request_irq(&pdev->dev, irq, ti_qspi_isr, 0, 532 - dev_name(&pdev->dev), qspi); 533 - if (ret < 0) { 534 - dev_err(&pdev->dev, "Failed to register ISR for IRQ %d\n", 535 - irq); 536 - goto free_master; 537 - } 538 - 539 554 qspi->fclk = devm_clk_get(&pdev->dev, "fck"); 540 555 if (IS_ERR(qspi->fclk)) { 541 556 ret = PTR_ERR(qspi->fclk); 542 557 dev_err(&pdev->dev, "could not get clk: %d\n", ret); 543 558 } 544 - 545 - init_completion(&qspi->transfer_complete); 546 559 547 560 pm_runtime_use_autosuspend(&pdev->dev); 548 561 pm_runtime_set_autosuspend_delay(&pdev->dev, QSPI_AUTOSUSPEND_TIMEOUT); ··· 554 587 555 588 static int ti_qspi_remove(struct platform_device *pdev) 556 589 { 557 - struct ti_qspi *qspi = platform_get_drvdata(pdev); 558 - int ret; 559 - 560 - ret = pm_runtime_get_sync(qspi->dev); 561 - if (ret < 0) { 562 - dev_err(qspi->dev, "pm_runtime_get_sync() failed\n"); 563 - return ret; 564 - } 565 - 566 - ti_qspi_write(qspi, QSPI_WC_INT_DISABLE, QSPI_INTR_ENABLE_CLEAR_REG); 567 - 568 - pm_runtime_put(qspi->dev); 590 + pm_runtime_put_sync(&pdev->dev); 569 591 pm_runtime_disable(&pdev->dev); 570 592 571 593 return 0;
-1
drivers/spi/spi-tle62x0.c
··· 307 307 static struct spi_driver tle62x0_driver = { 308 308 .driver = { 309 309 .name = "tle62x0", 310 - .owner = THIS_MODULE, 311 310 }, 312 311 .probe = tle62x0_probe, 313 312 .remove = tle62x0_remove,
+1 -1
drivers/spi/spi-txx9.c
··· 181 181 u32 data; 182 182 unsigned int len = t->len; 183 183 unsigned int wsize; 184 - u32 speed_hz = t->speed_hz ? : spi->max_speed_hz; 184 + u32 speed_hz = t->speed_hz; 185 185 u8 bits_per_word = t->bits_per_word; 186 186 187 187 wsize = bits_per_word >> 3; /* in bytes */
+24 -14
drivers/spi/spi-xilinx.c
··· 270 270 271 271 while (remaining_words) { 272 272 int n_words, tx_words, rx_words; 273 + u32 sr; 273 274 274 275 n_words = min(remaining_words, xspi->buffer_size); 275 276 ··· 285 284 if (use_irq) { 286 285 xspi->write_fn(cr, xspi->regs + XSPI_CR_OFFSET); 287 286 wait_for_completion(&xspi->done); 288 - } else 289 - while (!(xspi->read_fn(xspi->regs + XSPI_SR_OFFSET) & 290 - XSPI_SR_TX_EMPTY_MASK)) 291 - ; 292 - 293 - /* A transmit has just completed. Process received data and 294 - * check for more data to transmit. Always inhibit the 295 - * transmitter while the Isr refills the transmit register/FIFO, 296 - * or make sure it is stopped if we're done. 297 - */ 298 - if (use_irq) 287 + /* A transmit has just completed. Process received data 288 + * and check for more data to transmit. Always inhibit 289 + * the transmitter while the Isr refills the transmit 290 + * register/FIFO, or make sure it is stopped if we're 291 + * done. 292 + */ 299 293 xspi->write_fn(cr | XSPI_CR_TRANS_INHIBIT, 300 - xspi->regs + XSPI_CR_OFFSET); 294 + xspi->regs + XSPI_CR_OFFSET); 295 + sr = XSPI_SR_TX_EMPTY_MASK; 296 + } else 297 + sr = xspi->read_fn(xspi->regs + XSPI_SR_OFFSET); 301 298 302 299 /* Read out all the data from the Rx FIFO */ 303 300 rx_words = n_words; 304 - while (rx_words--) 305 - xilinx_spi_rx(xspi); 301 + while (rx_words) { 302 + if ((sr & XSPI_SR_TX_EMPTY_MASK) && (rx_words > 1)) { 303 + xilinx_spi_rx(xspi); 304 + rx_words--; 305 + continue; 306 + } 307 + 308 + sr = xspi->read_fn(xspi->regs + XSPI_SR_OFFSET); 309 + if (!(sr & XSPI_SR_RX_EMPTY_MASK)) { 310 + xilinx_spi_rx(xspi); 311 + rx_words--; 312 + } 313 + } 306 314 307 315 remaining_words -= n_words; 308 316 }
+114 -22
drivers/spi/spi.c
··· 123 123 SPI_STATISTICS_SHOW(bytes_rx, "%llu"); 124 124 SPI_STATISTICS_SHOW(bytes_tx, "%llu"); 125 125 126 + #define SPI_STATISTICS_TRANSFER_BYTES_HISTO(index, number) \ 127 + SPI_STATISTICS_SHOW_NAME(transfer_bytes_histo##index, \ 128 + "transfer_bytes_histo_" number, \ 129 + transfer_bytes_histo[index], "%lu") 130 + SPI_STATISTICS_TRANSFER_BYTES_HISTO(0, "0-1"); 131 + SPI_STATISTICS_TRANSFER_BYTES_HISTO(1, "2-3"); 132 + SPI_STATISTICS_TRANSFER_BYTES_HISTO(2, "4-7"); 133 + SPI_STATISTICS_TRANSFER_BYTES_HISTO(3, "8-15"); 134 + SPI_STATISTICS_TRANSFER_BYTES_HISTO(4, "16-31"); 135 + SPI_STATISTICS_TRANSFER_BYTES_HISTO(5, "32-63"); 136 + SPI_STATISTICS_TRANSFER_BYTES_HISTO(6, "64-127"); 137 + SPI_STATISTICS_TRANSFER_BYTES_HISTO(7, "128-255"); 138 + SPI_STATISTICS_TRANSFER_BYTES_HISTO(8, "256-511"); 139 + SPI_STATISTICS_TRANSFER_BYTES_HISTO(9, "512-1023"); 140 + SPI_STATISTICS_TRANSFER_BYTES_HISTO(10, "1024-2047"); 141 + SPI_STATISTICS_TRANSFER_BYTES_HISTO(11, "2048-4095"); 142 + SPI_STATISTICS_TRANSFER_BYTES_HISTO(12, "4096-8191"); 143 + SPI_STATISTICS_TRANSFER_BYTES_HISTO(13, "8192-16383"); 144 + SPI_STATISTICS_TRANSFER_BYTES_HISTO(14, "16384-32767"); 145 + SPI_STATISTICS_TRANSFER_BYTES_HISTO(15, "32768-65535"); 146 + SPI_STATISTICS_TRANSFER_BYTES_HISTO(16, "65536+"); 147 + 126 148 static struct attribute *spi_dev_attrs[] = { 127 149 &dev_attr_modalias.attr, 128 150 NULL, ··· 165 143 &dev_attr_spi_device_bytes.attr, 166 144 &dev_attr_spi_device_bytes_rx.attr, 167 145 &dev_attr_spi_device_bytes_tx.attr, 146 + &dev_attr_spi_device_transfer_bytes_histo0.attr, 147 + &dev_attr_spi_device_transfer_bytes_histo1.attr, 148 + &dev_attr_spi_device_transfer_bytes_histo2.attr, 149 + &dev_attr_spi_device_transfer_bytes_histo3.attr, 150 + &dev_attr_spi_device_transfer_bytes_histo4.attr, 151 + &dev_attr_spi_device_transfer_bytes_histo5.attr, 152 + &dev_attr_spi_device_transfer_bytes_histo6.attr, 153 + &dev_attr_spi_device_transfer_bytes_histo7.attr, 154 + &dev_attr_spi_device_transfer_bytes_histo8.attr, 155 + &dev_attr_spi_device_transfer_bytes_histo9.attr, 156 + &dev_attr_spi_device_transfer_bytes_histo10.attr, 157 + &dev_attr_spi_device_transfer_bytes_histo11.attr, 158 + &dev_attr_spi_device_transfer_bytes_histo12.attr, 159 + &dev_attr_spi_device_transfer_bytes_histo13.attr, 160 + &dev_attr_spi_device_transfer_bytes_histo14.attr, 161 + &dev_attr_spi_device_transfer_bytes_histo15.attr, 162 + &dev_attr_spi_device_transfer_bytes_histo16.attr, 168 163 NULL, 169 164 }; 170 165 ··· 207 168 &dev_attr_spi_master_bytes.attr, 208 169 &dev_attr_spi_master_bytes_rx.attr, 209 170 &dev_attr_spi_master_bytes_tx.attr, 171 + &dev_attr_spi_master_transfer_bytes_histo0.attr, 172 + &dev_attr_spi_master_transfer_bytes_histo1.attr, 173 + &dev_attr_spi_master_transfer_bytes_histo2.attr, 174 + &dev_attr_spi_master_transfer_bytes_histo3.attr, 175 + &dev_attr_spi_master_transfer_bytes_histo4.attr, 176 + &dev_attr_spi_master_transfer_bytes_histo5.attr, 177 + &dev_attr_spi_master_transfer_bytes_histo6.attr, 178 + &dev_attr_spi_master_transfer_bytes_histo7.attr, 179 + &dev_attr_spi_master_transfer_bytes_histo8.attr, 180 + &dev_attr_spi_master_transfer_bytes_histo9.attr, 181 + &dev_attr_spi_master_transfer_bytes_histo10.attr, 182 + &dev_attr_spi_master_transfer_bytes_histo11.attr, 183 + &dev_attr_spi_master_transfer_bytes_histo12.attr, 184 + &dev_attr_spi_master_transfer_bytes_histo13.attr, 185 + &dev_attr_spi_master_transfer_bytes_histo14.attr, 186 + &dev_attr_spi_master_transfer_bytes_histo15.attr, 187 + &dev_attr_spi_master_transfer_bytes_histo16.attr, 210 188 NULL, 211 189 }; 212 190 ··· 242 186 struct spi_master *master) 243 187 { 244 188 unsigned long flags; 189 + int l2len = min(fls(xfer->len), SPI_STATISTICS_HISTO_SIZE) - 1; 190 + 191 + if (l2len < 0) 192 + l2len = 0; 245 193 246 194 spin_lock_irqsave(&stats->lock, flags); 247 195 248 196 stats->transfers++; 197 + stats->transfer_bytes_histo[l2len]++; 249 198 250 199 stats->bytes += xfer->len; 251 200 if ((xfer->tx_buf) && ··· 331 270 static int spi_drv_probe(struct device *dev) 332 271 { 333 272 const struct spi_driver *sdrv = to_spi_driver(dev->driver); 273 + struct spi_device *spi = to_spi_device(dev); 334 274 int ret; 335 275 336 276 ret = of_clk_set_defaults(dev->of_node, false); 337 277 if (ret) 338 278 return ret; 339 279 280 + if (dev->of_node) { 281 + spi->irq = of_irq_get(dev->of_node, 0); 282 + if (spi->irq == -EPROBE_DEFER) 283 + return -EPROBE_DEFER; 284 + if (spi->irq < 0) 285 + spi->irq = 0; 286 + } 287 + 340 288 ret = dev_pm_domain_attach(dev, true); 341 289 if (ret != -EPROBE_DEFER) { 342 - ret = sdrv->probe(to_spi_device(dev)); 290 + ret = sdrv->probe(spi); 343 291 if (ret) 344 292 dev_pm_domain_detach(dev, true); 345 293 } ··· 375 305 } 376 306 377 307 /** 378 - * spi_register_driver - register a SPI driver 308 + * __spi_register_driver - register a SPI driver 379 309 * @sdrv: the driver to register 380 310 * Context: can sleep 311 + * 312 + * Return: zero on success, else a negative error code. 381 313 */ 382 - int spi_register_driver(struct spi_driver *sdrv) 314 + int __spi_register_driver(struct module *owner, struct spi_driver *sdrv) 383 315 { 316 + sdrv->driver.owner = owner; 384 317 sdrv->driver.bus = &spi_bus_type; 385 318 if (sdrv->probe) 386 319 sdrv->driver.probe = spi_drv_probe; ··· 393 320 sdrv->driver.shutdown = spi_drv_shutdown; 394 321 return driver_register(&sdrv->driver); 395 322 } 396 - EXPORT_SYMBOL_GPL(spi_register_driver); 323 + EXPORT_SYMBOL_GPL(__spi_register_driver); 397 324 398 325 /*-------------------------------------------------------------------------*/ 399 326 ··· 432 359 * needs to discard the spi_device without adding it, then it should 433 360 * call spi_dev_put() on it. 434 361 * 435 - * Returns a pointer to the new device, or NULL. 362 + * Return: a pointer to the new device, or NULL. 436 363 */ 437 364 struct spi_device *spi_alloc_device(struct spi_master *master) 438 365 { ··· 491 418 * Companion function to spi_alloc_device. Devices allocated with 492 419 * spi_alloc_device can be added onto the spi bus with this function. 493 420 * 494 - * Returns 0 on success; negative errno on failure 421 + * Return: 0 on success; negative errno on failure 495 422 */ 496 423 int spi_add_device(struct spi_device *spi) 497 424 { ··· 564 491 * this is exported so that for example a USB or parport based adapter 565 492 * driver could add devices (which it would learn about out-of-band). 566 493 * 567 - * Returns the new device, or NULL. 494 + * Return: the new device, or NULL. 568 495 */ 569 496 struct spi_device *spi_new_device(struct spi_master *master, 570 497 struct spi_board_info *chip) ··· 636 563 * 637 564 * The board info passed can safely be __initdata ... but be careful of 638 565 * any embedded pointers (platform_data, etc), they're copied as-is. 566 + * 567 + * Return: zero on success, else a negative error code. 639 568 */ 640 569 int spi_register_board_info(struct spi_board_info const *info, unsigned n) 641 570 { ··· 672 597 if (spi->mode & SPI_CS_HIGH) 673 598 enable = !enable; 674 599 675 - if (spi->cs_gpio >= 0) 600 + if (gpio_is_valid(spi->cs_gpio)) 676 601 gpio_set_value(spi->cs_gpio, !enable); 677 602 else if (spi->master->set_cs) 678 603 spi->master->set_cs(spi, !enable); ··· 1215 1140 * 1216 1141 * If there are more messages in the queue, the next message is returned from 1217 1142 * this call. 1143 + * 1144 + * Return: the next message in the queue, else NULL if the queue is empty. 1218 1145 */ 1219 1146 struct spi_message *spi_get_next_queued_message(struct spi_master *master) 1220 1147 { ··· 1380 1303 * spi_queued_transfer - transfer function for queued transfers 1381 1304 * @spi: spi device which is requesting transfer 1382 1305 * @msg: spi message which is to handled is queued to driver queue 1306 + * 1307 + * Return: zero on success, else a negative error code. 1383 1308 */ 1384 1309 static int spi_queued_transfer(struct spi_device *spi, struct spi_message *msg) 1385 1310 { ··· 1511 1432 goto err_out; 1512 1433 } 1513 1434 spi->max_speed_hz = value; 1514 - 1515 - /* IRQ */ 1516 - spi->irq = irq_of_parse_and_map(nc, 0); 1517 1435 1518 1436 /* Store a pointer to the node in the device structure */ 1519 1437 of_node_get(nc); ··· 1681 1605 * only ones directly touching chip registers. It's how they allocate 1682 1606 * an spi_master structure, prior to calling spi_register_master(). 1683 1607 * 1684 - * This must be called from context that can sleep. It returns the SPI 1685 - * master structure on success, else NULL. 1608 + * This must be called from context that can sleep. 1686 1609 * 1687 1610 * The caller is responsible for assigning the bus number and initializing 1688 1611 * the master's methods before calling spi_register_master(); and (after errors 1689 1612 * adding the device) calling spi_master_put() to prevent a memory leak. 1613 + * 1614 + * Return: the SPI master structure on success, else NULL. 1690 1615 */ 1691 1616 struct spi_master *spi_alloc_master(struct device *dev, unsigned size) 1692 1617 { ··· 1771 1694 * success, else a negative error code (dropping the master's refcount). 1772 1695 * After a successful return, the caller is responsible for calling 1773 1696 * spi_unregister_master(). 1697 + * 1698 + * Return: zero on success, else a negative error code. 1774 1699 */ 1775 1700 int spi_register_master(struct spi_master *master) 1776 1701 { ··· 1866 1787 * 1867 1788 * Register a SPI device as with spi_register_master() which will 1868 1789 * automatically be unregister 1790 + * 1791 + * Return: zero on success, else a negative error code. 1869 1792 */ 1870 1793 int devm_spi_register_master(struct device *dev, struct spi_master *master) 1871 1794 { ··· 1973 1892 * arch init time. It returns a refcounted pointer to the relevant 1974 1893 * spi_master (which the caller must release), or NULL if there is 1975 1894 * no such master registered. 1895 + * 1896 + * Return: the SPI master structure on success, else NULL. 1976 1897 */ 1977 1898 struct spi_master *spi_busnum_to_master(u16 bus_num) 1978 1899 { ··· 2028 1945 * that the underlying controller or its driver does not support. For 2029 1946 * example, not all hardware supports wire transfers using nine bit words, 2030 1947 * LSB-first wire encoding, or active-high chipselects. 1948 + * 1949 + * Return: zero on success, else a negative error code. 2031 1950 */ 2032 1951 int spi_setup(struct spi_device *spi) 2033 1952 { 2034 1953 unsigned bad_bits, ugly_bits; 2035 - int status = 0; 1954 + int status; 2036 1955 2037 1956 /* check mode to prevent that DUAL and QUAD set at the same time 2038 1957 */ ··· 2071 1986 if (!spi->bits_per_word) 2072 1987 spi->bits_per_word = 8; 2073 1988 2074 - if (__spi_validate_bits_per_word(spi->master, spi->bits_per_word)) 2075 - return -EINVAL; 1989 + status = __spi_validate_bits_per_word(spi->master, spi->bits_per_word); 1990 + if (status) 1991 + return status; 2076 1992 2077 1993 if (!spi->max_speed_hz) 2078 1994 spi->max_speed_hz = spi->master->max_speed_hz; 2079 1995 2080 - spi_set_cs(spi, false); 2081 - 2082 1996 if (spi->master->setup) 2083 1997 status = spi->master->setup(spi); 1998 + 1999 + spi_set_cs(spi, false); 2084 2000 2085 2001 dev_dbg(&spi->dev, "setup mode %d, %s%s%s%s%u bits/w, %u Hz max --> %d\n", 2086 2002 (int) (spi->mode & (SPI_CPOL | SPI_CPHA)), ··· 2248 2162 * no other spi_message queued to that device will be processed. 2249 2163 * (This rule applies equally to all the synchronous transfer calls, 2250 2164 * which are wrappers around this core asynchronous primitive.) 2165 + * 2166 + * Return: zero on success, else a negative error code. 2251 2167 */ 2252 2168 int spi_async(struct spi_device *spi, struct spi_message *message) 2253 2169 { ··· 2302 2214 * no other spi_message queued to that device will be processed. 2303 2215 * (This rule applies equally to all the synchronous transfer calls, 2304 2216 * which are wrappers around this core asynchronous primitive.) 2217 + * 2218 + * Return: zero on success, else a negative error code. 2305 2219 */ 2306 2220 int spi_async_locked(struct spi_device *spi, struct spi_message *message) 2307 2221 { ··· 2419 2329 * Also, the caller is guaranteeing that the memory associated with the 2420 2330 * message will not be freed before this call returns. 2421 2331 * 2422 - * It returns zero on success, else a negative error code. 2332 + * Return: zero on success, else a negative error code. 2423 2333 */ 2424 2334 int spi_sync(struct spi_device *spi, struct spi_message *message) 2425 2335 { ··· 2441 2351 * SPI bus. It has to be preceded by a spi_bus_lock call. The SPI bus must 2442 2352 * be released by a spi_bus_unlock call when the exclusive access is over. 2443 2353 * 2444 - * It returns zero on success, else a negative error code. 2354 + * Return: zero on success, else a negative error code. 2445 2355 */ 2446 2356 int spi_sync_locked(struct spi_device *spi, struct spi_message *message) 2447 2357 { ··· 2462 2372 * exclusive access is over. Data transfer must be done by spi_sync_locked 2463 2373 * and spi_async_locked calls when the SPI bus lock is held. 2464 2374 * 2465 - * It returns zero on success, else a negative error code. 2375 + * Return: always zero. 2466 2376 */ 2467 2377 int spi_bus_lock(struct spi_master *master) 2468 2378 { ··· 2491 2401 * This call releases an SPI bus lock previously obtained by an spi_bus_lock 2492 2402 * call. 2493 2403 * 2494 - * It returns zero on success, else a negative error code. 2404 + * Return: always zero. 2495 2405 */ 2496 2406 int spi_bus_unlock(struct spi_master *master) 2497 2407 { ··· 2526 2436 * portable code should never use this for more than 32 bytes. 2527 2437 * Performance-sensitive or bulk transfer code should instead use 2528 2438 * spi_{async,sync}() calls with dma-safe buffers. 2439 + * 2440 + * Return: zero on success, else a negative error code. 2529 2441 */ 2530 2442 int spi_write_then_read(struct spi_device *spi, 2531 2443 const void *txbuf, unsigned n_tx,
-1
drivers/spi/spidev.c
··· 788 788 static struct spi_driver spidev_spi_driver = { 789 789 .driver = { 790 790 .name = "spidev", 791 - .owner = THIS_MODULE, 792 791 .of_match_table = of_match_ptr(spidev_dt_ids), 793 792 }, 794 793 .probe = spidev_probe,
-1
drivers/staging/fbtft/fbtft.h
··· 327 327 static struct spi_driver fbtft_driver_spi_driver = { \ 328 328 .driver = { \ 329 329 .name = _name, \ 330 - .owner = THIS_MODULE, \ 331 330 .of_match_table = of_match_ptr(dt_ids), \ 332 331 }, \ 333 332 .probe = fbtft_driver_probe_spi, \
-1
drivers/staging/fbtft/flexfb.c
··· 573 573 static struct spi_driver flexfb_spi_driver = { 574 574 .driver = { 575 575 .name = DRVNAME, 576 - .owner = THIS_MODULE, 577 576 }, 578 577 .probe = flexfb_probe_spi, 579 578 .remove = flexfb_remove_spi,
-1
drivers/staging/iio/accel/adis16201_core.c
··· 235 235 static struct spi_driver adis16201_driver = { 236 236 .driver = { 237 237 .name = "adis16201", 238 - .owner = THIS_MODULE, 239 238 }, 240 239 .probe = adis16201_probe, 241 240 .remove = adis16201_remove,
-1
drivers/staging/iio/accel/adis16203_core.c
··· 203 203 static struct spi_driver adis16203_driver = { 204 204 .driver = { 205 205 .name = "adis16203", 206 - .owner = THIS_MODULE, 207 206 }, 208 207 .probe = adis16203_probe, 209 208 .remove = adis16203_remove,
-1
drivers/staging/iio/accel/adis16204_core.c
··· 241 241 static struct spi_driver adis16204_driver = { 242 242 .driver = { 243 243 .name = "adis16204", 244 - .owner = THIS_MODULE, 245 244 }, 246 245 .probe = adis16204_probe, 247 246 .remove = adis16204_remove,
-1
drivers/staging/iio/accel/adis16209_core.c
··· 235 235 static struct spi_driver adis16209_driver = { 236 236 .driver = { 237 237 .name = "adis16209", 238 - .owner = THIS_MODULE, 239 238 }, 240 239 .probe = adis16209_probe, 241 240 .remove = adis16209_remove,
-1
drivers/staging/iio/accel/adis16220_core.c
··· 482 482 static struct spi_driver adis16220_driver = { 483 483 .driver = { 484 484 .name = "adis16220", 485 - .owner = THIS_MODULE, 486 485 }, 487 486 .probe = adis16220_probe, 488 487 .remove = adis16220_remove,
-1
drivers/staging/iio/accel/adis16240_core.c
··· 288 288 static struct spi_driver adis16240_driver = { 289 289 .driver = { 290 290 .name = "adis16240", 291 - .owner = THIS_MODULE, 292 291 }, 293 292 .probe = adis16240_probe, 294 293 .remove = adis16240_remove,
-1
drivers/staging/iio/accel/lis3l02dq_core.c
··· 802 802 static struct spi_driver lis3l02dq_driver = { 803 803 .driver = { 804 804 .name = "lis3l02dq", 805 - .owner = THIS_MODULE, 806 805 }, 807 806 .probe = lis3l02dq_probe, 808 807 .remove = lis3l02dq_remove,
-1
drivers/staging/iio/accel/sca3000_core.c
··· 1197 1197 static struct spi_driver sca3000_driver = { 1198 1198 .driver = { 1199 1199 .name = "sca3000", 1200 - .owner = THIS_MODULE, 1201 1200 }, 1202 1201 .probe = sca3000_probe, 1203 1202 .remove = sca3000_remove,
-1
drivers/staging/iio/adc/ad7192.c
··· 707 707 static struct spi_driver ad7192_driver = { 708 708 .driver = { 709 709 .name = "ad7192", 710 - .owner = THIS_MODULE, 711 710 }, 712 711 .probe = ad7192_probe, 713 712 .remove = ad7192_remove,
-1
drivers/staging/iio/adc/ad7280a.c
··· 974 974 static struct spi_driver ad7280_driver = { 975 975 .driver = { 976 976 .name = "ad7280", 977 - .owner = THIS_MODULE, 978 977 }, 979 978 .probe = ad7280_probe, 980 979 .remove = ad7280_remove,
-1
drivers/staging/iio/adc/ad7606_spi.c
··· 103 103 static struct spi_driver ad7606_driver = { 104 104 .driver = { 105 105 .name = "ad7606", 106 - .owner = THIS_MODULE, 107 106 .pm = AD7606_SPI_PM_OPS, 108 107 }, 109 108 .probe = ad7606_spi_probe,
-1
drivers/staging/iio/adc/ad7780.c
··· 264 264 static struct spi_driver ad7780_driver = { 265 265 .driver = { 266 266 .name = "ad7780", 267 - .owner = THIS_MODULE, 268 267 }, 269 268 .probe = ad7780_probe, 270 269 .remove = ad7780_remove,
-1
drivers/staging/iio/adc/ad7816.c
··· 432 432 static struct spi_driver ad7816_driver = { 433 433 .driver = { 434 434 .name = "ad7816", 435 - .owner = THIS_MODULE, 436 435 }, 437 436 .probe = ad7816_probe, 438 437 .id_table = ad7816_id,
-1
drivers/staging/iio/addac/adt7316-spi.c
··· 132 132 .driver = { 133 133 .name = "adt7316", 134 134 .pm = ADT7316_PM_OPS, 135 - .owner = THIS_MODULE, 136 135 }, 137 136 .probe = adt7316_spi_probe, 138 137 .id_table = adt7316_spi_id,
-1
drivers/staging/iio/frequency/ad9832.c
··· 339 339 static struct spi_driver ad9832_driver = { 340 340 .driver = { 341 341 .name = "ad9832", 342 - .owner = THIS_MODULE, 343 342 }, 344 343 .probe = ad9832_probe, 345 344 .remove = ad9832_remove,
-1
drivers/staging/iio/frequency/ad9834.c
··· 446 446 static struct spi_driver ad9834_driver = { 447 447 .driver = { 448 448 .name = "ad9834", 449 - .owner = THIS_MODULE, 450 449 }, 451 450 .probe = ad9834_probe, 452 451 .remove = ad9834_remove,
-2
drivers/staging/iio/gyro/adis16060_core.c
··· 208 208 static struct spi_driver adis16060_r_driver = { 209 209 .driver = { 210 210 .name = "adis16060_r", 211 - .owner = THIS_MODULE, 212 211 }, 213 212 .probe = adis16060_r_probe, 214 213 }; ··· 215 216 static struct spi_driver adis16060_w_driver = { 216 217 .driver = { 217 218 .name = "adis16060_w", 218 - .owner = THIS_MODULE, 219 219 }, 220 220 .probe = adis16060_w_probe, 221 221 .remove = adis16060_w_remove,
-1
drivers/staging/iio/magnetometer/hmc5843_spi.c
··· 88 88 .driver = { 89 89 .name = "hmc5843", 90 90 .pm = HMC5843_PM_OPS, 91 - .owner = THIS_MODULE, 92 91 }, 93 92 .id_table = hmc5843_id, 94 93 .probe = hmc5843_spi_probe,
-1
drivers/staging/iio/meter/ade7753.c
··· 534 534 static struct spi_driver ade7753_driver = { 535 535 .driver = { 536 536 .name = "ade7753", 537 - .owner = THIS_MODULE, 538 537 }, 539 538 .probe = ade7753_probe, 540 539 .remove = ade7753_remove,
-1
drivers/staging/iio/meter/ade7754.c
··· 575 575 static struct spi_driver ade7754_driver = { 576 576 .driver = { 577 577 .name = "ade7754", 578 - .owner = THIS_MODULE, 579 578 }, 580 579 .probe = ade7754_probe, 581 580 .remove = ade7754_remove,
-1
drivers/staging/iio/meter/ade7758_core.c
··· 904 904 static struct spi_driver ade7758_driver = { 905 905 .driver = { 906 906 .name = "ade7758", 907 - .owner = THIS_MODULE, 908 907 }, 909 908 .probe = ade7758_probe, 910 909 .remove = ade7758_remove,
-1
drivers/staging/iio/meter/ade7759.c
··· 490 490 static struct spi_driver ade7759_driver = { 491 491 .driver = { 492 492 .name = "ade7759", 493 - .owner = THIS_MODULE, 494 493 }, 495 494 .probe = ade7759_probe, 496 495 .remove = ade7759_remove,
-1
drivers/staging/iio/meter/ade7854-spi.c
··· 314 314 static struct spi_driver ade7854_driver = { 315 315 .driver = { 316 316 .name = "ade7854", 317 - .owner = THIS_MODULE, 318 317 }, 319 318 .probe = ade7854_spi_probe, 320 319 .remove = ade7854_spi_remove,
-1
drivers/staging/iio/resolver/ad2s1200.c
··· 155 155 static struct spi_driver ad2s1200_driver = { 156 156 .driver = { 157 157 .name = DRV_NAME, 158 - .owner = THIS_MODULE, 159 158 }, 160 159 .probe = ad2s1200_probe, 161 160 .id_table = ad2s1200_id,
-1
drivers/staging/iio/resolver/ad2s1210.c
··· 735 735 static struct spi_driver ad2s1210_driver = { 736 736 .driver = { 737 737 .name = DRV_NAME, 738 - .owner = THIS_MODULE, 739 738 }, 740 739 .probe = ad2s1210_probe, 741 740 .remove = ad2s1210_remove,
-1
drivers/staging/iio/resolver/ad2s90.c
··· 100 100 static struct spi_driver ad2s90_driver = { 101 101 .driver = { 102 102 .name = "ad2s90", 103 - .owner = THIS_MODULE, 104 103 }, 105 104 .probe = ad2s90_probe, 106 105 .id_table = ad2s90_id,
-1
drivers/staging/mt29f_spinand/mt29f_spinand.c
··· 946 946 static struct spi_driver spinand_driver = { 947 947 .driver = { 948 948 .name = "mt29f", 949 - .owner = THIS_MODULE, 950 949 .of_match_table = spinand_dt, 951 950 }, 952 951 .probe = spinand_probe,
+1 -1
drivers/tty/serial/ifx6x60.c
··· 1362 1362 .driver = { 1363 1363 .name = DRVNAME, 1364 1364 .pm = &ifx_spi_pm, 1365 - .owner = THIS_MODULE}, 1365 + }, 1366 1366 .probe = ifx_spi_spi_probe, 1367 1367 .shutdown = ifx_spi_spi_shutdown, 1368 1368 .remove = ifx_spi_spi_remove,
-1
drivers/tty/serial/max3100.c
··· 904 904 static struct spi_driver max3100_driver = { 905 905 .driver = { 906 906 .name = "max3100", 907 - .owner = THIS_MODULE, 908 907 .pm = MAX3100_PM_OPS, 909 908 }, 910 909 .probe = max3100_probe,
-1
drivers/tty/serial/max310x.c
··· 1338 1338 static struct spi_driver max310x_uart_driver = { 1339 1339 .driver = { 1340 1340 .name = MAX310X_NAME, 1341 - .owner = THIS_MODULE, 1342 1341 .of_match_table = of_match_ptr(max310x_dt_ids), 1343 1342 .pm = &max310x_pm_ops, 1344 1343 },
-1
drivers/tty/serial/sc16is7xx.c
··· 1360 1360 static struct spi_driver sc16is7xx_spi_uart_driver = { 1361 1361 .driver = { 1362 1362 .name = SC16IS7XX_NAME, 1363 - .owner = THIS_MODULE, 1364 1363 .of_match_table = of_match_ptr(sc16is7xx_dt_ids), 1365 1364 }, 1366 1365 .probe = sc16is7xx_spi_probe,
-1
drivers/usb/host/max3421-hcd.c
··· 1944 1944 .remove = max3421_remove, 1945 1945 .driver = { 1946 1946 .name = "max3421-hcd", 1947 - .owner = THIS_MODULE, 1948 1947 }, 1949 1948 }; 1950 1949
-1
drivers/video/backlight/ams369fg06.c
··· 556 556 static struct spi_driver ams369fg06_driver = { 557 557 .driver = { 558 558 .name = "ams369fg06", 559 - .owner = THIS_MODULE, 560 559 .pm = &ams369fg06_pm_ops, 561 560 }, 562 561 .probe = ams369fg06_probe,
-1
drivers/video/backlight/corgi_lcd.c
··· 598 598 static struct spi_driver corgi_lcd_driver = { 599 599 .driver = { 600 600 .name = "corgi-lcd", 601 - .owner = THIS_MODULE, 602 601 .pm = &corgi_lcd_pm_ops, 603 602 }, 604 603 .probe = corgi_lcd_probe,
-1
drivers/video/backlight/ili922x.c
··· 536 536 static struct spi_driver ili922x_driver = { 537 537 .driver = { 538 538 .name = "ili922x", 539 - .owner = THIS_MODULE, 540 539 }, 541 540 .probe = ili922x_probe, 542 541 .remove = ili922x_remove,
-1
drivers/video/backlight/l4f00242t03.c
··· 255 255 static struct spi_driver l4f00242t03_driver = { 256 256 .driver = { 257 257 .name = "l4f00242t03", 258 - .owner = THIS_MODULE, 259 258 }, 260 259 .probe = l4f00242t03_probe, 261 260 .remove = l4f00242t03_remove,
-1
drivers/video/backlight/ld9040.c
··· 797 797 static struct spi_driver ld9040_driver = { 798 798 .driver = { 799 799 .name = "ld9040", 800 - .owner = THIS_MODULE, 801 800 .pm = &ld9040_pm_ops, 802 801 }, 803 802 .probe = ld9040_probe,
-1
drivers/video/backlight/lms283gf05.c
··· 192 192 static struct spi_driver lms283gf05_driver = { 193 193 .driver = { 194 194 .name = "lms283gf05", 195 - .owner = THIS_MODULE, 196 195 }, 197 196 .probe = lms283gf05_probe, 198 197 };
-1
drivers/video/backlight/lms501kf03.c
··· 422 422 static struct spi_driver lms501kf03_driver = { 423 423 .driver = { 424 424 .name = "lms501kf03", 425 - .owner = THIS_MODULE, 426 425 .pm = &lms501kf03_pm_ops, 427 426 }, 428 427 .probe = lms501kf03_probe,
-1
drivers/video/backlight/ltv350qv.c
··· 295 295 static struct spi_driver ltv350qv_driver = { 296 296 .driver = { 297 297 .name = "ltv350qv", 298 - .owner = THIS_MODULE, 299 298 .pm = &ltv350qv_pm_ops, 300 299 }, 301 300
-1
drivers/video/backlight/s6e63m0.c
··· 842 842 static struct spi_driver s6e63m0_driver = { 843 843 .driver = { 844 844 .name = "s6e63m0", 845 - .owner = THIS_MODULE, 846 845 .pm = &s6e63m0_pm_ops, 847 846 }, 848 847 .probe = s6e63m0_probe,
-1
drivers/video/backlight/tdo24m.c
··· 437 437 static struct spi_driver tdo24m_driver = { 438 438 .driver = { 439 439 .name = "tdo24m", 440 - .owner = THIS_MODULE, 441 440 .pm = &tdo24m_pm_ops, 442 441 }, 443 442 .probe = tdo24m_probe,
-1
drivers/video/backlight/tosa_lcd.c
··· 263 263 static struct spi_driver tosa_lcd_driver = { 264 264 .driver = { 265 265 .name = "tosa-lcd", 266 - .owner = THIS_MODULE, 267 266 .pm = &tosa_lcd_pm_ops, 268 267 }, 269 268 .probe = tosa_lcd_probe,
-1
drivers/video/backlight/vgg2432a4.c
··· 251 251 static struct spi_driver vgg2432a4_driver = { 252 252 .driver = { 253 253 .name = "VGG2432A4", 254 - .owner = THIS_MODULE, 255 254 .pm = &vgg2432a4_pm_ops, 256 255 }, 257 256 .probe = vgg2432a4_probe,
-1
drivers/video/fbdev/mmp/panel/tpo_tj032md01bw.c
··· 175 175 static struct spi_driver panel_tpohvga_driver = { 176 176 .driver = { 177 177 .name = "tpo-hvga", 178 - .owner = THIS_MODULE, 179 178 }, 180 179 .probe = tpohvga_probe, 181 180 };
-1
drivers/video/fbdev/omap/lcd_mipid.c
··· 603 603 static struct spi_driver mipid_spi_driver = { 604 604 .driver = { 605 605 .name = MIPID_MODULE_NAME, 606 - .owner = THIS_MODULE, 607 606 }, 608 607 .probe = mipid_spi_probe, 609 608 .remove = mipid_spi_remove,
-1
drivers/video/fbdev/omap2/displays-new/panel-lgphilips-lb035q02.c
··· 391 391 .remove = lb035q02_panel_spi_remove, 392 392 .driver = { 393 393 .name = "panel_lgphilips_lb035q02", 394 - .owner = THIS_MODULE, 395 394 .of_match_table = lb035q02_of_match, 396 395 .suppress_bind_attrs = true, 397 396 },
-1
drivers/video/fbdev/omap2/displays-new/panel-nec-nl8048hl11.c
··· 421 421 static struct spi_driver nec_8048_driver = { 422 422 .driver = { 423 423 .name = "panel-nec-nl8048hl11", 424 - .owner = THIS_MODULE, 425 424 .pm = NEC_8048_PM_OPS, 426 425 .of_match_table = nec_8048_of_match, 427 426 .suppress_bind_attrs = true,
-1
drivers/video/fbdev/omap2/displays-new/panel-sony-acx565akm.c
··· 903 903 static struct spi_driver acx565akm_driver = { 904 904 .driver = { 905 905 .name = "acx565akm", 906 - .owner = THIS_MODULE, 907 906 .of_match_table = acx565akm_of_match, 908 907 .suppress_bind_attrs = true, 909 908 },
-1
drivers/video/fbdev/omap2/displays-new/panel-tpo-td028ttec1.c
··· 498 498 499 499 .driver = { 500 500 .name = "panel-tpo-td028ttec1", 501 - .owner = THIS_MODULE, 502 501 .of_match_table = td028ttec1_of_match, 503 502 .suppress_bind_attrs = true, 504 503 },
-1
drivers/video/fbdev/omap2/displays-new/panel-tpo-td043mtea1.c
··· 670 670 static struct spi_driver tpo_td043_spi_driver = { 671 671 .driver = { 672 672 .name = "panel-tpo-td043mtea1", 673 - .owner = THIS_MODULE, 674 673 .pm = &tpo_td043_spi_pm, 675 674 .of_match_table = tpo_td043_of_match, 676 675 .suppress_bind_attrs = true,
+1
include/linux/pxa2xx_ssp.h
··· 198 198 LPSS_LPT_SSP, /* Keep LPSS types sorted with lpss_platforms[] */ 199 199 LPSS_BYT_SSP, 200 200 LPSS_SPT_SSP, 201 + LPSS_BXT_SSP, 201 202 }; 202 203 203 204 struct ssp_device {
+29 -15
include/linux/spi/spi.h
··· 51 51 * @bytes_tx: number of bytes sent to device 52 52 * @bytes_rx: number of bytes received from device 53 53 * 54 + * @transfer_bytes_histo: 55 + * transfer bytes histogramm 54 56 */ 55 57 struct spi_statistics { 56 58 spinlock_t lock; /* lock for the whole structure */ ··· 70 68 unsigned long long bytes_rx; 71 69 unsigned long long bytes_tx; 72 70 71 + #define SPI_STATISTICS_HISTO_SIZE 17 72 + unsigned long transfer_bytes_histo[SPI_STATISTICS_HISTO_SIZE]; 73 73 }; 74 74 75 75 void spi_statistics_add_transfer_stats(struct spi_statistics *stats, ··· 254 250 return drv ? container_of(drv, struct spi_driver, driver) : NULL; 255 251 } 256 252 257 - extern int spi_register_driver(struct spi_driver *sdrv); 253 + extern int __spi_register_driver(struct module *owner, struct spi_driver *sdrv); 258 254 259 255 /** 260 256 * spi_unregister_driver - reverse effect of spi_register_driver ··· 266 262 if (sdrv) 267 263 driver_unregister(&sdrv->driver); 268 264 } 265 + 266 + /* use a define to avoid include chaining to get THIS_MODULE */ 267 + #define spi_register_driver(driver) \ 268 + __spi_register_driver(THIS_MODULE, driver) 269 269 270 270 /** 271 271 * module_spi_driver() - Helper macro for registering a SPI driver ··· 851 843 * @len: data buffer size 852 844 * Context: can sleep 853 845 * 854 - * This writes the buffer and returns zero or a negative error code. 846 + * This function writes the buffer @buf. 855 847 * Callable only from contexts that can sleep. 848 + * 849 + * Return: zero on success, else a negative error code. 856 850 */ 857 851 static inline int 858 852 spi_write(struct spi_device *spi, const void *buf, size_t len) ··· 877 867 * @len: data buffer size 878 868 * Context: can sleep 879 869 * 880 - * This reads the buffer and returns zero or a negative error code. 870 + * This function reads the buffer @buf. 881 871 * Callable only from contexts that can sleep. 872 + * 873 + * Return: zero on success, else a negative error code. 882 874 */ 883 875 static inline int 884 876 spi_read(struct spi_device *spi, void *buf, size_t len) ··· 907 895 * 908 896 * For more specific semantics see spi_sync(). 909 897 * 910 - * It returns zero on success, else a negative error code. 898 + * Return: Return: zero on success, else a negative error code. 911 899 */ 912 900 static inline int 913 901 spi_sync_transfer(struct spi_device *spi, struct spi_transfer *xfers, ··· 931 919 * @cmd: command to be written before data is read back 932 920 * Context: can sleep 933 921 * 934 - * This returns the (unsigned) eight bit number returned by the 935 - * device, or else a negative error code. Callable only from 936 - * contexts that can sleep. 922 + * Callable only from contexts that can sleep. 923 + * 924 + * Return: the (unsigned) eight bit number returned by the 925 + * device, or else a negative error code. 937 926 */ 938 927 static inline ssize_t spi_w8r8(struct spi_device *spi, u8 cmd) 939 928 { ··· 953 940 * @cmd: command to be written before data is read back 954 941 * Context: can sleep 955 942 * 956 - * This returns the (unsigned) sixteen bit number returned by the 957 - * device, or else a negative error code. Callable only from 958 - * contexts that can sleep. 959 - * 960 943 * The number is returned in wire-order, which is at least sometimes 961 944 * big-endian. 945 + * 946 + * Callable only from contexts that can sleep. 947 + * 948 + * Return: the (unsigned) sixteen bit number returned by the 949 + * device, or else a negative error code. 962 950 */ 963 951 static inline ssize_t spi_w8r16(struct spi_device *spi, u8 cmd) 964 952 { ··· 978 964 * @cmd: command to be written before data is read back 979 965 * Context: can sleep 980 966 * 981 - * This returns the (unsigned) sixteen bit number returned by the device in cpu 982 - * endianness, or else a negative error code. Callable only from contexts that 983 - * can sleep. 984 - * 985 967 * This function is similar to spi_w8r16, with the exception that it will 986 968 * convert the read 16 bit data word from big-endian to native endianness. 987 969 * 970 + * Callable only from contexts that can sleep. 971 + * 972 + * Return: the (unsigned) sixteen bit number returned by the device in cpu 973 + * endianness, or else a negative error code. 988 974 */ 989 975 static inline ssize_t spi_w8r16be(struct spi_device *spi, u8 cmd) 990 976
+1 -1
include/linux/spi/spi_bitbang.h
··· 4 4 #include <linux/workqueue.h> 5 5 6 6 struct spi_bitbang { 7 - spinlock_t lock; 7 + struct mutex lock; 8 8 u8 busy; 9 9 u8 use_dma; 10 10 u8 flags; /* extra spi->mode support */
-1
sound/soc/codecs/ad1836.c
··· 404 404 static struct spi_driver ad1836_spi_driver = { 405 405 .driver = { 406 406 .name = "ad1836", 407 - .owner = THIS_MODULE, 408 407 }, 409 408 .probe = ad1836_spi_probe, 410 409 .remove = ad1836_spi_remove,
-1
sound/soc/codecs/ad193x-spi.c
··· 36 36 static struct spi_driver ad193x_spi_driver = { 37 37 .driver = { 38 38 .name = "ad193x", 39 - .owner = THIS_MODULE, 40 39 }, 41 40 .probe = ad193x_spi_probe, 42 41 .remove = ad193x_spi_remove,
-1
sound/soc/codecs/adau1761-spi.c
··· 64 64 static struct spi_driver adau1761_spi_driver = { 65 65 .driver = { 66 66 .name = "adau1761", 67 - .owner = THIS_MODULE, 68 67 }, 69 68 .probe = adau1761_spi_probe, 70 69 .remove = adau1761_spi_remove,
-1
sound/soc/codecs/adau1781-spi.c
··· 62 62 static struct spi_driver adau1781_spi_driver = { 63 63 .driver = { 64 64 .name = "adau1781", 65 - .owner = THIS_MODULE, 66 65 }, 67 66 .probe = adau1781_spi_probe, 68 67 .remove = adau1781_spi_remove,
-1
sound/soc/codecs/adau1977-spi.c
··· 63 63 static struct spi_driver adau1977_spi_driver = { 64 64 .driver = { 65 65 .name = "adau1977", 66 - .owner = THIS_MODULE, 67 66 }, 68 67 .probe = adau1977_spi_probe, 69 68 .remove = adau1977_spi_remove,
-1
sound/soc/codecs/adav801.c
··· 39 39 static struct spi_driver adav80x_spi_driver = { 40 40 .driver = { 41 41 .name = "adav801", 42 - .owner = THIS_MODULE, 43 42 }, 44 43 .probe = adav80x_spi_probe, 45 44 .remove = adav80x_spi_remove,
-1
sound/soc/codecs/ak4104.c
··· 344 344 static struct spi_driver ak4104_spi_driver = { 345 345 .driver = { 346 346 .name = "ak4104", 347 - .owner = THIS_MODULE, 348 347 .of_match_table = ak4104_of_match, 349 348 }, 350 349 .id_table = ak4104_id_table,
-1
sound/soc/codecs/cs4271-spi.c
··· 42 42 static struct spi_driver cs4271_spi_driver = { 43 43 .driver = { 44 44 .name = "cs4271", 45 - .owner = THIS_MODULE, 46 45 .of_match_table = of_match_ptr(cs4271_dt_ids), 47 46 }, 48 47 .probe = cs4271_spi_probe,
-1
sound/soc/codecs/da7210.c
··· 1339 1339 static struct spi_driver da7210_spi_driver = { 1340 1340 .driver = { 1341 1341 .name = "da7210", 1342 - .owner = THIS_MODULE, 1343 1342 }, 1344 1343 .probe = da7210_spi_probe, 1345 1344 .remove = da7210_spi_remove
-1
sound/soc/codecs/pcm1792a.c
··· 257 257 static struct spi_driver pcm1792a_codec_driver = { 258 258 .driver = { 259 259 .name = "pcm1792a", 260 - .owner = THIS_MODULE, 261 260 .of_match_table = of_match_ptr(pcm1792a_of_match), 262 261 }, 263 262 .id_table = pcm1792a_spi_ids,
-1
sound/soc/codecs/pcm512x-spi.c
··· 64 64 .id_table = pcm512x_spi_id, 65 65 .driver = { 66 66 .name = "pcm512x", 67 - .owner = THIS_MODULE, 68 67 .of_match_table = pcm512x_of_match, 69 68 .pm = &pcm512x_pm_ops, 70 69 },
-1
sound/soc/codecs/rt5677-spi.c
··· 232 232 static struct spi_driver rt5677_spi_driver = { 233 233 .driver = { 234 234 .name = "rt5677", 235 - .owner = THIS_MODULE, 236 235 }, 237 236 .probe = rt5677_spi_probe, 238 237 };
-1
sound/soc/codecs/ssm2602-spi.c
··· 35 35 static struct spi_driver ssm2602_spi_driver = { 36 36 .driver = { 37 37 .name = "ssm2602", 38 - .owner = THIS_MODULE, 39 38 .of_match_table = ssm2602_of_match, 40 39 }, 41 40 .probe = ssm2602_spi_probe,
-1
sound/soc/codecs/tlv320aic23-spi.c
··· 43 43 static struct spi_driver aic23_spi = { 44 44 .driver = { 45 45 .name = "tlv320aic23", 46 - .owner = THIS_MODULE, 47 46 }, 48 47 .probe = aic23_spi_probe, 49 48 .remove = aic23_spi_remove,
-1
sound/soc/codecs/tlv320aic26.c
··· 373 373 static struct spi_driver aic26_spi = { 374 374 .driver = { 375 375 .name = "tlv320aic26-codec", 376 - .owner = THIS_MODULE, 377 376 }, 378 377 .probe = aic26_spi_probe, 379 378 .remove = aic26_spi_remove,
-1
sound/soc/codecs/wm0010.c
··· 998 998 static struct spi_driver wm0010_spi_driver = { 999 999 .driver = { 1000 1000 .name = "wm0010", 1001 - .owner = THIS_MODULE, 1002 1001 }, 1003 1002 .probe = wm0010_spi_probe, 1004 1003 .remove = wm0010_spi_remove,
-1
sound/soc/codecs/wm8510.c
··· 644 644 static struct spi_driver wm8510_spi_driver = { 645 645 .driver = { 646 646 .name = "wm8510", 647 - .owner = THIS_MODULE, 648 647 .of_match_table = wm8510_of_match, 649 648 }, 650 649 .probe = wm8510_spi_probe,
-1
sound/soc/codecs/wm8711.c
··· 431 431 static struct spi_driver wm8711_spi_driver = { 432 432 .driver = { 433 433 .name = "wm8711", 434 - .owner = THIS_MODULE, 435 434 .of_match_table = wm8711_of_match, 436 435 }, 437 436 .probe = wm8711_spi_probe,
-1
sound/soc/codecs/wm8728.c
··· 272 272 static struct spi_driver wm8728_spi_driver = { 273 273 .driver = { 274 274 .name = "wm8728", 275 - .owner = THIS_MODULE, 276 275 .of_match_table = wm8728_of_match, 277 276 }, 278 277 .probe = wm8728_spi_probe,
-1
sound/soc/codecs/wm8731.c
··· 718 718 static struct spi_driver wm8731_spi_driver = { 719 719 .driver = { 720 720 .name = "wm8731", 721 - .owner = THIS_MODULE, 722 721 .of_match_table = wm8731_of_match, 723 722 }, 724 723 .probe = wm8731_spi_probe,
-1
sound/soc/codecs/wm8737.c
··· 707 707 static struct spi_driver wm8737_spi_driver = { 708 708 .driver = { 709 709 .name = "wm8737", 710 - .owner = THIS_MODULE, 711 710 .of_match_table = wm8737_of_match, 712 711 }, 713 712 .probe = wm8737_spi_probe,
-1
sound/soc/codecs/wm8741.c
··· 657 657 static struct spi_driver wm8741_spi_driver = { 658 658 .driver = { 659 659 .name = "wm8741", 660 - .owner = THIS_MODULE, 661 660 .of_match_table = wm8741_of_match, 662 661 }, 663 662 .probe = wm8741_spi_probe,
-1
sound/soc/codecs/wm8750.c
··· 777 777 static struct spi_driver wm8750_spi_driver = { 778 778 .driver = { 779 779 .name = "wm8750", 780 - .owner = THIS_MODULE, 781 780 .of_match_table = wm8750_of_match, 782 781 }, 783 782 .id_table = wm8750_spi_ids,
-1
sound/soc/codecs/wm8753.c
··· 1549 1549 static struct spi_driver wm8753_spi_driver = { 1550 1550 .driver = { 1551 1551 .name = "wm8753", 1552 - .owner = THIS_MODULE, 1553 1552 .of_match_table = wm8753_of_match, 1554 1553 }, 1555 1554 .probe = wm8753_spi_probe,
-1
sound/soc/codecs/wm8770.c
··· 703 703 static struct spi_driver wm8770_spi_driver = { 704 704 .driver = { 705 705 .name = "wm8770", 706 - .owner = THIS_MODULE, 707 706 .of_match_table = wm8770_of_match, 708 707 }, 709 708 .probe = wm8770_spi_probe,
-1
sound/soc/codecs/wm8776.c
··· 488 488 static struct spi_driver wm8776_spi_driver = { 489 489 .driver = { 490 490 .name = "wm8776", 491 - .owner = THIS_MODULE, 492 491 .of_match_table = wm8776_of_match, 493 492 }, 494 493 .probe = wm8776_spi_probe,
-1
sound/soc/codecs/wm8804-spi.c
··· 42 42 static struct spi_driver wm8804_spi_driver = { 43 43 .driver = { 44 44 .name = "wm8804", 45 - .owner = THIS_MODULE, 46 45 .pm = &wm8804_pm, 47 46 .of_match_table = wm8804_of_match, 48 47 },
-1
sound/soc/codecs/wm8900.c
··· 1266 1266 static struct spi_driver wm8900_spi_driver = { 1267 1267 .driver = { 1268 1268 .name = "wm8900", 1269 - .owner = THIS_MODULE, 1270 1269 }, 1271 1270 .probe = wm8900_spi_probe, 1272 1271 .remove = wm8900_spi_remove,
-1
sound/soc/codecs/wm8983.c
··· 1033 1033 static struct spi_driver wm8983_spi_driver = { 1034 1034 .driver = { 1035 1035 .name = "wm8983", 1036 - .owner = THIS_MODULE, 1037 1036 }, 1038 1037 .probe = wm8983_spi_probe, 1039 1038 .remove = wm8983_spi_remove
-1
sound/soc/codecs/wm8985.c
··· 1096 1096 static struct spi_driver wm8985_spi_driver = { 1097 1097 .driver = { 1098 1098 .name = "wm8985", 1099 - .owner = THIS_MODULE, 1100 1099 }, 1101 1100 .probe = wm8985_spi_probe, 1102 1101 .remove = wm8985_spi_remove
-1
sound/soc/codecs/wm8988.c
··· 871 871 static struct spi_driver wm8988_spi_driver = { 872 872 .driver = { 873 873 .name = "wm8988", 874 - .owner = THIS_MODULE, 875 874 }, 876 875 .probe = wm8988_spi_probe, 877 876 .remove = wm8988_spi_remove,
-1
sound/soc/codecs/wm8995.c
··· 2246 2246 static struct spi_driver wm8995_spi_driver = { 2247 2247 .driver = { 2248 2248 .name = "wm8995", 2249 - .owner = THIS_MODULE, 2250 2249 }, 2251 2250 .probe = wm8995_spi_probe, 2252 2251 .remove = wm8995_spi_remove