History

Merge branch 'spi-5.1' into spi-next

Mark Brown committed 7 years ago

Commit 14dbfb42 parents b50c6ac 0e836c366 files · +5004 −2432Browse files

Showing the changes to include/linux (4 of 66 files). Show all

Unified · Split

4 files
  1. include/linux/platform_data/spi-ath79.h +19 −0
  2. include/linux/spi/pxa2xx_spi.h +2 −2
  3. include/linux/spi/spi-mem.h +5 −0
  4. include/linux/spi/spi.h +25 −4
include/linux/platform_data/spi-ath79.h+19−0
@@ -0,0 +1,19 @@
1+/*
2+ * Platform data definition for Atheros AR71XX/AR724X/AR913X SPI controller
3+ *
4+ * Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
5+ *
6+ * This program is free software; you can redistribute it and/or modify it
7+ * under the terms of the GNU General Public License version 2 as published
8+ * by the Free Software Foundation.
9+ */
10+
11+#ifndef _ATH79_SPI_PLATFORM_H
12+#define _ATH79_SPI_PLATFORM_H
13+
14+struct ath79_spi_platform_data {
15+ unsigned bus_num;
16+ unsigned num_chipselect;
17+};
18+
19+#endif /* _ATH79_SPI_PLATFORM_H */
include/linux/spi/pxa2xx_spi.h+2−2
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 struct dma_chan;
2323
2424 /* device.platform_data for SSP controller devices */
25−struct pxa2xx_spi_master {
25+struct pxa2xx_spi_controller {
2626 u16 num_chipselect;
2727 u8 enable_dma;
2828 bool is_slave;
@@ -54,7 +54,7 @@ struct pxa2xx_spi_chip { · 25 unmodified lines
5454
5555 #include <linux/clk.h>
5656
57−extern void pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info);
57+extern void pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_controller *info);
5858
5959 #endif
6060 #endif
include/linux/spi/spi-mem.h+5−0
@@ -330,6 +330,11 @@ ssize_t spi_mem_dirmap_read(struct spi_mem_dirmap_desc *desc, · 329 unmodified lines
330330 u64 offs, size_t len, void *buf);
331331 ssize_t spi_mem_dirmap_write(struct spi_mem_dirmap_desc *desc,
332332 u64 offs, size_t len, const void *buf);
333+struct spi_mem_dirmap_desc *
334+devm_spi_mem_dirmap_create(struct device *dev, struct spi_mem *mem,
335+ const struct spi_mem_dirmap_info *info);
336+void devm_spi_mem_dirmap_destroy(struct device *dev,
337+ struct spi_mem_dirmap_desc *desc);
333338
334339 int spi_mem_driver_register_with_owner(struct spi_mem_driver *drv,
335340 struct module *owner);
include/linux/spi/spi.h+25−4
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #include <linux/kthread.h>
1313 #include <linux/completion.h>
1414 #include <linux/scatterlist.h>
15+#include <linux/gpio/consumer.h>
1516
1617 struct dma_chan;
1718 struct property_entry;
@@ -116,8 +117,13 @@ void spi_statistics_add_transfer_stats(struct spi_statistics *stats, · 98 unmodified lines
116117 * @modalias: Name of the driver to use with this device, or an alias
117118 * for that name. This appears in the sysfs "modalias" attribute
118119 * for driver coldplugging, and in uevents used for hotplugging
119− * @cs_gpio: gpio number of the chipselect line (optional, -ENOENT when
120+ * @cs_gpio: LEGACY: gpio number of the chipselect line (optional, -ENOENT when
121+ * not using a GPIO line) use cs_gpiod in new drivers by opting in on
122+ * the spi_master.
123+ * @cs_gpiod: gpio descriptor of the chipselect line (optional, NULL when
120124 * not using a GPIO line)
125+ * @word_delay_usecs: microsecond delay to be inserted between consecutive
126+ * words of a transfer
121127 *
122128 * @statistics: statistics for the spi_device
123129 *
@@ -163,7 +169,9 @@ struct spi_device { · 39 unmodified lines
163169 void *controller_data;
164170 char modalias[SPI_NAME_SIZE];
165171 const char *driver_override;
166− int cs_gpio; /* chip select gpio */
172+ int cs_gpio; /* LEGACY: chip select gpio */
173+ struct gpio_desc *cs_gpiod; /* chip select gpio desc */
174+ uint8_t word_delay_usecs; /* inter-word delay */
167175
168176 /* the statistics */
169177 struct spi_statistics statistics;
@@ -376,9 +384,17 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) · 206 unmodified lines
376384 * controller has native support for memory like operations.
377385 * @unprepare_message: undo any work done by prepare_message().
378386 * @slave_abort: abort the ongoing transfer request on an SPI slave controller
379− * @cs_gpios: Array of GPIOs to use as chip select lines; one per CS
380− * number. Any individual value may be -ENOENT for CS lines that
387+ * @cs_gpios: LEGACY: array of GPIO descs to use as chip select lines; one per
388+ * CS number. Any individual value may be -ENOENT for CS lines that
389+ * are not GPIOs (driven by the SPI controller itself). Use the cs_gpiods
390+ * in new drivers.
391+ * @cs_gpiods: Array of GPIO descs to use as chip select lines; one per CS
392+ * number. Any individual value may be NULL for CS lines that
381393 * are not GPIOs (driven by the SPI controller itself).
394+ * @use_gpio_descriptors: Turns on the code in the SPI core to parse and grab
395+ * GPIO descriptors rather than using global GPIO numbers grabbed by the
396+ * driver. This will fill in @cs_gpiods and @cs_gpios should not be used,
397+ * and SPI devices will have the cs_gpiod assigned rather than cs_gpio.
382398 * @statistics: statistics for the spi_controller
383399 * @dma_tx: DMA transmit channel
384400 * @dma_rx: DMA receive channel
@@ -557,6 +573,8 @@ struct spi_controller { · 172 unmodified lines
557573
558574 /* gpio chip select */
559575 int *cs_gpios;
576+ struct gpio_desc **cs_gpiods;
577+ bool use_gpio_descriptors;
560578
561579 /* statistics */
562580 struct spi_statistics statistics;
@@ -706,6 +724,8 @@ extern void spi_res_release(struct spi_controller *ctlr, · 143 unmodified lines
706724 * @delay_usecs: microseconds to delay after this transfer before
707725 * (optionally) changing the chipselect status, then starting
708726 * the next transfer or completing this @spi_message.
727+ * @word_delay_usecs: microseconds to inter word delay after each word size
728+ * (set by bits_per_word) transmission.
709729 * @word_delay: clock cycles to inter word delay after each word size
710730 * (set by bits_per_word) transmission.
711731 * @transfer_list: transfers are sequenced through @spi_message.transfers
@@ -788,6 +808,7 @@ struct spi_transfer { · 76 unmodified lines
788808 #define SPI_NBITS_DUAL 0x02 /* 2bits transfer */
789809 #define SPI_NBITS_QUAD 0x04 /* 4bits transfer */
790810 u8 bits_per_word;
811+ u8 word_delay_usecs;
791812 u16 delay_usecs;
792813 u32 speed_hz;
793814 u16 word_delay;

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