Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

spi: davinci: remove platform data header

There are no longer any board files including the DaVinci SPI platform
data header. Let's move the bits and pieces that are used in the driver
into the driver .c file itself and remove the header.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://patch.msgid.link/20251117-davinci-spi-v2-1-cd799d17f04a@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Bartosz Golaszewski and committed by
Mark Brown
96498e80 118eb2cb

+62 -75
+62 -2
drivers/spi/spi-davinci.c
··· 9 9 #include <linux/gpio/consumer.h> 10 10 #include <linux/module.h> 11 11 #include <linux/delay.h> 12 + #include <linux/platform_data/edma.h> 12 13 #include <linux/platform_device.h> 13 14 #include <linux/err.h> 14 15 #include <linux/clk.h> ··· 19 18 #include <linux/spi/spi.h> 20 19 #include <linux/spi/spi_bitbang.h> 21 20 #include <linux/slab.h> 22 - 23 - #include <linux/platform_data/spi-davinci.h> 24 21 25 22 #define CS_DEFAULT 0xFF 26 23 ··· 97 98 #define SPIDEF 0x4c 98 99 #define SPIFMT0 0x50 99 100 101 + #define SPI_IO_TYPE_POLL 1 102 + #define SPI_IO_TYPE_DMA 2 103 + 100 104 #define DMA_MIN_BYTES 16 105 + 106 + enum { 107 + SPI_VERSION_1, /* For DM355/DM365/DM6467 */ 108 + SPI_VERSION_2, /* For DA8xx */ 109 + }; 110 + 111 + /** 112 + * struct davinci_spi_platform_data - Platform data for SPI master device on DaVinci 113 + * 114 + * @version: version of the SPI IP. Different DaVinci devices have slightly 115 + * varying versions of the same IP. 116 + * @num_chipselect: number of chipselects supported by this SPI master 117 + * @intr_line: interrupt line used to connect the SPI IP to the ARM interrupt 118 + * controller withn the SoC. Possible values are 0 and 1. 119 + * @prescaler_limit: max clock prescaler value 120 + * @cshold_bug: set this to true if the SPI controller on your chip requires 121 + * a write to CSHOLD bit in between transfers (like in DM355). 122 + * @dma_event_q: DMA event queue to use if SPI_IO_TYPE_DMA is used for any 123 + * device on the bus. 124 + */ 125 + struct davinci_spi_platform_data { 126 + u8 version; 127 + u8 num_chipselect; 128 + u8 intr_line; 129 + u8 prescaler_limit; 130 + bool cshold_bug; 131 + enum dma_event_q dma_event_q; 132 + }; 133 + 134 + /** 135 + * struct davinci_spi_config - Per-chip-select configuration for SPI slave devices 136 + * 137 + * @wdelay: amount of delay between transmissions. Measured in number of 138 + * SPI module clocks. 139 + * @odd_parity: polarity of parity flag at the end of transmit data stream. 140 + * 0 - odd parity, 1 - even parity. 141 + * @parity_enable: enable transmission of parity at end of each transmit 142 + * data stream. 143 + * @io_type: type of IO transfer. Choose between polled, interrupt and DMA. 144 + * @timer_disable: disable chip-select timers (setup and hold) 145 + * @c2tdelay: chip-select setup time. Measured in number of SPI module clocks. 146 + * @t2cdelay: chip-select hold time. Measured in number of SPI module clocks. 147 + * @t2edelay: transmit data finished to SPI ENAn pin inactive time. Measured 148 + * in number of SPI clocks. 149 + * @c2edelay: chip-select active to SPI ENAn signal active time. Measured in 150 + * number of SPI clocks. 151 + */ 152 + struct davinci_spi_config { 153 + u8 wdelay; 154 + u8 odd_parity; 155 + u8 parity_enable; 156 + u8 io_type; 157 + u8 timer_disable; 158 + u8 c2tdelay; 159 + u8 t2cdelay; 160 + u8 t2edelay; 161 + u8 c2edelay; 162 + }; 101 163 102 164 /* SPI Controller driver's private data. */ 103 165 struct davinci_spi {
-73
include/linux/platform_data/spi-davinci.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * Copyright 2009 Texas Instruments. 4 - */ 5 - 6 - #ifndef __ARCH_ARM_DAVINCI_SPI_H 7 - #define __ARCH_ARM_DAVINCI_SPI_H 8 - 9 - #include <linux/platform_data/edma.h> 10 - 11 - #define SPI_INTERN_CS 0xFF 12 - 13 - enum { 14 - SPI_VERSION_1, /* For DM355/DM365/DM6467 */ 15 - SPI_VERSION_2, /* For DA8xx */ 16 - }; 17 - 18 - /** 19 - * davinci_spi_platform_data - Platform data for SPI master device on DaVinci 20 - * 21 - * @version: version of the SPI IP. Different DaVinci devices have slightly 22 - * varying versions of the same IP. 23 - * @num_chipselect: number of chipselects supported by this SPI master 24 - * @intr_line: interrupt line used to connect the SPI IP to the ARM interrupt 25 - * controller withn the SoC. Possible values are 0 and 1. 26 - * @cshold_bug: set this to true if the SPI controller on your chip requires 27 - * a write to CSHOLD bit in between transfers (like in DM355). 28 - * @dma_event_q: DMA event queue to use if SPI_IO_TYPE_DMA is used for any 29 - * device on the bus. 30 - */ 31 - struct davinci_spi_platform_data { 32 - u8 version; 33 - u8 num_chipselect; 34 - u8 intr_line; 35 - u8 prescaler_limit; 36 - bool cshold_bug; 37 - enum dma_event_q dma_event_q; 38 - }; 39 - 40 - /** 41 - * davinci_spi_config - Per-chip-select configuration for SPI slave devices 42 - * 43 - * @wdelay: amount of delay between transmissions. Measured in number of 44 - * SPI module clocks. 45 - * @odd_parity: polarity of parity flag at the end of transmit data stream. 46 - * 0 - odd parity, 1 - even parity. 47 - * @parity_enable: enable transmission of parity at end of each transmit 48 - * data stream. 49 - * @io_type: type of IO transfer. Choose between polled, interrupt and DMA. 50 - * @timer_disable: disable chip-select timers (setup and hold) 51 - * @c2tdelay: chip-select setup time. Measured in number of SPI module clocks. 52 - * @t2cdelay: chip-select hold time. Measured in number of SPI module clocks. 53 - * @t2edelay: transmit data finished to SPI ENAn pin inactive time. Measured 54 - * in number of SPI clocks. 55 - * @c2edelay: chip-select active to SPI ENAn signal active time. Measured in 56 - * number of SPI clocks. 57 - */ 58 - struct davinci_spi_config { 59 - u8 wdelay; 60 - u8 odd_parity; 61 - u8 parity_enable; 62 - #define SPI_IO_TYPE_INTR 0 63 - #define SPI_IO_TYPE_POLL 1 64 - #define SPI_IO_TYPE_DMA 2 65 - u8 io_type; 66 - u8 timer_disable; 67 - u8 c2tdelay; 68 - u8 t2cdelay; 69 - u8 t2edelay; 70 - u8 c2edelay; 71 - }; 72 - 73 - #endif /* __ARCH_ARM_DAVINCI_SPI_H */