Skip to content

Commit

Permalink
drivers: i2c: clean up Kconfig file
Browse files Browse the repository at this point in the history
Several minor changes to clean up I2C Kconfig file
- align help text
- remove duplicate dependencies
- use unified naming for I2C port options
- replace outdated references to datasheet in help text
- add comments at the end of 'endif'

Change-Id: I452083feb29f40909e6e38324ff9d9961fc6bd07
Signed-off-by: Piotr Mienkowski <[email protected]>
  • Loading branch information
mnkp authored and Anas Nashif committed Apr 29, 2017
1 parent b29b3e2 commit 068766f
Showing 1 changed file with 88 additions and 101 deletions.
189 changes: 88 additions & 101 deletions drivers/i2c/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,64 +14,63 @@ menuconfig I2C
prompt "I2C Drivers"
default n
help
Enable I2C Driver Configuration
Enable I2C Driver Configuration

if I2C

config I2C_DW
bool "Design Ware I2C support"
depends on I2C
default n
help
Enable Design Ware I2C support on the selected board
Enable Design Ware I2C support on the selected board

config I2C_QMSI_SS
bool "QMSI I2C driver for the Sensor Subsystem"
depends on I2C && QMSI
depends on QMSI
default n
help
This option enable the Sensor QMSI I2C driver.
This option enable the Sensor QMSI I2C driver.

This driver is simply a shim driver based on the I2C driver
provided by the QMSI BSP.
This driver is simply a shim driver based on the I2C driver
provided by the QMSI BSP.

config I2C_QMSI
bool "QMSI I2C driver"
depends on I2C && QMSI
depends on QMSI
default n
help
This option enable the QMSI I2C driver.
This option enable the QMSI I2C driver.

This driver is simply a shim driver based on the I2C driver
provided by the QMSI BSP.
This driver is simply a shim driver based on the I2C driver
provided by the QMSI BSP.

config I2C_ATMEL_SAM3
bool "Atmel SAM3 I2C Driver"
depends on I2C && SOC_ATMEL_SAM3
depends on SOC_ATMEL_SAM3
default n
help
Enable I2C support on the Atmel SAM3 family processor.
Enable I2C support on the Atmel SAM3 family processor.

Says y to enable additional options to enable support
for individual controllers.
Says y to enable additional options to enable support
for individual controllers.

config TWIHS_SAM
bool "Atmel SAM I2C driver"
depends on I2C && SOC_FAMILY_SAM
depends on SOC_FAMILY_SAM
default n
help
Enable Atmel SAM MCU Family I2C bus driver.

config I2C_MCUX
bool "MCUX I2C driver"
depends on I2C && HAS_MCUX
depends on HAS_MCUX
default n
help
Enable the mcux I2C driver.
Enable the mcux I2C driver.

config I2C_NRF5
bool "NRF5 I2C driver"
depends on I2C && SOC_FAMILY_NRF5
depends on SOC_FAMILY_NRF5
select GPIO
default n
help
Expand All @@ -94,17 +93,17 @@ config I2C_NRF5_GPIO_SCL_PIN

config I2C_STM32LX
bool "STM32Lx MCU I2C Driver"
depends on I2C && SOC_FAMILY_STM32 && SOC_SERIES_STM32L4X
depends on SOC_FAMILY_STM32 && SOC_SERIES_STM32L4X
default n
help
Enable I2C support on the STM32Lxx family of processors.
Enable I2C support on the STM32Lxx family of processors.

config I2C_STM32LX_INTERRUPT
bool "STM32Lx MCU I2C Interrupt Support"
depends on I2C_STM32LX
default n
help
Enable Interrupt support for the I2C Driver of STM32Lxx family.
Enable Interrupt support for the I2C Driver of STM32Lxx family.

config I2C_BITBANG
bool
Expand All @@ -116,41 +115,34 @@ source "drivers/i2c/Kconfig.gpio"

config I2C_INIT_PRIORITY
int
depends on I2C
default 60
prompt "Init priority"
help
I2C device driver initialization priority.
I2C device driver initialization priority.

config I2C_DW_CLOCK_SPEED
int "Set the clock speed for I2C"
default 32
depends on I2C && I2C_DW
depends on I2C_DW

config SYS_LOG_I2C_LEVEL
int
prompt "I2C log level"
depends on I2C && SYS_LOG
depends on SYS_LOG
default 0
help
Sets log level for I2C connections

Levels are:

- 0 OFF, do not write

- 1 ERROR, only write SYS_LOG_ERR

- 2 WARNING, write SYS_LOG_WRN in addition to previous level

- 3 INFO, write SYS_LOG_INF in addition to previous levels

- 4 DEBUG, write SYS_LOG_DBG in addition to previous levels
Sets log level for I2C drivers.
Levels are:
- 0 OFF, do not write
- 1 ERROR, only write SYS_LOG_ERR
- 2 WARNING, write SYS_LOG_WRN in addition to previous level
- 3 INFO, write SYS_LOG_INF in addition to previous levels
- 4 DEBUG, write SYS_LOG_DBG in addition to previous levels

config I2C_DW_SHARED_IRQ
bool
default n
depends on I2C && I2C_DW
depends on I2C_DW

choice
prompt "I2C_0 Interrupts via"
Expand All @@ -160,107 +152,104 @@ choice
config I2C_DW_0_IRQ_DIRECT
bool "Direct Hardware Interrupt"
help
When interrupts fire, the driver's ISR function is being called
directly.
When interrupts fire, the driver's ISR function is being called
directly.

config I2C_DW_0_IRQ_SHARED
bool "Shared IRQ"
depends on SHARED_IRQ
select I2C_DW_SHARED_IRQ
help
When interrupts fire, the shared IRQ driver is notified.
Then the shared IRQ driver dispatches the interrupt to other drivers.
When interrupts fire, the shared IRQ driver is notified.
Then the shared IRQ driver dispatches the interrupt to other drivers.

endchoice

config I2C_DW_0_IRQ_SHARED_NAME
string "Device name for Shared IRQ"
depends on I2C_0 && I2C_DW_0_IRQ_SHARED
help
Specify the device name for the shared IRQ driver. It is used
to register this driver with the shared IRQ driver, so interrupts
can be dispatched correctly.
Specify the device name for the shared IRQ driver. It is used
to register this driver with the shared IRQ driver, so interrupts
can be dispatched correctly.

config I2C_0
bool "Enable I2C_0"
depends on I2C
bool "Enable I2C Port 0"
default n

config I2C_0_NAME
string "Select a name for finding the device"
string "Port 0 device name"
depends on I2C_0
default "I2C_0"

config I2C_0_DEFAULT_CFG
hex "I2C default configuration"
hex "Port 0 default configuration"
depends on I2C_0
default 0x0
help
Allows the I2C port to be brought up with a default configuration.
This is useful to set if other drivers depend upon using the I2C bus
before the application has a chance to custom configure the port.
Setting this value does not prohibit the application from customizing
the values later. Refer to the I2C datasheet for proper values.
Allows the I2C port to be brought up with a default configuration.
This is useful to set if other drivers depend upon using the I2C bus
before the application has a chance to custom configure the port.
Setting this value does not prohibit the application from customizing
the values later. Refer to include/i2c.h file for proper values.

config I2C_0_IRQ_PRI
int "Controller interrupt priority"
int "Port 0 interrupt priority"
depends on I2C_0
help
IRQ priority.
IRQ priority.

config I2C_1
bool "Enable I2C Port 1"
depends on I2C
default n

config I2C_1_NAME
string "Select a name for finding the device"
string "Port 1 device name"
default "I2C_1"
depends on I2C_1

config I2C_1_DEFAULT_CFG
hex "I2C default configuration"
hex "Port 1 default configuration"
depends on I2C_1
default 0x0
help
Allows the I2C port to be brought up with a default configuration.
This is useful to set if other drivers depend upon using the I2C bus
before the application has a chance to custom configure the port.
Setting this value does not prohibit the application from customizing
the values later. Refer to the I2C datasheet for proper values.
Allows the I2C port to be brought up with a default configuration.
This is useful to set if other drivers depend upon using the I2C bus
before the application has a chance to custom configure the port.
Setting this value does not prohibit the application from customizing
the values later. Refer to include/i2c.h file for proper values.

config I2C_1_IRQ_PRI
int "Controller interrupt priority"
int "Port 1 interrupt priority"
depends on I2C_1
help
IRQ priority.
IRQ priority.

config I2C_2
bool "Enable I2C Port 2"
depends on I2C
default n

config I2C_2_NAME
string "Select a name for finding the device"
string "Port 2 device name"
default "I2C_2"
depends on I2C_2

config I2C_2_DEFAULT_CFG
hex "I2C default configuration"
hex "Port 2 default configuration"
depends on I2C_2
default 0x0
help
Allows the I2C port to be brought up with a default configuration.
This is useful to set if other drivers depend upon using the I2C bus
before the application has a chance to custom configure the port.
Setting this value does not prohibit the application from customizing
the values later. Refer to the I2C datasheet for proper values.
Allows the I2C port to be brought up with a default configuration.
This is useful to set if other drivers depend upon using the I2C bus
before the application has a chance to custom configure the port.
Setting this value does not prohibit the application from customizing
the values later. Refer to include/i2c.h file for proper values.

config I2C_2_IRQ_PRI
int "Controller interrupt priority"
int "Port 2 interrupt priority"
depends on I2C_2
help
IRQ priority.
IRQ priority.

config I2C_SS_0
bool "Enable I2C_SS_0"
Expand All @@ -277,11 +266,11 @@ config I2C_SS_0_DEFAULT_CFG
depends on I2C_SS_0
default 0x0
help
Allows the I2C port to be brought up with a default configuration.
This is useful to set if other drivers depend upon using the I2C bus
before the application has a chance to custom configure the port.
Setting this value does not prohibit the application from customizing
the values later. Refer to the I2C datasheet for proper values.
Allows the I2C port to be brought up with a default configuration.
This is useful to set if other drivers depend upon using the I2C bus
before the application has a chance to custom configure the port.
Setting this value does not prohibit the application from customizing
the values later. Refer to the I2C datasheet for proper values.

config I2C_SS_1
bool "Enable I2C SS Port 1"
Expand All @@ -298,47 +287,45 @@ config I2C_SS_1_DEFAULT_CFG
depends on I2C_SS_1
default 0x0
help
Allows the I2C port to be brought up with a default configuration.
This is useful to set if other drivers depend upon using the I2C bus
before the application has a chance to custom configure the port.
Setting this value does not prohibit the application from customizing
the values later. Refer to the I2C datasheet for proper values.
Allows the I2C port to be brought up with a default configuration.
This is useful to set if other drivers depend upon using the I2C bus
before the application has a chance to custom configure the port.
Setting this value does not prohibit the application from customizing
the values later. Refer to the I2C datasheet for proper values.

config I2C_SS_SDA_HOLD
int
depends on I2C_QMSI_SS
help
The hold time on the data signal after a negative edge of i2c clock.
The unit is i2c module base clock.
The hold time on the data signal after a negative edge of i2c clock.
The unit is i2c module base clock.

config I2C_SS_SDA_SETUP
int
depends on I2C_QMSI_SS
help
The delay time of clock rising edge relative to i2c data signal change.
The unit is i2c module base clock.
The delay time of clock rising edge relative to i2c data signal
change. The unit is i2c module base clock.

config I2C_SDA_SETUP
int
depends on I2C_QMSI
help
The delay time of clock rising edge relative to i2c data signal change.
The unit is i2c module base clock.
The delay time of clock rising edge relative to i2c data signal
change. The unit is i2c module base clock.

config I2C_SDA_TX_HOLD
int
depends on I2C_QMSI
help
The hold time on the data signal after a negative edge of i2c clock
while i2c acts as transmitter.
The unit is i2c module base clock.
The hold time on the data signal after a negative edge of i2c clock
while i2c acts as transmitter. The unit is i2c module base clock.

config I2C_SDA_RX_HOLD
int
depends on I2C_QMSI
help
The hold time on the data signal after a negative edge of i2c clock
while i2c acts as receiver.
The unit is i2c module base clock.
The hold time on the data signal after a negative edge of i2c clock
while i2c acts as receiver. The unit is i2c module base clock.

endif
endif # I2C

0 comments on commit 068766f

Please sign in to comment.