| /linux/drivers/spi/ | 
| H A D | spi-stm32.c | 1 // SPDX-License-Identifier: GPL-2.03 // STMicroelectronics STM32 SPI Controller driver
 5 // Copyright (C) 2017, STMicroelectronics - All Rights Reserved
 12 #include <linux/dma-mapping.h>
 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 */
 [all …]
 
 | 
| H A D | spi-gpio.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later3  * 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
 25  * platform_device->driver_data ... points to spi_gpio
 27  * spi->controller_state ... reserved for bitbang framework code
 29  * spi->controller->dev.driver_data ... points to spi_gpio->bitbang
 [all …]
 
 | 
| H A D | spi-omap2-mcspi.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later15 #include <linux/dma-mapping.h>
 28 #include <linux/spi/spi.h>
 32 #include <linux/platform_data/spi-omap2-mcspi.h>
 49 /* per-channel banks, 0x14 bytes each, first is: */
 56 /* per-register bitmasks: */
 155 	writel_relaxed(val, mcspi->base + idx);  in mcspi_write_reg()
 162 	return readl_relaxed(mcspi->base + idx);  in mcspi_read_reg()
 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()
 [all …]
 
 | 
| H A D | spi-loongson-core.c | 1 // SPDX-License-Identifier: GPL-2.0+2 // Loongson SPI Support
 15 #include <linux/spi/spi.h>
 17 #include "spi-loongson.h"
 19 static inline void loongson_spi_write_reg(struct loongson_spi *spi, unsigned char reg,  in loongson_spi_write_reg()  argument
 22 	writeb(data, spi->base + reg);  in loongson_spi_write_reg()
 25 static inline char loongson_spi_read_reg(struct loongson_spi *spi, unsigned char reg)  in loongson_spi_read_reg()  argument
 27 	return readb(spi->base + reg);  in loongson_spi_read_reg()
 30 static void loongson_spi_set_cs(struct spi_device *spi, bool en)  in loongson_spi_set_cs()  argument
 33 	unsigned char mask = (BIT(4) | BIT(0)) << spi_get_chipselect(spi, 0);  in loongson_spi_set_cs()
 [all …]
 
 | 
| H A D | spi-davinci.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later16 #include <linux/dma-mapping.h>
 18 #include <linux/spi/spi.h>
 19 #include <linux/spi/spi_bitbang.h>
 22 #include <linux/platform_data/spi-davinci.h>
 88 /* SPI Controller registers */
 103 /* SPI Controller driver's private data. */
 136 	if (dspi->rx) {  in davinci_spi_rx_buf_u8()
 137 		u8 *rx = dspi->rx;  in davinci_spi_rx_buf_u8()
 139 		dspi->rx = rx;  in davinci_spi_rx_buf_u8()
 [all …]
 
 | 
| H A D | spi-bitbang.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later3  * Polling/bitbanging SPI host controller controller driver utilities
 16 #include <linux/spi/spi.h>
 17 #include <linux/spi/spi_bitbang.h>
 22 /*----------------------------------------------------------------------*/
 25  * FIRST PART (OPTIONAL):  word-at-a-time spi_transfer support.
 26  * Use this for GPIO or shift-register level hardware APIs.
 28  * spi_bitbang_cs is in spi_device->controller_state, which is unavailable
 30  * used, though maybe they're called from controller-aware code.
 32  * chipselect() and friends may use spi_device->controller_data and
 [all …]
 
 | 
| /linux/drivers/staging/greybus/ | 
| H A D | spilib.c | 1 // SPDX-License-Identifier: GPL-2.03  * Greybus SPI library
 5  * Copyright 2014-2016 Google Inc.
 6  * Copyright 2014-2016 Linaro Ltd.
 14 #include <linux/spi/spi.h>
 41 #define GB_SPI_STATE_MSG_ERROR		((void *)-1)
 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()
 54 	data_max -= sizeof(struct gb_spi_transfer_request);  in tx_header_fit_operation()
 65 	data_max -= sizeof(struct gb_spi_transfer_response);  in calc_rx_xfer_size()
 [all …]
 
 | 
| /linux/drivers/video/backlight/ | 
| H A D | ili922x.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later7  * controller. The interface to the display is SPI and the display's
 19 #include <linux/spi/spi.h>
 88  *   ----------------------------------
 90  *   ----------------------------------
 93  *	  - START_RS_INDEX	set the index register
 94  *	  - START_RS_REG	write/read registers/GRAM
 96  *	 - START_RW_WRITE	write
 97  *	 - START_RW_READ	read
 103  * CHECK_FREQ_REG(spi_device s, spi_transfer x) - Check the frequency
 [all …]
 
 | 
| H A D | l4f00242t03.c | 1 // SPDX-License-Identifier: GPL-2.0-only3  * l4f00242t03.c -- support for Epson L4F00242T03 LCD
 5  * Copyright 2007-2009 Freescale Semiconductor, Inc. All Rights Reserved.
 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()
 54 	ret = regulator_set_voltage(priv->io_reg, 1800000, 1800000);  in l4f00242t03_lcd_init()
 56 		dev_err(&spi->dev, "failed to set the IO regulator voltage.\n");  in l4f00242t03_lcd_init()
 [all …]
 
 | 
| /linux/Documentation/devicetree/bindings/spi/ | 
| H A D | mediatek,spi-mt65xx.yaml | 1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)3 ---
 4 $id: http://devicetree.org/schemas/spi/mediatek,spi-mt65xx.yaml#
 5 $schema: http://devicetree.org/meta-schemas/core.yaml#
 7 title: SPI Bus controller for MediaTek ARM SoCs
 10   - Leilk Liu <leilk.liu@mediatek.com>
 13   - $ref: /schemas/spi/spi-controller.yaml#
 18       - items:
 19           - enum:
 20               - mediatek,mt7629-spi
 [all …]
 
 | 
| H A D | brcm,spi-bcm-qspi.yaml | 1 # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause3 ---
 4 $id: http://devicetree.org/schemas/spi/brcm,spi-bcm-qspi.yaml#
 5 $schema: http://devicetree.org/meta-schemas/core.yaml#
 7 title: Broadcom SPI controller
 10   - Kamal Dasu <kdasu.kdev@gmail.com>
 11   - Rafał Miłecki <rafal@milecki.pl>
 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
 [all …]
 
 | 
| H A D | snps,dw-apb-ssi.yaml | 1 # SPDX-License-Identifier: GPL-2.0-only3 ---
 4 $id: http://devicetree.org/schemas/spi/snps,dw-apb-ssi.yaml#
 5 $schema: http://devicetree.org/meta-schemas/core.yaml#
 10   - Mark Brown <broonie@kernel.org>
 13   - $ref: spi-controller.yaml#
 14   - if:
 19               - mscc,ocelot-spi
 20               - mscc,jaguar2-spi
 25   - if:
 [all …]
 
 | 
| H A D | brcm,bcm63xx-spi.yaml | 1 # SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause3 ---
 4 $id: http://devicetree.org/schemas/spi/brcm,bcm63xx-spi.yaml#
 5 $schema: http://devicetree.org/meta-schemas/core.yaml#
 7 title: Broadcom BCM6348/BCM6358 SPI controller
 10   - Jonas Gorski <jonas.gorski@gmail.com>
 13   Broadcom "Low Speed" SPI controller found in many older MIPS based Broadband
 17   between the SPI transfers within the same SPI message. This can terminate the
 18   transaction to some SPI devices prematurely. The issue can be worked around by
 22   - $ref: spi-controller.yaml#
 [all …]
 
 | 
| H A D | allwinner,sun6i-a31-spi.yaml | 1 # SPDX-License-Identifier: GPL-2.03 ---
 4 $id: http://devicetree.org/schemas/spi/allwinner,sun6i-a31-spi.yaml#
 5 $schema: http://devicetree.org/meta-schemas/core.yaml#
 7 title: Allwinner A31 SPI Controller
 10   - $ref: spi-controller.yaml
 13   - Chen-Yu Tsai <wens@csie.org>
 14   - Maxime Ripard <mripard@kernel.org>
 19       - const: allwinner,sun50i-r329-spi
 20       - const: allwinner,sun6i-a31-spi
 [all …]
 
 | 
| /linux/drivers/net/wan/ | 
| H A D | slic_ds26522.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later16 #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
 [all …]
 
 | 
| /linux/drivers/misc/ | 
| H A D | gehc-achc.c | 1 // SPDX-License-Identifier: GPL-2.0-only3  * 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>
 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()
 85 	ret = spi_sync_locked(spi, &msg);  in ezport_start_programming()
 [all …]
 
 | 
| H A D | lattice-ecp3-config.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later11 #include <linux/spi/spi.h>
 16 #define FIRMWARE_NAME	"lattice-ecp3.bit"
 36  * (LatticeECP3 Slave SPI Port User's Guide)
 57 		.name = "Lattice ECP3-17",
 61 		.name = "Lattice ECP3-35",
 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()
 82 	if (fw->size == 0) {  in firmware_load()
 [all …]
 
 | 
| /linux/drivers/media/dvb-frontends/cxd2880/ | 
| H A D | cxd2880_spi_device.c | 1 // SPDX-License-Identifier: GPL-2.04  * Sony CXD2880 DVB-T2/T tuner + demodulator driver
 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()
 23 		return -EINVAL;  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()
 36 		return -EIO;  in cxd2880_spi_device_write()
 [all …]
 
 | 
| /linux/drivers/video/fbdev/omap2/omapfb/displays/ | 
| H A D | panel-lgphilips-lb035q02.c | 1 // SPDX-License-Identifier: GPL-2.0-only12 #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()
 [all …]
 
 | 
| /linux/drivers/iio/common/st_sensors/ | 
| H A D | st_sensors_spi.c | 1 // SPDX-License-Identifier: GPL-2.0-only3  * 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/spi/ | 
| H A D | spi-summary.rst | 2 Overview of Linux kernel SPI support5 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
 24 in parallel.  All SPI targets support chipselects; they are usually active
 29 SPI target functions are usually not interoperable between vendors
 [all …]
 
 | 
| /linux/drivers/media/v4l2-core/ | 
| H A D | v4l2-spi.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later3  * v4l2-spi - SPI helpers for Video4Linux2
 7 #include <linux/spi/spi.h>
 8 #include <media/v4l2-common.h>
 9 #include <media/v4l2-device.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
 23 	sd->flags |= V4L2_SUBDEV_FL_IS_SPI;  in v4l2_spi_subdev_init()
 [all …]
 
 | 
| /linux/drivers/net/dsa/b53/ | 
| H A D | b53_spi.c | 2  * B53 register access through SPI4  * Copyright (C) 2011-2013 Jonas Gorski <jogo@openwrt.org>
 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()
 71 		return -EIO;  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()
 [all …]
 
 | 
| /linux/drivers/tty/serial/ | 
| H A D | sc16is7xx_spi.c | 1 // SPDX-License-Identifier: GPL-2.0+2 /* SC16IS7xx SPI interface driver */
 8 #include <linux/spi/spi.h>
 14 /* SPI definitions */
 17 static int sc16is7xx_spi_probe(struct spi_device *spi)  in sc16is7xx_spi_probe()  argument
 25 	/* Setup SPI bus */  in sc16is7xx_spi_probe()
 26 	spi->bits_per_word	= 8;  in sc16is7xx_spi_probe()
 28 	if ((spi->mode & SPI_MODE_X_MASK) != SPI_MODE_0)  in sc16is7xx_spi_probe()
 29 		return dev_err_probe(&spi->dev, -EINVAL, "Unsupported SPI mode\n");  in sc16is7xx_spi_probe()
 31 	spi->mode		= spi->mode ? : SPI_MODE_0;  in sc16is7xx_spi_probe()
 [all …]
 
 | 
| /linux/net/ipv6/ | 
| H A D | xfrm6_tunnel.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later5  * Authors	Mitsuru KANDA  <mk@linux-ipv6.org>
 6  *		YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
 31 	u32 spi;  member
 41  * xfrm_tunnel_spi things are for allocating unique id ("spi")
 48 	u32			spi;  member
 64 	h &= XFRM6_TUNNEL_SPI_BYADDR_HSIZE - 1;  in xfrm6_tunnel_spi_hash_byaddr()
 69 static inline unsigned int xfrm6_tunnel_spi_hash_byspi(u32 spi)  in xfrm6_tunnel_spi_hash_byspi()  argument
 71 	return spi % XFRM6_TUNNEL_SPI_BYSPI_HSIZE;  in xfrm6_tunnel_spi_hash_byspi()
 80 			     &xfrm6_tn->spi_byaddr[xfrm6_tunnel_spi_hash_byaddr(saddr)],  in __xfrm6_tunnel_spi_lookup()
 [all …]
 
 |