@@ -221,6 +221,8 @@ ehrpwm1_pins: pinmux-ehrpwm1-pins {
pinctrl-single,pins = <
AM33XX_PADCONF(AM335X_PIN_GPMC_A2, PIN_OUTPUT_PULLDOWN, MUX_MODE6) /* (U14) gpmc_a2.ehrpwm1A */
>;
+ pinctrl-single,bias-pulldown = <8 8 0 24>;
+ /*pinctrl-single,bias-pullup = <24 24 0 24>;*/
};
mmc0_pins: pinmux-mmc0-pins {
@@ -288,7 +288,7 @@ scm: scm@0 {
ranges = <0 0 0x2000>;
am33xx_pinmux: pinmux@800 {
- compatible = "pinctrl-single";
+ compatible = "pinconf-single";
reg = <0x800 0x238>;
#pinctrl-cells = <2>;
pinctrl-single,register-width = <32>;
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
# generic gpio support: platform drivers, dedicated expander chips, etc
-ccflags-$(CONFIG_DEBUG_GPIO) += -DDEBUG
+ccflags-$(CONFIG_DEBUG_GPIO) += -DDEBUG -fno-inline
obj-$(CONFIG_GPIOLIB) += gpiolib.o
obj-$(CONFIG_GPIOLIB) += gpiolib-devres.o
@@ -871,6 +871,21 @@ static int omap_gpio_get_multiple(struct gpio_chip *chip, unsigned long *mask,
return 0;
}
+/**
+ * omap_gpio_bias() - apply configuration for a pin
+ * @gc: the gpiochip owning the GPIO
+ * @offset: the offset of the GPIO to apply the configuration
+ * @config: the configuration to be applied
+ */
+static int omap_gpio_bias(struct gpio_chip *gc, unsigned offset, unsigned long config)
+{
+ int ret = 0;
+
+ ret = gpiochip_generic_config(gc, offset, config);
+ return ret;
+}
+
+
static int omap_gpio_debounce(struct gpio_chip *chip, unsigned offset,
unsigned debounce)
{
@@ -896,12 +911,26 @@ static int omap_gpio_set_config(struct gpio_chip *chip, unsigned offset,
unsigned long config)
{
u32 debounce;
+ u32 config_arg;
+ int ret;
- if (pinconf_to_config_param(config) != PIN_CONFIG_INPUT_DEBOUNCE)
- return -ENOTSUPP;
+ if ((pinconf_to_config_param(config) == PIN_CONFIG_BIAS_DISABLE) ||
+ (pinconf_to_config_param(config) == PIN_CONFIG_BIAS_PULL_UP) ||
+ (pinconf_to_config_param(config) == PIN_CONFIG_BIAS_PULL_DOWN))
+ {
+ ret = omap_gpio_bias(chip, offset, config);
+ }
+ else if (pinconf_to_config_param(config) == PIN_CONFIG_INPUT_DEBOUNCE)
+ {
+ debounce = pinconf_to_config_argument(config);
+ ret = omap_gpio_debounce(chip, offset, debounce);
+ }
+ else
+ {
+ ret = -ENOTSUPP;
+ }
- debounce = pinconf_to_config_argument(config);
- return omap_gpio_debounce(chip, offset, debounce);
+ return ret;
}
static void omap_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
# generic pinmux support
-subdir-ccflags-$(CONFIG_DEBUG_PINCTRL) += -DDEBUG
+subdir-ccflags-$(CONFIG_DEBUG_PINCTRL) += -DDEBUG -fno-inline
obj-y += core.o pinctrl-utils.o
obj-$(CONFIG_PINMUX) += pinmux.o