/openbmc/linux/drivers/spi/ |
H A D | spi-stm32.c | 1 // SPDX-License-Identifier: GPL-2.0 3 // STMicroelectronics STM32 SPI Controller driver 5 // Copyright (C) 2017, STMicroelectronics - All Rights Reserved 20 #include <linux/spi/spi.h> 24 /* STM32F4 SPI registers */ 73 /* STM32F4 SPI Baud Rate min/max divisor */ 77 /* STM32H7 SPI registers */ 149 /* STM32H7 SPI Master Baud Rate min/max divisor */ 153 /* STM32H7 SPI Communication mode */ 159 /* SPI Communication type */ [all …]
|
H A D | spi-davinci.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 16 #include <linux/dma-mapping.h> 18 #include <linux/spi/spi.h> 19 #include <linux/spi/spi_bitbang.h> 22 #include <linux/platform_data/spi-davinci.h> 88 /* SPI Controller registers */ 103 /* SPI Controller driver's private data. */ 110 void __iomem *base; member 136 if (dspi->rx) { in davinci_spi_rx_buf_u8() 137 u8 *rx = dspi->rx; in davinci_spi_rx_buf_u8() [all …]
|
H A D | spi-mxs.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 // Freescale MXS SPI master driver 15 // Based on code from U-Boot bootloader by: 18 // Based on spi-stmp.c, which is: 28 #include <linux/dma-mapping.h> 39 #include <linux/spi/spi.h> 40 #include <linux/spi/mxs-spi.h> 41 #include <trace/events/spi.h> 43 #define DRIVER_NAME "mxs-spi" 55 #define TXRX_DEASSERT_CS (1<<1) /* De-assert CS at end of txrx */ [all …]
|
H A D | spi-oc-tiny.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * OpenCores tiny SPI master driver 19 #include <linux/spi/spi.h> 20 #include <linux/spi/spi_bitbang.h> 21 #include <linux/spi/spi_oc_tiny.h> 41 void __iomem *base; member 56 return spi_master_get_devdata(sdev->master); in tiny_spi_to_hw() 59 static unsigned int tiny_spi_baud(struct spi_device *spi, unsigned int hz) in tiny_spi_baud() argument 61 struct tiny_spi *hw = tiny_spi_to_hw(spi); in tiny_spi_baud() 63 return min(DIV_ROUND_UP(hw->freq, hz * 2), (1U << hw->baudwidth)) - 1; in tiny_spi_baud() [all …]
|
H A D | spi-ar934x.c | 1 // SPDX-License-Identifier: GPL-2.0 3 // SPI controller driver for Qualcomm Atheros AR934x/QCA95xx SoCs 7 // Based on spi-mt7621.c: 9 // Copyright (C) 2011-2013 Gabor Juhos <juhosg@openwrt.org> 10 // Copyright (C) 2014-2015 Felix Fietkau <nbd@nbd.name> 19 #include <linux/spi/spi.h> 21 #define DRIVER_NAME "spi-ar934x" 46 void __iomem *base; member 53 int div = DIV_ROUND_UP(sp->clk_freq, freq * 2) - 1; in ar934x_spi_clk_div() 58 return -EINVAL; in ar934x_spi_clk_div() [all …]
|
H A D | spi-mt65xx.c | 1 // SPDX-License-Identifier: GPL-2.0-only 17 #include <linux/platform_data/spi-mt65xx.h> 19 #include <linux/spi/spi.h> 20 #include <linux/spi/spi-mem.h> 21 #include <linux/dma-mapping.h> 114 * struct mtk_spi_compatible - device data structure 115 * @need_pad_sel: Enable pad (pins) selection in SPI controller 119 * @no_need_unprepare: Don't unprepare the SPI clk during runtime 132 * struct mtk_spi - SPI driver instance 133 * @base: Start address of the SPI controller registers [all …]
|
H A D | spi-st-ssc4.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (c) 2008-2014 STMicroelectronics Limited 9 * SPI master mode controller driver, used in STMicroelectronics devices. 22 #include <linux/spi/spi.h> 23 #include <linux/spi/spi_bitbang.h> 54 /* SSC SPI Controller */ 55 void __iomem *base; member 59 /* SSC SPI current transaction */ 74 if (spi_st->words_remaining > FIFO_SIZE) in ssc_write_tx_fifo() 77 count = spi_st->words_remaining; in ssc_write_tx_fifo() [all …]
|
H A D | spi-geni-qcom.c | 1 // SPDX-License-Identifier: GPL-2.0 2 // Copyright (c) 2017-2018, The Linux foundation. All rights reserved. 6 #include <linux/dma-mapping.h> 7 #include <linux/dma/qcom-gpi-dma.h> 16 #include <linux/soc/qcom/geni-se.h> 17 #include <linux/spi/spi.h> 20 /* SPI SE specific registers and respective register fields */ 59 /* M_CMD OP codes for SPI */ 66 /* M_CMD params for SPI */ 108 struct geni_se *se = &mas->se; in spi_slv_setup() [all …]
|
H A D | spi-uniphier.c | 1 // SPDX-License-Identifier: GPL-2.0 2 // spi-uniphier.c - Socionext UniPhier SPI controller driver 4 // Copyright 2016-2018 Socionext Inc. 16 #include <linux/spi/spi.h> 26 void __iomem *base; member 113 val = readl(priv->base + SSI_IE); in uniphier_spi_irq_enable() 115 writel(val, priv->base + SSI_IE); in uniphier_spi_irq_enable() 123 val = readl(priv->base + SSI_IE); in uniphier_spi_irq_disable() 125 writel(val, priv->base + SSI_IE); in uniphier_spi_irq_disable() 128 static void uniphier_spi_set_mode(struct spi_device *spi) in uniphier_spi_set_mode() argument [all …]
|
H A D | spi-slave-mt27xx.c | 1 // SPDX-License-Identifier: GPL-2.0+ 6 #include <linux/dma-mapping.h> 12 #include <linux/spi/spi.h> 68 void __iomem *base; member 90 { .compatible = "mediatek,mt2712-spi-slave", 92 { .compatible = "mediatek,mt8195-spi-slave", 102 reg_val = readl(mdata->base + SPIS_DMA_CFG_REG); in mtk_spi_slave_disable_dma() 105 writel(reg_val, mdata->base + SPIS_DMA_CFG_REG); in mtk_spi_slave_disable_dma() 112 reg_val = readl(mdata->base + SPIS_CFG_REG); in mtk_spi_slave_disable_xfer() 115 writel(reg_val, mdata->base + SPIS_CFG_REG); in mtk_spi_slave_disable_xfer() [all …]
|
H A D | spi-qup.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (c) 2008-2014, The Linux foundation. All rights reserved. 16 #include <linux/spi/spi.h> 18 #include <linux/dma-mapping.h> 115 #define SPI_MAX_XFER (SZ_64K - 64) 125 void __iomem *base; member 140 int w_size; /* bytes per SPI word */ 153 static int spi_qup_io_config(struct spi_device *spi, struct spi_transfer *xfer); 157 u32 opflag = readl_relaxed(controller->base + QUP_OPERATIONAL); in spi_qup_is_flag_set() 173 return controller->n_words * controller->w_size; in spi_qup_len() [all …]
|
H A D | spi-mt7621.c | 1 // SPDX-License-Identifier: GPL-2.0 3 // spi-mt7621.c -- MediaTek MT7621 SPI controller driver 6 // Copyright (C) 2011-2013 Gabor Juhos <juhosg@openwrt.org> 7 // Copyright (C) 2014-2015 Felix Fietkau <nbd@nbd.name> 9 // Some parts are based on spi-orion.c: 11 // Copyright (C) 2007-2008 Marvell Ltd. 21 #include <linux/spi/spi.h> 23 #define DRIVER_NAME "spi-mt7621" 57 void __iomem *base; member 63 static inline struct mt7621_spi *spidev_to_mt7621_spi(struct spi_device *spi) in spidev_to_mt7621_spi() argument [all …]
|
H A D | spi-omap2-mcspi.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 15 #include <linux/dma-mapping.h> 28 #include <linux/spi/spi.h> 30 #include <linux/platform_data/spi-omap2-mcspi.h> 47 /* per-channel banks, 0x14 bytes each, first is: */ 54 /* per-register bitmasks: */ 121 /* Virtual base address of the controller */ 122 void __iomem *base; member 137 void __iomem *base; member 151 writel_relaxed(val, mcspi->base + idx); in mcspi_write_reg() [all …]
|
H A D | spi-ath79.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * SPI controller driver for the Atheros AR71XX/AR724X/AR913X SoCs 5 * Copyright (C) 2009-2011 Gabor Juhos <juhosg@openwrt.org> 7 * This driver has been based on the spi-gpio.c: 17 #include <linux/spi/spi.h> 18 #include <linux/spi/spi-mem.h> 19 #include <linux/spi/spi_bitbang.h> 24 #define DRV_NAME "ath79-spi" 30 #define AR71XX_SPI_REG_CTRL 0x04 /* SPI Control */ 31 #define AR71XX_SPI_REG_IOC 0x08 /* SPI I/O Control */ [all …]
|
H A D | spi-npcm-pspi.c | 1 // SPDX-License-Identifier: GPL-2.0 12 #include <linux/spi/spi.h> 26 void __iomem *base; member 37 #define DRIVER_NAME "npcm-pspi" 70 val = ioread16(priv->base + NPCM_PSPI_CTL1); in npcm_pspi_irq_enable() 72 iowrite16(val, priv->base + NPCM_PSPI_CTL1); in npcm_pspi_irq_enable() 79 val = ioread16(priv->base + NPCM_PSPI_CTL1); in npcm_pspi_irq_disable() 81 iowrite16(val, priv->base + NPCM_PSPI_CTL1); in npcm_pspi_irq_disable() 88 val = ioread16(priv->base + NPCM_PSPI_CTL1); in npcm_pspi_enable() 90 iowrite16(val, priv->base + NPCM_PSPI_CTL1); in npcm_pspi_enable() [all …]
|
H A D | spi-imx.c | 1 // SPDX-License-Identifier: GPL-2.0+ 2 // Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. 10 #include <linux/dma-mapping.h> 21 #include <linux/spi/spi.h> 26 #include <linux/dma/imx-dma.h> 74 int (*prepare_transfer)(struct spi_imx_data *spi_imx, struct spi_device *spi); 97 void __iomem *base; member 133 return d->devtype_data->devtype == IMX27_CSPI; in is_imx27_cspi() 138 return d->devtype_data->devtype == IMX35_CSPI; in is_imx35_cspi() 143 return d->devtype_data->devtype == IMX51_ECSPI; in is_imx51_ecspi() [all …]
|
H A D | spi-altera-dfl.c | 1 // SPDX-License-Identifier: GPL-2.0 3 // DFL bus driver for Altera SPI Master 19 #include <linux/io-64-nonatomic-lo-hi.h> 21 #include <linux/spi/spi.h> 22 #include <linux/spi/altera.h> 52 void __iomem *base = context; in indirect_bus_reg_read() local 56 writeq((reg >> 2) | INDIRECT_RD, base + INDIRECT_ADDR); in indirect_bus_reg_read() 59 while ((readq(base + INDIRECT_ADDR) & INDIRECT_RD) && in indirect_bus_reg_read() 65 return -ETIME; in indirect_bus_reg_read() 68 v = readq(base + INDIRECT_RD_DATA); in indirect_bus_reg_read() [all …]
|
H A D | spi-axi-spi-engine.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * SPI-Engine SPI controller driver 5 * Author: Lars-Peter Clausen <lars@metafoo.de> 9 #include <linux/fpga/adi-axi-common.h> 16 #include <linux/spi/spi.h> 78 * struct spi_engine_message_state - SPI engine per-message state 109 void __iomem *base; member 122 p->instructions[p->length] = cmd; in spi_engine_program_add_cmd() 123 p->length++; in spi_engine_program_add_cmd() 126 static unsigned int spi_engine_get_config(struct spi_device *spi) in spi_engine_get_config() argument [all …]
|
H A D | spi-sprd.c | 1 // SPDX-License-Identifier: GPL-2.0 6 #include <linux/dma-mapping.h> 7 #include <linux/dma/sprd-dma.h> 17 #include <linux/spi/spi.h> 151 void __iomem *base; member 177 * SPI transmission time. in sprd_spi_transfer_max_timeout() 179 u32 size = t->bits_per_word * SPRD_SPI_FIFO_SIZE; in sprd_spi_transfer_max_timeout() 180 u32 bit_time_us = DIV_ROUND_UP(USEC_PER_SEC, ss->hw_speed_hz); in sprd_spi_transfer_max_timeout() 183 * There is an interval between data and the data in our SPI hardware, in sprd_spi_transfer_max_timeout() 186 u32 interval_cycle = SPRD_SPI_FIFO_SIZE * ss->word_delay; in sprd_spi_transfer_max_timeout() [all …]
|
/openbmc/linux/sound/pci/hda/ |
H A D | cs35l56_hda_spi.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 // CS35L56 HDA audio driver SPI binding 10 #include <linux/spi/spi.h> 14 static int cs35l56_hda_spi_probe(struct spi_device *spi) in cs35l56_hda_spi_probe() argument 19 cs35l56 = devm_kzalloc(&spi->dev, sizeof(*cs35l56), GFP_KERNEL); in cs35l56_hda_spi_probe() 21 return -ENOMEM; in cs35l56_hda_spi_probe() 23 cs35l56->base.dev = &spi->dev; in cs35l56_hda_spi_probe() 24 cs35l56->base.regmap = devm_regmap_init_spi(spi, &cs35l56_regmap_spi); in cs35l56_hda_spi_probe() 25 if (IS_ERR(cs35l56->base.regmap)) { in cs35l56_hda_spi_probe() 26 ret = PTR_ERR(cs35l56->base.regmap); in cs35l56_hda_spi_probe() [all …]
|
/openbmc/linux/sound/soc/codecs/ |
H A D | cs35l56-spi.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 // CS35L56 ALSA SoC audio driver SPI binding 12 #include <linux/spi/spi.h> 17 static int cs35l56_spi_probe(struct spi_device *spi) in cs35l56_spi_probe() argument 23 cs35l56 = devm_kzalloc(&spi->dev, sizeof(struct cs35l56_private), GFP_KERNEL); in cs35l56_spi_probe() 25 return -ENOMEM; in cs35l56_spi_probe() 27 spi_set_drvdata(spi, cs35l56); in cs35l56_spi_probe() 28 cs35l56->base.regmap = devm_regmap_init_spi(spi, regmap_config); in cs35l56_spi_probe() 29 if (IS_ERR(cs35l56->base.regmap)) { in cs35l56_spi_probe() 30 ret = PTR_ERR(cs35l56->base.regmap); in cs35l56_spi_probe() [all …]
|
/openbmc/u-boot/doc/driver-model/ |
H A D | MIGRATION.txt | 4 U-Boot has been migrating to a new driver model since its introduction in 5 2014. This file describes the schedule for deprecation of pre-driver-model 9 ------------- 15 switching over to using CONFIG_DM_MMC and other base driver model options in 19 ------------- 26 other base driver model options in time for inclusion in the 2019.07 rerelease. 29 ----------- 36 other base driver model options in time for inclusion in the 2019.07 rerelease. 39 ---------- 53 ------------------- [all …]
|
/openbmc/u-boot/include/ |
H A D | pch.h | 1 /* SPDX-License-Identifier: GPL-2.0+ */ 16 /* Returns HDA config info if Azalia V1CTL enabled, -ENOENT if not */ 27 * struct pch_ops - Operations for the Platform Controller Hub 29 * Consider using ioctl() to add rarely used or driver-specific operations. 33 * get_spi_base() - get the address of SPI base 36 * @sbasep: Returns address of SPI base if available, else 0 37 * @return 0 if OK, -ve on error (e.g. there is no SPI base) 42 * set_spi_protect() - set whether SPI flash is protected or not 47 * @return 0 on success, -ENOSYS if not implemented 52 * get_gpio_base() - get the address of GPIO base [all …]
|
/openbmc/u-boot/include/linux/mtd/ |
H A D | spinand.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 3 * Copyright (c) 2016-2017 Micron Technology, Inc. 17 #include <linux/spi/spi.h> 18 #include <linux/spi/spi-mem.h> 21 #include <spi.h> 22 #include <spi-mem.h> 27 * Standard SPI NAND flash operations 121 * Standard SPI NAND flash commands 152 * struct spinand_id - SPI NAND id structure 157 * struct_spinand_id->data contains all bytes returned after a READ_ID command, [all …]
|
/openbmc/linux/Documentation/devicetree/bindings/net/dsa/ |
H A D | nxp,sja1105.yaml | 1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 3 --- 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 10 The SJA1105 SPI interface requires a CS-to-CLK time (t2 in UM10944.pdf) of at 11 least one half of t_CLK. At an SPI frequency of 1MHz, this means a minimum 12 cs_sck_delay of 500ns. Ensuring that this SPI timing requirement is observed 13 depends on the SPI bus master driver. 16 - Vladimir Oltean <vladimir.oltean@nxp.com> 21 - nxp,sja1105e 22 - nxp,sja1105t [all …]
|