Boot Linux faster!

Check our new training course

Boot Linux faster!

Check our new training course
and Creative Commons CC-BY-SA
lecture and lab materials

Bootlin logo

Elixir Cross Referencer

# Kconfig.dw - DesignWare GPIO configuration options
#
#
# Copyright (c) 2016 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

menuconfig GPIO_DW
	prompt "Designware GPIO"
	default n
	depends on GPIO
	bool
	help
	  Enable driver for Designware GPIO

if GPIO_DW

config GPIO_DW_IO_ACCESS
	prompt "I/O register access"
	default n
	default y if ARC
	depends on GPIO_DW
	bool
	help
	  Driver access configuration register by
	  I/O or auxiliary registers.

config GPIO_DW_BOTHEDGES_SUPPORT
	bool
	prompt "Interrupt on Both Edges"
	default y
	depends on GPIO_DW && !ARC
	help
	This option is enabled by platforms that
	supports the interrupt-both-edges feature.
	This feature allows the GPIO hardware to
	trigger and interrupt on both, falling and
	rising, edges of an input.

config GPIO_DW_SHARED_IRQ
	bool
	default n
	depends on GPIO_DW

config	GPIO_DW_VENDOR_ID
	hex "PCI Vendor ID"
	depends on GPIO_DW && PCI
	default 0x8086

config	GPIO_DW_DEVICE_ID
	hex "PCI Device ID"
	depends on GPIO_DW && PCI
	default 0x934

config	GPIO_DW_CLASS
	hex "PCI class"
	depends on GPIO_DW && PCI
	default 0x0C

config GPIO_DW_INIT_PRIORITY
	int
	default 60
	depends on GPIO_DW
	prompt "Init priority"
	help
	  Device driver initialization priority.

config GPIO_DW_CLOCK_GATE
	bool "Enable glock gating"
	depends on GPIO_DW
	select CLOCK_CONTROL
	default n

config GPIO_DW_CLOCK_GATE_DRV_NAME
	string
	depends on GPIO_DW_CLOCK_GATE
	default ""

config GPIO_DW_0
       bool "Designware GPIO block 0"
       depends on GPIO_DW
       default n
       help
       Include Designware GPIO driver

config GPIO_DW_0_NAME
       string "Driver name"
       depends on GPIO_DW_0
       default "GPIO_0"

config GPIO_DW_0_BASE_ADDR
       hex "Controller base address"
       depends on GPIO_DW_0

config	GPIO_DW_0_BUS
	int "Port 0 PCI Bus"
	depends on GPIO_DW_0 && PCI

config	GPIO_DW_0_DEV
	int "Port 0 PCI Dev"
	depends on GPIO_DW_0 && PCI

config  GPIO_DW_0_FUNCTION
	int "PCI function number"
	depends on GPIO_DW_0 && PCI

config  GPIO_DW_0_BAR
	int "PCI BAR slot"
	depends on GPIO_DW_0 && PCI

config GPIO_DW_0_BITS
       int "Number of pins controlled"
       depends on GPIO_DW_0
       help
       Number of pins controlled by controller

config GPIO_DW_0_CLOCK_GATE_SUBSYS
	int "Clock controller's subsystem"
	depends on GPIO_DW_CLOCK_GATE && GPIO_DW_0

choice
	prompt "Port 0 Interrupts via"
	default GPIO_DW_0_IRQ_DIRECT
	depends on GPIO_DW_0

config GPIO_DW_0_IRQ_DIRECT
	bool "Direct Hardware Interrupt"
	help
	  When interrupts fire, the driver's ISR function is being called directly.

config GPIO_DW_0_IRQ_SHARED
	bool "Shared IRQ"
	depends on SHARED_IRQ
	select GPIO_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

choice
prompt "DW GPIO port 0 trigger condition"
default GPIO_DW_0_RISING_EDGE
depends on GPIO_DW_0 && GPIO_DW_0_IRQ_DIRECT

config GPIO_DW_0_FALLING_EDGE
	bool "Falling edge"
	help
	  DW GPIO port 0 uses falling edge interrupt

config GPIO_DW_0_RISING_EDGE
	bool "Rising edge"
	help
	  DW GPIO port 0 uses rising edge interrupt

config GPIO_DW_0_LEVEL_HIGH
	bool "Level high"
	help
	  DW GPIO port 0 uses level high interrupt

config GPIO_DW_0_LEVEL_LOW
	bool "Level low"
	help
	  DW GPIO port 0 uses level low interrupt

endchoice

config GPIO_DW_0_IRQ_SHARED_NAME
	string "Device name for Shared IRQ"
	depends on GPIO_DW_0 && GPIO_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 GPIO_DW_0_IRQ
       int "Controller interrupt number"
       depends on GPIO_DW_0 && GPIO_DW_0_IRQ_DIRECT
       help
       IRQ number for the controller

config GPIO_DW_0_PRI
       int "Controller interrupt priority"
       depends on GPIO_DW_0 && GPIO_DW_0_IRQ_DIRECT
       help
       IRQ priority

config GPIO_DW_1
       bool "Designware GPIO block 1"
       depends on GPIO_DW
       default n
       help
       Include Designware GPIO driver

config GPIO_DW_1_NAME
       string "Driver name"
       depends on GPIO_DW_1
       default "GPIO_1"

config GPIO_DW_1_BASE_ADDR
       hex "Controller base address"
       depends on GPIO_DW_1

config GPIO_DW_1_BITS
       int "Number of pins controlled"
       depends on GPIO_DW_1
       help
       Number of pins controlled by controller

config GPIO_DW_1_CLOCK_GATE_SUBSYS
	int "Clock controller's subsystem"
	depends on GPIO_DW_CLOCK_GATE && GPIO_DW_1

choice
	prompt "Port 1 Interrupts via"
	default GPIO_DW_1_IRQ_DIRECT
	depends on GPIO_DW_1

config GPIO_DW_1_IRQ_DIRECT
	bool "Direct Hardware Interrupt"
	help
	  When interrupts fire, the driver's ISR function is being called directly.

config GPIO_DW_1_IRQ_SHARED
	bool "Shared IRQ"
	depends on SHARED_IRQ
	select GPIO_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 GPIO_DW_1_IRQ_SHARED_NAME
	string "Device name for Shared IRQ"
	depends on GPIO_DW_1_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 GPIO_DW_1_IRQ
       int "Controller interrupt number"
       depends on GPIO_DW_1 && GPIO_DW_1_IRQ_DIRECT
       help
       IRQ number for the controller

config GPIO_DW_1_PRI
       int "Controller interrupt priority"
       depends on GPIO_DW_1 && GPIO_DW_1_IRQ_DIRECT
       help
       IRQ priority

choice
prompt "DW GPIO port 1 trigger condition"
default GPIO_DW_1_RISING_EDGE
depends on GPIO_DW_1 && GPIO_DW_1_IRQ_DIRECT

config GPIO_DW_1_FALLING_EDGE
	bool "Falling edge"
	help
	  DW GPIO port 1 uses falling edge interrupt

config GPIO_DW_1_RISING_EDGE
	bool "Rising edge"
	help
	  DW GPIO port 1 uses rising edge interrupt

config GPIO_DW_1_LEVEL_HIGH
	bool "Level high"
	help
	  DW GPIO port 1 uses level high interrupt

config GPIO_DW_1_LEVEL_LOW
	bool "Level low"
	help
	  DW GPIO port 1 uses level low interrupt

endchoice

endif # GPIO_DW