Home
last modified time | relevance | path

Searched +full:spi +full:- +full:lsb +full:- +full:first (Results 1 – 25 of 38) sorted by relevance

12

/linux/Documentation/devicetree/bindings/spi/
H A Dicpdas-lp8841-spi-rtc.txt1 * ICP DAS LP-8841 SPI Controller for RTC
3 ICP DAS LP-8841 contains a DS-1302 RTC. RTC is connected to an IO
4 memory register, which acts as an SPI master device.
6 The device uses the standard MicroWire half-duplex transfer timing.
13 - #address-cells: should be 1
15 - #size-cells: should be 0
17 - compatible: should be "icpdas,lp8841-spi-rtc"
19 - reg: should provide IO memory address
21 Requirements to SPI slave nodes:
23 - There can be only one slave device.
[all …]
H A Dspi-peripheral-props.yaml1 # 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 …]
/linux/Documentation/devicetree/bindings/rtc/
H A Dmaxim-ds1302.txt1 * Maxim/Dallas Semiconductor DS-1302 RTC
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
32 spi@901c {
[all …]
/linux/drivers/iio/adc/
H A Dmax11100.c1 // SPDX-License-Identifier: GPL-2.0
6 * Copyright (C) 2016-17 Renesas Electronics Corporation
7 * Copyright (C) 2016-17 Jacopo Mondi
14 #include <linux/spi/spi.h>
21 * LSB is the ADC single digital step
22 * 1 LSB = (vref_mv / 2 ^ 16)
24 * LSB is used to calculate analog voltage value
27 * Ain = (count * LSB)
33 struct spi_device *spi; member
55 ret = spi_read(state->spi, state->buffer, sizeof(state->buffer)); in max11100_read_single()
[all …]
H A Dad7768-1.c1 // SPDX-License-Identifier: GPL-2.0
3 * Analog Devices AD7768-1 SPI ADC driver
17 #include <linux/spi/spi.h>
155 struct spi_device *spi; member
185 shift = 32 - (8 * len); in ad7768_spi_reg_read()
186 st->data.d8[0] = AD7768_RD_FLAG_MSK(addr); in ad7768_spi_reg_read()
188 ret = spi_write_then_read(st->spi, st->data.d8, 1, in ad7768_spi_reg_read()
189 &st->data.d32, len); in ad7768_spi_reg_read()
193 return (be32_to_cpu(st->data.d32) >> shift); in ad7768_spi_reg_read()
200 st->data.d8[0] = AD7768_WR_FLAG_MSK(addr); in ad7768_spi_reg_write()
[all …]
H A Dstm32-dfsdm-adc.c1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (C) 2017, STMicroelectronics - All Rights Reserved
10 #include <linux/dma-mapping.h>
11 #include <linux/iio/adc/stm32-dfsdm-adc.h>
14 #include <linux/iio/hw-consumer.h>
16 #include <linux/iio/timer/stm32-lptim-trigger.h>
17 #include <linux/iio/timer/stm32-timer-trigger.h>
29 #include "stm32-dfsdm.h"
44 /* Limit filter output resolution to 31 bits. (i.e. sample range is +/-2^30) */
48 * Data from filters are in the range +/-2^(n-1)
[all …]
/linux/tools/spi/
H A Dspidev_fdx.c1 // SPDX-License-Identifier: GPL-2.0
13 #include <linux/spi/spidev.h>
42 status -= 2; in do_read()
44 while (status-- > 0) in do_read()
75 for (bp = buf; len; len--) in do_msg()
82 __u8 lsb, bits; in dumpstat() local
86 perror("SPI rd_mode"); in dumpstat()
89 if (ioctl(fd, SPI_IOC_RD_LSB_FIRST, &lsb) < 0) { in dumpstat()
90 perror("SPI rd_lsb_fist"); in dumpstat()
94 perror("SPI bits_per_word"); in dumpstat()
[all …]
/linux/drivers/mfd/
H A Docelot-spi.c1 // 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>
24 #include <linux/spi/spi.h>
63 * The SPI address must be big-endian, but we want the payload to match in ocelot_spi_initialize()
68 * 0b00: little-endian, MSB first in ocelot_spi_initialize()
72 * 0b01: big-endian, MSB first in ocelot_spi_initialize()
[all …]
/linux/drivers/spi/
H A Dspi-lp8841-rtc.c1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * SPI host driver for ICP DAS LP-8841 RTC
11 * Copyright (C) 2003 - 2007 Paul Mundt
18 #include <linux/spi/spi.h>
29 * REVISIT If there is support for SPI_3WIRE and SPI_LSB_FIRST in SPI
30 * GPIO driver, this SPI driver can be replaced by a simple GPIO driver
43 data->state |= SPI_LP8841_RTC_CLK; in setsck()
45 data->state &= ~SPI_LP8841_RTC_CLK; in setsck()
46 writeb(data->state, data->iomem); in setsck()
53 data->state |= SPI_LP8841_RTC_MOSI; in setmosi()
[all …]
H A Dspi-ppc4xx.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * SPI_PPC4XX SPI controller driver.
9 * Based in part on drivers/spi/spi_s3c24xx.c
17 * The PPC4xx SPI controller has no FIFO so each sent/received byte will
20 * during SPI transfers by setting max_speed_hz via the device tree.
35 #include <linux/spi/spi.h>
36 #include <linux/spi/spi_bitbang.h>
39 #include <asm/dcr-regs.h>
41 /* bits in mode register - bit 0 is MSb */
54 * SPI_PPC4XX_MODE_RD = 0 means "MSB first" - this is the normal mode
[all …]
/linux/Documentation/spi/
H A Dspidev.rst2 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,
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.
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:
38 - struct spi_device_id spidev_spi_ids[]: list of devices that can be
42 - struct of_device_id spidev_dt_ids[]: list of devices that can be
[all …]
H A Dspi-summary.rst2 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
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/crypto/caam/
H A Dpdb.h1 /* SPDX-License-Identifier: GPL-2.0 */
5 * Copyright 2008-2016 Freescale Semiconductor, Inc.
14 * PDB- IPSec ESP Header Modification Options
19 * Encap and Decap - Decrement TTL (Hop Limit) - Based on the value of the
27 * Decap - DiffServ Copy - Copy the IPv4 TOS or IPv6 Traffic Class byte
32 * Encap- Copy DF bit -if an IPv4 tunnel mode outer IP header is coming from
47 * PDB - IPSec ESP Encap/Decap Options
50 #define PDBOPTS_ESP_ARS32 0x40 /* 32-entry antireplay window */
51 #define PDBOPTS_ESP_ARS128 0x80 /* 128-entry antireplay window */
52 #define PDBOPTS_ESP_ARS64 0xc0 /* 64-entry antireplay window */
[all …]
/linux/drivers/iio/resolver/
H A Dad2s1210.c1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (c) 2010-2010 Analog Devices Inc.
11 * ------
1545 ad2s1210_probe(struct spi_device * spi) ad2s1210_probe() argument
[all...]
/linux/drivers/char/tpm/
H A Dtpm_tis_spi_cr50.c1 // SPDX-License-Identifier: GPL-2.0
5 * This device driver implements a TCG PTP FIFO interface over SPI for chips
15 #include <linux/spi/spi.h>
23 * - can go to sleep not earlier than after CR50_SLEEP_DELAY_MSEC.
24 * - needs up to CR50_WAKE_START_DELAY_USEC to wake after sleep.
25 * - requires waiting for "ready" IRQ, if supported; or waiting for at least
27 * - waits for up to CR50_FLOW_CONTROL for flow control 'ready' indication.
69 cr50_phy->irq_confirmed = true; in cr50_spi_irq_handler()
70 complete(&cr50_phy->spi_phy.ready); in cr50_spi_irq_handler()
81 unsigned long allowed_access = phy->last_access + phy->access_delay; in cr50_ensure_access_delay()
[all …]
/linux/drivers/net/wireless/ti/wlcore/
H A Dspi.c1 // 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",
91 struct wl12xx_spi_glue *glue = dev_get_drvdata(child->parent); in wl12xx_spi_reset()
[all …]
/linux/drivers/hwmon/
H A Dadt7411.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * Driver for the ADT7411 (I2C/SPI 8 channel 10 bit ADC & temperature-sensor)
7 * TODO: SPI, use power-down mode for suspend?, interrupt handling?
18 #include <linux/hwmon-sysfs.h>
63 ? 0x2b + 2 * ((nr)-2) \
66 ? 0x2c + 2 * ((nr)-2) \
111 * When reading a register containing (up to 4) lsb, all associated
112 * msb-registers get locked by the hardware. After _one_ of those msb is read,
113 * _all_ are unlocked. In order to use this locking correctly, reading lsb/msb
122 mutex_lock(&data->device_lock); in adt7411_read_10_bit()
[all …]
/linux/drivers/iio/imu/
H A Dadis16475.c1 // SPDX-License-Identifier: GPL-2.0
25 #include <linux/spi/spi.h>
75 /* spi max speed in brust mode */
171 struct adis16475 *st = file->private_data; in adis16475_show_firmware_revision()
177 ret = adis_read_reg_16(&st->adis, ADIS16475_REG_FIRM_REV, &rev); in adis16475_show_firmware_revision()
197 struct adis16475 *st = file->private_data; in adis16475_show_firmware_date()
203 ret = adis_read_reg_16(&st->adis, ADIS16475_REG_FIRM_Y, &year); in adis16475_show_firmware_date()
207 ret = adis_read_reg_16(&st->adis, ADIS16475_REG_FIRM_DM, &md); in adis16475_show_firmware_date()
211 len = snprintf(buf, sizeof(buf), "%.2x-%.2x-%.4x\n", md >> 8, md & 0xff, in adis16475_show_firmware_date()
230 ret = adis_read_reg_16(&st->adis, ADIS16475_REG_SERIAL_NUM, &serial); in adis16475_show_serial_number()
[all …]
H A Dadis16480.c1 // SPDX-License-Identifier: GPL-2.0-only
15 #include <linux/spi/spi.h>
116 ADIS16480_REG((page) + 1, (x) - 60 + 8))
199 struct adis16480 *adis16480 = file->private_data; in adis16480_show_firmware_revision()
205 ret = adis_read_reg_16(&adis16480->adis, ADIS16480_REG_FIRM_REV, &rev); in adis16480_show_firmware_revision()
224 struct adis16480 *adis16480 = file->private_data; in adis16480_show_firmware_date()
230 ret = adis_read_reg_16(&adis16480->adis, ADIS16480_REG_FIRM_Y, &year); in adis16480_show_firmware_date()
234 ret = adis_read_reg_16(&adis16480->adis, ADIS16480_REG_FIRM_DM, &md); in adis16480_show_firmware_date()
238 len = snprintf(buf, sizeof(buf), "%.2x-%.2x-%.4x\n", in adis16480_show_firmware_date()
257 ret = adis_read_reg_16(&adis16480->adis, ADIS16480_REG_SERIAL_NUM, in adis16480_show_serial_number()
[all …]
/linux/arch/powerpc/include/asm/
H A Dcpm1.h1 /* SPDX-License-Identifier: GPL-2.0 */
11 * are needed. -- Dan
13 * On the MBX board, EPPC-Bug loads CPM microcode into the first 512
38 #define CPM_CR_CH_SPI ((ushort)0x0005) /* SPI / IDMA2 / Timers */
331 uint sen_tbuf0data0; /* Save area 0 - current frame */
332 uint sen_tbuf0data1; /* Save area 1 - current frame */
338 ushort sen_paddrl; /* physical address (LSB) */
340 ushort sen_rfbdptr; /* Rx first BD pointer */
341 ushort sen_tfbdptr; /* Tx first BD pointer */
343 uint sen_tbuf1data0; /* Save area 0 - current frame */
[all …]
/linux/Documentation/scsi/
H A Dscsi_mid_low_api.rst1 .. SPDX-License-Identifier: GPL-2.0
4 SCSI mid_level - lower_level driver interface
14 (SCSI terminology, see SAM-3 at http://www.t10.org) sends SCSI commands
22 Examples are the usb-storage driver (found in the drivers/usb/storage
27 (SPI) controllers based on that company's 7xxx chip series. The aic7xxx
30 HBAs. These HBAs might be either on PCI daughter-boards or built into
33 has its own PCI device address. [The one-to-one correspondence between
49 documented in Documentation/scsi (e.g. aic7xxx.rst). The SCSI mid-level is
53 scsi-generic.rst (for the sg driver).
68 and OS-specific code (e.g. FreeBSD and Linux). Such drivers tend to have
[all …]
/linux/drivers/scsi/qla2xxx/
H A Dqla_def.h1 /* SPDX-License-Identifier: GPL-2.0-only */
4 * Copyright (c) 2003-2014 QLogic Corporation
15 #include <linux/dma-mapping.h>
140 #define LSB(x) ((uint8_t)(x)) macro
234 /* 83XX: Macros defining 8200 AEN Error-levels */
248 /* 83XX: Macros for defining IDC-Control bits */
257 /* 83XX: Macros for defining class in DEV-Partition Info register */
263 /* 83XX: Macros for IDC Lock-Recovery stages */
265 * lock-recovery
267 #define IDC_LOCK_RECOVERY_STAGE2 0x2 /* Stage2: Perform lock-recovery */
[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 …]
/linux/drivers/net/ethernet/intel/e1000/
H A De1000_hw.c1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright(c) 1999 - 2006 Intel Corporation. */
89 * e1000_set_phy_type - Set the phy type member in the hw struct.
94 if (hw->mac_type == e1000_undefined) in e1000_set_phy_type()
95 return -E1000_ERR_PHY_TYPE; in e1000_set_phy_type()
97 switch (hw->phy_id) { in e1000_set_phy_type()
103 hw->phy_type = e1000_phy_m88; in e1000_set_phy_type()
106 if (hw->mac_type == e1000_82541 || in e1000_set_phy_type()
107 hw->mac_type == e1000_82541_rev_2 || in e1000_set_phy_type()
108 hw->mac_type == e1000_82547 || in e1000_set_phy_type()
[all …]
/linux/drivers/usb/serial/
H A Df81534.c1 // SPDX-License-Identifier: GPL-2.0+
12 * The F81532/F81534 had 1 control endpoint for setting, 1 endpoint bulk-out
13 * for all serial port TX and 1 endpoint bulk-in for all serial port read in
87 * We used interal SPI bus to access FLASH section. We must wait the SPI bus to
90 * SPI Bus status register: F81534_BUS_REG_STATUS
122 * Bit2-1: Clock source selector
197 usb_get_serial_data(port->serial); in f81534_logic_to_phy_port()
202 if (serial_priv->conf_data[i] & F81534_PORT_UNAVAILABLE) in f81534_logic_to_phy_port()
205 if (port->port_number == count) in f81534_logic_to_phy_port()
211 return -ENODEV; in f81534_logic_to_phy_port()
[all …]

12