]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
b5f3294f SH |
2 | |
3 | #ifndef __MACH_SPI_H_ | |
4 | #define __MACH_SPI_H_ | |
5 | ||
6 | /* | |
7 | * struct spi_imx_master - device.platform_data for SPI controller devices. | |
8 | * @chipselect: Array of chipselects for this master. Numbers >= 0 mean gpio | |
9 | * pins, numbers < 0 mean internal CSPI chipselects according | |
10 | * to MXC_SPI_CS(). Normally you want to use gpio based chip | |
11 | * selects as the CSPI module tries to be intelligent about | |
12 | * when to assert the chipselect: The CSPI module deasserts the | |
13 | * chipselect once it runs out of input data. The other problem | |
14 | * is that it is not possible to mix between high active and low | |
15 | * active chipselects on one single bus using the internal | |
16 | * chipselects. Unfortunately Freescale decided to put some | |
17 | * chipselects on dedicated pins which are not usable as gpios, | |
18 | * so we have to support the internal chipselects. | |
19 | * @num_chipselect: ARRAY_SIZE(chipselect) | |
20 | */ | |
21 | struct spi_imx_master { | |
22 | int *chipselect; | |
23 | int num_chipselect; | |
24 | }; | |
25 | ||
26 | #define MXC_SPI_CS(no) ((no) - 32) | |
27 | ||
28 | #endif /* __MACH_SPI_H_*/ |