spi: dw: Add an initialization priority Kconfig option

On Quark SE, SPI might require GPIO to be ready before hand, to emulate
CS, thus providing an option to tweak the intialization priority for SPI
DW driver.

Change-Id: Ifa373948ac8227bf6e4ed1113bcb4dc9139b6663
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2016-01-22 14:47:11 +01:00 committed by Anas Nashif
commit 6021c64844
3 changed files with 11 additions and 2 deletions

View file

@ -234,6 +234,9 @@ config GPIO_DW_INIT_PRIORITY
config I2C_INIT_PRIORITY config I2C_INIT_PRIORITY
default 60 default 60
config SPI_DW_INIT_PRIORITY
default 70 # It might require GPIO to be ready first
if UART_NS16550 if UART_NS16550
config UART_NS16550_PORT_0 config UART_NS16550_PORT_0

View file

@ -237,6 +237,12 @@ config SPI_DW_CS_GPIO
depends on SPI_DW && GPIO depends on SPI_DW && GPIO
default n default n
config SPI_DW_INIT_PRIORITY
int "Init priority"
default 60
help
Device driver initialization priority.
choice choice
depends on SPI_DW depends on SPI_DW
prompt "DesignWare SPI interrupt trigger condition" prompt "DesignWare SPI interrupt trigger condition"

View file

@ -579,7 +579,7 @@ DECLARE_DEVICE_INIT_CONFIG(spi_dw_port_0, CONFIG_SPI_DW_PORT_0_DRV_NAME,
spi_dw_init, &spi_dw_config_0); spi_dw_init, &spi_dw_config_0);
SYS_DEFINE_DEVICE(spi_dw_port_0, &spi_dw_data_port_0, SECONDARY, SYS_DEFINE_DEVICE(spi_dw_port_0, &spi_dw_data_port_0, SECONDARY,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); CONFIG_SPI_DW_INIT_PRIORITY);
void spi_config_0_irq(void) void spi_config_0_irq(void)
{ {
@ -612,7 +612,7 @@ DECLARE_DEVICE_INIT_CONFIG(spi_dw_port_1, CONFIG_SPI_DW_PORT_1_DRV_NAME,
spi_dw_init, &spi_dw_config_1); spi_dw_init, &spi_dw_config_1);
SYS_DEFINE_DEVICE(spi_dw_port_1, &spi_dw_data_port_1, SECONDARY, SYS_DEFINE_DEVICE(spi_dw_port_1, &spi_dw_data_port_1, SECONDARY,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); CONFIG_SPI_DW_INIT_PRIORITY);
void spi_config_1_irq(void) void spi_config_1_irq(void)
{ {