Home
last modified time | relevance | path

Searched full:spi (Results 1 – 25 of 2689) sorted by relevance

12345678910>>...108

/linux/drivers/spi/
H A Dspi-stm32.c3 // STMicroelectronics STM32 SPI Controller driver
23 #include <linux/spi/spi.h>
27 /* STM32F4/7 SPI registers */
83 /* STM32F4 SPI Baud Rate min/max divisor */
87 /* STM32H7 SPI registers */
162 /* STM32MP25 SPI registers bit fields */
176 /* STM32H7 SPI Master Baud Rate min/max divisor */
180 /* STM32H7 SPI Communication mode */
186 /* SPI Communication type */
201 /* STM32 SPI driver helpers */
[all …]
H A Dspi-gpio.c3 * SPI host driver using generic bitbanged GPIO
15 #include <linux/spi/spi.h>
16 #include <linux/spi/spi_bitbang.h>
17 #include <linux/spi/spi_gpio.h>
20 * This bitbanging SPI host driver should help make systems usable
21 * when a native hardware SPI engine is not available, perhaps because
27 * spi->controller_state ... reserved for bitbang framework code
29 * spi->controller->dev.driver_data ... points to spi_gpio->bitbang
47 spi_to_spi_gpio(const struct spi_device *spi) in spi_to_spi_gpio() argument
52 bang = spi_controller_get_devdata(spi->controller); in spi_to_spi_gpio()
[all …]
H A Dspi-omap2-mcspi.c28 #include <linux/spi/spi.h>
32 #include <linux/platform_data/spi-omap2-mcspi.h>
165 static inline void mcspi_write_cs_reg(const struct spi_device *spi, in mcspi_write_cs_reg() argument
168 struct omap2_mcspi_cs *cs = spi->controller_state; in mcspi_write_cs_reg()
173 static inline u32 mcspi_read_cs_reg(const struct spi_device *spi, int idx) in mcspi_read_cs_reg() argument
175 struct omap2_mcspi_cs *cs = spi->controller_state; in mcspi_read_cs_reg()
180 static inline u32 mcspi_cached_chconf0(const struct spi_device *spi) in mcspi_cached_chconf0() argument
182 struct omap2_mcspi_cs *cs = spi->controller_state; in mcspi_cached_chconf0()
187 static inline void mcspi_write_chconf0(const struct spi_device *spi, u32 val) in mcspi_write_chconf0() argument
189 struct omap2_mcspi_cs *cs = spi->controller_state; in mcspi_write_chconf0()
[all …]
H A Dspi-loongson-core.c2 // Loongson SPI Support
15 #include <linux/spi/spi.h>
17 #include "spi-loongson.h"
19 static inline void loongson_spi_write_reg(struct loongson_spi *spi, unsigned char reg, in loongson_spi_write_reg() argument
22 writeb(data, spi->base + reg); in loongson_spi_write_reg()
25 static inline char loongson_spi_read_reg(struct loongson_spi *spi, unsigned char reg) in loongson_spi_read_reg() argument
27 return readb(spi->base + reg); in loongson_spi_read_reg()
30 static void loongson_spi_set_cs(struct spi_device *spi, bool en) in loongson_spi_set_cs() argument
33 unsigned char mask = (BIT(4) | BIT(0)) << spi_get_chipselect(spi, 0); in loongson_spi_set_cs()
34 unsigned char val = en ? mask : (BIT(0) << spi_get_chipselect(spi, 0)); in loongson_spi_set_cs()
[all …]
H A Dspi-davinci.c18 #include <linux/spi/spi.h>
19 #include <linux/spi/spi_bitbang.h>
22 #include <linux/platform_data/spi-davinci.h>
88 /* SPI Controller registers */
103 /* SPI Controller driver's private data. */
197 static void davinci_spi_chipselect(struct spi_device *spi, int value) in davinci_spi_chipselect() argument
200 struct davinci_spi_config *spicfg = spi->controller_data; in davinci_spi_chipselect()
201 u8 chip_sel = spi_get_chipselect(spi, 0); in davinci_spi_chipselect()
204 dspi = spi_controller_get_devdata(spi->controller); in davinci_spi_chipselect()
214 if (spi_get_csgpiod(spi, 0)) { in davinci_spi_chipselect()
[all …]
H A Dspi-bitbang.c3 * Polling/bitbanging SPI host controller controller driver utilities
16 #include <linux/spi/spi.h>
17 #include <linux/spi/spi_bitbang.h>
36 * NOTE: SPI controller pins can often be used as GPIO pins instead,
51 static unsigned int bitbang_txrx_8(struct spi_device *spi, in bitbang_txrx_8() argument
63 bitbang = spi_controller_get_devdata(spi->controller); in bitbang_txrx_8()
70 word = spi->mode & SPI_MOSI_IDLE_HIGH ? 0xFF : 0; in bitbang_txrx_8()
71 word = txrx_word(spi, ns, word, bits, flags); in bitbang_txrx_8()
77 bitbang->set_mosi_idle(spi); in bitbang_txrx_8()
82 static unsigned int bitbang_txrx_16(struct spi_device *spi, in bitbang_txrx_16() argument
[all …]
/linux/drivers/video/backlight/
H A Dili922x.c7 * controller. The interface to the display is SPI and the display's
19 #include <linux/spi/spi.h>
104 * for the SPI transfer. According to the datasheet, the controller
109 * @s: pointer to an SPI device
138 struct spi_device *spi; member
145 * @spi: spi device
148 static int ili922x_read_status(struct spi_device *spi, u16 *rs) in ili922x_read_status() argument
161 CHECK_FREQ_REG(spi, &xfer); in ili922x_read_status()
175 ret = spi_sync(spi, &msg); in ili922x_read_status()
177 dev_dbg(&spi->dev, "Error sending SPI message 0x%x", ret); in ili922x_read_status()
[all …]
H A Dl4f00242t03.c21 #include <linux/spi/spi.h>
24 struct spi_device *spi; member
46 static void l4f00242t03_lcd_init(struct spi_device *spi) in l4f00242t03_lcd_init() argument
48 struct l4f00242t03_priv *priv = spi_get_drvdata(spi); in l4f00242t03_lcd_init()
52 dev_dbg(&spi->dev, "initializing LCD\n"); in l4f00242t03_lcd_init()
56 dev_err(&spi->dev, "failed to set the IO regulator voltage.\n"); in l4f00242t03_lcd_init()
61 dev_err(&spi->dev, "failed to enable the IO regulator.\n"); in l4f00242t03_lcd_init()
67 dev_err(&spi->dev, "failed to set the core regulator voltage.\n"); in l4f00242t03_lcd_init()
73 dev_err(&spi->dev, "failed to enable the core regulator.\n"); in l4f00242t03_lcd_init()
82 spi_write(spi, (const u8 *)cmd, ARRAY_SIZE(cmd) * sizeof(u16)); in l4f00242t03_lcd_init()
[all …]
/linux/drivers/staging/greybus/
H A Dspilib.c3 * Greybus SPI library
14 #include <linux/spi/spi.h>
45 static struct spi_controller *get_controller_from_spi(struct gb_spilib *spi) in get_controller_from_spi() argument
47 return gb_connection_get_data(spi->connection); in get_controller_from_spi()
95 static void clean_xfer_state(struct gb_spilib *spi) in clean_xfer_state() argument
97 spi->first_xfer = NULL; in clean_xfer_state()
98 spi->last_xfer = NULL; in clean_xfer_state()
99 spi->rx_xfer_offset = 0; in clean_xfer_state()
100 spi->tx_xfer_offset = 0; in clean_xfer_state()
101 spi->last_xfer_size = 0; in clean_xfer_state()
[all …]
/linux/drivers/net/wan/
H A Dslic_ds26522.c16 #include <linux/spi/spi.h>
38 static void slic_write(struct spi_device *spi, u16 addr, in slic_write() argument
49 /* write spi addr and value */ in slic_write()
50 spi_write(spi, &temp[0], SLIC_THREE_LEN); in slic_write()
53 static u8 slic_read(struct spi_device *spi, u16 addr) in slic_read() argument
62 spi_write_then_read(spi, &temp[0], SLIC_TWO_LEN, &data, in slic_read()
69 static bool get_slic_product_code(struct spi_device *spi) in get_slic_product_code() argument
73 device_id = slic_read(spi, DS26522_IDR_ADDR); in get_slic_product_code()
80 static void ds26522_e1_spec_config(struct spi_device *spi) in ds26522_e1_spec_config() argument
83 slic_write(spi, DS26522_RMMR_ADDR, DS26522_RMMR_E1); in ds26522_e1_spec_config()
[all …]
/linux/Documentation/devicetree/bindings/spi/
H A Dmediatek,spi-mt65xx.yaml4 $id: http://devicetree.org/schemas/spi/mediatek,spi-mt65xx.yaml#
7 title: SPI Bus controller for MediaTek ARM SoCs
13 - $ref: /schemas/spi/spi-controller.yaml#
20 - mediatek,mt7629-spi
21 - mediatek,mt8365-spi
22 - const: mediatek,mt7622-spi
25 - mediatek,mt8516-spi
26 - const: mediatek,mt2712-spi
29 - mediatek,mt6779-spi
30 - mediatek,mt8186-spi
[all …]
H A Dbrcm,spi-bcm-qspi.yaml4 $id: http://devicetree.org/schemas/spi/brcm,spi-bcm-qspi.yaml#
7 title: Broadcom SPI controller
14 The Broadcom SPI controller is a SPI master found on various SOCs, including
15 BRCMSTB (BCM7XXX), Cygnus, NSP and NS2. The Broadcom Master SPI hw IP consists
17 MSPI : SPI master controller can read and write to a SPI slave device
18 BSPI : Broadcom SPI in combination with the MSPI hw IP provides acceleration
25 use SPI protocol.
28 - $ref: spi-controller.yaml#
36 - brcm,spi-bcm7425-qspi
37 - brcm,spi-bcm7429-qspi
[all …]
H A Dsnps,dw-apb-ssi.yaml4 $id: http://devicetree.org/schemas/spi/snps,dw-apb-ssi.yaml#
13 - $ref: spi-controller.yaml#
19 - mscc,ocelot-spi
20 - mscc,jaguar2-spi
44 const: amd,pensando-elba-spi
55 - description: Generic DW SPI Controller
59 - description: Microchip Sparx5 SoC SPI Controller
60 const: microchip,sparx5-spi
61 - description: Amazon Alpine SPI Controller
66 - mscc,ocelot-spi
[all …]
H A Dspi-rockchip.yaml4 $id: http://devicetree.org/schemas/spi/spi-rockchip.yaml#
7 title: Rockchip SPI Controller
10 The Rockchip SPI controller is used to interface with various devices such
11 as flash and display controllers using the SPI communication interface.
14 - $ref: spi-controller.yaml#
23 - const: rockchip,rk3036-spi
24 - const: rockchip,rk3066-spi
25 - const: rockchip,rk3228-spi
26 - const: rockchip,rv1108-spi
29 - rockchip,px30-spi
[all …]
H A Dbrcm,bcm63xx-spi.yaml4 $id: http://devicetree.org/schemas/spi/brcm,bcm63xx-spi.yaml#
7 title: Broadcom BCM6348/BCM6358 SPI controller
13 Broadcom "Low Speed" SPI controller found in many older MIPS based Broadband
17 between the SPI transfers within the same SPI message. This can terminate the
18 transaction to some SPI devices prematurely. The issue can be worked around by
22 - $ref: spi-controller.yaml#
29 - brcm,bcm6368-spi
30 - brcm,bcm6362-spi
31 - brcm,bcm63268-spi
32 - const: brcm,bcm6358-spi
[all …]
/linux/drivers/misc/
H A Dgehc-achc.c15 #include <linux/spi/spi.h>
59 static int ezport_start_programming(struct spi_device *spi, struct gpio_desc *reset) in ezport_start_programming() argument
68 spi_bus_lock(spi->controller); in ezport_start_programming()
73 ret = spi_sync_locked(spi, &msg); in ezport_start_programming()
85 ret = spi_sync_locked(spi, &msg); in ezport_start_programming()
88 spi_bus_unlock(spi->controller); in ezport_start_programming()
92 static void ezport_stop_programming(struct spi_device *spi, struct gpio_desc *reset) in ezport_stop_programming() argument
95 spi_bus_lock(spi->controller); in ezport_stop_programming()
97 spi_bus_unlock(spi->controller); in ezport_stop_programming()
100 static int ezport_get_status_register(struct spi_device *spi) in ezport_get_status_register() argument
[all …]
H A Dlattice-ecp3-config.c11 #include <linux/spi/spi.h>
36 * (LatticeECP3 Slave SPI Port User's Guide)
67 struct spi_device *spi = (struct spi_device *)context; in firmware_load() local
68 struct fpga_data *data = spi_get_drvdata(spi); in firmware_load()
78 dev_err(&spi->dev, "Cannot load firmware, aborting\n"); in firmware_load()
83 dev_err(&spi->dev, "Error: Firmware size is 0!\n"); in firmware_load()
92 /* Trying to speak with the FPGA via SPI... */ in firmware_load()
94 spi_write_then_read(spi, txbuf, 8, rxbuf, rx_len); in firmware_load()
96 dev_dbg(&spi->dev, "FPGA JTAG ID=%08x\n", jedec_id); in firmware_load()
103 dev_err(&spi->dev, in firmware_load()
[all …]
/linux/drivers/media/dvb-frontends/cxd2880/
H A Dcxd2880_spi_device.c5 * SPI access functions
10 #include <linux/spi/spi.h>
14 static int cxd2880_spi_device_write(struct cxd2880_spi *spi, in cxd2880_spi_device_write() argument
22 if (!spi || !spi->user || !data || size == 0) in cxd2880_spi_device_write()
25 spi_device = spi->user; in cxd2880_spi_device_write()
33 result = spi_sync(spi_device->spi, &msg); in cxd2880_spi_device_write()
41 static int cxd2880_spi_device_write_read(struct cxd2880_spi *spi, in cxd2880_spi_device_write_read() argument
50 if (!spi || !spi->user || !tx_data || in cxd2880_spi_device_write_read()
54 spi_device = spi->user; in cxd2880_spi_device_write_read()
56 result = spi_write_then_read(spi_device->spi, tx_data, in cxd2880_spi_device_write_read()
[all …]
/linux/drivers/video/fbdev/omap2/omapfb/displays/
H A Dpanel-lgphilips-lb035q02.c12 #include <linux/spi/spi.h>
43 struct spi_device *spi; member
54 static int lb035q02_write_reg(struct spi_device *spi, u8 reg, u16 val) in lb035q02_write_reg() argument
82 return spi_sync(spi, &msg); in lb035q02_write_reg()
85 static void init_lb035q02_panel(struct spi_device *spi) in init_lb035q02_panel() argument
88 lb035q02_write_reg(spi, 0x01, 0x6300); in init_lb035q02_panel()
89 lb035q02_write_reg(spi, 0x02, 0x0200); in init_lb035q02_panel()
90 lb035q02_write_reg(spi, 0x03, 0x0177); in init_lb035q02_panel()
91 lb035q02_write_reg(spi, 0x04, 0x04c7); in init_lb035q02_panel()
92 lb035q02_write_reg(spi, 0x05, 0xffc0); in init_lb035q02_panel()
[all …]
/linux/drivers/iio/common/st_sensors/
H A Dst_sensors_spi.c3 * STMicroelectronics sensors spi library driver
15 #include <linux/spi/spi.h>
33 * st_sensors_is_spi_3_wire() - check if SPI 3-wire mode has been selected
34 * @spi: spi device reference.
36 * Return: true if SPI 3-wire mode is selected, false otherwise.
38 static bool st_sensors_is_spi_3_wire(struct spi_device *spi) in st_sensors_is_spi_3_wire() argument
41 struct device *dev = &spi->dev; in st_sensors_is_spi_3_wire()
43 if (device_property_read_bool(dev, "spi-3wire")) in st_sensors_is_spi_3_wire()
54 * st_sensors_configure_spi_3_wire() - configure SPI 3-wire if needed
55 * @spi: spi device reference.
[all …]
/linux/Documentation/spi/
H A Dspi-summary.rst2 Overview of Linux kernel SPI support
7 What is SPI?
9 The "Serial Peripheral Interface" (SPI) is a synchronous four wire serial
12 standardization body. SPI uses a host/target configuration.
22 SPI hosts use a fourth "chip select" line to activate a given SPI target
24 in parallel. All SPI targets support chipselects; they are usually active
29 SPI target functions are usually not interoperable between vendors
30 (except for commodities like SPI memory chips).
32 - SPI may be used for request/response style device protocols, as with
44 - Sometimes SPI is used to daisy-chain devices, like shift registers.
[all …]
/linux/drivers/media/v4l2-core/
H A Dv4l2-spi.c3 * v4l2-spi - SPI helpers for Video4Linux2
7 #include <linux/spi/spi.h>
13 struct spi_device *spi = v4l2_get_subdevdata(sd); in v4l2_spi_subdev_unregister() local
15 if (spi && !spi->dev.of_node && !spi->dev.fwnode) in v4l2_spi_subdev_unregister()
16 spi_unregister_device(spi); in v4l2_spi_subdev_unregister()
19 void v4l2_spi_subdev_init(struct v4l2_subdev *sd, struct spi_device *spi, in v4l2_spi_subdev_init() argument
25 sd->owner = spi->dev.driver->owner; in v4l2_spi_subdev_init()
26 sd->dev = &spi->dev; in v4l2_spi_subdev_init()
28 v4l2_set_subdevdata(sd, spi); in v4l2_spi_subdev_init()
29 spi_set_drvdata(spi, sd); in v4l2_spi_subdev_init()
[all …]
/linux/drivers/net/dsa/b53/
H A Db53_spi.c2 * B53 register access through SPI
24 #include <linux/spi/spi.h>
42 static inline int b53_spi_read_reg(struct spi_device *spi, u8 reg, u8 *val, in b53_spi_read_reg() argument
50 return spi_write_then_read(spi, txbuf, 2, val, len); in b53_spi_read_reg()
53 static inline int b53_spi_clear_status(struct spi_device *spi) in b53_spi_clear_status() argument
60 ret = b53_spi_read_reg(spi, B53_SPI_STATUS, &rxbuf, 1); in b53_spi_clear_status()
76 static inline int b53_spi_set_page(struct spi_device *spi, u8 page) in b53_spi_set_page() argument
84 return spi_write(spi, txbuf, sizeof(txbuf)); in b53_spi_set_page()
87 static inline int b53_prepare_reg_access(struct spi_device *spi, u8 page) in b53_prepare_reg_access() argument
89 int ret = b53_spi_clear_status(spi); in b53_prepare_reg_access()
[all …]
/linux/drivers/tty/serial/
H A Dsc16is7xx_spi.c2 /* SC16IS7xx SPI interface driver */
8 #include <linux/spi/spi.h>
14 /* SPI definitions */
17 static int sc16is7xx_spi_probe(struct spi_device *spi) in sc16is7xx_spi_probe() argument
25 /* Setup SPI bus */ in sc16is7xx_spi_probe()
26 spi->bits_per_word = 8; in sc16is7xx_spi_probe()
28 if ((spi->mode & SPI_MODE_X_MASK) != SPI_MODE_0) in sc16is7xx_spi_probe()
29 return dev_err_probe(&spi->dev, -EINVAL, "Unsupported SPI mode\n"); in sc16is7xx_spi_probe()
31 spi->mode = spi->mode ? : SPI_MODE_0; in sc16is7xx_spi_probe()
32 spi->max_speed_hz = spi->max_speed_hz ? : 4 * HZ_PER_MHZ; in sc16is7xx_spi_probe()
[all …]
/linux/drivers/iio/chemical/
H A Dbme680_spi.c3 * BME680 - SPI Driver
10 #include <linux/spi/spi.h>
15 struct spi_device *spi; member
20 * In SPI mode there are only 7 address bits, a "page" register determines
27 struct spi_device *spi = ctx->spi; in bme680_regmap_spi_select_page() local
40 ret = spi_write_then_read(spi, buf, 1, buf + 1, 1); in bme680_regmap_spi_select_page()
42 dev_err(&spi->dev, "failed to set page %u\n", page); in bme680_regmap_spi_select_page()
52 ret = spi_write(spi, buf, 2); in bme680_regmap_spi_select_page()
54 dev_err(&spi->dev, "failed to set page %u\n", page); in bme680_regmap_spi_select_page()
67 struct spi_device *spi = ctx->spi; in bme680_regmap_spi_write() local
[all …]

12345678910>>...108