| /linux/drivers/spi/ |
| H A D | spi-stm32.c | 3 // 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 D | spi-atcspi200.c | 3 * Driver for Andes ATCSPI200 SPI Controller 22 #include <linux/spi/spi.h> 23 #include <linux/spi/spi-mem.h> 26 #define ATCSPI_TRANS_FMT 0x10 /* SPI transfer format register */ 27 #define ATCSPI_TRANS_CTRL 0x20 /* SPI transfer control register */ 28 #define ATCSPI_CMD 0x24 /* SPI command register */ 29 #define ATCSPI_ADDR 0x28 /* SPI address register */ 30 #define ATCSPI_DATA 0x2C /* SPI data register */ 31 #define ATCSPI_CTRL 0x30 /* SPI control register */ 32 #define ATCSPI_STATUS 0x34 /* SPI status register */ [all …]
|
| H A D | spi-mpfs.c | 3 * Microchip CoreSPI SPI controller driver 21 #include <linux/spi/spi.h> 107 u32 clk_gen; /* divider for spi output clock generated by the controller */ 116 static inline u32 mpfs_spi_read(struct mpfs_spi *spi, unsigned int reg) in mpfs_spi_read() argument 118 return readl(spi->regs + reg); in mpfs_spi_read() 121 static inline void mpfs_spi_write(struct mpfs_spi *spi, unsigned int reg, u32 val) in mpfs_spi_write() argument 123 writel(val, spi->regs + reg); in mpfs_spi_write() 126 static inline void mpfs_spi_disable(struct mpfs_spi *spi) in mpfs_spi_disable() argument 128 u32 control = mpfs_spi_read(spi, REG_CONTROL); in mpfs_spi_disable() 132 mpfs_spi_write(spi, REG_CONTROL, control); in mpfs_spi_disable() [all …]
|
| H A D | spi.c | 2 // SPI init/core code 34 #include <linux/spi/offload/types.h> 35 #include <linux/spi/spi.h> 36 #include <linux/spi/spi-mem.h> 40 #include <trace/events/spi.h> 50 struct spi_device *spi = to_spi_device(dev); in spidev_release() local 52 spi_controller_put(spi->controller); in spidev_release() 53 kfree(spi->driver_override); in spidev_release() 54 free_percpu(spi->pcpu_statistics); in spidev_release() 55 kfree(spi); in spidev_release() [all …]
|
| H A D | spi-omap2-mcspi.c | 28 #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 D | spi-davinci.c | 19 #include <linux/spi/spi.h> 20 #include <linux/spi/spi_bitbang.h> 87 /* SPI Controller registers */ 111 * struct davinci_spi_platform_data - Platform data for SPI master device on DaVinci 113 * @version: version of the SPI IP. Different DaVinci devices have slightly 115 * @num_chipselect: number of chipselects supported by this SPI master 116 * @intr_line: interrupt line used to connect the SPI IP to the ARM interrupt 119 * @cshold_bug: set this to true if the SPI controller on your chip requires 134 * struct davinci_spi_config - Per-chip-select configuration for SPI slave devices 137 * SPI module clocks. [all …]
|
| /linux/drivers/video/backlight/ |
| H A D | ili922x.c | 7 * 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 D | l4f00242t03.c | 21 #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 D | spilib.c | 3 * 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 D | slic_ds26522.c | 16 #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 D | mediatek,spi-mt65xx.yaml | 4 $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 D | brcm,spi-bcm-qspi.yaml | 4 $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 D | allwinner,sun6i-a31-spi.yaml | 4 $id: http://devicetree.org/schemas/spi/allwinner,sun6i-a31-spi.yaml# 7 title: Allwinner A31 SPI Controller 16 - const: allwinner,sun50i-r329-spi 17 - const: allwinner,sun55i-a523-spi 18 - const: allwinner,sun6i-a31-spi 19 - const: allwinner,sun8i-h3-spi 22 - allwinner,sun8i-r40-spi 23 - allwinner,sun50i-h6-spi 24 - allwinner,sun50i-h616-spi 25 - allwinner,suniv-f1c100s-spi [all …]
|
| H A D | spi-rockchip.yaml | 4 $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 D | snps,dw-apb-ssi.yaml | 4 $id: http://devicetree.org/schemas/spi/snps,dw-apb-ssi.yaml# 13 - $ref: spi-controller.yaml# 19 - mscc,ocelot-spi 20 - mscc,jaguar2-spi 29 const: amd,pensando-elba-spi 40 - description: Generic DW SPI Controller 44 - description: Microchip Sparx5 SoC SPI Controller 45 const: microchip,sparx5-spi 46 - description: Amazon Alpine SPI Controller 51 - mscc,ocelot-spi [all …]
|
| /linux/drivers/misc/ |
| H A D | gehc-achc.c | 15 #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 D | lattice-ecp3-config.c | 11 #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/net/can/spi/ |
| H A D | mcp251x.c | 2 /* 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 …]
|
| H A D | hi311x.c | 2 /* 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/drivers/media/dvb-frontends/cxd2880/ |
| H A D | cxd2880_spi_device.c | 5 * 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 D | panel-lgphilips-lb035q02.c | 12 #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/Documentation/spi/ |
| H A D | spi-summary.rst | 2 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/iio/common/st_sensors/ |
| H A D | st_sensors_spi.c | 3 * 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/drivers/net/dsa/b53/ |
| H A D | b53_spi.c | 2 * 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/media/v4l2-core/ |
| H A D | v4l2-spi.c | 3 * 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 …]
|