diff options
author | Aapo Vienamo <avienamo@nvidia.com> | 2018-08-10 14:08:09 -0400 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2018-08-27 06:25:17 -0400 |
commit | f142b9d6461c4f60feb2a602bafcd582aa324288 (patch) | |
tree | e9fcf5817d0274716362a921475d6b7ba2f8f46d | |
parent | 00ead3c913afe8872a428e56e2a815adb2b230d1 (diff) |
soc/tegra: pmc: Implement tegra_io_pad_is_powered()
Implement a function to query whether a pad is in deep power down mode.
This is needed by the pinctrl callbacks.
Signed-off-by: Aapo Vienamo <avienamo@nvidia.com>
Acked-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r-- | drivers/soc/tegra/pmc.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c index c04ff5eb7cad..d366ebcca171 100644 --- a/drivers/soc/tegra/pmc.c +++ b/drivers/soc/tegra/pmc.c | |||
@@ -1075,6 +1075,21 @@ unlock: | |||
1075 | } | 1075 | } |
1076 | EXPORT_SYMBOL(tegra_io_pad_power_disable); | 1076 | EXPORT_SYMBOL(tegra_io_pad_power_disable); |
1077 | 1077 | ||
1078 | static int tegra_io_pad_is_powered(enum tegra_io_pad id) | ||
1079 | { | ||
1080 | unsigned long request, status; | ||
1081 | u32 mask, value; | ||
1082 | int err; | ||
1083 | |||
1084 | err = tegra_io_pad_get_dpd_register_bit(id, &request, &status, &mask); | ||
1085 | if (err) | ||
1086 | return err; | ||
1087 | |||
1088 | value = tegra_pmc_readl(status); | ||
1089 | |||
1090 | return !(value & mask); | ||
1091 | } | ||
1092 | |||
1078 | int tegra_io_pad_set_voltage(enum tegra_io_pad id, | 1093 | int tegra_io_pad_set_voltage(enum tegra_io_pad id, |
1079 | enum tegra_io_pad_voltage voltage) | 1094 | enum tegra_io_pad_voltage voltage) |
1080 | { | 1095 | { |