Home
last modified time | relevance | path

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

12345678910>>...19

/OK3568_Linux_fs/u-boot/include/
H A Dspi.h2 * Common SPI Interface: Controller-specific definitions
7 * SPDX-License-Identifier: GPL-2.0+
15 /* SPI mode flags */
23 #define SPI_LSB_FIRST BIT(3) /* per-word bits-on-wire */
26 #define SPI_SLAVE BIT(6) /* slave mode */
44 * struct dm_spi_bus - SPI bus info
46 * This contains information about a SPI bus. To obtain this structure, use
47 * dev_get_uclass_priv(bus) where bus is the SPI bus udevice.
62 * struct dm_spi_platdata - platform data for all SPI slaves
64 * This describes a SPI slave, a child device of the SPI bus. To obtain this
[all …]
H A Dspi-mem.h1 /* SPDX-License-Identifier: GPL-2.0+ */
17 #include <spi.h>
61 * enum spi_mem_data_dir - describes the direction of a SPI memory data
63 * @SPI_MEM_DATA_IN: data coming from the SPI memory
64 * @SPI_MEM_DATA_OUT: data sent the SPI memory
72 * struct spi_mem_op - describes a SPI memory operation
111 /* buf.{in,out} must be DMA-able. */
129 * struct spi_mem - describes a SPI memory device
130 * @spi: the underlying SPI device
133 * Extra information that describe the SPI memory device and may be needed by
[all …]
/OK3568_Linux_fs/u-boot/drivers/spi/
H A Dmpc8xxx_spi.c5 * SPDX-License-Identifier: GPL-2.0+
11 #include <spi.h>
18 #define SPI_MODE_REV (0x80000000 >> 5) /* Reverse mode - MSB first */
27 struct spi_slave *slave; in spi_setup_slave() local
32 slave = spi_alloc_slave_base(bus, cs); in spi_setup_slave()
33 if (!slave) in spi_setup_slave()
41 return slave; in spi_setup_slave()
44 void spi_free_slave(struct spi_slave *slave) in spi_free_slave() argument
46 free(slave); in spi_free_slave()
51 volatile spi8xxx_t *spi = &((immap_t *) (CONFIG_SYS_IMMR))->spi; in spi_init() local
[all …]
H A Dspi-uclass.c4 * SPDX-License-Identifier: GPL-2.0+
11 #include <spi.h>
12 #include <dm/device-internal.h>
13 #include <dm/uclass-internal.h>
27 if (ops->set_speed) in spi_set_speed_mode()
28 ret = ops->set_speed(bus, speed); in spi_set_speed_mode()
30 ret = -EINVAL; in spi_set_speed_mode()
36 if (ops->set_mode) in spi_set_speed_mode()
37 ret = ops->set_mode(bus, mode); in spi_set_speed_mode()
39 ret = -EINVAL; in spi_set_speed_mode()
[all …]
H A Dspi-mem.c1 // SPDX-License-Identifier: GPL-2.0+
14 #include <spi.h>
15 #include <spi-mem.h>
20 * spi_controller_dma_map_mem_op_data() - DMA-map the buffer attached to a
22 * @ctlr: the SPI controller requesting this dma_map()
24 * @sgt: a pointer to a non-initialized sg_table that will be filled by this
28 * This helper prepares everything for you and provides a ready-to-use
29 * sg_table. This function is not intended to be called from spi drivers.
30 * Only SPI controller drivers should use it.
32 * op->data.buf.{in,out} is DMA-able before calling this function.
[all …]
H A Dkirkwood_spi.c4 * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
6 * Derived from drivers/spi/mpc8xxx_spi.c
8 * SPDX-License-Identifier: GPL-2.0+
14 #include <spi.h>
20 #include <asm/arch-mvebu/spi.h>
24 setbits_le32(&reg->ctrl, KWSPI_CSN_ACT); in _spi_cs_activate()
29 clrbits_le32(&reg->ctrl, KWSPI_CSN_ACT); in _spi_cs_deactivate()
44 * handle data in 8-bit chunks in _spi_xfer()
47 clrsetbits_le32(&reg->cfg, KWSPI_XFERLEN_MASK, KWSPI_XFERLEN_1BYTE); in _spi_xfer()
53 /* Shift data so it's msb-justified */ in _spi_xfer()
[all …]
H A Ddavinci_spi.c2 * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
4 * Driver for SPI controller on DaVinci. Based on atmel_spi.c
9 * SPDX-License-Identifier: GPL-2.0+
13 #include <spi.h>
70 * define CONFIG_SYS_SPI1 when platform has spi-1 device (bus #1) and
80 * define CONFIG_SYS_SPI2 when platform has spi-2 device (bus #2) and
92 /* davinci spi register set */
120 /* davinci spi slave */
123 struct spi_slave slave; member
126 unsigned int freq; /* current SPI bus frequency */
[all …]
H A Dsh_qspi.c2 * SH QSPI (Quad SPI) driver
7 * SPDX-License-Identifier: GPL-2.0
13 #include <spi.h>
71 struct spi_slave slave; member
75 static inline struct sh_qspi_slave *to_sh_qspi(struct spi_slave *slave) in to_sh_qspi() argument
77 return container_of(slave, struct sh_qspi_slave, slave); in to_sh_qspi()
84 writeb(SPCR_MSTR, &ss->regs->spcr); in sh_qspi_init()
87 writeb(0x00, &ss->regs->sslp); in sh_qspi_init()
90 writeb(SPPCR_IO3FV|SPPCR_IO2FV, &ss->regs->sppcr); in sh_qspi_init()
93 writeb(0x01, &ss->regs->spbr); in sh_qspi_init()
[all …]
H A Dsoft_spi_legacy.c8 * SPDX-License-Identifier: GPL-2.0+
12 #include <spi.h>
16 /*-----------------------------------------------------------------------
27 struct spi_slave slave; member
31 static inline struct soft_spi_slave *to_soft_spi(struct spi_slave *slave) in to_soft_spi() argument
33 return container_of(slave, struct soft_spi_slave, slave); in to_soft_spi()
40 /*-----------------------------------------------------------------------
59 ss->mode = mode; in spi_setup_slave()
63 return &ss->slave; in spi_setup_slave()
66 void spi_free_slave(struct spi_slave *slave) in spi_free_slave() argument
[all …]
H A Dlpc32xx_ssp.c2 * LPC32xx SSP interface (SPI mode)
5 * Written-by: Albert ARIBAUD <albert.aribaud@3adev.fr>
7 * SPDX-License-Identifier: GPL-2.0+
14 #include <spi.h>
39 /* lpc32xx spi slave */
41 struct spi_slave slave; member
46 struct spi_slave *slave) in to_lpc32xx_spi_slave() argument
48 return container_of(slave, struct lpc32xx_spi_slave, slave); in to_lpc32xx_spi_slave()
69 pr_err("3-wire mode not supported"); in spi_setup_slave()
74 pr_err("slave mode not supported\n"); in spi_setup_slave()
[all …]
H A Dmxs_spi.c2 * Freescale i.MX28 SPI driver
7 * SPDX-License-Identifier: GPL-2.0+
9 * NOTE: This driver only supports the SPI-controller chipselects,
16 #include <spi.h>
20 #include <asm/arch/imx-regs.h>
22 #include <asm/mach-imx/dma.h>
32 struct spi_slave slave; member
38 static inline struct mxs_spi_slave *to_mxs_slave(struct spi_slave *slave) in to_mxs_slave() argument
40 return container_of(slave, struct mxs_spi_slave, slave); in to_mxs_slave()
49 /* MXS SPI: 4 ports and 3 chip selects maximum */ in spi_cs_is_valid()
[all …]
H A Dmxc_spi.c4 * SPDX-License-Identifier: GPL-2.0+
10 #include <spi.h>
14 #include <asm/arch/imx-regs.h>
16 #include <asm/mach-imx/spi.h>
30 return -1; in board_spi_cs_gpio()
43 struct spi_slave slave; member
56 static inline struct mxc_spi_slave *to_mxc_spi_slave(struct spi_slave *slave) in to_mxc_spi_slave() argument
58 return container_of(slave, struct mxc_spi_slave, slave); in to_mxc_spi_slave()
64 dm_gpio_set_value(&mxcs->ss, mxcs->ss_pol); in mxc_spi_cs_activate()
66 if (mxcs->gpio > 0) in mxc_spi_cs_activate()
[all …]
/OK3568_Linux_fs/kernel/Documentation/spi/
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 master/slave configuration.
15 and parallel data lines with "Master Out, Slave In" (MOSI) or "Master In,
16 Slave Out" (MISO) signals. (Other names are also used.) There are four
17 clocking modes through which data is exchanged; mode-0 and mode-3 are most
22 SPI masters use a fourth "chip select" line to activate a given SPI slave
[all …]
H A Dpxa2xx.rst2 PXA2xx SPI on SSP driver HOWTO
6 synchronous serial port into a SPI master controller
7 (see Documentation/spi/spi-summary.rst). The driver has the following features
9 - Support for any PXA2xx SSP
10 - SSP PIO and SSP DMA data transfers.
11 - External and Internal (SSPFRM) chip selects.
12 - Per slave device (chip) configuration.
13 - Full suspend, freeze, resume support.
17 (pump_transfer) is responsible for queuing SPI transactions and setting up and
21 -----------------------------------
[all …]
/OK3568_Linux_fs/kernel/drivers/spi/
H A DKconfig1 # SPDX-License-Identifier: GPL-2.0-only
3 # SPI driver configuration
5 menuconfig SPI config
6 bool "SPI support"
10 protocol. Chips that support SPI can have data transfer rates
12 controller and a chipselect. Most SPI slaves don't support
13 dynamic device discovery; some are even write-only or read-only.
15 SPI is widely used by microcontrollers to talk with sensors,
17 chips, analog to digital (and d-to-a) converters, and more.
18 MMC and SD cards can be accessed using SPI protocol; and for
[all …]
H A Dspi-slave-time.c2 * SPI slave handler reporting uptime at reception of previous SPI message
4 * This SPI slave handler sends the time of reception of the last SPI message
5 * as two 32-bit unsigned integers in binary format and in network byte order,
9 * Copyright (C) 2016-2017 Glider bvba
15 * Usage (assuming /dev/spidev2.0 corresponds to the SPI master on the remote
18 * # spidev_test -D /dev/spidev2.0 -p dummy-8B
19 * spi mode: 0x0
30 #include <linux/spi/spi.h>
34 struct spi_device *spi; member
48 ret = priv->msg.status; in spi_slave_time_complete()
[all …]
/OK3568_Linux_fs/kernel/drivers/base/regmap/
H A Dregmap-spi-avmm.c1 // SPDX-License-Identifier: GPL-2.0
3 // Register map access API - SPI AVMM support
5 // Copyright (C) 2018-2020 Intel Corporation. All rights reserved.
9 #include <linux/spi/spi.h>
12 * This driver implements the regmap operations for a generic SPI
13 * master to access the registers of the spi slave chip which has an
16 * The "SPI slave to Avalon Master Bridge" (spi-avmm) IP should be integrated
17 * in the spi slave chip. The IP acts as a bridge to convert encoded streams of
19 * order to issue register access requests to the slave chip, the host should
27 * Chapter "SPI Slave/JTAG to Avalon Master Bridge Cores" is a general
[all …]
/OK3568_Linux_fs/u-boot/drivers/power/
H A Dpower_spi.c8 * (C) Copyright 2008-2009 Freescale Semiconductor, Inc.
10 * SPDX-License-Identifier: GPL-2.0+
16 #include <spi.h>
18 static struct spi_slave *slave; variable
25 if (!slave) { in pmic_reg()
26 slave = spi_setup_slave(p->bus, p->hw.spi.cs, p->hw.spi.clk, in pmic_reg()
27 p->hw.spi.mode); in pmic_reg()
29 if (!slave) in pmic_reg()
30 return -ENODEV; in pmic_reg()
34 return -EINVAL; in pmic_reg()
[all …]
/OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/spi/
H A Dspi-controller.yaml1 # SPDX-License-Identifier: GPL-2.0
3 ---
4 $id: http://devicetree.org/schemas/spi/spi-controller.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
7 title: SPI Controller Generic Binding
10 - Mark Brown <broonie@kernel.org>
13 SPI busses can be described with a node for the SPI controller device
14 and a set of child nodes for each SPI slave on the bus. The system SPI
15 controller may be described for use in SPI master mode or in SPI slave mode,
20 pattern: "^spi(@.*|-[0-9a-f])*$"
[all …]
/OK3568_Linux_fs/u-boot/doc/device-tree-bindings/spi/
H A Dspi-bus.txt1 SPI (Serial Peripheral Interface) busses
3 SPI busses can be described with a node for the SPI master device
4 and a set of child nodes for each SPI slave on the bus. For this
5 discussion, it is assumed that the system's SPI controller is in
6 SPI master mode. This binding does not describe SPI controllers
7 in slave mode.
9 The SPI master node requires the following properties:
10 - #address-cells - number of cells required to define a chip select
11 address on the SPI bus.
12 - #size-cells - should be zero.
[all …]
/OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/fpga/
H A Dxilinx-slave-serial.txt1 Xilinx Slave Serial SPI FPGA Manager
3 Xilinx Spartan-6 and 7 Series FPGAs support a method of loading the
4 bitstream over what is referred to as "slave serial" interface.
5 The slave serial link is not technically SPI, and might require extra
6 circuits in order to play nicely with other SPI slaves on the same bus.
9 - https://www.xilinx.com/support/documentation/user_guides/ug380.pdf
10 - https://www.xilinx.com/support/documentation/user_guides/ug470_7Series_Config.pdf
11 - https://www.xilinx.com/support/documentation/application_notes/xapp583-fpga-configuration.pdf
14 - compatible: should contain "xlnx,fpga-slave-serial"
15 - reg: spi chip select of the FPGA
[all …]
H A Dlattice-machxo2-spi.txt1 Lattice MachXO2 Slave SPI FPGA Manager
4 'slave SPI' interface.
9 - compatible: should contain "lattice,machxo2-slave-spi"
10 - reg: spi chip select of the FPGA
14 fpga-region0 {
15 compatible = "fpga-region";
16 fpga-mgr = <&fpga_mgr_spi>;
17 #address-cells = <0x1>;
18 #size-cells = <0x1>;
21 spi1: spi@2000 {
[all …]
/OK3568_Linux_fs/u-boot/cmd/
H A Dspi.c5 * SPDX-License-Identifier: GPL-2.0+
9 * SPI Read/Write Utilities
16 #include <spi.h>
18 /*-----------------------------------------------------------------------
45 struct spi_slave *slave; in do_spi_xfer() local
55 return -ENOMEM; in do_spi_xfer()
57 str, &dev, &slave); in do_spi_xfer()
61 slave = spi_setup_slave(bus, cs, 1000000, mode); in do_spi_xfer()
62 if (!slave) { in do_spi_xfer()
64 return -EINVAL; in do_spi_xfer()
[all …]
/OK3568_Linux_fs/u-boot/doc/driver-model/
H A Dspi-howto.txt1 How to port a SPI driver to driver model
4 Here is a rough step-by-step guide. It is based around converting the
5 exynos SPI driver to driver model (DM) and the example code is based
6 around U-Boot v2014.10-rc2 (commit be9f643). This has been updated for
11 Before driver model, SPI drivers have their own private structure which
13 exists, but now it is 'per-child data' for the SPI bus. Each child of the
14 SPI bus is a SPI slave. The information that was stored in the
15 driver-specific slave structure can now be port in private data for the
16 SPI bus.
21 struct spi_slave slave;
[all …]
/OK3568_Linux_fs/u-boot/drivers/misc/
H A Dcros_ec_spi.c2 * Chromium OS cros_ec driver - SPI interface
6 * SPDX-License-Identifier: GPL-2.0+
20 #include <spi.h>
27 struct spi_slave *slave = dev_get_parent_priv(dev->dev); in cros_ec_spi_packet() local
33 if (spi_claim_bus(slave)) { in cros_ec_spi_packet()
34 debug("%s: Cannot claim SPI bus\n", __func__); in cros_ec_spi_packet()
35 return -1; in cros_ec_spi_packet()
38 rv = spi_xfer(slave, out_bytes * 8, dev->dout, NULL, SPI_XFER_BEGIN); in cros_ec_spi_packet()
43 rv = spi_xfer(slave, 8, NULL, &byte, 0); in cros_ec_spi_packet()
49 rv = -ETIMEDOUT; in cros_ec_spi_packet()
[all …]

12345678910>>...19