/linux-3.3/drivers/spi/ |
D | Kconfig | 2 # SPI driver configuration 4 # NOTE: the reason this doesn't show SPI slave support is mostly that 8 menuconfig SPI config 9 bool "SPI support" 13 protocol. Chips that support SPI can have data transfer rates 15 controller and a chipselect. Most SPI slaves don't support 18 SPI is widely used by microcontrollers to talk with sensors, 21 MMC and SD cards can be accessed using SPI protocol; and for 22 DataFlash cards used in MMC sockets, SPI must always be used. 24 SPI is one of a family of similar protocols using a four wire [all …]
|
D | Makefile | 2 # Makefile for kernel SPI drivers. 9 obj-$(CONFIG_SPI_MASTER) += spi.o 12 # SPI master controller drivers (bus) 13 obj-$(CONFIG_SPI_ALTERA) += spi-altera.o 14 obj-$(CONFIG_SPI_ATMEL) += spi-atmel.o 15 obj-$(CONFIG_SPI_ATH79) += spi-ath79.o 16 obj-$(CONFIG_SPI_AU1550) += spi-au1550.o 17 obj-$(CONFIG_SPI_BFIN) += spi-bfin5xx.o 18 obj-$(CONFIG_SPI_BFIN_SPORT) += spi-bfin-sport.o 19 obj-$(CONFIG_SPI_BITBANG) += spi-bitbang.o [all …]
|
D | spi-omap2-mcspi.c | 38 #include <linux/spi/spi.h> 46 /* OMAP2 has 3 SPI controllers, while OMAP3 has 4 */ 169 static inline void mcspi_write_cs_reg(const struct spi_device *spi, in mcspi_write_cs_reg() argument 172 struct omap2_mcspi_cs *cs = spi->controller_state; in mcspi_write_cs_reg() 177 static inline u32 mcspi_read_cs_reg(const struct spi_device *spi, int idx) in mcspi_read_cs_reg() argument 179 struct omap2_mcspi_cs *cs = spi->controller_state; in mcspi_read_cs_reg() 184 static inline u32 mcspi_cached_chconf0(const struct spi_device *spi) in mcspi_cached_chconf0() argument 186 struct omap2_mcspi_cs *cs = spi->controller_state; in mcspi_cached_chconf0() 191 static inline void mcspi_write_chconf0(const struct spi_device *spi, u32 val) in mcspi_write_chconf0() argument 193 struct omap2_mcspi_cs *cs = spi->controller_state; in mcspi_write_chconf0() [all …]
|
D | spi-ath79.c | 2 * SPI controller driver for the Atheros AR71XX/AR724X/AR913X SoCs 6 * This driver has been based on the spi-gpio.c: 23 #include <linux/spi/spi.h> 24 #include <linux/spi/spi_bitbang.h> 31 #define DRV_NAME "ath79-spi" 50 static inline struct ath79_spi *ath79_spidev_to_sp(struct spi_device *spi) in ath79_spidev_to_sp() argument 52 return spi_master_get_devdata(spi->master); in ath79_spidev_to_sp() 55 static void ath79_spi_chipselect(struct spi_device *spi, int is_active) in ath79_spi_chipselect() argument 57 struct ath79_spi *sp = ath79_spidev_to_sp(spi); in ath79_spi_chipselect() 58 int cs_high = (spi->mode & SPI_CS_HIGH) ? is_active : !is_active; in ath79_spi_chipselect() [all …]
|
D | spi-gpio.c | 2 * SPI master driver using generic bitbanged GPIO 26 #include <linux/spi/spi.h> 27 #include <linux/spi/spi_bitbang.h> 28 #include <linux/spi/spi_gpio.h> 32 * This bitbanging SPI master driver should help make systems usable 33 * when a native hardware SPI engine is not available, perhaps because 39 * spi->controller_state ... reserved for bitbang framework code 40 * spi->controller_data ... holds chipselect GPIO 42 * spi->master->dev.driver_data ... points to spi_gpio->bitbang 73 * #include "spi-gpio.c" [all …]
|
D | spi-orion.c | 2 * Marvell Orion SPI controller driver 18 #include <linux/spi/spi.h> 19 #include <linux/spi/orion_spi.h> 97 static int orion_spi_baudrate_set(struct spi_device *spi, unsigned int speed) in orion_spi_baudrate_set() argument 105 orion_spi = spi_master_get_devdata(spi->master); in orion_spi_baudrate_set() 123 /* Convert the rate to SPI clock divisor value. */ in orion_spi_baudrate_set() 137 orion_spi_setup_transfer(struct spi_device *spi, struct spi_transfer *t) in orion_spi_setup_transfer() argument 140 unsigned int speed = spi->max_speed_hz; in orion_spi_setup_transfer() 141 unsigned int bits_per_word = spi->bits_per_word; in orion_spi_setup_transfer() 144 orion_spi = spi_master_get_devdata(spi->master); in orion_spi_setup_transfer() [all …]
|
D | spi.c | 2 * SPI init/core code 29 #include <linux/spi/spi.h> 36 struct spi_device *spi = to_spi_device(dev); in spidev_release() local 38 /* spi masters may cleanup for released devices */ in spidev_release() 39 if (spi->master->cleanup) in spidev_release() 40 spi->master->cleanup(spi); in spidev_release() 42 spi_master_put(spi->master); in spidev_release() 43 kfree(spi); in spidev_release() 49 const struct spi_device *spi = to_spi_device(dev); in modalias_show() local 51 return sprintf(buf, "%s\n", spi->modalias); in modalias_show() [all …]
|
/linux-3.3/Documentation/devicetree/bindings/spi/ |
D | spi-bus.txt | 1 SPI (Serial Peripheral Interface) busses 3 SPI busses can be described with a node for the SPI master device 4 and a set of child nodes for each SPI slave on the bus. For this 5 discussion, it is assumed that the system's SPI controller is in 6 SPI master mode. This binding does not describe SPI controllers 9 The SPI master node requires the following properties: 11 address on the SPI bus. 13 - compatible - name of SPI bus controller following generic names 15 No other properties are required in the SPI bus node. It is assumed 16 that a driver for an SPI bus device will understand that it is an SPI bus. [all …]
|
/linux-3.3/drivers/net/can/ |
D | mcp251x.c | 2 * CAN bus driver for Microchip 251x CAN Controller with SPI Interface 76 #include <linux/spi/spi.h> 79 /* SPI interface instruction set */ 202 * Buffer size required for the largest SPI transfer (i.e., reading a 213 static int mcp251x_enable_dma; /* Enable SPI DMA. Default: 0 (Off) */ 215 MODULE_PARM_DESC(mcp251x_enable_dma, "Enable SPI DMA. Default: 0 (Off)"); 237 struct spi_device *spi; member 240 struct mutex mcp_lock; /* SPI device lock */ 264 static inline int mcp251x_is_##_model(struct spi_device *spi) \ 266 struct mcp251x_priv *priv = dev_get_drvdata(&spi->dev); \ [all …]
|
/linux-3.3/drivers/of/ |
D | of_spi.c | 2 * SPI OF support routines 5 * Support routines for deriving SPI device attachments from the device 12 #include <linux/spi/spi.h> 17 * of_register_spi_devices - Register child devices onto the SPI bus 25 struct spi_device *spi; in of_register_spi_devices() local 36 spi = spi_alloc_device(master); in of_register_spi_devices() 37 if (!spi) { in of_register_spi_devices() 40 spi_dev_put(spi); in of_register_spi_devices() 45 if (of_modalias_node(nc, spi->modalias, in of_register_spi_devices() 46 sizeof(spi->modalias)) < 0) { in of_register_spi_devices() [all …]
|
/linux-3.3/drivers/video/backlight/ |
D | l4f00242t03.c | 23 #include <linux/spi/spi.h> 24 #include <linux/spi/l4f00242t03.h> 27 struct spi_device *spi; member 48 static void l4f00242t03_lcd_init(struct spi_device *spi) in l4f00242t03_lcd_init() argument 50 struct l4f00242t03_pdata *pdata = spi->dev.platform_data; in l4f00242t03_lcd_init() 51 struct l4f00242t03_priv *priv = dev_get_drvdata(&spi->dev); in l4f00242t03_lcd_init() 54 dev_dbg(&spi->dev, "initializing LCD\n"); in l4f00242t03_lcd_init() 66 spi_write(spi, (const u8 *)cmd, ARRAY_SIZE(cmd) * sizeof(u16)); in l4f00242t03_lcd_init() 69 static void l4f00242t03_lcd_powerdown(struct spi_device *spi) in l4f00242t03_lcd_powerdown() argument 71 struct l4f00242t03_pdata *pdata = spi->dev.platform_data; in l4f00242t03_lcd_powerdown() [all …]
|
D | tosa_lcd.c | 16 #include <linux/spi/spi.h> 38 struct spi_device *spi; member 46 static int tosa_tg_send(struct spi_device *spi, int adrs, uint8_t data) in tosa_tg_send() argument 60 return spi_sync(spi, &msg); in tosa_tg_send() 63 int tosa_bl_enable(struct spi_device *spi, int enable) in tosa_bl_enable() argument 66 return tosa_tg_send(spi, TG_GPODR2, enable? 0x01 : 0x00); in tosa_bl_enable() 78 tosa_tg_send(data->spi, TG_TPOSCTL, 0x00); in tosa_lcd_tg_init() 80 tosa_tg_send(data->spi, TG_GPOSR, 0x02); in tosa_lcd_tg_init() 85 struct spi_device *spi = data->spi; in tosa_lcd_tg_on() local 91 tosa_tg_send(spi, TG_PNLCTL, value); in tosa_lcd_tg_on() [all …]
|
/linux-3.3/Documentation/spi/ |
D | spi-summary | 1 Overview of Linux kernel SPI support 6 What is SPI? 8 The "Serial Peripheral Interface" (SPI) is a synchronous four wire serial 11 standardization body. SPI uses a master/slave configuration. 21 SPI masters use a fourth "chip select" line to activate a given SPI slave 23 in parallel. All SPI slaves support chipselects; they are usually active 28 SPI slave functions are usually not interoperable between vendors 29 (except for commodities like SPI memory chips). 31 - SPI may be used for request/response style device protocols, as with 43 - Sometimes SPI is used to daisy-chain devices, like shift registers. [all …]
|
/linux-3.3/Documentation/networking/caif/ |
D | spi_porting.txt | 1 - CAIF SPI porting - 3 - CAIF SPI basics: 5 Running CAIF over SPI needs some extra setup, owing to the nature of SPI. 8 CAIF over SPI is a SPI slave chip and two GPIOs (more details below). 12 - CAIF SPI framework: 14 To make porting as easy as possible, the CAIF SPI has been divided in 16 generic functionality such as length framing, SPI frame negotiation 17 and SPI frame delivery and transmission. The other part is the CAIF 18 SPI slave device part, which is the module that you have to write if 19 you want to run SPI CAIF on a new hardware. This part takes care of [all …]
|
/linux-3.3/drivers/input/misc/ |
D | adxl34x-spi.c | 2 * ADLX345/346 Three-Axis Digital Accelerometers (SPI Interface) 12 #include <linux/spi/spi.h> 28 struct spi_device *spi = to_spi_device(dev); in adxl34x_spi_read() local 33 return spi_w8r8(spi, cmd); in adxl34x_spi_read() 39 struct spi_device *spi = to_spi_device(dev); in adxl34x_spi_write() local 45 return spi_write(spi, buf, sizeof(buf)); in adxl34x_spi_write() 52 struct spi_device *spi = to_spi_device(dev); in adxl34x_spi_read_block() local 56 status = spi_write_then_read(spi, ®, 1, buf, count); in adxl34x_spi_read_block() 68 static int __devinit adxl34x_spi_probe(struct spi_device *spi) in adxl34x_spi_probe() argument 72 /* don't exceed max specified SPI CLK frequency */ in adxl34x_spi_probe() [all …]
|
/linux-3.3/drivers/input/touchscreen/ |
D | ad7879-spi.c | 2 * AD7879/AD7889 touchscreen (SPI bus) 11 #include <linux/spi/spi.h> 30 static int ad7879_spi_xfer(struct spi_device *spi, in ad7879_spi_xfer() argument 72 ret = spi_sync(spi, &msg); in ad7879_spi_xfer() 85 struct spi_device *spi = to_spi_device(dev); in ad7879_spi_multi_read() local 87 return ad7879_spi_xfer(spi, AD7879_READCMD(first_reg), count, NULL, buf); in ad7879_spi_multi_read() 92 struct spi_device *spi = to_spi_device(dev); in ad7879_spi_read() local 95 return ad7879_spi_xfer(spi, AD7879_READCMD(reg), 1, &dummy, &ret) ? : ret; in ad7879_spi_read() 100 struct spi_device *spi = to_spi_device(dev); in ad7879_spi_write() local 103 return ad7879_spi_xfer(spi, AD7879_WRITECMD(reg), 1, &val, &dummy); in ad7879_spi_write() [all …]
|
/linux-3.3/drivers/video/omap2/displays/ |
D | panel-lgphilips-lb035q02.c | 21 #include <linux/spi/spi.h> 186 static int lb035q02_write_reg(struct spi_device *spi, u8 reg, u16 val) in lb035q02_write_reg() argument 214 return spi_sync(spi, &msg); in lb035q02_write_reg() 217 static void init_lb035q02_panel(struct spi_device *spi) in init_lb035q02_panel() argument 220 lb035q02_write_reg(spi, 0x01, 0x6300); in init_lb035q02_panel() 221 lb035q02_write_reg(spi, 0x02, 0x0200); in init_lb035q02_panel() 222 lb035q02_write_reg(spi, 0x03, 0x0177); in init_lb035q02_panel() 223 lb035q02_write_reg(spi, 0x04, 0x04c7); in init_lb035q02_panel() 224 lb035q02_write_reg(spi, 0x05, 0xffc0); in init_lb035q02_panel() 225 lb035q02_write_reg(spi, 0x06, 0xe806); in init_lb035q02_panel() [all …]
|
/linux-3.3/include/linux/spi/ |
D | spi.h | 27 * INTERFACES between SPI master-side drivers and SPI infrastructure. 28 * (There's no SPI slave support for Linux yet...) 33 * struct spi_device - Master side proxy for an SPI slave device 35 * @master: SPI controller used with the device. 40 * @mode: The spi mode defines how data is clocked out and in. 60 * A @spi_device is used to interchange data between an SPI slave 110 static inline struct spi_device *spi_dev_get(struct spi_device *spi) in spi_dev_get() argument 112 return (spi && get_device(&spi->dev)) ? spi : NULL; in spi_dev_get() 115 static inline void spi_dev_put(struct spi_device *spi) in spi_dev_put() argument 117 if (spi) in spi_dev_put() [all …]
|
/linux-3.3/drivers/mfd/ |
D | stmpe-spi.c | 2 * ST Microelectronics MFD: stmpe's spi client specific driver 10 #include <linux/spi/spi.h> 21 struct spi_device *spi = stmpe->client; in spi_reg_read() local 22 int status = spi_w8r16(spi, reg | READ_CMD); in spi_reg_read() 29 struct spi_device *spi = stmpe->client; in spi_reg_write() local 32 return spi_write(spi, (const u8 *)&cmd, 2); in spi_reg_write() 65 struct spi_device *spi = stmpe->client; in spi_init() local 67 spi->bits_per_word = 8; in spi_init() 71 spi_reg_write(stmpe, STMPE811_REG_SPI_CFG, spi->mode); in spi_init() 73 if (spi_setup(spi) < 0) in spi_init() [all …]
|
/linux-3.3/net/ipv6/ |
D | xfrm6_tunnel.c | 45 u32 spi; member 55 * xfrm_tunnel_spi things are for allocating unique id ("spi") 62 u32 spi; member 83 static inline unsigned xfrm6_tunnel_spi_hash_byspi(u32 spi) in xfrm6_tunnel_spi_hash_byspi() argument 85 return spi % XFRM6_TUNNEL_SPI_BYSPI_HSIZE; in xfrm6_tunnel_spi_hash_byspi() 107 u32 spi; in xfrm6_tunnel_spi_lookup() local 111 spi = x6spi ? x6spi->spi : 0; in xfrm6_tunnel_spi_lookup() 113 return htonl(spi); in xfrm6_tunnel_spi_lookup() 118 static int __xfrm6_tunnel_spi_check(struct net *net, u32 spi) in __xfrm6_tunnel_spi_check() argument 122 int index = xfrm6_tunnel_spi_hash_byspi(spi); in __xfrm6_tunnel_spi_check() [all …]
|
/linux-3.3/drivers/rtc/ |
D | rtc-m41t94.c | 2 * Driver for ST M41T94 SPI RTC 15 #include <linux/spi/spi.h> 34 struct spi_device *spi = to_spi_device(dev); in m41t94_set_time() local 56 return spi_write(spi, buf, 8); in m41t94_set_time() 61 struct spi_device *spi = to_spi_device(dev); in m41t94_read_time() local 66 ret = spi_w8r8(spi, M41T94_REG_HT); in m41t94_read_time() 72 spi_write(spi, buf, 2); in m41t94_read_time() 76 ret = spi_w8r8(spi, M41T94_REG_SECONDS); in m41t94_read_time() 82 spi_write(spi, buf, 2); in m41t94_read_time() 85 tm->tm_sec = bcd2bin(spi_w8r8(spi, M41T94_REG_SECONDS)); in m41t94_read_time() [all …]
|
D | rtc-m41t93.c | 3 * Driver for ST M41T93 SPI RTC 17 #include <linux/spi/spi.h> 37 static inline int m41t93_set_reg(struct spi_device *spi, u8 addr, u8 data) in m41t93_set_reg() argument 45 return spi_write(spi, buf, sizeof(buf)); in m41t93_set_reg() 50 struct spi_device *spi = to_spi_device(dev); in m41t93_set_time() local 61 dev_warn(&spi->dev, "unsupported date (before 2000-01-01).\n"); in m41t93_set_time() 75 return spi_write(spi, buf, sizeof(buf)); in m41t93_set_time() 81 struct spi_device *spi = to_spi_device(dev); in m41t93_get_time() local 97 tmp = spi_w8r8(spi, M41T93_REG_ALM_HOUR_HT); in m41t93_get_time() 102 dev_dbg(&spi->dev, "HT bit is set, reenable clock update.\n"); in m41t93_get_time() [all …]
|
D | rtc-ds3234.c | 3 * Driver for Dallas Semiconductor (DS3234) SPI RTC with Integrated Crystal 19 #include <linux/spi/spi.h> 37 struct spi_device *spi = to_spi_device(dev); in ds3234_set_reg() local 44 return spi_write_then_read(spi, buf, 2, NULL, 0); in ds3234_set_reg() 50 struct spi_device *spi = to_spi_device(dev); in ds3234_get_reg() local 54 return spi_write_then_read(spi, data, 1, data, 1); in ds3234_get_reg() 61 struct spi_device *spi = to_spi_device(dev); in ds3234_read_time() local 65 err = spi_write_then_read(spi, buf, 1, buf, 8); in ds3234_read_time() 108 static int __devinit ds3234_probe(struct spi_device *spi) in ds3234_probe() argument 114 spi->mode = SPI_MODE_3; in ds3234_probe() [all …]
|
/linux-3.3/drivers/misc/lis3lv02d/ |
D | lis3lv02d_spi.c | 2 * lis3lv02d_spi - SPI glue layer for lis3lv02d 18 #include <linux/spi/spi.h> 28 struct spi_device *spi = lis3->bus_priv; in lis3_spi_read() local 29 int ret = spi_w8r8(spi, reg | LIS3_SPI_READ); in lis3_spi_read() 40 struct spi_device *spi = lis3->bus_priv; in lis3_spi_write() local 41 return spi_write(spi, tmp, sizeof(tmp)); in lis3_spi_write() 61 static int __devinit lis302dl_spi_probe(struct spi_device *spi) in lis302dl_spi_probe() argument 65 spi->bits_per_word = 8; in lis302dl_spi_probe() 66 spi->mode = SPI_MODE_0; in lis302dl_spi_probe() 67 ret = spi_setup(spi); in lis302dl_spi_probe() [all …]
|
/linux-3.3/arch/arm/mach-u300/ |
D | dummyspichip.c | 6 * This is a dummy loopback SPI "chip" used for testing SPI. 16 #include <linux/spi/spi.h> 35 /* When we cat /sys/bus/spi/devices/spi0.0/looptest this will be triggered */ 39 struct spi_device *spi = to_spi_device(dev); in dummy_looptest() local 40 struct dummy *p_dummy = dev_get_drvdata(&spi->dev); in dummy_looptest() 74 spi->bits_per_word = 8; in dummy_looptest() 76 spi->master->setup(spi); in dummy_looptest() 81 status = spi_w8r8(spi, 0xAA); in dummy_looptest() 90 status = spi_write_then_read(spi, &txbuf[0], 8, &rxbuf[0], 8); in dummy_looptest() 99 status = spi_write_then_read(spi, &txbuf[0], 14, &rxbuf[0], 14); in dummy_looptest() [all …]
|