diff options
author | Mika Westerberg <mika.westerberg@linux.intel.com> | 2016-02-08 17:14:28 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-02-09 18:19:40 +0000 |
commit | a0a90718f18264dc904d34a580f332006f5561e9 (patch) | |
tree | c40aaf68aada348c4133059aaef79baf948a811a /include/linux/spi | |
parent | 92e963f50fc74041b5e9e744c330dca48e04f08d (diff) | |
download | linux-a0a90718f18264dc904d34a580f332006f5561e9.tar.gz linux-a0a90718f18264dc904d34a580f332006f5561e9.tar.bz2 linux-a0a90718f18264dc904d34a580f332006f5561e9.zip |
spi: Let drivers translate ACPI DeviceSelection to suitable Linux chip select
In Windows it is up to the SPI host controller driver to handle the ACPI
DeviceSelection as it likes. The SPI core does not take any part in it.
This is different in Linux because we always expect to have chip select in
range of 0 .. master->num_chipselect - 1.
In order to support this in Linux we need a way to allow the driver to
translate between ACPI DeviceSelection field and Linux chip select number
so provide a new optional hook ->fw_translate_cs() that can be used by a
driver to handle translation and call this hook if set during SPI slave
ACPI enumeration.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/linux/spi')
-rw-r--r-- | include/linux/spi/spi.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 53be3a4c60cb..8a25e6c2fb56 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -369,6 +369,9 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) * @dma_rx: DMA receive channel * @dummy_rx: dummy receive buffer for full-duplex devices * @dummy_tx: dummy transmit buffer for full-duplex devices + * @fw_translate_cs: If the boot firmware uses different numbering scheme + * what Linux expects, this optional hook can be used to translate + * between the two. * * Each SPI master controller can communicate with one or more @spi_device * children. These make a small bus, sharing MOSI, MISO and SCK signals @@ -537,6 +540,8 @@ struct spi_master { /* dummy data for full duplex devices */ void *dummy_rx; void *dummy_tx; + + int (*fw_translate_cs)(struct spi_master *master, unsigned cs); }; static inline void *spi_master_get_devdata(struct spi_master *master) |