NVIDIA: SAUCE: pinctrl: tegra: Add config property GPIO mode

BugLink: https://bugs.launchpad.net/bugs/2080908

The sfio/gpio select bit that is set for a given pin is not displayed,
adding the support to retrieve this information from the
pinmux set for each pin.

http://nvbugs/4504578
http://nvbugs/4754882

Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
Reviewed-by: Petlozu Pravareshwar <petlozup@nvidia.com>
Tested-by: Petlozu Pravareshwar <petlozup@nvidia.com>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Noah Wager <noah.wager@canonical.com>
Acked-by: Jacob Martin <jacob.martin@canonical.com>
Signed-off-by: Noah Wager <noah.wager@canonical.com>
This commit is contained in:
Prathamesh Shete
2024-03-18 06:38:44 +00:00
committed by Noah Wager
parent 7562fbfa12
commit 63dc7e4d70
2 changed files with 9 additions and 0 deletions
+7
View File
@@ -96,6 +96,7 @@ static const struct cfg_param {
{"nvidia,slew-rate-falling", TEGRA_PINCONF_PARAM_SLEW_RATE_FALLING},
{"nvidia,slew-rate-rising", TEGRA_PINCONF_PARAM_SLEW_RATE_RISING},
{"nvidia,drive-type", TEGRA_PINCONF_PARAM_DRIVE_TYPE},
{"nvidia,gpio-mode", TEGRA_PINCONF_PARAM_GPIO_MODE},
};
static int tegra_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
@@ -473,6 +474,12 @@ static int tegra_pinconf_reg(struct tegra_pmx *pmx,
*bit = g->drvtype_bit;
*width = 2;
break;
case TEGRA_PINCONF_PARAM_GPIO_MODE:
*bank = g->mux_bank;
*reg = g->mux_reg;
*bit = g->sfsel_bit;
*width = 1;
break;
default:
dev_err(pmx->dev, "Invalid config param %04x\n", param);
return -ENOTSUPP;
+2
View File
@@ -54,6 +54,8 @@ enum tegra_pinconf_param {
TEGRA_PINCONF_PARAM_SLEW_RATE_RISING,
/* argument: Integer, range is HW-dependant */
TEGRA_PINCONF_PARAM_DRIVE_TYPE,
/* argument: Boolean */
TEGRA_PINCONF_PARAM_GPIO_MODE,
};
enum tegra_pinconf_pull {