zephyr/drivers/i2c/Kconfig

203 lines
5.2 KiB
Plaintext

# Kconfig - I2C configuration options
#
# Copyright (c) 2015 Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1) Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2) Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3) Neither the name of Intel Corporation nor the names of its contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
#
# I2C options
#
menuconfig I2C
bool
prompt "I2C Drivers"
default n
help
Enable I2C Driver Configuration
config I2C_DW
bool "Design Ware I2C support"
depends on I2C
default n
help
Enable Design Ware I2C support on the selected platform
choice
prompt "IRQ Trigger Condition"
default I2C_DW_IRQ_RISING_EDGE
depends on I2C_DW
config I2C_DW_IRQ_FALLING_EDGE
bool "Falling Edge"
help
This option signifies that the controller
uses falling edge interrupt.
config I2C_DW_IRQ_RISING_EDGE
bool "Rising Edge"
help
This option signifies that the controller
uses rising edge interrupt.
config I2C_DW_IRQ_LEVEL_HIGH
bool "Level High"
help
This option signifies that the controller
uses level high interrupt.
config I2C_DW_IRQ_LEVEL_LOW
bool "Level Low"
help
This option signifies that the controller
uses level low interrupt.
endchoice
config I2C_DW_SHARED_IRQ
bool
default n
depends on I2C_DW
config I2C_DW_VENDOR_ID
hex "PCI Vendor ID of the controllers"
depends on I2C_DW && PCI
default 0x8086
config I2C_DW_DEVICE_ID
hex "PCI Device ID of the controllers"
depends on I2C_DW && PCI
default 0x934
config I2C_DW_CLASS
hex "PCI device class"
depends on I2C_DW && PCI
default 0x0C
config I2C_DW_0
bool "Enable I2C0"
default n
depends on I2C_DW
config I2C_DW_0_BASE
hex "Base address for I2C0"
default 0x00000000
depends on I2C_DW_0
config I2C_DW_0_NAME
string "Select a name for finding the device"
depends on I2C_DW_0
default "I2C0"
choice
prompt "I2C0 Interrupts via"
default I2C_DW_0_IRQ_DIRECT
depends on I2C_DW_0
config I2C_DW_0_IRQ_DIRECT
bool "Direct Hardware Interrupt"
help
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.
endchoice
config I2C_DW_0_IRQ_SHARED_NAME
string "Device name for Shared IRQ"
depends on I2C_DW_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.
config I2C_DW_0_IRQ
int "Controller interrupt"
depends on I2C_DW_0 && I2C_DW_0_IRQ_DIRECT
default 0
config I2C_DW_0_INT_PRIORITY
int "Controller interrupt priority"
depends on I2C_DW_0 && I2C_DW_0_IRQ_DIRECT
default 0
help
IRQ priority
config I2C_DW_0_DEFAULT_CFG
hex "I2C default configuration"
depends on I2C_DW_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.
config I2C_DW_0_BUS
int "PCI Bus number"
depends on I2C_DW_0 && PCI
default 0
config I2C_DW_0_DEV
int "PCI device number"
depends on I2C_DW_0 && PCI
default 0
config I2C_DW_0_FUNCTION
int "PCI function number"
depends on I2C_DW_0 && PCI
default 0
config I2C_DW_0_BAR
int "PCI BAR number"
depends on I2C_DW_0 && PCI
default 0
config I2C_STATUS_DELAY
int "Delay for controller response"
depends on I2C
default 1000
config I2C_CLOCK_SPEED
int "Set the clock speed for I2C"
default 32
depends on I2C
config I2C_DEBUG
bool "Enable I2C debug options"
default n
depends on I2C
help
This option enables the debug features for I2C connections