Browse Source

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>
pull/255/head
Tomasz Bursztyka 10 years ago committed by Anas Nashif
parent
commit
6021c64844
  1. 3
      arch/x86/soc/quark_se/Kconfig
  2. 6
      drivers/spi/Kconfig
  3. 4
      drivers/spi/spi_dw.c

3
arch/x86/soc/quark_se/Kconfig

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

6
drivers/spi/Kconfig

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

4
drivers/spi/spi_dw.c

@ -579,7 +579,7 @@ DECLARE_DEVICE_INIT_CONFIG(spi_dw_port_0, CONFIG_SPI_DW_PORT_0_DRV_NAME, @@ -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);
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)
{
@ -612,7 +612,7 @@ DECLARE_DEVICE_INIT_CONFIG(spi_dw_port_1, CONFIG_SPI_DW_PORT_1_DRV_NAME, @@ -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);
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)
{

Loading…
Cancel
Save