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
14struct 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
22struct dma_chan;22struct dma_chan;
23 23
24/* device.platform_data for SSP controller devices */24/* device.platform_data for SSP controller devices */
25struct pxa2xx_spi_master {25struct pxa2xx_spi_controller {
26 u16 num_chipselect;26 u16 num_chipselect;
27 u8 enable_dma;27 u8 enable_dma;
28 bool is_slave;28 bool is_slave;
@@ -54,7 +54,7 @@ struct pxa2xx_spi_chip { · 25 unmodified lines
54 54
55#include <linux/clk.h>55#include <linux/clk.h>
56 56
57extern void pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info);57extern void pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_controller *info);
58 58
59#endif59#endif
60#endif60#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
330 u64 offs, size_t len, void *buf);330 u64 offs, size_t len, void *buf);
331ssize_t spi_mem_dirmap_write(struct spi_mem_dirmap_desc *desc,331ssize_t spi_mem_dirmap_write(struct spi_mem_dirmap_desc *desc,
332 u64 offs, size_t len, const void *buf);332 u64 offs, size_t len, const void *buf);
333struct spi_mem_dirmap_desc *
334devm_spi_mem_dirmap_create(struct device *dev, struct spi_mem *mem,
335 const struct spi_mem_dirmap_info *info);
336void devm_spi_mem_dirmap_destroy(struct device *dev,
337 struct spi_mem_dirmap_desc *desc);
333 338
334int spi_mem_driver_register_with_owner(struct spi_mem_driver *drv,339int spi_mem_driver_register_with_owner(struct spi_mem_driver *drv,
335 struct module *owner);340 struct module *owner);
include/linux/spi/spi.h+25−4
@@ -12,6 +12,7 @@ · 11 unmodified lines
12#include <linux/kthread.h>12#include <linux/kthread.h>
13#include <linux/completion.h>13#include <linux/completion.h>
14#include <linux/scatterlist.h>14#include <linux/scatterlist.h>
15#include <linux/gpio/consumer.h>
15 16
16struct dma_chan;17struct dma_chan;
17struct property_entry;18struct property_entry;
@@ -116,8 +117,13 @@ void spi_statistics_add_transfer_stats(struct spi_statistics *stats, · 98 unmodified lines
116 * @modalias: Name of the driver to use with this device, or an alias117 * @modalias: Name of the driver to use with this device, or an alias
117 * for that name. This appears in the sysfs "modalias" attribute118 * for that name. This appears in the sysfs "modalias" attribute
118 * for driver coldplugging, and in uevents used for hotplugging119 * for driver coldplugging, and in uevents used for hotplugging
119 * @cs_gpio: gpio number of the chipselect line (optional, -ENOENT when120 * @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
120 * not using a GPIO line)124 * not using a GPIO line)
125 * @word_delay_usecs: microsecond delay to be inserted between consecutive
126 * words of a transfer
121 *127 *
122 * @statistics: statistics for the spi_device128 * @statistics: statistics for the spi_device
123 *129 *
@@ -163,7 +169,9 @@ struct spi_device { · 39 unmodified lines
163 void *controller_data;169 void *controller_data;
164 char modalias[SPI_NAME_SIZE];170 char modalias[SPI_NAME_SIZE];
165 const char *driver_override;171 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 */
167 175
168 /* the statistics */176 /* the statistics */
169 struct spi_statistics statistics;177 struct spi_statistics statistics;
@@ -376,9 +384,17 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) · 206 unmodified lines
376 * controller has native support for memory like operations.384 * controller has native support for memory like operations.
377 * @unprepare_message: undo any work done by prepare_message().385 * @unprepare_message: undo any work done by prepare_message().
378 * @slave_abort: abort the ongoing transfer request on an SPI slave controller386 * @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 CS387 * @cs_gpios: LEGACY: array of GPIO descs to use as chip select lines; one per
380 * number. Any individual value may be -ENOENT for CS lines that388 * 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
381 * are not GPIOs (driven by the SPI controller itself).393 * 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.
382 * @statistics: statistics for the spi_controller398 * @statistics: statistics for the spi_controller
383 * @dma_tx: DMA transmit channel399 * @dma_tx: DMA transmit channel
384 * @dma_rx: DMA receive channel400 * @dma_rx: DMA receive channel
@@ -557,6 +573,8 @@ struct spi_controller { · 172 unmodified lines
557 573
558 /* gpio chip select */574 /* gpio chip select */
559 int *cs_gpios;575 int *cs_gpios;
576 struct gpio_desc **cs_gpiods;
577 bool use_gpio_descriptors;
560 578
561 /* statistics */579 /* statistics */
562 struct spi_statistics statistics;580 struct spi_statistics statistics;
@@ -706,6 +724,8 @@ extern void spi_res_release(struct spi_controller *ctlr, · 143 unmodified lines
706 * @delay_usecs: microseconds to delay after this transfer before724 * @delay_usecs: microseconds to delay after this transfer before
707 * (optionally) changing the chipselect status, then starting725 * (optionally) changing the chipselect status, then starting
708 * the next transfer or completing this @spi_message.726 * 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.
709 * @word_delay: clock cycles to inter word delay after each word size729 * @word_delay: clock cycles to inter word delay after each word size
710 * (set by bits_per_word) transmission.730 * (set by bits_per_word) transmission.
711 * @transfer_list: transfers are sequenced through @spi_message.transfers731 * @transfer_list: transfers are sequenced through @spi_message.transfers
@@ -788,6 +808,7 @@ struct spi_transfer { · 76 unmodified lines
788#define SPI_NBITS_DUAL 0x02 /* 2bits transfer */808#define SPI_NBITS_DUAL 0x02 /* 2bits transfer */
789#define SPI_NBITS_QUAD 0x04 /* 4bits transfer */809#define SPI_NBITS_QUAD 0x04 /* 4bits transfer */
790 u8 bits_per_word;810 u8 bits_per_word;
811 u8 word_delay_usecs;
791 u16 delay_usecs;812 u16 delay_usecs;
792 u32 speed_hz;813 u32 speed_hz;
793 u16 word_delay;814 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