| /linux/drivers/net/can/spi/mcp251xfd/ | 
| H A D | mcp251xfd-regmap.c | 1 // SPDX-License-Identifier: GPL-2.03 // mcp251xfd - Microchip MCP251xFD Family CAN controller driver
 6 //               Marc Kleine-Budde <kernel@pengutronix.de>
 18 	struct spi_device *spi = context;  in mcp251xfd_regmap_nocrc_write()  local
 20 	return spi_write(spi, data, count);  in mcp251xfd_regmap_nocrc_write()
 28 	struct spi_device *spi = context;  in mcp251xfd_regmap_nocrc_gather_write()  local
 29 	struct mcp251xfd_priv *priv = spi_get_drvdata(spi);  in mcp251xfd_regmap_nocrc_gather_write()
 30 	struct mcp251xfd_map_buf_nocrc *buf_tx = priv->map_buf_nocrc_tx;  in mcp251xfd_regmap_nocrc_gather_write()
 34 			.len = sizeof(buf_tx->cmd) + val_len,  in mcp251xfd_regmap_nocrc_gather_write()
 38 	BUILD_BUG_ON(sizeof(buf_tx->cmd) != sizeof(__be16));  in mcp251xfd_regmap_nocrc_gather_write()
 [all …]
 
 | 
| H A D | mcp251xfd-tx.c | 1 // SPDX-License-Identifier: GPL-2.03 // mcp251xfd - Microchip MCP251xFD Family CAN controller driver
 6 //               Marc Kleine-Budde <kernel@pengutronix.de>
 10 // CAN bus driver for Microchip 25XXFD CAN Controller with SPI Interface
 27 	return &tx_ring->obj[tx_head];  in mcp251xfd_get_tx_obj_next()
 36 	const struct canfd_frame *cfd = (struct canfd_frame *)skb->data;  in mcp251xfd_tx_obj_from_skb()
 43 	if (cfd->can_id & CAN_EFF_FLAG) {  in mcp251xfd_tx_obj_from_skb()
 46 		sid = FIELD_GET(MCP251XFD_REG_FRAME_EFF_SID_MASK, cfd->can_id);  in mcp251xfd_tx_obj_from_skb()
 47 		eid = FIELD_GET(MCP251XFD_REG_FRAME_EFF_EID_MASK, cfd->can_id);  in mcp251xfd_tx_obj_from_skb()
 54 		id = FIELD_PREP(MCP251XFD_OBJ_ID_SID_MASK, cfd->can_id);  in mcp251xfd_tx_obj_from_skb()
 [all …]
 
 | 
| H A D | mcp251xfd-core.c | 1 // SPDX-License-Identifier: GPL-2.03 // mcp251xfd - Microchip MCP251xFD Family CAN controller driver
 6 //               Marc Kleine-Budde <kernel@pengutronix.de>
 10 // CAN bus driver for Microchip 25XXFD CAN Controller with SPI Interface
 47 /* Autodetect model, start with CRC enabled. */
 79  * [-64,63] for TDCO, indicating a relative TDCO.
 115 	return __mcp251xfd_get_model_str(priv->devtype_data.model);  in mcp251xfd_get_model_str()
 160 	if (!priv->reg_vdd)  in mcp251xfd_vdd_enable()
 163 	return regulator_enable(priv->reg_vdd);  in mcp251xfd_vdd_enable()
 168 	if (!priv->reg_vdd)  in mcp251xfd_vdd_disable()
 [all …]
 
 | 
| H A D | mcp251xfd.h | 1 /* SPDX-License-Identifier: GPL-2.03  * mcp251xfd - Microchip MCP251xFD Family CAN controller driver
 6  *               Marc Kleine-Budde <kernel@pengutronix.de>
 16 #include <linux/can/rx-offload.h>
 22 #include <linux/spi/spi.h>
 370 /* SPI commands */
 425 /* Use CRC to access registers */
 427 /* Use CRC to access RX/TEF-RAM */
 429 /* Use CRC to access TX-RAM */
 433 /* Use Half Duplex SPI transfers */
 [all …]
 
 | 
| H A D | mcp251xfd-crc16.c | 1 // SPDX-License-Identifier: GPL-2.03 // mcp251xfd - Microchip MCP251xFD Family CAN controller driver
 6 //                    Marc Kleine-Budde <kernel@pengutronix.de>
 10 // CAN bus driver for Microchip 25XXFD CAN Controller with SPI Interface
 58 static inline u16 mcp251xfd_crc16_byte(u16 crc, const u8 data)  in mcp251xfd_crc16_byte()  argument
 60 	u8 index = (crc >> 8) ^ data;  in mcp251xfd_crc16_byte()
 62 	return (crc << 8) ^ mcp251xfd_crc16_table[index];  in mcp251xfd_crc16_byte()
 65 static u16 mcp251xfd_crc16(u16 crc, u8 const *buffer, size_t len)  in mcp251xfd_crc16()  argument
 67 	while (len--)  in mcp251xfd_crc16()
 68 		crc = mcp251xfd_crc16_byte(crc, *buffer++);  in mcp251xfd_crc16()
 [all …]
 
 | 
| /linux/drivers/leds/ | 
| H A D | leds-cr0014114.c | 1 // SPDX-License-Identifier: GPL-2.09 #include <linux/spi/spi.h>
 13  *  CR0014114 SPI protocol descrtiption:
 14  *  +----+-----------------------------------+----+
 15  *  | CMD|             BRIGHTNESS            |CRC |
 16  *  +----+-----------------------------------+----+
 18  *  |    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+    |
 20  *  | 1  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1  |
 22  *  |    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+    |
 24  *  +----+-----------------------------------+----+
 [all …]
 
 | 
| /linux/net/nfc/nci/ | 
| H A D | spi.c | 1 // SPDX-License-Identifier: GPL-2.0-only11 #include <linux/spi/spi.h>
 12 #include <linux/crc-ccitt.h>
 37 	/* a NULL skb means we just want the SPI chip select line to raise */  in __nci_spi_send()
 39 		t.tx_buf = skb->data;  in __nci_spi_send()
 40 		t.len = skb->len;  in __nci_spi_send()
 47 	t.delay.value = nspi->xfer_udelay;  in __nci_spi_send()
 49 	t.speed_hz = nspi->xfer_speed_hz;  in __nci_spi_send()
 54 	return spi_sync(nspi->spi, &m);  in __nci_spi_send()
 61 	unsigned int payload_len = skb->len;  in nci_spi_send()
 [all …]
 
 | 
| /linux/drivers/misc/mei/ | 
| H A D | vsc-tp.c | 1 // SPDX-License-Identifier: GPL-2.0-only19 #include <linux/spi/spi.h>
 23 #include "vsc-tp.h"
 36 /* SPI xfer timeout size */
 40 	(sizeof(struct vsc_tp_packet_hdr) + le16_to_cpu((pkt)->hdr.len) + VSC_TP_CRC_SIZE)
 46 	(len + sizeof(struct vsc_tp_packet_hdr) + VSC_TP_CRC_SIZE - offset + VSC_TP_PACKET_PADDING_SIZE)
 57 	__u8 buf[VSC_TP_MAX_XFER_SIZE - sizeof(struct vsc_tp_packet_hdr)];
 62 	struct spi_device *spi;  member
 95 	{ "wakeuphost-gpios", &wakeuphost_gpio, 1 },
 96 	{ "wakeuphostint-gpios", &wakeuphostint_gpio, 1 },
 [all …]
 
 | 
| /linux/drivers/input/keyboard/ | 
| H A D | applespi.c | 1 // SPDX-License-Identifier: GPL-2.03  * 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/drivers/iio/imu/ | 
| H A D | adis16550.c | 1 // SPDX-License-Identifier: GPL-2.023 #include <linux/spi/spi.h>
 75 /* SPI protocol*/
 136 	u8 crc = 0xa;  in spi_crc4()  local
 140 	/* Calculate crc4 over four-bit nibbles, starting at the MSbit */  in spi_crc4()
 141 	for (i = bits - 4; i >= 0; i -= 4)  in spi_crc4()
 142 		crc = crc ^ ((__val >> i) & 0xf);  in spi_crc4()
 144 	return crc;  in spi_crc4()
 151 	u8 crc, crc_rcv, sv;  in adis16550_spi_validate()  local
 157 	crc = spi_crc4(__dout);  in adis16550_spi_validate()
 [all …]
 
 | 
| H A D | smi240.c | 1 // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.011 #include <linux/spi/spi.h>
 153 	u8 crc = init;  in smi240_crc3()  local
 158 		do_xor = crc & 0x04;  in smi240_crc3()
 159 		crc <<= 1;  in smi240_crc3()
 160 		crc |= 0x01 & (data >> i);  in smi240_crc3()
 162 			crc ^= poly;  in smi240_crc3()
 164 		crc &= SMI240_CRC_MASK;  in smi240_crc3()
 165 	} while (--i >= 0);  in smi240_crc3()
 167 	return crc;  in smi240_crc3()
 [all …]
 
 | 
| /linux/drivers/net/ieee802154/ | 
| H A D | cc2520.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later2 /* Driver for TI CC2520 802.15.4 Wireless-PAN Networking controller
 12 #include <linux/spi/spi.h>
 18 #include <linux/crc-ccitt.h>
 47 /* IEEE-802.15.4 defined constants (2.4 GHz logical channels) */
 202 	struct spi_device *spi;		/* SPI device structure */  member
 203 	struct ieee802154_hw *hw;	/* IEEE-802.15.4 device */
 204 	u8 *buf;			/* SPI TX/Rx data buffer */
 205 	struct mutex buffer_mutex;	/* SPI buffer mutex */
 223 		.tx_buf = priv->buf,  in cc2520_cmd_strobe()
 [all …]
 
 | 
| /linux/arch/mips/cavium-octeon/executive/ | 
| H A D | cvmx-helper-spi.c | 7  * Copyright (C) 2003-2018 Cavium, Inc.14  * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
 21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 29  * Functions for SPI initialization, configuration,
 34 #include <asm/octeon/cvmx-config.h>
 35 #include <asm/octeon/cvmx-spi.h>
 36 #include <asm/octeon/cvmx-helper.h>
 38 #include <asm/octeon/cvmx-pip-defs.h>
 39 #include <asm/octeon/cvmx-pko-defs.h>
 40 #include <asm/octeon/cvmx-spxx-defs.h>
 [all …]
 
 | 
| /linux/Documentation/devicetree/bindings/net/ | 
| H A D | adi,adin1110.yaml | 1 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)3 ---
 5 $schema: http://devicetree.org/meta-schemas/core.yaml#
 7 title: ADI ADIN1110 MAC-PHY
 10   - Marcelo Schmitt <marcelo.schmitt@analog.com>
 13   The ADIN1110 is a low power single port 10BASE-T1L MAC-
 18   The ADIN2111 is a low power, low complexity, two-Ethernet ports
 19   switch with integrated 10BASE-T1L PHYs and one serial peripheral
 20   interface (SPI) port. The device is designed for industrial Ethernet
 22   with the IEEE 802.3cg-2019 Ethernet standard for long reach
 [all …]
 
 | 
| /linux/drivers/iio/accel/ | 
| H A D | sca3300.c | 1 // SPDX-License-Identifier: GPL-2.0-only3  * Murata SCA3300 3-axis industrial accelerometer
 13 #include <linux/spi/spi.h>
 181  * struct sca3300_data - device data
 182  * @spi: SPI device structure
 189 	struct spi_device *spi;  member
 242 	u8 crc;  in sca3300_transfer()  local
 245 			.tx_buf = sca_data->txbuf,  in sca3300_transfer()
 246 			.len = ARRAY_SIZE(sca_data->txbuf),  in sca3300_transfer()
 251 			.rx_buf = sca_data->rxbuf,  in sca3300_transfer()
 [all …]
 
 | 
| /linux/drivers/iio/adc/ | 
| H A D | ad7280a.c | 1 // SPDX-License-Identifier: GPL-2.022 #include <linux/spi/spi.h>
 129 #define AD7280A_NUM_CH			(AD7280A_AUX_ADC_6_REG - \
 135 					     (c) - AD7280A_CELLS_PER_DEV)
 143 /* 5-bit device address is sent LSB first */
 157  * So the TXVAL is AD7280A_DEVADDR_ALL + CRC
 162  * AD7280 CRC
 169 	struct spi_device		*spi;  member
 193 	unsigned char crc;  in ad7280_calc_crc8()  local
 195 	crc = crc_tab[val >> 16 & 0xFF];  in ad7280_calc_crc8()
 [all …]
 
 | 
| /linux/fs/jffs2/ | 
| H A D | summary.c | 2  * JFFS2 -- Journalling Flash File System, Version 2.4  * Copyright © 2004  Ferenc Havasi <havasi@inf.u-szeged.hu>,
 5  *		     Zoltan Sogor <weth@inf.u-szeged.hu>,
 6  *		     Patrik Kluba <pajko@halom.u-szeged.hu>,
 28 	uint32_t sum_size = min_t(uint32_t, c->sector_size, MAX_SUMMARY_SIZE);  in jffs2_sum_init()
 30 	c->summary = kzalloc(sizeof(struct jffs2_summary), GFP_KERNEL);  in jffs2_sum_init()
 32 	if (!c->summary) {  in jffs2_sum_init()
 34 		return -ENOMEM;  in jffs2_sum_init()
 37 	c->summary->sum_buf = kmalloc(sum_size, GFP_KERNEL);  in jffs2_sum_init()
 39 	if (!c->summary->sum_buf) {  in jffs2_sum_init()
 [all …]
 
 | 
| /linux/drivers/soc/samsung/ | 
| H A D | Kconfig | 1 # SPDX-License-Identifier: GPL-2.012 	bool "Exynos ASV ARMv7-specific driver extensions" if COMPILE_TEST
 33 	  IP-core found in modern Samsung Exynos SoCs, like Exynos850 and
 35 	  following serial protocols: UART, SPI or High Speed I2C.
 49 	bool "Exynos PMU ARMv7-specific driver extensions" if COMPILE_TEST
 53 	bool "S3C2410 PM Suspend Memory CRC"
 66 	int "S3C2410 PM Suspend CRC Chunksize (KiB)"
 70 	  Set the chunksize in Kilobytes of the CRC for checking memory
 72 	  the CRC data block will take more memory, but will identify any
 
 | 
| /linux/drivers/gpio/ | 
| H A D | gpio-max3191x.c | 1 // SPDX-License-Identifier: GPL-2.0-only3  * gpio-max3191x.c - GPIO driver for Maxim MAX3191x industrial serializer
 7  * The MAX3191x makes 8 digital 24V inputs available via SPI.
 8  * Multiple chips can be daisy-chained, the spec does not impose
 11  * Either of two modes is selectable: In 8-bit mode, only the state
 13  * In 16-bit mode, an additional status byte is clocked out with
 14  * a CRC and indicator bits for undervoltage and overtemperature.
 17  * readout of non-faulting chips in the same daisy-chain.
 21  * daisy-chain.
 23  * If the chips are hardwired to 8-bit mode ("modesel" pulled high),
 [all …]
 
 | 
| /linux/arch/mips/include/asm/octeon/ | 
| H A D | cvmx-pip.h | 7  * Copyright (c) 2003-2008 Cavium Networks14  * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
 21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 36 #include <asm/octeon/cvmx-wqe.h>
 37 #include <asm/octeon/cvmx-fpa.h>
 38 #include <asm/octeon/cvmx-pip-defs.h>
 103 	/* RGM+SPI 1 = partially received packet (buffering/bandwidth
 106 	/* RGM+SPI 2 = receive packet too large and truncated */
 113 	/* RGM+SPI 4 = max frame error (pkt len > max frame len) */
 116 	 * RGM 5 = nibble error (data not byte multiple - 100M and 10M
 [all …]
 
 | 
| /linux/arch/arm/boot/dts/st/ | 
| H A D | stm32f746.dtsi | 2  * Copyright 2015 - Maxime Coquelin <mcoquelin.stm32@gmail.com>4  * This file is dual-licensed: you can use it either under the terms
 43 #include "../armv7-m.dtsi"
 44 #include <dt-bindings/clock/stm32fx-clock.h>
 45 #include <dt-bindings/mfd/stm32f7-rcc.h>
 46 #include <dt-bindings/interrupt-controller/irq.h>
 49 	#address-cells = <1>;
 50 	#size-cells = <1>;
 53 		clk_hse: clk-hse {
 54 			#clock-cells = <0>;
 [all …]
 
 | 
| H A D | stm32f429.dtsi | 2  * Copyright 2015 - Maxime Coquelin <mcoquelin.stm32@gmail.com>4  * This file is dual-licensed: you can use it either under the terms
 22  *     MA 02110-1301 USA
 48 #include "../armv7-m.dtsi"
 49 #include <dt-bindings/clock/stm32fx-clock.h>
 50 #include <dt-bindings/mfd/stm32f4-rcc.h>
 53 	#address-cells = <1>;
 54 	#size-cells = <1>;
 57 		clk_hse: clk-hse {
 58 			#clock-cells = <0>;
 [all …]
 
 | 
| /linux/drivers/nfc/st95hf/ | 
| H A D | core.c | 1 // SPDX-License-Identifier: GPL-2.0-only3  * --------------------------------------------------------------------
 5  * --------------------------------------------------------------------
 24 #include "spi.h"
 100  * List of top-level cmds to be used internally by the driver.
 195  *	for spi communication between st95hf and host.
 250 	struct device *dev = &st95context->spicontext.spidev->dev;  in st95hf_send_recv_cmd()
 253 		return -EINVAL;  in st95hf_send_recv_cmd()
 255 		return -EINVAL;  in st95hf_send_recv_cmd()
 257 		return -EINVAL;  in st95hf_send_recv_cmd()
 [all …]
 
 | 
| /linux/drivers/net/dsa/sja1105/ | 
| H A D | sja1105_dynamic_config.c | 1 // SPDX-License-Identifier: GPL-2.02 /* Copyright (c) 2018-2019, Vladimir Oltean <olteanv@gmail.com>
 6 /* In the dynamic configuration interface, the switch exposes a register-like
 13  * This file creates a per-switch-family abstraction called
 15  * - sja1105_dynamic_config_write
 16  * - sja1105_dynamic_config_read
 25  * +-----------------------------------------+------------------+
 27  * +-----------------------------------------+------------------+
 29  * <----------------------- packed_size ------------------------>
 33  * function is reused (bar exceptional cases - see
 [all …]
 
 | 
| /linux/drivers/mfd/ | 
| H A D | tps6594-spi.c | 1 // SPDX-License-Identifier: GPL-2.03  * SPI access driver for the following TI PMICs:
 4  *  - LP8764
 5  *  - TPS65224
 6  *  - TPS652G1
 7  *  - TPS6593
 8  *  - TPS6594
 10  * Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/
 18 #include <linux/spi/spi.h>
 27 MODULE_PARM_DESC(enable_crc, "Enable CRC feature for SPI interface");
 [all …]
 
 |