Home
last modified time | relevance | path

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

1234

/linux/drivers/net/wireless/microchip/wilc1000/
H A Dspi.c1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2012 - 2018 Microchip Technology Inc., and its subsidiaries.
8 #include <linux/spi/spi.h>
10 #include <linux/crc-itu-t.h>
18 static bool enable_crc7; /* protect SPI commands with CRC7 */
22 "\t\t\tagainst corruption during the SPI transfer.\n"
23 "\t\t\tCommand transfers are short and the CPU-cycle cost\n"
26 static bool enable_crc16; /* protect SPI data with CRC16 */
30 "\t\t\tagainst corruption during the SPI transfer.\n"
31 "\t\t\tData transfers can be large and the CPU-cycle cost\n"
[all …]
/linux/drivers/net/can/spi/mcp251xfd/
H A Dmcp251xfd-regmap.c1 // SPDX-License-Identifier: GPL-2.0
3 // 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 Dmcp251xfd-tx.c1 // SPDX-License-Identifier: GPL-2.0
3 // 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 Dmcp251xfd-ring.c1 // SPDX-License-Identifier: GPL-2.0
3 // 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
18 #include "mcp251xfd-ram.h"
31 len = last_byte - first_byte + 1; in mcp251xfd_cmd_prepare_write_reg()
37 if (!(priv->devtype_data.quirks & MCP251XFD_QUIRK_CRC_REG)) { in mcp251xfd_cmd_prepare_write_reg()
38 len += sizeof(write_reg_buf->nocrc.cmd); in mcp251xfd_cmd_prepare_write_reg()
40 u16 crc; in mcp251xfd_cmd_prepare_write_reg() local
42 /* CRC */ in mcp251xfd_cmd_prepare_write_reg()
[all …]
H A Dmcp251xfd-core.c1 // SPDX-License-Identifier: GPL-2.0
3 // 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. */
97 return __mcp251xfd_get_model_str(priv->devtype_data.model); in mcp251xfd_get_model_str()
142 if (!priv->reg_vdd) in mcp251xfd_vdd_enable()
145 return regulator_enable(priv->reg_vdd); in mcp251xfd_vdd_enable()
150 if (!priv->reg_vdd) in mcp251xfd_vdd_disable()
153 return regulator_disable(priv->reg_vdd); in mcp251xfd_vdd_disable()
[all …]
H A Dmcp251xfd.h1 /* SPDX-License-Identifier: GPL-2.0
3 * 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 Dmcp251xfd-crc16.c1 // SPDX-License-Identifier: GPL-2.0
3 // 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 Dleds-cr0014114.c1 // SPDX-License-Identifier: GPL-2.0
9 #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 Dspi.c1 // SPDX-License-Identifier: GPL-2.0-only
11 #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 Dvsc-tp.c1 // SPDX-License-Identifier: GPL-2.0-only
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 },
92 { "resetfw-gpios", &resetfw_gpio, 1 },
[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 …]
/linux/drivers/net/ieee802154/
H A Dcc2520.c1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /* 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 Dcvmx-helper-spi.c7 * 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/drivers/mmc/host/
H A Dmmc_spi.c1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Access SD/MMC cards through SPI master controllers
7 * (C) Copyright 2006-2007, David Brownell
9 * Hans-Peter Nilsson (hp@axis.com)
19 #include <linux/crc-itu-t.h>
24 #include <linux/mmc/slot-gpio.h>
26 #include <linux/spi/spi.h>
27 #include <linux/spi/mmc_spi.h>
34 * - For now, we won't try to interoperate with a real mmc/sd/sdio
36 * SPI protocol. The main reason for such configs would be mmc-ish
[all …]
/linux/Documentation/devicetree/bindings/net/
H A Dadi,adin1110.yaml1 # 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 - Alexandru Tachici <alexandru.tachici@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 Dsca3300.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * Murata SCA3300 3-axis industrial accelerometer
13 #include <linux/spi/spi.h>
192 * struct sca3300_data - device data
193 * @spi: SPI device structure
197 * -SCA3300: 4 channel 16-bit data + 64-bit timestamp
198 * -SCL3300: 7 channel 16-bit data + 64-bit timestamp
203 struct spi_device *spi; member
257 u8 crc; in sca3300_transfer() local
260 .tx_buf = sca_data->txbuf, in sca3300_transfer()
[all …]
/linux/drivers/iio/adc/
H A Dad7280a.c1 // SPDX-License-Identifier: GPL-2.0
22 #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 Dsummary.c2 * 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 DKconfig1 # SPDX-License-Identifier: GPL-2.0
12 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 Dgpio-max3191x.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * 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 Dcvmx-pip.h7 * Copyright (c) 2003-2008 Cavium Networks
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
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 Dstm32f746.dtsi2 * 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>
48 #address-cells = <1>;
49 #size-cells = <1>;
52 clk_hse: clk-hse {
53 #clock-cells = <0>;
54 compatible = "fixed-clock";
[all …]
H A Dstm32f429.dtsi2 * 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 Dcore.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * --------------------------------------------------------------------
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 Dsja1105_dynamic_config.c1 // SPDX-License-Identifier: GPL-2.0
2 /* 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 …]

1234