Home
last modified time | relevance | path

Searched +full:spi +full:- +full:device (Results 1 – 25 of 1129) sorted by relevance

12345678910>>...46

/linux/Documentation/spi/
H A Dspidev.rst2 SPI userspace API
5 SPI devices have a limited userspace API, supporting basic half-duplex
6 read() and write() access to SPI slave devices. Using ioctl() requests,
7 full duplex transfers and device I/O configuration are also available.
15 #include <linux/spi/spidev.h>
19 * Prototyping in an environment that's not crash-prone; stray pointers
23 as SPI slaves, which you may need to change quite often.
30 DEVICE CREATION, DRIVER BINDING
33 The spidev driver contains lists of SPI devices that are supported for
36 The following are the SPI device tables supported by the spidev driver:
[all …]
H A Dspi-summary.rst2 Overview of Linux kernel SPI support
5 02-Feb-2012
7 What is SPI?
8 ------------
9 The "Serial Peripheral Interface" (SPI) is a synchronous four wire serial
12 standardization body. SPI uses a host/target configuration.
17 clocking modes through which data is exchanged; mode-0 and mode-3 are most
22 SPI hosts use a fourth "chip select" line to activate a given SPI target
23 device, so those three signal wires may be connected to several chips
24 in parallel. All SPI targets support chipselects; they are usually active
[all …]
/linux/include/linux/spi/
H A Dspi.h1 /* SPDX-License-Identifier: GPL-2.0-or-later
12 #include <linux/device.h>
21 #include <uapi/linux/spi/spi.h>
23 /* Max no. of CS supported per spi device */
260 spi_dev_get(struct spi_device * spi) spi_dev_get() argument
265 spi_dev_put(struct spi_device * spi) spi_dev_put() argument
272 spi_get_ctldata(const struct spi_device * spi) spi_get_ctldata() argument
277 spi_set_ctldata(struct spi_device * spi,void * state) spi_set_ctldata() argument
284 spi_set_drvdata(struct spi_device * spi,void * data) spi_set_drvdata() argument
289 spi_get_drvdata(const struct spi_device * spi) spi_get_drvdata() argument
294 spi_get_chipselect(const struct spi_device * spi,u8 idx) spi_get_chipselect() argument
299 spi_set_chipselect(struct spi_device * spi,u8 idx,u8 chipselect) spi_set_chipselect() argument
304 spi_get_csgpiod(const struct spi_device * spi,u8 idx) spi_get_csgpiod() argument
309 spi_set_csgpiod(struct spi_device * spi,u8 idx,struct gpio_desc * csgpiod) spi_set_csgpiod() argument
314 spi_is_csgpiod(struct spi_device * spi) spi_is_csgpiod() argument
1157 struct spi_device *spi; global() member
1297 spi_max_message_size(struct spi_device * spi) spi_max_message_size() argument
1307 spi_max_transfer_size(struct spi_device * spi) spi_max_transfer_size() argument
1330 spi_is_bpw_supported(struct spi_device * spi,u32 bpw) spi_is_bpw_supported() argument
1457 spi_sync_transfer(struct spi_device * spi,struct spi_transfer * xfers,unsigned int num_xfers) spi_sync_transfer() argument
1480 spi_write(struct spi_device * spi,const void * buf,size_t len) spi_write() argument
1503 spi_read(struct spi_device * spi,void * buf,size_t len) spi_read() argument
1529 spi_w8r8(struct spi_device * spi,u8 cmd) spi_w8r8() argument
1554 spi_w8r16(struct spi_device * spi,u8 cmd) spi_w8r16() argument
1579 spi_w8r16be(struct spi_device * spi,u8 cmd) spi_w8r16be() argument
[all...]
/linux/drivers/mtd/devices/
H A Dmtd_dataflash.c1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Atmel AT45xxx DataFlash MTD driver for lightweight SPI framework
6 * Copyright (C) 2003-2005 SAN People (Pty) Ltd
11 #include <linux/device.h>
17 #include <linux/spi/spi.h>
18 #include <linux/spi/flash.h>
24 * DataFlash is a kind of SPI flash. Most AT45 chips have two buffers in
28 * Sometimes DataFlash is packaged in MMC-format cards, although the
57 #define OP_MWRITE_BUFFER1 0x88 /* sector must be pre-erased */
58 #define OP_MWRITE_BUFFER2 0x89 /* sector must be pre-erased */
[all …]
/linux/drivers/iio/common/st_sensors/
H A Dst_sensors_spi.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * STMicroelectronics sensors spi library driver
5 * Copyright 2012-2013 STMicroelectronics Inc.
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()
[all …]
/linux/drivers/video/backlight/
H A Dili922x.c1 // SPDX-License-Identifier: GPL-2.0-or-later
6 * This driver implements a lcd device for the ILITEK 922x display
7 * controller. The interface to the display is SPI and the display's
19 #include <linux/spi/spi.h>
72 * Device ID as found in the datasheet (supports 9221 and 9222)
88 * ----------------------------------
90 * ----------------------------------
93 * - START_RS_INDEX set the index register
94 * - START_RS_REG write/read registers/GRAM
96 * - START_RW_WRITE write
[all …]
/linux/Documentation/devicetree/bindings/spi/
H A Dspi-peripheral-props.yaml1 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
3 ---
4 $id: http://devicetree.org/schemas/spi/spi-peripheral-props.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
7 title: Peripheral-specific properties for a SPI bus.
10 Many SPI controllers need to add properties to peripheral devices. They could
11 be common properties like spi-max-frequency, spi-cs-high, etc. or they could
14 per-peripheral and there can be multiple peripherals attached to a
20 - Mark Brown <broonie@kernel.org>
28 - minimum: 0
[all …]
H A Dspi-davinci.txt1 Davinci SPI controller device bindings
4 Keystone 2 - https://www.ti.com/lit/ug/sprugp2a/sprugp2a.pdf
5 dm644x - https://www.ti.com/lit/ug/sprue32a/sprue32a.pdf
6 OMAP-L138/da830 - http://www.ti.com/lit/ug/spruh77a/spruh77a.pdf
9 - #address-cells: number of cells required to define a chip select
10 address on the SPI bus. Should be set to 1.
11 - #size-cells: should be zero.
12 - compatible:
13 - "ti,dm6441-spi" for SPI used similar to that on DM644x SoC family
14 - "ti,da830-spi" for SPI used similar to that on DA8xx SoC family
[all …]
H A Dicpdas-lp8841-spi-rtc.txt1 * ICP DAS LP-8841 SPI Controller for RTC
3 ICP DAS LP-8841 contains a DS-1302 RTC. RTC is connected to an IO
4 memory register, which acts as an SPI master device.
6 The device uses the standard MicroWire half-duplex transfer timing.
13 - #address-cells: should be 1
15 - #size-cells: should be 0
17 - compatible: should be "icpdas,lp8841-spi-rtc"
19 - reg: should provide IO memory address
21 Requirements to SPI slave nodes:
23 - There can be only one slave device.
[all …]
/linux/drivers/spi/
H A Dspidev.c1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Simple synchronous userspace interface to SPI devices
6 * Andrea Paterniani <a.paterniani@swapp-eng.it>
13 #include <linux/device.h>
24 #include <linux/spi/spi.h>
25 #include <linux/spi/spidev.h>
31 * This supports access to SPI devices using normal userspace I/O calls.
33 * and often mask message boundaries, full SPI support requires full duplex
37 * SPI has a character major number assigned. We allocate minor numbers
39 * (or mdev with busybox) to create and destroy the /dev/spidevB.C device
[all …]
H A Dspi-mem.c1 // SPDX-License-Identifier: GPL-2.0+
11 #include <linux/spi/spi.h>
12 #include <linux/spi/spi-mem.h>
20 * spi_controller_dma_map_mem_op_data() - DMA-map the buffer attached to a
22 * @ctlr: the SPI controller requesting this dma_map()
24 * @sgt: a pointer to a non-initialized sg_table that will be filled by this
28 * This helper prepares everything for you and provides a ready-to-use
29 * sg_table. This function is not intended to be called from spi drivers.
30 * Only SPI controller drivers should use it.
32 * op->data.buf.{in,out} is DMA-able before calling this function.
[all …]
/linux/drivers/input/rmi4/
H A Drmi_spi.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2011-2016 Synaptics Incorporated
11 #include <linux/spi/spi.h>
38 struct spi_device *spi; member
55 struct spi_device *spi = rmi_spi->spi; in rmi_spi_manage_pools() local
56 int buf_size = rmi_spi->xfer_buf_size in rmi_spi_manage_pools()
57 ? rmi_spi->xfer_buf_size : RMI_SPI_DEFAULT_XFER_BUF_SIZE; in rmi_spi_manage_pools()
68 tmp = rmi_spi->rx_buf; in rmi_spi_manage_pools()
69 buf = devm_kcalloc(&spi->dev, buf_size, 2, in rmi_spi_manage_pools()
72 return -ENOMEM; in rmi_spi_manage_pools()
[all …]
/linux/drivers/rtc/
H A Drtc-max6916.c1 // SPDX-License-Identifier: GPL-2.0-only
2 /* rtc-max6916.c
4 * Driver for MAXIM max6916 Low Current, SPI Compatible
12 #include <linux/device.h>
15 #include <linux/spi/spi.h>
31 static int max6916_read_reg(struct device *dev, unsigned char address, in max6916_read_reg()
34 struct spi_device *spi = to_spi_device(dev); in max6916_read_reg() local
38 return spi_write_then_read(spi, data, 1, data, 1); in max6916_read_reg()
41 static int max6916_write_reg(struct device *dev, unsigned char address, in max6916_write_reg()
44 struct spi_device *spi = to_spi_device(dev); in max6916_write_reg() local
[all …]
H A Drtc-ds1390.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * rtc-ds1390.c -- driver for the Dallas/Maxim DS1390/93/94 SPI RTC
17 #include <linux/spi/spi.h>
53 static void ds1390_set_reg(struct device *dev, unsigned char address, in ds1390_set_reg()
56 struct spi_device *spi = to_spi_device(dev); in ds1390_set_reg() local
63 spi_write(spi, buf, 2); in ds1390_set_reg()
66 static int ds1390_get_reg(struct device *dev, unsigned char address, in ds1390_get_reg()
69 struct spi_device *spi = to_spi_device(dev); in ds1390_get_reg() local
74 return -EINVAL; in ds1390_get_reg()
77 chip->txrx_buf[0] = address & 0x7f; in ds1390_get_reg()
[all …]
H A Drtc-ds1343.c1 // SPDX-License-Identifier: GPL-2.0-only
2 /* rtc-ds1343.c
4 * Driver for Dallas Semiconductor DS1343 Low Current, SPI Compatible
14 #include <linux/device.h>
15 #include <linux/spi/spi.h>
75 MODULE_DEVICE_TABLE(spi, ds1343_id);
83 static ssize_t ds1343_show_glitchfilter(struct device *dev, in ds1343_show_glitchfilter()
86 struct ds1343_priv *priv = dev_get_drvdata(dev->parent); in ds1343_show_glitchfilter()
90 res = regmap_read(priv->map, DS1343_CONTROL_REG, &data); in ds1343_show_glitchfilter()
102 static ssize_t ds1343_store_glitchfilter(struct device *dev, in ds1343_store_glitchfilter()
[all …]
/linux/drivers/mfd/
H A Dsprd-sc27xx-spi.c1 // SPDX-License-Identifier: GPL-2.0-only
10 #include <linux/mfd/sc27xx-pmic.h>
14 #include <linux/spi/spi.h>
39 struct device *dev;
56 * in the device data structure.
70 enum usb_charger_type sprd_pmic_detect_charger_type(struct device *dev) in sprd_pmic_detect_charger_type()
72 struct spi_device *spi = to_spi_device(dev); in sprd_pmic_detect_charger_type() local
73 struct sprd_pmic *ddata = spi_get_drvdata(spi); in sprd_pmic_detect_charger_type()
74 const struct sprd_pmic_data *pdata = ddata->pdata; in sprd_pmic_detect_charger_type()
79 ret = regmap_read_poll_timeout(ddata->regmap, pdata->charger_det, val, in sprd_pmic_detect_charger_type()
[all …]
H A Docelot-spi.c1 // SPDX-License-Identifier: (GPL-2.0 OR MIT)
3 * SPI core driver for the Ocelot chip family.
6 * SPI to the VSC7511, VSC7512, VSC7513 and VSC7514 chips. The main functions
7 * are to prepare the chip's SPI interface for a specific bus speed, and a host
11 * Copyright 2021-2022 Innovative Advantage Inc.
13 * Author: Colin Foster <colin.foster@in-advantage.com>
16 #include <linux/device.h>
24 #include <linux/spi/spi.h>
54 static int ocelot_spi_initialize(struct device *dev) in ocelot_spi_initialize()
63 * The SPI address must be big-endian, but we want the payload to match in ocelot_spi_initialize()
[all …]
/linux/drivers/misc/
H A Dgehc-achc.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * datasheet: https://www.nxp.com/docs/en/data-sheet/K20P144M120SF3.pdf
5 * Copyright (C) 2018-2021 Collabora
6 * Copyright (C) 2018-2021 GE Healthcare
15 #include <linux/spi/spi.h>
25 struct mutex device_lock; /* avoid concurrent device access */
42 #define EZPORT_SECTOR_MASK (EZPORT_SECTOR_SIZE - 1)
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()
[all …]
/linux/drivers/hwmon/
H A Dadcxx.c1 // SPDX-License-Identifier: GPL-2.0-or-later
9 * The adcxx4s communicates with a host processor via an SPI/Microwire Bus
28 #include <linux/device.h>
32 #include <linux/hwmon-sysfs.h>
35 #include <linux/spi/spi.h>
40 struct device *hwmon_dev;
47 static ssize_t adcxx_show(struct device *dev, in adcxx_show()
50 struct spi_device *spi = to_spi_device(dev); in adcxx_show() local
52 struct adcxx *adc = spi_get_drvdata(spi); in adcxx_show()
58 if (mutex_lock_interruptible(&adc->lock)) in adcxx_show()
[all …]
H A Dmax31722.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * max31722 - hwmon driver for Maxim Integrated MAX31722/MAX31723 SPI
10 #include <linux/hwmon-sysfs.h>
13 #include <linux/spi/spi.h>
25 struct device *hwmon_dev;
33 struct spi_device *spi = data->spi_device; in max31722_set_mode() local
36 (data->mode & MAX31722_MODE_MASK) | mode in max31722_set_mode()
39 ret = spi_write(spi, &buf, sizeof(buf)); in max31722_set_mode()
41 dev_err(&spi->dev, "failed to set sensor mode.\n"); in max31722_set_mode()
44 data->mode = (data->mode & MAX31722_MODE_MASK) | mode; in max31722_set_mode()
[all …]
/linux/drivers/net/wireless/ti/wlcore/
H A Dspi.c1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright (C) 2008-2009 Nokia Corporation
16 #include <linux/spi/spi.h>
51 ((WL1271_BUSY_WORD_LEN - 4) / sizeof(u32))
63 /* Maximum number of SPI write chunks */
69 .nvs_name = "ti-connectivity/wl127x-nvs.bin",
74 .nvs_name = "ti-connectivity/wl128x-nvs.bin",
79 .cfg_name = "ti-connectivity/wl18xx-conf.bin",
80 .nvs_name = "ti-connectivity/wl1271-nvs.bin",
84 struct device *dev;
[all …]
/linux/Documentation/devicetree/bindings/iio/adc/
H A Dmicrochip,mcp3564.yaml1 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
3 ---
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
10 - Marius Cristea <marius.cristea@microchip.com>
13 Bindings for the Microchip family of 153.6 ksps, Low-Noise 16/24-Bit
14 Delta-Sigma ADCs with an SPI interface. Datasheet can be found here:
16 …s/aemDocuments/documents/MSLD/ProductDocuments/DataSheets/MCP3561-2-4-Family-Data-Sheet-DS20006181…
18 …ds/aemDocuments/documents/APID/ProductDocuments/DataSheets/MCP3561_2_4R-Data-Sheet-DS200006391C.pdf
20 …ProductDocuments/DataSheets/MCP3461-2-4-Two-Four-Eight-Channel-153.6-ksps-Low-Noise-16-Bit-Delta-S…
22 …/aemDocuments/documents/APID/ProductDocuments/DataSheets/MCP3461-2-4R-Family-Data-Sheet-DS20006404…
[all …]
/linux/Documentation/devicetree/bindings/mtd/
H A Dst-fsm.txt1 * ST-Microelectronics SPI FSM Serial (NOR) Flash Controller
4 - compatible : Should be "st,spi-fsm"
5 - reg : Contains register's location and length.
6 - reg-names : Should contain the reg names "spi-fsm"
7 - interrupts : The interrupt number
8 - pinctrl-0 : Standard Pinctrl phandle (see: pinctrl/pinctrl-bindings.txt)
11 - st,syscfg : Phandle to boot-device system configuration registers
12 - st,boot-device-reg : Address of the aforementioned boot-device register(s)
13 - st,boot-device-spi : Expected boot-device value if booted via this device
17 compatible = "st,spi-fsm";
[all …]
/linux/Documentation/devicetree/bindings/rtc/
H A Dmaxim-ds1302.txt1 * Maxim/Dallas Semiconductor DS-1302 RTC
3 Simple device which could be used to store date/time between reboots.
5 The device uses the standard MicroWire half-duplex transfer timing.
12 - compatible : Should be "maxim,ds1302"
14 Required SPI properties:
16 - reg : Should be address of the device chip select within
19 - spi-max-frequency : DS-1302 has 500 kHz if powered at 2.2V,
22 - spi-3wire : The device has a shared signal IN/OUT line.
24 - spi-lsb-first : DS-1302 requires least significant bit first
27 - spi-cs-high: DS-1302 has active high chip select line. This is
[all …]
/linux/drivers/input/keyboard/
H A Dapplespi.c1 // SPDX-License-Identifier: GPL-2.0
3 * MacBook (Pro) SPI keyboard and touchpad driver
5 * Copyright (c) 2015-2018 Federico Lorenzi
6 * Copyright (c) 2017-2018 Ronald Tschalär
11 * MacBook8 and newer can be driven either by USB or SPI. However the USB
15 * * UIEN ("USB Interface Enable"): If invoked with argument 1, disables SPI
18 * * SIEN ("SPI Interface Enable"): If invoked with argument 1, disables USB
19 * and enables SPI. If invoked with argument 0, disables SPI.
20 * * SIST ("SPI Interface Status"): Returns 1 if SPI is enabled, 0 otherwise.
21 * * ISOL: Resets the four GPIO pins used for SPI. Intended to be invoked with
[all …]

12345678910>>...46