drivers/spi: Adapt Kconfig and generic context to enable slave support

Adding Kconfig options to set supported modes by the controller
(master, slave or both)

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2017-06-28 12:35:07 +02:00 committed by Carles Cufí
commit 29a68cd7a5
2 changed files with 89 additions and 2 deletions

View file

@ -31,6 +31,13 @@ config SPI_ASYNC
help
This option enables the asynchronous API calls.
config SPI_SLAVE
bool "Enable Slave support [EXPERIMENTAL]"
default n
help
Enables Driver SPI slave operations. Slave support depends
on the driver and the hardware it runs on.
config SPI_INIT_PRIORITY
int "Init priority"
default 70
@ -75,6 +82,17 @@ config SPI_0_NAME
depends on !HAS_DTS_SPI
default "SPI_0"
config SPI_0_OP_MODES
int "Port 0 supported operation modes (master/slave/both)"
default 1
range 1 3
help
This sets the supported operation modes at runtime, by the SPI
port 0, where:
1 is MASTER mode only (default)
2 is SLAVE mode only
3 is both modes are available.
config SPI_0_IRQ_PRI
int "Port 0 interrupt priority"
@ -111,6 +129,17 @@ config SPI_1_NAME
depends on !HAS_DTS_SPI
default "SPI_1"
config SPI_1_OP_MODES
int "Port 1 supported operation modes (master/slave/both)"
default 1
range 1 3
help
This sets the supported operation modes at runtime, by the SPI
port 1, where:
1 is MASTER mode only (default)
2 is SLAVE mode only
3 is both modes are available.
config SPI_1_IRQ_PRI
int "Port 0 interrupt priority"
depends on !HAS_DTS_SPI
@ -148,6 +177,17 @@ config SPI_2_NAME
depends on !HAS_DTS_SPI
default "SPI_2"
config SPI_2_OP_MODES
int "Port 2 supported operation modes (master/slave/both)"
default 1
range 1 3
help
This sets the supported operation modes at runtime, by the SPI
port 2, where:
1 is MASTER mode only (default)
2 is SLAVE mode only
3 is both modes are available.
config SPI_2_IRQ_PRI
int "Port 2 interrupt priority"
depends on !HAS_DTS_SPI
@ -185,6 +225,17 @@ config SPI_3_NAME
depends on !HAS_DTS_SPI
default "SPI_3"
config SPI_3_OP_MODES
int "Port 3 supported operation modes (master/slave/both)"
default 1
range 1 3
help
This sets the supported operation modes at runtime, by the SPI
port 3, where:
1 is MASTER mode only (default)
2 is SLAVE mode only
3 is both modes are available.
config SPI_3_IRQ_PRI
int "Port 3 interrupt priority"
depends on !HAS_DTS_SPI
@ -202,6 +253,18 @@ config SPI_4_NAME
depends on SPI_4
default "SPI_4"
config SPI_4_OP_MODES
int "Port 4 supported operation modes (master/slave/both)"
depends on SPI_4
default 1
range 1 3
help
This sets the supported operation modes at runtime, by the SPI
port 4, where:
1 is MASTER mode only (default)
2 is SLAVE mode only
3 is both modes are available.
config SPI_5
bool "SPI port 5"
default n
@ -213,6 +276,18 @@ config SPI_5_NAME
depends on SPI_5
default "SPI_5"
config SPI_5_OP_MODES
int "Port 5 supported operation modes (master/slave/both)"
depends on SPI_5
default 1
range 1 3
help
This sets the supported operation modes at runtime, by the SPI
port 5, where:
1 is MASTER mode only (default)
2 is SLAVE mode only
3 is both modes are available.
if SPI_LEGACY_API
config SPI_INTEL