/linux/Documentation/spi/ |
H A D | spidev.rst | 2 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 D | spi-summary.rst | 2 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 D | spi.h | 1 /* 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 */ 36 * INTERFACES between SPI master-side drivers and SPI slave protocol handlers, 37 * and SPI infrastructure. 42 * struct spi_statistics - statistics for spi transfers 43 * @syncp: seqcount to protect members in this struct for per-cpu update 44 * on 32-bit systems 46 * @messages: number of spi-messages handled [all …]
|
/linux/drivers/mtd/devices/ |
H A D | mtd_dataflash.c | 1 // 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/video/backlight/ |
H A D | ili922x.c | 1 // 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/drivers/iio/common/st_sensors/ |
H A D | st_sensors_spi.c | 1 // 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/Documentation/devicetree/bindings/spi/ |
H A D | spi-peripheral-props.yaml | 1 # 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-cpha, etc. or they could be 13 need to be defined in the peripheral node because they are per-peripheral and 19 - Mark Brown <broonie@kernel.org> 27 - minimum: 0 [all …]
|
H A D | spi-orion.txt | 1 Marvell Orion SPI device 4 - compatible : should be on of the following: 5 - "marvell,orion-spi" for the Orion, mv78x00, Kirkwood and Dove SoCs 6 - "marvell,armada-370-spi", for the Armada 370 SoCs 7 - "marvell,armada-375-spi", for the Armada 375 SoCs 8 - "marvell,armada-380-spi", for the Armada 38x SoCs 9 - "marvell,armada-390-spi", for the Armada 39x SoCs 10 - "marvell,armada-xp-spi", for the Armada XP SoCs 11 - reg : offset and length of the register set for the device. 13 the SPI direct access mode that some of the Marvell SoCs support [all …]
|
H A D | spi-davinci.txt | 1 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 …]
|
/linux/drivers/input/rmi4/ |
H A D | rmi_spi.c | 1 // 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/misc/mei/ |
H A D | vsc-tp.c | 1 // SPDX-License-Identifier: GPL-2.0-only 11 #include <linux/device.h> 19 #include <linux/spi/spi.h> 22 #include "vsc-tp.h" 35 /* SPI xfer timeout size */ 39 (sizeof(struct vsc_tp_packet) + le16_to_cpu((pkt)->len) + VSC_TP_CRC_SIZE) 45 (len + sizeof(struct vsc_tp_packet) + VSC_TP_CRC_SIZE - offset + VSC_TP_PACKET_PADDING_SIZE) 57 struct spi_device *spi; member 90 { "wakeuphost-gpios", &wakeuphost_gpio, 1 }, 91 { "wakeuphostint-gpios", &wakeuphostint_gpio, 1 }, [all …]
|
/linux/drivers/rtc/ |
H A D | rtc-max6916.c | 1 // 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 D | rtc-ds1390.c | 1 // 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 D | rtc-ds1343.c | 1 // 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/spi/ |
H A D | spi-apple.c | 1 // SPDX-License-Identifier: GPL-2.0 3 // Apple SoC SPI device driver 7 // Based on spi-sifive.c, Copyright 2018 SiFive, Inc. 18 #include <linux/spi/spi.h> 114 * intra-word delay is 0xffff refclocks. So the maximum time a transfer 126 struct completion done; /* wake-up from interrupt */ 129 static inline void reg_write(struct apple_spi *spi, int offset, u32 value) in reg_write() argument 131 writel_relaxed(value, spi->regs + offset); in reg_write() 134 static inline u32 reg_read(struct apple_spi *spi, int offset) in reg_read() argument 136 return readl_relaxed(spi->regs + offset); in reg_read() [all …]
|
/linux/drivers/misc/ |
H A D | gehc-achc.c | 1 // 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/mfd/ |
H A D | sprd-sc27xx-spi.c | 1 // 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 D | ocelot-spi.c | 1 // 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/hwmon/ |
H A D | adcxx.c | 1 // 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 …]
|
/linux/drivers/net/wireless/ti/wlcore/ |
H A D | spi.c | 1 // 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 D | microchip,mcp3564.yaml | 1 # 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/rtc/ |
H A D | maxim-ds1302.txt | 1 * 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 D | applespi.c | 1 // 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 …]
|
/linux/Documentation/devicetree/bindings/mtd/ |
H A D | st-fsm.txt | 1 * 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/drivers/video/fbdev/omap2/omapfb/displays/ |
H A D | panel-tpo-td043mtea1.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 6 * Converted to new DSS device model: Tomi Valkeinen <tomi.valkeinen@ti.com> 11 #include <linux/spi/spi.h> 58 struct spi_device *spi; member 93 static int tpo_td043_write(struct spi_device *spi, u8 addr, u8 data) in tpo_td043_write() argument 110 r = spi_sync(spi, &m); in tpo_td043_write() 112 dev_warn(&spi->dev, "failed to write to LCD reg (%d)\n", r); in tpo_td043_write() 116 static void tpo_td043_write_gamma(struct spi_device *spi, u16 gamma[12]) in tpo_td043_write_gamma() argument 123 tpo_td043_write(spi, 0x11, val); in tpo_td043_write_gamma() 127 tpo_td043_write(spi, 0x12, val); in tpo_td043_write_gamma() [all …]
|