History

Merge branch 'spi-5.2' into spi-next

Mark Brown committed 7 years ago

Commit 2e5f0812 parents 58b860e d61ad2355 files · +2408 −649Browse files

Showing the changes to include/linux (5 of 55 files). Show all

Unified · Split

5 files
  1. include/linux/platform_data/spi-ep93xx.h +0 −4
  2. include/linux/spi/pxa2xx_spi.h +1 −0
  3. include/linux/spi/spi-mem.h +12 −0
  4. include/linux/spi/spi.h +19 −5
  5. include/linux/spi/spi_bitbang.h +1 −0
include/linux/platform_data/spi-ep93xx.h+0−4
@@ -6,13 +6,9 @@ struct spi_device; · 5 unmodified lines
6 6
7/**7/**
8 * struct ep93xx_spi_info - EP93xx specific SPI descriptor8 * struct ep93xx_spi_info - EP93xx specific SPI descriptor
9 * @chipselect: array of gpio numbers to use as chip selects
10 * @num_chipselect: ARRAY_SIZE(chipselect)
11 * @use_dma: use DMA for the transfers9 * @use_dma: use DMA for the transfers
12 */10 */
13struct ep93xx_spi_info {11struct ep93xx_spi_info {
14 int *chipselect;
15 int num_chipselect;
16 bool use_dma;12 bool use_dma;
17};13};
18 14
include/linux/spi/pxa2xx_spi.h+1−0
@@ -25,6 +25,7 @@ struct dma_chan; · 24 unmodified lines
25struct pxa2xx_spi_controller {25struct pxa2xx_spi_controller {
26 u16 num_chipselect;26 u16 num_chipselect;
27 u8 enable_dma;27 u8 enable_dma;
28 u8 dma_burst_size;
28 bool is_slave;29 bool is_slave;
29 30
30 /* DMA engine specific config */31 /* DMA engine specific config */
include/linux/spi/spi-mem.h+12−0
@@ -295,6 +295,10 @@ int spi_controller_dma_map_mem_op_data(struct spi_controller *ctlr, · 294 unmodified lines
295void spi_controller_dma_unmap_mem_op_data(struct spi_controller *ctlr,295void spi_controller_dma_unmap_mem_op_data(struct spi_controller *ctlr,
296 const struct spi_mem_op *op,296 const struct spi_mem_op *op,
297 struct sg_table *sg);297 struct sg_table *sg);
298
299bool spi_mem_default_supports_op(struct spi_mem *mem,
300 const struct spi_mem_op *op);
301
298#else302#else
299static inline int303static inline int
300spi_controller_dma_map_mem_op_data(struct spi_controller *ctlr,304spi_controller_dma_map_mem_op_data(struct spi_controller *ctlr,
@@ -310,6 +314,14 @@ spi_controller_dma_unmap_mem_op_data(struct spi_controller *ctlr, · 9 unmodified lines
310 struct sg_table *sg)314 struct sg_table *sg)
311{315{
312}316}
317
318static inline
319bool spi_mem_default_supports_op(struct spi_mem *mem,
320 const struct spi_mem_op *op)
321{
322 return false;
323}
324
313#endif /* CONFIG_SPI_MEM */325#endif /* CONFIG_SPI_MEM */
314 326
315int spi_mem_adjust_op_size(struct spi_mem *mem, struct spi_mem_op *op);327int spi_mem_adjust_op_size(struct spi_mem *mem, struct spi_mem_op *op);
include/linux/spi/spi.h+19−5
@@ -143,7 +143,7 @@ struct spi_device { · 142 unmodified lines
143 u32 max_speed_hz;143 u32 max_speed_hz;
144 u8 chip_select;144 u8 chip_select;
145 u8 bits_per_word;145 u8 bits_per_word;
146 u16 mode;146 u32 mode;
147#define SPI_CPHA 0x01 /* clock phase */147#define SPI_CPHA 0x01 /* clock phase */
148#define SPI_CPOL 0x02 /* clock polarity */148#define SPI_CPOL 0x02 /* clock polarity */
149#define SPI_MODE_0 (0|0) /* (original MicroWire) */149#define SPI_MODE_0 (0|0) /* (original MicroWire) */
@@ -330,6 +330,9 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) · 180 unmodified lines
330 * must fail if an unrecognized or unsupported mode is requested.330 * must fail if an unrecognized or unsupported mode is requested.
331 * It's always safe to call this unless transfers are pending on331 * It's always safe to call this unless transfers are pending on
332 * the device whose settings are being modified.332 * the device whose settings are being modified.
333 * @set_cs_timing: optional hook for SPI devices to request SPI master
334 * controller for configuring specific CS setup time, hold time and inactive
335 * delay interms of clock counts
333 * @transfer: adds a message to the controller's transfer queue.336 * @transfer: adds a message to the controller's transfer queue.
334 * @cleanup: frees controller-specific state337 * @cleanup: frees controller-specific state
335 * @can_dma: determine whether this controller supports DMA338 * @can_dma: determine whether this controller supports DMA
@@ -363,6 +366,7 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) · 27 unmodified lines
363 * @unprepare_transfer_hardware: there are currently no more messages on the366 * @unprepare_transfer_hardware: there are currently no more messages on the
364 * queue so the subsystem notifies the driver that it may relax the367 * queue so the subsystem notifies the driver that it may relax the
365 * hardware by issuing this call368 * hardware by issuing this call
369 *
366 * @set_cs: set the logic level of the chip select line. May be called370 * @set_cs: set the logic level of the chip select line. May be called
367 * from interrupt context.371 * from interrupt context.
368 * @prepare_message: set up the controller to transfer a single message,372 * @prepare_message: set up the controller to transfer a single message,
@@ -439,13 +443,12 @@ struct spi_controller { · 70 unmodified lines
439 u16 dma_alignment;443 u16 dma_alignment;
440 444
441 /* spi_device.mode flags understood by this controller driver */445 /* spi_device.mode flags understood by this controller driver */
442 u16 mode_bits;446 u32 mode_bits;
443 447
444 /* bitmask of supported bits_per_word for transfers */448 /* bitmask of supported bits_per_word for transfers */
445 u32 bits_per_word_mask;449 u32 bits_per_word_mask;
446#define SPI_BPW_MASK(bits) BIT((bits) - 1)450#define SPI_BPW_MASK(bits) BIT((bits) - 1)
447#define SPI_BIT_MASK(bits) (((bits) == 32) ? ~0U : (BIT(bits) - 1))451#define SPI_BPW_RANGE_MASK(min, max) GENMASK((max) - 1, (min) - 1)
448#define SPI_BPW_RANGE_MASK(min, max) (SPI_BIT_MASK(max) - SPI_BIT_MASK(min - 1))
449 452
450 /* limits on transfer speed */453 /* limits on transfer speed */
451 u32 min_speed_hz;454 u32 min_speed_hz;
@@ -489,6 +492,17 @@ struct spi_controller { · 37 unmodified lines
489 */492 */
490 int (*setup)(struct spi_device *spi);493 int (*setup)(struct spi_device *spi);
491 494
495 /*
496 * set_cs_timing() method is for SPI controllers that supports
497 * configuring CS timing.
498 *
499 * This hook allows SPI client drivers to request SPI controllers
500 * to configure specific CS timing through spi_set_cs_timing() after
501 * spi_setup().
502 */
503 void (*set_cs_timing)(struct spi_device *spi, u8 setup_clk_cycles,
504 u8 hold_clk_cycles, u8 inactive_clk_cycles);
505
492 /* bidirectional bulk transfers506 /* bidirectional bulk transfers
493 *507 *
494 * + The transfer() method may not sleep; its main role is508 * + The transfer() method may not sleep; its main role is
@@ -1277,7 +1291,7 @@ struct spi_board_info { · 782 unmodified lines
1277 /* mode becomes spi_device.mode, and is essential for chips1291 /* mode becomes spi_device.mode, and is essential for chips
1278 * where the default of SPI_CS_HIGH = 0 is wrong.1292 * where the default of SPI_CS_HIGH = 0 is wrong.
1279 */1293 */
1280 u16 mode;1294 u32 mode;
1281 1295
1282 /* ... may need additional spi_device chip config data here.1296 /* ... may need additional spi_device chip config data here.
1283 * avoid stuff protocol drivers can set; but include stuff1297 * avoid stuff protocol drivers can set; but include stuff
include/linux/spi/spi_bitbang.h+1−0
@@ -44,6 +44,7 @@ extern int spi_bitbang_setup_transfer(struct spi_device *spi, · 43 unmodified lines
44 44
45/* start or stop queue processing */45/* start or stop queue processing */
46extern int spi_bitbang_start(struct spi_bitbang *spi);46extern int spi_bitbang_start(struct spi_bitbang *spi);
47extern int spi_bitbang_init(struct spi_bitbang *spi);
47extern void spi_bitbang_stop(struct spi_bitbang *spi);48extern void spi_bitbang_stop(struct spi_bitbang *spi);
48 49
49#endif /* __SPI_BITBANG_H */50#endif /* __SPI_BITBANG_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t