Home
last modified time | relevance | path

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

12345678910>>...135

/linux-6.12.1/drivers/spi/
DMakefile3 # Makefile for kernel SPI drivers.
10 obj-$(CONFIG_SPI_MASTER) += spi.o
11 obj-$(CONFIG_SPI_MEM) += spi-mem.o
12 obj-$(CONFIG_SPI_MUX) += spi-mux.o
14 obj-$(CONFIG_SPI_LOOPBACK_TEST) += spi-loopback-test.o
16 # SPI master controller drivers (bus)
17 obj-$(CONFIG_SPI_AIROHA_SNFI) += spi-airoha-snfi.o
18 obj-$(CONFIG_SPI_ALTERA) += spi-altera-platform.o
19 obj-$(CONFIG_SPI_ALTERA_CORE) += spi-altera-core.o
20 obj-$(CONFIG_SPI_ALTERA_DFL) += spi-altera-dfl.o
[all …]
Dspi-stm32.c3 // STMicroelectronics STM32 SPI Controller driver
21 #include <linux/spi/spi.h>
25 /* STM32F4/7 SPI registers */
81 /* STM32F4 SPI Baud Rate min/max divisor */
85 /* STM32H7 SPI registers */
157 /* STM32MP25 SPI registers bit fields */
171 /* STM32H7 SPI Master Baud Rate min/max divisor */
175 /* STM32H7 SPI Communication mode */
181 /* SPI Communication type */
196 /* STM32 SPI driver helpers */
[all …]
DKconfig3 # SPI driver configuration
5 menuconfig SPI config
6 bool "SPI support"
10 protocol. Chips that support SPI can have data transfer rates
12 controller and a chipselect. Most SPI slaves don't support
15 SPI is widely used by microcontrollers to talk with sensors,
18 MMC and SD cards can be accessed using SPI protocol; and for
19 DataFlash cards used in MMC sockets, SPI must always be used.
21 SPI is one of a family of similar protocols using a four wire
26 if SPI
[all …]
Dspi-lantiq-ssc.c20 #include <linux/spi/spi.h>
156 int (*cfg_irq)(struct platform_device *pdev, struct lantiq_ssc_spi *spi);
189 static u32 lantiq_ssc_readl(const struct lantiq_ssc_spi *spi, u32 reg) in lantiq_ssc_readl() argument
191 return __raw_readl(spi->regbase + reg); in lantiq_ssc_readl()
194 static void lantiq_ssc_writel(const struct lantiq_ssc_spi *spi, u32 val, in lantiq_ssc_writel() argument
197 __raw_writel(val, spi->regbase + reg); in lantiq_ssc_writel()
200 static void lantiq_ssc_maskl(const struct lantiq_ssc_spi *spi, u32 clr, in lantiq_ssc_maskl() argument
203 u32 val = __raw_readl(spi->regbase + reg); in lantiq_ssc_maskl()
207 __raw_writel(val, spi->regbase + reg); in lantiq_ssc_maskl()
210 static unsigned int tx_fifo_level(const struct lantiq_ssc_spi *spi) in tx_fifo_level() argument
[all …]
Dspi-microchip-core.c3 * Microchip CoreSPI SPI controller driver
21 #include <linux/spi/spi.h>
108 u32 clk_gen; /* divider for spi output clock generated by the controller */
117 static inline u32 mchp_corespi_read(struct mchp_corespi *spi, unsigned int reg) in mchp_corespi_read() argument
119 return readl(spi->regs + reg); in mchp_corespi_read()
122 static inline void mchp_corespi_write(struct mchp_corespi *spi, unsigned int reg, u32 val) in mchp_corespi_write() argument
124 writel(val, spi->regs + reg); in mchp_corespi_write()
127 static inline void mchp_corespi_disable(struct mchp_corespi *spi) in mchp_corespi_disable() argument
129 u32 control = mchp_corespi_read(spi, REG_CONTROL); in mchp_corespi_disable()
133 mchp_corespi_write(spi, REG_CONTROL, control); in mchp_corespi_disable()
[all …]
Dspi-mux.c3 // General Purpose SPI multiplexer
10 #include <linux/spi/spi.h>
17 * This driver supports a MUX on an SPI bus. This can be useful when you need
21 * The driver will create an additional SPI controller. Devices added under the
27 * @spi: pointer to the device struct attached to the parent
28 * spi controller
36 * downstream spi devices
39 struct spi_device *spi; member
49 static int spi_mux_select(struct spi_device *spi) in spi_mux_select() argument
51 struct spi_mux_priv *priv = spi_controller_get_devdata(spi->controller); in spi_mux_select()
[all …]
Dspi-sifive.c5 // SiFive SPI controller driver (master mode only)
15 #include <linux/spi/spi.h>
38 #define SIFIVE_SPI_REG_FCTRL 0x60 /* SPI flash interface control */
39 #define SIFIVE_SPI_REG_FFMT 0x64 /* SPI flash instruction format */
99 static void sifive_spi_write(struct sifive_spi *spi, int offset, u32 value) in sifive_spi_write() argument
101 iowrite32(value, spi->regs + offset); in sifive_spi_write()
104 static u32 sifive_spi_read(struct sifive_spi *spi, int offset) in sifive_spi_read() argument
106 return ioread32(spi->regs + offset); in sifive_spi_read()
109 static void sifive_spi_init(struct sifive_spi *spi) in sifive_spi_init() argument
112 sifive_spi_write(spi, SIFIVE_SPI_REG_IE, 0); in sifive_spi_init()
[all …]
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
62 * #include "spi-gpio.c"
75 spi_to_spi_gpio(const struct spi_device *spi) in spi_to_spi_gpio() argument
[all …]
Dspi.c2 // SPI init/core code
34 #include <linux/spi/spi.h>
35 #include <linux/spi/spi-mem.h>
39 #include <trace/events/spi.h>
49 struct spi_device *spi = to_spi_device(dev); in spidev_release() local
51 spi_controller_put(spi->controller); in spidev_release()
52 kfree(spi->driver_override); in spidev_release()
53 free_percpu(spi->pcpu_statistics); in spidev_release()
54 kfree(spi); in spidev_release()
60 const struct spi_device *spi = to_spi_device(dev); in modalias_show() local
[all …]
Dspi-orion.c3 * Marvell Orion SPI controller driver
14 #include <linux/spi/spi.h>
73 * have both is for managing the armada-370-spi case with old
135 static int orion_spi_baudrate_set(struct spi_device *spi, unsigned int speed) in orion_spi_baudrate_set() argument
144 orion_spi = spi_controller_get_devdata(spi->controller); in orion_spi_baudrate_set()
221 /* Convert the rate to SPI clock divisor value. */ in orion_spi_baudrate_set()
233 orion_spi_mode_set(struct spi_device *spi) in orion_spi_mode_set() argument
238 orion_spi = spi_controller_get_devdata(spi->controller); in orion_spi_mode_set()
242 if (spi->mode & SPI_CPOL) in orion_spi_mode_set()
244 if (spi->mode & SPI_CPHA) in orion_spi_mode_set()
[all …]
Dspi-omap2-mcspi.c28 #include <linux/spi/spi.h>
32 #include <linux/platform_data/spi-omap2-mcspi.h>
164 static inline void mcspi_write_cs_reg(const struct spi_device *spi, in mcspi_write_cs_reg() argument
167 struct omap2_mcspi_cs *cs = spi->controller_state; in mcspi_write_cs_reg()
172 static inline u32 mcspi_read_cs_reg(const struct spi_device *spi, int idx) in mcspi_read_cs_reg() argument
174 struct omap2_mcspi_cs *cs = spi->controller_state; in mcspi_read_cs_reg()
179 static inline u32 mcspi_cached_chconf0(const struct spi_device *spi) in mcspi_cached_chconf0() argument
181 struct omap2_mcspi_cs *cs = spi->controller_state; in mcspi_cached_chconf0()
186 static inline void mcspi_write_chconf0(const struct spi_device *spi, u32 val) in mcspi_write_chconf0() argument
188 struct omap2_mcspi_cs *cs = spi->controller_state; in mcspi_write_chconf0()
[all …]
/linux-6.12.1/drivers/staging/greybus/
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-6.12.1/drivers/video/backlight/
Dili922x.c7 * controller. The interface to the display is SPI and the display's
20 #include <linux/spi/spi.h>
105 * for the SPI transfer. According to the datasheet, the controller
110 * @s: pointer to an SPI device
139 struct spi_device *spi; member
146 * @spi: spi device
149 static int ili922x_read_status(struct spi_device *spi, u16 *rs) in ili922x_read_status() argument
162 CHECK_FREQ_REG(spi, &xfer); in ili922x_read_status()
176 ret = spi_sync(spi, &msg); in ili922x_read_status()
178 dev_dbg(&spi->dev, "Error sending SPI message 0x%x", ret); in ili922x_read_status()
[all …]
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-6.12.1/drivers/net/wan/
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-6.12.1/drivers/media/pci/netup_unidvb/
Dnetup_unidvb_spi.c5 * Internal SPI driver for NetUP Universal Dual DVB-CI
13 #include <linux/spi/spi.h>
14 #include <linux/spi/flash.h>
69 irqreturn_t netup_spi_interrupt(struct netup_spi *spi) in netup_spi_interrupt() argument
74 if (!spi) in netup_spi_interrupt()
77 spin_lock_irqsave(&spi->lock, flags); in netup_spi_interrupt()
78 reg = readw(&spi->regs->control_stat); in netup_spi_interrupt()
80 spin_unlock_irqrestore(&spi->lock, flags); in netup_spi_interrupt()
81 dev_dbg(&spi->ctlr->dev, in netup_spi_interrupt()
85 writew(reg | NETUP_SPI_CTRL_IRQ, &spi->regs->control_stat); in netup_spi_interrupt()
[all …]
/linux-6.12.1/drivers/net/can/spi/
Dmcp251x.c2 /* CAN bus driver for Microchip 251x/25625 CAN Controller with SPI Interface
42 #include <linux/spi/spi.h>
45 /* SPI interface instruction set */
196 /* Buffer size required for the largest SPI transfer (i.e., reading a
230 struct spi_device *spi; member
233 struct mutex mcp_lock; /* SPI device lock */
263 static inline int mcp251x_is_##_model(struct spi_device *spi) \
265 struct mcp251x_priv *priv = spi_get_drvdata(spi); \
285 * registers via SPI is not really different conceptually than using
296 static int mcp251x_spi_trans(struct spi_device *spi, int len) in mcp251x_spi_trans() argument
[all …]
Dhi311x.c2 /* CAN bus driver for Holt HI3110 CAN Controller with SPI Interface
35 #include <linux/spi/spi.h>
147 struct spi_device *spi; member
150 struct mutex hi3110_lock; /* SPI device lock */
189 * registers via SPI is not really different conceptually than using
200 static int hi3110_spi_trans(struct spi_device *spi, int len) in hi3110_spi_trans() argument
202 struct hi3110_priv *priv = spi_get_drvdata(spi); in hi3110_spi_trans()
215 ret = spi_sync(spi, &m); in hi3110_spi_trans()
218 dev_err(&spi->dev, "spi transfer failed: ret = %d\n", ret); in hi3110_spi_trans()
222 static int hi3110_cmd(struct spi_device *spi, u8 command) in hi3110_cmd() argument
[all …]
/linux-6.12.1/Documentation/devicetree/bindings/spi/
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 …]
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 …]
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: Microsemi Ocelot/Jaguar2 SoC SPI Controller
62 - mscc,ocelot-spi
63 - mscc,jaguar2-spi
65 - description: Microchip Sparx5 SoC SPI Controller
[all …]
/linux-6.12.1/drivers/misc/
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 …]
/linux-6.12.1/drivers/media/dvb-frontends/cxd2880/
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-6.12.1/drivers/video/fbdev/omap2/omapfb/displays/
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-6.12.1/drivers/iio/common/st_sensors/
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 …]

12345678910>>...135