/openbmc/linux/drivers/net/wireless/microchip/wilc1000/ |
H A D | spi.c | 1 // 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 …]
|
/openbmc/linux/drivers/net/can/spi/mcp251xfd/ |
H A D | mcp251xfd-regmap.c | 1 // 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 D | mcp251xfd-tx.c | 1 // 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 D | mcp251xfd-ring.c | 1 // 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 D | mcp251xfd-core.c | 1 // 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 D | mcp251xfd-crc16.c | 1 // 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 …]
|
H A D | mcp251xfd.h | 1 /* 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 …]
|
/openbmc/linux/drivers/leds/ |
H A D | leds-cr0014114.c | 1 // 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 …]
|
/openbmc/u-boot/drivers/mmc/ |
H A D | mmc_spi.c | 2 * generic mmc spi driver 5 * Licensed under the GPL-2 or later. 12 #include <spi.h> 13 #include <u-boot/crc.h> 17 /* MMC/SD in SPI mode reports R1 status always */ 34 /* Read and write blocks start with these tokens and end with crc; 41 /* MMC SPI commands start with a start bit "0" and a transmit bit "1" */ 55 struct spi_slave *spi = mmc->priv; in mmc_spi_sendcmd() local 66 spi_xfer(spi, sizeof(cmdo) * 8, cmdo, NULL, 0); in mmc_spi_sendcmd() 68 spi_xfer(spi, 1 * 8, NULL, &r1, 0); in mmc_spi_sendcmd() [all …]
|
/openbmc/linux/net/nfc/nci/ |
H A D | spi.c | 1 // 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 …]
|
/openbmc/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 …]
|
/openbmc/u-boot/board/gardena/smart-gateway-mt7688/ |
H A D | board.c | 1 // SPDX-License-Identifier: GPL-2.0+ 10 #include <spi.h> 21 #error "U-Boot image with environment too big (overlapping with factory-data)!" 25 #define FACTORY_DATA_CRC_LEN (FACTORY_DATA_SIZE - \ 26 FACTORY_DATA_USER_OFFS - sizeof(u32)) 35 u8 pad_3[FACTORY_DATA_USER_OFFS - 4 - 6 - 30 - 6]; 37 u32 crc; member 66 /* Convert non-ascii character to 'X' */ in prepare_uuid_var() 89 u32 crc; in factory_data_env_config() local 95 printf("F-Data:Unable to allocate buffer\n"); in factory_data_env_config() [all …]
|
/openbmc/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 …]
|
/openbmc/linux/drivers/net/ieee802154/ |
H A D | cc2520.c | 1 // 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 …]
|
/openbmc/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 - 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 …]
|
/openbmc/linux/drivers/mmc/host/ |
H A D | mmc_spi.c | 1 // 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) 18 #include <linux/dma-direction.h> 20 #include <linux/crc-itu-t.h> 25 #include <linux/mmc/slot-gpio.h> 27 #include <linux/spi/spi.h> 28 #include <linux/spi/mmc_spi.h> 35 * - For now, we won't try to interoperate with a real mmc/sd/sdio [all …]
|
/openbmc/linux/drivers/iio/accel/ |
H A D | sca3300.c | 1 // 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 …]
|
/openbmc/linux/drivers/iio/adc/ |
H A D | ad7280a.c | 1 // SPDX-License-Identifier: GPL-2.0 21 #include <linux/spi/spi.h> 128 #define AD7280A_NUM_CH (AD7280A_AUX_ADC_6_REG - \ 134 (c) - AD7280A_CELLS_PER_DEV) 142 /* 5-bit device address is sent LSB first */ 156 * So the TXVAL is AD7280A_DEVADDR_ALL + CRC 161 * AD7280 CRC 168 struct spi_device *spi; member 192 unsigned char crc; in ad7280_calc_crc8() local 194 crc = crc_tab[val >> 16 & 0xFF]; in ad7280_calc_crc8() [all …]
|
/openbmc/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 …]
|
/openbmc/linux/drivers/soc/samsung/ |
H A D | Kconfig | 1 # 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. 48 bool "Exynos PMU ARMv7-specific driver extensions" if COMPILE_TEST 56 bool "S3C2410 PM Suspend Memory CRC" 69 int "S3C2410 PM Suspend CRC Chunksize (KiB)" 73 Set the chunksize in Kilobytes of the CRC for checking memory 75 the CRC data block will take more memory, but will identify any
|
/openbmc/linux/drivers/gpio/ |
H A D | gpio-max3191x.c | 1 // 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 …]
|
/openbmc/linux/arch/mips/include/asm/octeon/ |
H A D | cvmx-pip.h | 7 * 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 …]
|
/openbmc/linux/drivers/mfd/ |
H A D | tps6594-spi.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * SPI access driver for TI TPS6594/TPS6593/LP8764 PMICs 5 * Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/ 13 #include <linux/spi/spi.h> 22 MODULE_PARM_DESC(enable_crc, "Enable CRC feature for SPI interface"); 28 struct spi_device *spi = context; in tps6594_spi_reg_read() local 29 struct tps6594 *tps = spi_get_drvdata(spi); in tps6594_spi_reg_read() 37 if (tps->use_crc) in tps6594_spi_reg_read() 40 ret = spi_write_then_read(spi, buf, 2, buf + 2, count_rx); in tps6594_spi_reg_read() 44 if (tps->use_crc && buf[3] != crc8(tps6594_spi_crc_table, buf, 3, CRC8_INIT_VALUE)) in tps6594_spi_reg_read() [all …]
|
/openbmc/linux/drivers/nfc/st95hf/ |
H A D | core.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * -------------------------------------------------------------------- 5 * -------------------------------------------------------------------- 25 #include "spi.h" 101 * List of top-level cmds to be used internally by the driver. 196 * for spi communication between st95hf and host. 251 struct device *dev = &st95context->spicontext.spidev->dev; in st95hf_send_recv_cmd() 254 return -EINVAL; in st95hf_send_recv_cmd() 256 return -EINVAL; in st95hf_send_recv_cmd() 258 return -EINVAL; in st95hf_send_recv_cmd() [all …]
|
/openbmc/linux/drivers/iio/imu/ |
H A D | adis16475.c | 1 // SPDX-License-Identifier: GPL-2.0 24 #include <linux/spi/spi.h> 64 /* spi max speed in brust mode */ 130 struct adis16475 *st = file->private_data; in adis16475_show_firmware_revision() 136 ret = adis_read_reg_16(&st->adis, ADIS16475_REG_FIRM_REV, &rev); in adis16475_show_firmware_revision() 156 struct adis16475 *st = file->private_data; in adis16475_show_firmware_date() 162 ret = adis_read_reg_16(&st->adis, ADIS16475_REG_FIRM_Y, &year); in adis16475_show_firmware_date() 166 ret = adis_read_reg_16(&st->adis, ADIS16475_REG_FIRM_DM, &md); in adis16475_show_firmware_date() 170 len = snprintf(buf, sizeof(buf), "%.2x-%.2x-%.4x\n", md >> 8, md & 0xff, in adis16475_show_firmware_date() 189 ret = adis_read_reg_16(&st->adis, ADIS16475_REG_SERIAL_NUM, &serial); in adis16475_show_serial_number() [all …]
|