mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-11-30 15:11:43 +01:00
dm: pinctrl: sync with Linux to use pin_config_param
Sync with Linux commit 30a7acd573899fd8b("Linux 4.15-rc6")
to use enum pin_config_param.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
d1ccaa4760
commit
0fe4e41825
@ -137,6 +137,12 @@ struct pinctrl_ops {
|
|||||||
/**
|
/**
|
||||||
* Generic pin configuration paramters
|
* Generic pin configuration paramters
|
||||||
*
|
*
|
||||||
|
* enum pin_config_param - possible pin configuration parameters
|
||||||
|
* @PIN_CONFIG_BIAS_BUS_HOLD: the pin will be set to weakly latch so that it
|
||||||
|
* weakly drives the last value on a tristate bus, also known as a "bus
|
||||||
|
* holder", "bus keeper" or "repeater". This allows another device on the
|
||||||
|
* bus to change the value by driving the bus high or low and switching to
|
||||||
|
* tristate. The argument is ignored.
|
||||||
* @PIN_CONFIG_BIAS_DISABLE: disable any pin bias on the pin, a
|
* @PIN_CONFIG_BIAS_DISABLE: disable any pin bias on the pin, a
|
||||||
* transition from say pull-up to pull-down implies that you disable
|
* transition from say pull-up to pull-down implies that you disable
|
||||||
* pull-up in the process, this setting disables all biasing.
|
* pull-up in the process, this setting disables all biasing.
|
||||||
@ -146,14 +152,6 @@ struct pinctrl_ops {
|
|||||||
* if for example some other pin is going to drive the signal connected
|
* if for example some other pin is going to drive the signal connected
|
||||||
* to it for a while. Pins used for input are usually always high
|
* to it for a while. Pins used for input are usually always high
|
||||||
* impedance.
|
* impedance.
|
||||||
* @PIN_CONFIG_BIAS_BUS_HOLD: the pin will be set to weakly latch so that it
|
|
||||||
* weakly drives the last value on a tristate bus, also known as a "bus
|
|
||||||
* holder", "bus keeper" or "repeater". This allows another device on the
|
|
||||||
* bus to change the value by driving the bus high or low and switching to
|
|
||||||
* tristate. The argument is ignored.
|
|
||||||
* @PIN_CONFIG_BIAS_PULL_UP: the pin will be pulled up (usually with high
|
|
||||||
* impedance to VDD). If the argument is != 0 pull-up is enabled,
|
|
||||||
* if it is 0, pull-up is total, i.e. the pin is connected to VDD.
|
|
||||||
* @PIN_CONFIG_BIAS_PULL_DOWN: the pin will be pulled down (usually with high
|
* @PIN_CONFIG_BIAS_PULL_DOWN: the pin will be pulled down (usually with high
|
||||||
* impedance to GROUND). If the argument is != 0 pull-down is enabled,
|
* impedance to GROUND). If the argument is != 0 pull-down is enabled,
|
||||||
* if it is 0, pull-down is total, i.e. the pin is connected to GROUND.
|
* if it is 0, pull-down is total, i.e. the pin is connected to GROUND.
|
||||||
@ -165,10 +163,9 @@ struct pinctrl_ops {
|
|||||||
* If the argument is != 0 pull up/down is enabled, if it is 0, the
|
* If the argument is != 0 pull up/down is enabled, if it is 0, the
|
||||||
* configuration is ignored. The proper way to disable it is to use
|
* configuration is ignored. The proper way to disable it is to use
|
||||||
* @PIN_CONFIG_BIAS_DISABLE.
|
* @PIN_CONFIG_BIAS_DISABLE.
|
||||||
* @PIN_CONFIG_DRIVE_PUSH_PULL: the pin will be driven actively high and
|
* @PIN_CONFIG_BIAS_PULL_UP: the pin will be pulled up (usually with high
|
||||||
* low, this is the most typical case and is typically achieved with two
|
* impedance to VDD). If the argument is != 0 pull-up is enabled,
|
||||||
* active transistors on the output. Setting this config will enable
|
* if it is 0, pull-up is total, i.e. the pin is connected to VDD.
|
||||||
* push-pull mode, the argument is ignored.
|
|
||||||
* @PIN_CONFIG_DRIVE_OPEN_DRAIN: the pin will be driven with open drain (open
|
* @PIN_CONFIG_DRIVE_OPEN_DRAIN: the pin will be driven with open drain (open
|
||||||
* collector) which means it is usually wired with other output ports
|
* collector) which means it is usually wired with other output ports
|
||||||
* which are then pulled up with an external resistor. Setting this
|
* which are then pulled up with an external resistor. Setting this
|
||||||
@ -176,59 +173,82 @@ struct pinctrl_ops {
|
|||||||
* @PIN_CONFIG_DRIVE_OPEN_SOURCE: the pin will be driven with open source
|
* @PIN_CONFIG_DRIVE_OPEN_SOURCE: the pin will be driven with open source
|
||||||
* (open emitter). Setting this config will enable open source mode, the
|
* (open emitter). Setting this config will enable open source mode, the
|
||||||
* argument is ignored.
|
* argument is ignored.
|
||||||
|
* @PIN_CONFIG_DRIVE_PUSH_PULL: the pin will be driven actively high and
|
||||||
|
* low, this is the most typical case and is typically achieved with two
|
||||||
|
* active transistors on the output. Setting this config will enable
|
||||||
|
* push-pull mode, the argument is ignored.
|
||||||
* @PIN_CONFIG_DRIVE_STRENGTH: the pin will sink or source at most the current
|
* @PIN_CONFIG_DRIVE_STRENGTH: the pin will sink or source at most the current
|
||||||
* passed as argument. The argument is in mA.
|
* passed as argument. The argument is in mA.
|
||||||
* @PIN_CONFIG_INPUT_ENABLE: enable the pin's input. Note that this does not
|
|
||||||
* affect the pin's ability to drive output. 1 enables input, 0 disables
|
|
||||||
* input.
|
|
||||||
* @PIN_CONFIG_INPUT_SCHMITT_ENABLE: control schmitt-trigger mode on the pin.
|
|
||||||
* If the argument != 0, schmitt-trigger mode is enabled. If it's 0,
|
|
||||||
* schmitt-trigger mode is disabled.
|
|
||||||
* @PIN_CONFIG_INPUT_SCHMITT: this will configure an input pin to run in
|
|
||||||
* schmitt-trigger mode. If the schmitt-trigger has adjustable hysteresis,
|
|
||||||
* the threshold value is given on a custom format as argument when
|
|
||||||
* setting pins to this mode.
|
|
||||||
* @PIN_CONFIG_INPUT_DEBOUNCE: this will configure the pin to debounce mode,
|
* @PIN_CONFIG_INPUT_DEBOUNCE: this will configure the pin to debounce mode,
|
||||||
* which means it will wait for signals to settle when reading inputs. The
|
* which means it will wait for signals to settle when reading inputs. The
|
||||||
* argument gives the debounce time in usecs. Setting the
|
* argument gives the debounce time in usecs. Setting the
|
||||||
* argument to zero turns debouncing off.
|
* argument to zero turns debouncing off.
|
||||||
* @PIN_CONFIG_POWER_SOURCE: if the pin can select between different power
|
* @PIN_CONFIG_INPUT_ENABLE: enable the pin's input. Note that this does not
|
||||||
* supplies, the argument to this parameter (on a custom format) tells
|
* affect the pin's ability to drive output. 1 enables input, 0 disables
|
||||||
* the driver which alternative power source to use.
|
* input.
|
||||||
* @PIN_CONFIG_SLEW_RATE: if the pin can select slew rate, the argument to
|
* @PIN_CONFIG_INPUT_SCHMITT: this will configure an input pin to run in
|
||||||
* this parameter (on a custom format) tells the driver which alternative
|
* schmitt-trigger mode. If the schmitt-trigger has adjustable hysteresis,
|
||||||
* slew rate to use.
|
* the threshold value is given on a custom format as argument when
|
||||||
|
* setting pins to this mode.
|
||||||
|
* @PIN_CONFIG_INPUT_SCHMITT_ENABLE: control schmitt-trigger mode on the pin.
|
||||||
|
* If the argument != 0, schmitt-trigger mode is enabled. If it's 0,
|
||||||
|
* schmitt-trigger mode is disabled.
|
||||||
* @PIN_CONFIG_LOW_POWER_MODE: this will configure the pin for low power
|
* @PIN_CONFIG_LOW_POWER_MODE: this will configure the pin for low power
|
||||||
* operation, if several modes of operation are supported these can be
|
* operation, if several modes of operation are supported these can be
|
||||||
* passed in the argument on a custom form, else just use argument 1
|
* passed in the argument on a custom form, else just use argument 1
|
||||||
* to indicate low power mode, argument 0 turns low power mode off.
|
* to indicate low power mode, argument 0 turns low power mode off.
|
||||||
* @PIN_CONFIG_OUTPUT: this will configure the pin as an output. Use argument
|
* @PIN_CONFIG_OUTPUT_ENABLE: this will enable the pin's output mode
|
||||||
* 1 to indicate high level, argument 0 to indicate low level. (Please
|
* without driving a value there. For most platforms this reduces to
|
||||||
* see Documentation/pinctrl.txt, section "GPIO mode pitfalls" for a
|
* enable the output buffers and then let the pin controller current
|
||||||
* discussion around this parameter.)
|
* configuration (eg. the currently selected mux function) drive values on
|
||||||
|
* the line. Use argument 1 to enable output mode, argument 0 to disable
|
||||||
|
* it.
|
||||||
|
* @PIN_CONFIG_OUTPUT: this will configure the pin as an output and drive a
|
||||||
|
* value on the line. Use argument 1 to indicate high level, argument 0 to
|
||||||
|
* indicate low level. (Please see Documentation/driver-api/pinctl.rst,
|
||||||
|
* section "GPIO mode pitfalls" for a discussion around this parameter.)
|
||||||
|
* @PIN_CONFIG_POWER_SOURCE: if the pin can select between different power
|
||||||
|
* supplies, the argument to this parameter (on a custom format) tells
|
||||||
|
* the driver which alternative power source to use.
|
||||||
|
* @PIN_CONFIG_SLEEP_HARDWARE_STATE: indicate this is sleep related state.
|
||||||
|
* @PIN_CONFIG_SLEW_RATE: if the pin can select slew rate, the argument to
|
||||||
|
* this parameter (on a custom format) tells the driver which alternative
|
||||||
|
* slew rate to use.
|
||||||
|
* @PIN_CONFIG_SKEW_DELAY: if the pin has programmable skew rate (on inputs)
|
||||||
|
* or latch delay (on outputs) this parameter (in a custom format)
|
||||||
|
* specifies the clock skew or latch delay. It typically controls how
|
||||||
|
* many double inverters are put in front of the line.
|
||||||
* @PIN_CONFIG_END: this is the last enumerator for pin configurations, if
|
* @PIN_CONFIG_END: this is the last enumerator for pin configurations, if
|
||||||
* you need to pass in custom configurations to the pin controller, use
|
* you need to pass in custom configurations to the pin controller, use
|
||||||
* PIN_CONFIG_END+1 as the base offset.
|
* PIN_CONFIG_END+1 as the base offset.
|
||||||
|
* @PIN_CONFIG_MAX: this is the maximum configuration value that can be
|
||||||
|
* presented using the packed format.
|
||||||
*/
|
*/
|
||||||
#define PIN_CONFIG_BIAS_DISABLE 0
|
enum pin_config_param {
|
||||||
#define PIN_CONFIG_BIAS_HIGH_IMPEDANCE 1
|
PIN_CONFIG_BIAS_BUS_HOLD,
|
||||||
#define PIN_CONFIG_BIAS_BUS_HOLD 2
|
PIN_CONFIG_BIAS_DISABLE,
|
||||||
#define PIN_CONFIG_BIAS_PULL_UP 3
|
PIN_CONFIG_BIAS_HIGH_IMPEDANCE,
|
||||||
#define PIN_CONFIG_BIAS_PULL_DOWN 4
|
PIN_CONFIG_BIAS_PULL_DOWN,
|
||||||
#define PIN_CONFIG_BIAS_PULL_PIN_DEFAULT 5
|
PIN_CONFIG_BIAS_PULL_PIN_DEFAULT,
|
||||||
#define PIN_CONFIG_DRIVE_PUSH_PULL 6
|
PIN_CONFIG_BIAS_PULL_UP,
|
||||||
#define PIN_CONFIG_DRIVE_OPEN_DRAIN 7
|
PIN_CONFIG_DRIVE_OPEN_DRAIN,
|
||||||
#define PIN_CONFIG_DRIVE_OPEN_SOURCE 8
|
PIN_CONFIG_DRIVE_OPEN_SOURCE,
|
||||||
#define PIN_CONFIG_DRIVE_STRENGTH 9
|
PIN_CONFIG_DRIVE_PUSH_PULL,
|
||||||
#define PIN_CONFIG_INPUT_ENABLE 10
|
PIN_CONFIG_DRIVE_STRENGTH,
|
||||||
#define PIN_CONFIG_INPUT_SCHMITT_ENABLE 11
|
PIN_CONFIG_INPUT_DEBOUNCE,
|
||||||
#define PIN_CONFIG_INPUT_SCHMITT 12
|
PIN_CONFIG_INPUT_ENABLE,
|
||||||
#define PIN_CONFIG_INPUT_DEBOUNCE 13
|
PIN_CONFIG_INPUT_SCHMITT,
|
||||||
#define PIN_CONFIG_POWER_SOURCE 14
|
PIN_CONFIG_INPUT_SCHMITT_ENABLE,
|
||||||
#define PIN_CONFIG_SLEW_RATE 15
|
PIN_CONFIG_LOW_POWER_MODE,
|
||||||
#define PIN_CONFIG_LOW_POWER_MODE 16
|
PIN_CONFIG_OUTPUT_ENABLE,
|
||||||
#define PIN_CONFIG_OUTPUT 17
|
PIN_CONFIG_OUTPUT,
|
||||||
#define PIN_CONFIG_END 0x7FFF
|
PIN_CONFIG_POWER_SOURCE,
|
||||||
|
PIN_CONFIG_SLEEP_HARDWARE_STATE,
|
||||||
|
PIN_CONFIG_SLEW_RATE,
|
||||||
|
PIN_CONFIG_SKEW_DELAY,
|
||||||
|
PIN_CONFIG_END = 0x7F,
|
||||||
|
PIN_CONFIG_MAX = 0xFF,
|
||||||
|
};
|
||||||
|
|
||||||
#if CONFIG_IS_ENABLED(PINCTRL_GENERIC)
|
#if CONFIG_IS_ENABLED(PINCTRL_GENERIC)
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user