Home
last modified time | relevance | path

Searched refs:spi (Results 1 – 25 of 660) sorted by relevance

12345678910>>...27

/drivers/spi/
Dspi-stm32.c246 int (*get_fifo_size)(struct stm32_spi *spi);
247 int (*get_bpw_mask)(struct stm32_spi *spi);
248 void (*disable)(struct stm32_spi *spi);
249 int (*config)(struct stm32_spi *spi);
250 void (*set_bpw)(struct stm32_spi *spi);
251 int (*set_mode)(struct stm32_spi *spi, unsigned int comm_type);
252 void (*set_data_idleness)(struct stm32_spi *spi, u32 length);
253 int (*set_number_of_data)(struct stm32_spi *spi, u32 length);
254 void (*transfer_one_dma_start)(struct stm32_spi *spi);
257 int (*transfer_one_irq)(struct stm32_spi *spi);
[all …]
DMakefile10 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
17 obj-$(CONFIG_SPI_ALTERA) += spi-altera-platform.o
18 obj-$(CONFIG_SPI_ALTERA_CORE) += spi-altera-core.o
19 obj-$(CONFIG_SPI_ALTERA_DFL) += spi-altera-dfl.o
20 obj-$(CONFIG_SPI_AMLOGIC_SPIFC_A1) += spi-amlogic-spifc-a1.o
21 obj-$(CONFIG_SPI_AR934X) += spi-ar934x.o
22 obj-$(CONFIG_SPI_ARMADA_3700) += spi-armada-3700.o
[all …]
Dspi-lantiq-ssc.c156 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
212 const struct lantiq_ssc_hwcfg *hwcfg = spi->hwcfg; in tx_fifo_level()
[all …]
Dspi-microchip-core.c117 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()
136 static inline void mchp_corespi_read_fifo(struct mchp_corespi *spi) in mchp_corespi_read_fifo() argument
141 fifo_max = min(spi->rx_len, FIFO_DEPTH); in mchp_corespi_read_fifo()
143 while ((i < fifo_max) && !(mchp_corespi_read(spi, REG_STATUS) & STATUS_RXFIFO_EMPTY)) { in mchp_corespi_read_fifo()
[all …]
Dspi-sifive.c99 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()
115 sifive_spi_write(spi, SIFIVE_SPI_REG_TXMARK, 1); in sifive_spi_init()
116 sifive_spi_write(spi, SIFIVE_SPI_REG_RXMARK, 0); in sifive_spi_init()
119 sifive_spi_write(spi, SIFIVE_SPI_REG_DELAY0, in sifive_spi_init()
122 sifive_spi_write(spi, SIFIVE_SPI_REG_DELAY1, in sifive_spi_init()
[all …]
Dspi-mux.c39 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()
54 ret = mux_control_select(priv->mux, spi_get_chipselect(spi, 0)); in spi_mux_select()
58 if (priv->current_cs == spi_get_chipselect(spi, 0)) in spi_mux_select()
61 dev_dbg(&priv->spi->dev, "setting up the mux for cs %d\n", in spi_mux_select()
62 spi_get_chipselect(spi, 0)); in spi_mux_select()
65 priv->spi->max_speed_hz = spi->max_speed_hz; in spi_mux_select()
66 priv->spi->mode = spi->mode; in spi_mux_select()
67 priv->spi->bits_per_word = spi->bits_per_word; in spi_mux_select()
[all …]
Dspi-gpio.c75 spi_to_spi_gpio(const struct spi_device *spi) in spi_to_spi_gpio() argument
80 bang = spi_controller_get_devdata(spi->controller); in spi_to_spi_gpio()
86 static inline void setsck(const struct spi_device *spi, int is_on) in setsck() argument
88 struct spi_gpio *spi_gpio = spi_to_spi_gpio(spi); in setsck()
93 static inline void setmosi(const struct spi_device *spi, int is_on) in setmosi() argument
95 struct spi_gpio *spi_gpio = spi_to_spi_gpio(spi); in setmosi()
100 static inline int getmiso(const struct spi_device *spi) in getmiso() argument
102 struct spi_gpio *spi_gpio = spi_to_spi_gpio(spi); in getmiso()
104 if (spi->mode & SPI_3WIRE) in getmiso()
134 static u32 spi_gpio_txrx_word_mode0(struct spi_device *spi, in spi_gpio_txrx_word_mode0() argument
[all …]
Dspi-omap2-mcspi.c161 static inline void mcspi_write_cs_reg(const struct spi_device *spi, in mcspi_write_cs_reg() argument
164 struct omap2_mcspi_cs *cs = spi->controller_state; in mcspi_write_cs_reg()
169 static inline u32 mcspi_read_cs_reg(const struct spi_device *spi, int idx) in mcspi_read_cs_reg() argument
171 struct omap2_mcspi_cs *cs = spi->controller_state; in mcspi_read_cs_reg()
176 static inline u32 mcspi_cached_chconf0(const struct spi_device *spi) in mcspi_cached_chconf0() argument
178 struct omap2_mcspi_cs *cs = spi->controller_state; in mcspi_cached_chconf0()
183 static inline void mcspi_write_chconf0(const struct spi_device *spi, u32 val) in mcspi_write_chconf0() argument
185 struct omap2_mcspi_cs *cs = spi->controller_state; in mcspi_write_chconf0()
188 mcspi_write_cs_reg(spi, OMAP2_MCSPI_CHCONF0, val); in mcspi_write_chconf0()
189 mcspi_read_cs_reg(spi, OMAP2_MCSPI_CHCONF0); in mcspi_write_chconf0()
[all …]
Dspi-orion.c135 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()
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()
246 if (spi->mode & SPI_LSB_FIRST) in orion_spi_mode_set()
255 orion_spi_50mhz_ac_timing_erratum(struct spi_device *spi, unsigned int speed) in orion_spi_50mhz_ac_timing_erratum() argument
260 orion_spi = spi_controller_get_devdata(spi->controller); in orion_spi_50mhz_ac_timing_erratum()
280 speed == 50000000 && spi->mode & SPI_CPOL && in orion_spi_50mhz_ac_timing_erratum()
[all …]
Dspi.c49 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
67 return sysfs_emit(buf, "%s%s\n", SPI_MODULE_PREFIX, spi->modalias); in modalias_show()
75 struct spi_device *spi = to_spi_device(dev); in driver_override_store() local
78 ret = driver_set_override(dev, &spi->driver_override, buf, count); in driver_override_store()
88 const struct spi_device *spi = to_spi_device(dev); in driver_override_show() local
[all …]
/drivers/staging/pi433/
Drf69.c20 u8 rf69_read_reg(struct spi_device *spi, u8 addr) in rf69_read_reg() argument
22 return spi_w8r8(spi, addr); in rf69_read_reg()
25 static int rf69_write_reg(struct spi_device *spi, u8 addr, u8 value) in rf69_write_reg() argument
32 return spi_write(spi, &buffer, ARRAY_SIZE(buffer)); in rf69_write_reg()
37 static int rf69_set_bit(struct spi_device *spi, u8 reg, u8 mask) in rf69_set_bit() argument
41 tmp = rf69_read_reg(spi, reg); in rf69_set_bit()
43 return rf69_write_reg(spi, reg, tmp); in rf69_set_bit()
46 static int rf69_clear_bit(struct spi_device *spi, u8 reg, u8 mask) in rf69_clear_bit() argument
50 tmp = rf69_read_reg(spi, reg); in rf69_clear_bit()
52 return rf69_write_reg(spi, reg, tmp); in rf69_clear_bit()
[all …]
Drf69.h20 u8 rf69_read_reg(struct spi_device *spi, u8 addr);
21 int rf69_get_version(struct spi_device *spi);
22 int rf69_set_mode(struct spi_device *spi, enum mode mode);
23 int rf69_set_data_mode(struct spi_device *spi, u8 data_mode);
24 int rf69_set_modulation(struct spi_device *spi, enum modulation modulation);
25 int rf69_set_modulation_shaping(struct spi_device *spi,
27 int rf69_set_bit_rate(struct spi_device *spi, u16 bit_rate);
28 int rf69_set_deviation(struct spi_device *spi, u32 deviation);
29 int rf69_set_frequency(struct spi_device *spi, u32 frequency);
30 int rf69_enable_amplifier(struct spi_device *spi, u8 amplifier_mask);
[all …]
/drivers/video/backlight/
Dili922x.c139 struct spi_device *spi; member
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()
192 static int ili922x_read(struct spi_device *spi, u8 reg, u16 *rx) in ili922x_read() argument
206 CHECK_FREQ_REG(spi, &xfer_regindex); in ili922x_read()
227 CHECK_FREQ_REG(spi, &xfer_regvalue); in ili922x_read()
230 ret = spi_sync(spi, &msg); in ili922x_read()
232 dev_dbg(&spi->dev, "Error sending SPI message 0x%x", ret); in ili922x_read()
[all …]
Dl4f00242t03.c24 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()
85 static void l4f00242t03_lcd_powerdown(struct spi_device *spi) in l4f00242t03_lcd_powerdown() argument
[all …]
/drivers/net/wan/
Dslic_ds26522.c37 static void slic_write(struct spi_device *spi, u16 addr, in slic_write() argument
49 spi_write(spi, &temp[0], SLIC_THREE_LEN); in slic_write()
52 static u8 slic_read(struct spi_device *spi, u16 addr) in slic_read() argument
61 spi_write_then_read(spi, &temp[0], SLIC_TWO_LEN, &data, in slic_read()
68 static bool get_slic_product_code(struct spi_device *spi) in get_slic_product_code() argument
72 device_id = slic_read(spi, DS26522_IDR_ADDR); in get_slic_product_code()
79 static void ds26522_e1_spec_config(struct spi_device *spi) in ds26522_e1_spec_config() argument
82 slic_write(spi, DS26522_RMMR_ADDR, DS26522_RMMR_E1); in ds26522_e1_spec_config()
85 slic_write(spi, DS26522_TMMR_ADDR, DS26522_TMMR_E1); in ds26522_e1_spec_config()
88 slic_write(spi, DS26522_RMMR_ADDR, in ds26522_e1_spec_config()
[all …]
/drivers/staging/greybus/
Dspilib.c45 static struct spi_master *get_master_from_spi(struct gb_spilib *spi) in get_master_from_spi() argument
47 return gb_connection_get_data(spi->connection); in get_master_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()
102 spi->op_timeout = 0; in clean_xfer_state()
105 static bool is_last_xfer_done(struct gb_spilib *spi) in is_last_xfer_done() argument
[all …]
/drivers/misc/
Dgehc-achc.c59 static int ezport_start_programming(struct spi_device *spi, struct gpio_desc *reset) in ezport_start_programming() argument
68 spi_bus_lock(spi->master); 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->master); 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->master); in ezport_stop_programming()
97 spi_bus_unlock(spi->master); in ezport_stop_programming()
100 static int ezport_get_status_register(struct spi_device *spi) in ezport_get_status_register() argument
104 ret = spi_w8r8(spi, EZPORT_CMD_RDSR); in ezport_get_status_register()
[all …]
Dlattice-ecp3-config.c67 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()
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()
109 dev_info(&spi->dev, "FPGA %s detected\n", ecp3_dev[i].name); in firmware_load()
112 spi_write_then_read(spi, txbuf, 8, rxbuf, rx_len); in firmware_load()
114 dev_dbg(&spi->dev, "FPGA Status=%08x\n", status); in firmware_load()
[all …]
/drivers/net/can/spi/
Dmcp251x.c231 struct spi_device *spi; member
264 static inline int mcp251x_is_##_model(struct spi_device *spi) \
266 struct mcp251x_priv *priv = spi_get_drvdata(spi); \
297 static int mcp251x_spi_trans(struct spi_device *spi, int len) in mcp251x_spi_trans() argument
299 struct mcp251x_priv *priv = spi_get_drvdata(spi); in mcp251x_spi_trans()
312 ret = spi_sync(spi, &m); in mcp251x_spi_trans()
314 dev_err(&spi->dev, "spi transfer failed: ret = %d\n", ret); in mcp251x_spi_trans()
318 static int mcp251x_spi_write(struct spi_device *spi, int len) in mcp251x_spi_write() argument
320 struct mcp251x_priv *priv = spi_get_drvdata(spi); in mcp251x_spi_write()
323 ret = spi_write(spi, priv->spi_tx_buf, len); in mcp251x_spi_write()
[all …]
Dhi311x.c147 struct spi_device *spi; member
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
224 struct hi3110_priv *priv = spi_get_drvdata(spi); in hi3110_cmd()
227 dev_dbg(&spi->dev, "hi3110_cmd: %02X\n", command); in hi3110_cmd()
229 return hi3110_spi_trans(spi, 1); in hi3110_cmd()
232 static u8 hi3110_read(struct spi_device *spi, u8 command) in hi3110_read() argument
[all …]
/drivers/media/pci/netup_unidvb/
Dnetup_unidvb_spi.c69 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->master->dev, in netup_spi_interrupt()
85 writew(reg | NETUP_SPI_CTRL_IRQ, &spi->regs->control_stat); in netup_spi_interrupt()
86 reg = readw(&spi->regs->control_stat); in netup_spi_interrupt()
87 writew(reg & ~NETUP_SPI_CTRL_IMASK, &spi->regs->control_stat); in netup_spi_interrupt()
88 spi->state = SPI_STATE_DONE; in netup_spi_interrupt()
[all …]
/drivers/video/fbdev/omap2/omapfb/displays/
Dpanel-lgphilips-lb035q02.c43 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()
93 lb035q02_write_reg(spi, 0x06, 0xe806); in init_lb035q02_panel()
[all …]
/drivers/media/dvb-frontends/cxd2880/
Dcxd2880_spi_device.c14 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()
70 struct spi_device *spi = spi_device->spi; in cxd2880_spi_device_initialize() local
74 spi->mode = SPI_MODE_0; in cxd2880_spi_device_initialize()
[all …]
/drivers/mtd/devices/
Dmtd_dataflash.c93 struct spi_device *spi; member
112 MODULE_DEVICE_TABLE(spi, dataflash_spi_ids);
119 static inline int dataflash_status(struct spi_device *spi) in dataflash_status() argument
124 return spi_w8r8(spi, OP_READ_STATUS); in dataflash_status()
131 static int dataflash_waitready(struct spi_device *spi) in dataflash_waitready() argument
136 status = dataflash_status(spi); in dataflash_waitready()
138 dev_dbg(&spi->dev, "status %d?\n", status); in dataflash_waitready()
157 struct spi_device *spi = priv->spi; in dataflash_erase() local
164 dev_dbg(&spi->dev, "erase addr=0x%llx len 0x%llx\n", in dataflash_erase()
198 dev_dbg(&spi->dev, "ERASE %s: (%x) %x %x %x [%i]\n", in dataflash_erase()
[all …]
/drivers/net/dsa/b53/
Db53_spi.c42 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()
94 return b53_spi_set_page(spi, page); in b53_prepare_reg_access()
97 static int b53_spi_prepare_reg_read(struct spi_device *spi, u8 reg) in b53_spi_prepare_reg_read() argument
[all …]

12345678910>>...27