Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

soc/tegra: pmc: Remove public pad voltage APIs

Make tegra_io_pad_set_voltage() and tegra_io_pad_get_voltage() static
and remove the prototypes from pmc.h. Remove enum tegra_io_pad_voltage
and use the defines from <dt-bindings/pinctrl/pinctrl-tegra-io-pad.h>
instead.

These functions aren't used outside of the pmc driver and new use cases
should use the pinctrl interface instead.

Signed-off-by: Aapo Vienamo <avienamo@nvidia.com>
Acked-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>

authored by

Aapo Vienamo and committed by
Thierry Reding
fccf0f76 437c4f26

+8 -28
+8 -9
drivers/soc/tegra/pmc.c
··· 45 45 #include <soc/tegra/fuse.h> 46 46 #include <soc/tegra/pmc.h> 47 47 48 + #include <dt-bindings/pinctrl/pinctrl-tegra-io-pad.h> 49 + 48 50 #define PMC_CNTRL 0x0 49 51 #define PMC_CNTRL_INTR_POLARITY BIT(17) /* inverts INTR polarity */ 50 52 #define PMC_CNTRL_CPU_PWRREQ_OE BIT(16) /* CPU pwr req enable */ ··· 1093 1091 return !(value & mask); 1094 1092 } 1095 1093 1096 - int tegra_io_pad_set_voltage(enum tegra_io_pad id, 1097 - enum tegra_io_pad_voltage voltage) 1094 + static int tegra_io_pad_set_voltage(enum tegra_io_pad id, int voltage) 1098 1095 { 1099 1096 const struct tegra_io_pad_soc *pad; 1100 1097 u32 value; ··· 1110 1109 if (pmc->soc->has_impl_33v_pwr) { 1111 1110 value = tegra_pmc_readl(PMC_IMPL_E_33V_PWR); 1112 1111 1113 - if (voltage == TEGRA_IO_PAD_1800000UV) 1112 + if (voltage == TEGRA_IO_PAD_VOLTAGE_1V8) 1114 1113 value &= ~BIT(pad->voltage); 1115 1114 else 1116 1115 value |= BIT(pad->voltage); ··· 1125 1124 /* update I/O voltage */ 1126 1125 value = tegra_pmc_readl(PMC_PWR_DET_VALUE); 1127 1126 1128 - if (voltage == TEGRA_IO_PAD_1800000UV) 1127 + if (voltage == TEGRA_IO_PAD_VOLTAGE_1V8) 1129 1128 value &= ~BIT(pad->voltage); 1130 1129 else 1131 1130 value |= BIT(pad->voltage); ··· 1139 1138 1140 1139 return 0; 1141 1140 } 1142 - EXPORT_SYMBOL(tegra_io_pad_set_voltage); 1143 1141 1144 - int tegra_io_pad_get_voltage(enum tegra_io_pad id) 1142 + static int tegra_io_pad_get_voltage(enum tegra_io_pad id) 1145 1143 { 1146 1144 const struct tegra_io_pad_soc *pad; 1147 1145 u32 value; ··· 1158 1158 value = tegra_pmc_readl(PMC_PWR_DET_VALUE); 1159 1159 1160 1160 if ((value & BIT(pad->voltage)) == 0) 1161 - return TEGRA_IO_PAD_1800000UV; 1161 + return TEGRA_IO_PAD_VOLTAGE_1V8; 1162 1162 1163 - return TEGRA_IO_PAD_3300000UV; 1163 + return TEGRA_IO_PAD_VOLTAGE_3V3; 1164 1164 } 1165 - EXPORT_SYMBOL(tegra_io_pad_get_voltage); 1166 1165 1167 1166 /** 1168 1167 * tegra_io_rail_power_on() - enable power to I/O rail
-19
include/soc/tegra/pmc.h
··· 141 141 #define TEGRA_IO_RAIL_HDMI TEGRA_IO_PAD_HDMI 142 142 #define TEGRA_IO_RAIL_LVDS TEGRA_IO_PAD_LVDS 143 143 144 - /** 145 - * enum tegra_io_pad_voltage - voltage level of the I/O pad's source rail 146 - * @TEGRA_IO_PAD_1800000UV: 1.8 V 147 - * @TEGRA_IO_PAD_3300000UV: 3.3 V 148 - */ 149 - enum tegra_io_pad_voltage { 150 - TEGRA_IO_PAD_1800000UV, 151 - TEGRA_IO_PAD_3300000UV, 152 - }; 153 - 154 144 #ifdef CONFIG_SOC_TEGRA_PMC 155 145 int tegra_powergate_is_powered(unsigned int id); 156 146 int tegra_powergate_power_on(unsigned int id); ··· 153 163 154 164 int tegra_io_pad_power_enable(enum tegra_io_pad id); 155 165 int tegra_io_pad_power_disable(enum tegra_io_pad id); 156 - int tegra_io_pad_set_voltage(enum tegra_io_pad id, 157 - enum tegra_io_pad_voltage voltage); 158 - int tegra_io_pad_get_voltage(enum tegra_io_pad id); 159 166 160 167 /* deprecated, use tegra_io_pad_power_{enable,disable}() instead */ 161 168 int tegra_io_rail_power_on(unsigned int id); ··· 196 209 } 197 210 198 211 static inline int tegra_io_pad_power_disable(enum tegra_io_pad id) 199 - { 200 - return -ENOSYS; 201 - } 202 - 203 - static inline int tegra_io_pad_set_voltage(enum tegra_io_pad id, 204 - enum tegra_io_pad_voltage voltage) 205 212 { 206 213 return -ENOSYS; 207 214 }