From 7606c377f56ab68421aa482b1ded6840d426e197 Mon Sep 17 00:00:00 2001 From: Furquan Shaikh Date: Sat, 11 Feb 2017 10:57:23 -0800 Subject: device: Add a new "SPI" device type Add support for a new "SPI" device type in the devicetree to bind a device on the SPI bus. Allow device to provide chip select number for the device as a parameter. Add spi_bus_operations with operation dev_to_bus which allows SoCs to define a translation method for converting "struct device" into a unique SPI bus number. BUG=chrome-os-partner:59832 BRANCH=None TEST=Compiles successfully. Change-Id: I86f09516d3cddd619fef23a4659c9e4eadbcf3fa Signed-off-by: Furquan Shaikh Reviewed-on: https://review.coreboot.org/18340 Reviewed-by: Duncan Laurie Tested-by: build bot (Jenkins) --- src/include/device/path.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/include/device/path.h') diff --git a/src/include/device/path.h b/src/include/device/path.h index 9d7fb38d42..849b579455 100644 --- a/src/include/device/path.h +++ b/src/include/device/path.h @@ -14,6 +14,7 @@ enum device_path_type { DEVICE_PATH_CPU_BUS, DEVICE_PATH_IOAPIC, DEVICE_PATH_GENERIC, + DEVICE_PATH_SPI, /* * When adding path types to this table, please also update the @@ -33,7 +34,8 @@ enum device_path_type { "DEVICE_PATH_CPU", \ "DEVICE_PATH_CPU_BUS", \ "DEVICE_PATH_IOAPIC", \ - "DEVICE_PATH_GENERIC" \ + "DEVICE_PATH_GENERIC", \ + "DEVICE_PATH_SPI", \ } struct domain_path @@ -58,6 +60,11 @@ struct i2c_path unsigned mode_10bit; }; +struct spi_path +{ + unsigned cs; +}; + struct apic_path { unsigned apic_id; @@ -107,6 +114,7 @@ struct device_path { struct cpu_path cpu; struct cpu_bus_path cpu_bus; struct generic_path generic; + struct spi_path spi; }; }; -- cgit v1.2.3