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
66
77 /**
88 * 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)
119 * @use_dma: use DMA for the transfers
1210 */
1311 struct ep93xx_spi_info {
14− int *chipselect;
15− int num_chipselect;
1612 bool use_dma;
1713 };
1814
include/linux/spi/pxa2xx_spi.h+1−0
@@ -25,6 +25,7 @@ struct dma_chan; · 24 unmodified lines
2525 struct pxa2xx_spi_controller {
2626 u16 num_chipselect;
2727 u8 enable_dma;
28+ u8 dma_burst_size;
2829 bool is_slave;
2930
3031 /* 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
295295 void spi_controller_dma_unmap_mem_op_data(struct spi_controller *ctlr,
296296 const struct spi_mem_op *op,
297297 struct sg_table *sg);
298+
299+bool spi_mem_default_supports_op(struct spi_mem *mem,
300+ const struct spi_mem_op *op);
301+
298302 #else
299303 static inline int
300304 spi_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
310314 struct sg_table *sg)
311315 {
312316 }
317+
318+static inline
319+bool spi_mem_default_supports_op(struct spi_mem *mem,
320+ const struct spi_mem_op *op)
321+{
322+ return false;
323+}
324+
313325 #endif /* CONFIG_SPI_MEM */
314326
315327 int 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
143143 u32 max_speed_hz;
144144 u8 chip_select;
145145 u8 bits_per_word;
146− u16 mode;
146+ u32 mode;
147147 #define SPI_CPHA 0x01 /* clock phase */
148148 #define SPI_CPOL 0x02 /* clock polarity */
149149 #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
330330 * must fail if an unrecognized or unsupported mode is requested.
331331 * It's always safe to call this unless transfers are pending on
332332 * 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
333336 * @transfer: adds a message to the controller's transfer queue.
334337 * @cleanup: frees controller-specific state
335338 * @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
363366 * @unprepare_transfer_hardware: there are currently no more messages on the
364367 * queue so the subsystem notifies the driver that it may relax the
365368 * hardware by issuing this call
369+ *
366370 * @set_cs: set the logic level of the chip select line. May be called
367371 * from interrupt context.
368372 * @prepare_message: set up the controller to transfer a single message,
@@ -439,13 +443,12 @@ struct spi_controller { · 70 unmodified lines
439443 u16 dma_alignment;
440444
441445 /* spi_device.mode flags understood by this controller driver */
442− u16 mode_bits;
446+ u32 mode_bits;
443447
444448 /* bitmask of supported bits_per_word for transfers */
445449 u32 bits_per_word_mask;
446450 #define SPI_BPW_MASK(bits) BIT((bits) - 1)
447−#define SPI_BIT_MASK(bits) (((bits) == 32) ? ~0U : (BIT(bits) - 1))
448−#define SPI_BPW_RANGE_MASK(min, max) (SPI_BIT_MASK(max) - SPI_BIT_MASK(min - 1))
451+#define SPI_BPW_RANGE_MASK(min, max) GENMASK((max) - 1, (min) - 1)
449452
450453 /* limits on transfer speed */
451454 u32 min_speed_hz;
@@ -489,6 +492,17 @@ struct spi_controller { · 37 unmodified lines
489492 */
490493 int (*setup)(struct spi_device *spi);
491494
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+
492506 /* bidirectional bulk transfers
493507 *
494508 * + The transfer() method may not sleep; its main role is
@@ -1277,7 +1291,7 @@ struct spi_board_info { · 782 unmodified lines
12771291 /* mode becomes spi_device.mode, and is essential for chips
12781292 * where the default of SPI_CS_HIGH = 0 is wrong.
12791293 */
1280− u16 mode;
1294+ u32 mode;
12811295
12821296 /* ... may need additional spi_device chip config data here.
12831297 * 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
4444
4545 /* start or stop queue processing */
4646 extern int spi_bitbang_start(struct spi_bitbang *spi);
47+extern int spi_bitbang_init(struct spi_bitbang *spi);
4748 extern void spi_bitbang_stop(struct spi_bitbang *spi);
4849
4950 #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