Skip to content

Commit edded7a

Browse files
jonhunterthierryreding
authored andcommitted
soc/tegra: pmc: Refactor IO pad voltage control
For Tegra devices, only a subset of IO pads can be configured for 1.8V or 3.3V. Therefore, in the 'tegra_io_pad_soc' structure for Tegra SoCs either all or most of the 'voltage' entries are set to UINT_MAX to indicate the IO pad voltage cannot be configured. So for the majority of IO pads this configuration is not applicable. However, refactoring the IO pad data to move this parameter into a separate structure does not make sense because the benefits are marginal. Support for the Tegra264 IO pads is currently missing and the control for configuring the voltage for the IO pads for Tegra264 has changed. Instead of having a single register that is used for setting the IO pad voltage for all IO pads, there is now a register associated with the specific IO pad. For Tegra264, there is now only one IO pad that can be configured for 1.8V or 3.3V which is the sdmmc1-hv. While we could make this work with by adding a new SoC flag, the implementation will be a bit cumbersome. Therefore, it now seems reasonable to refactor the IO pad code. Hence, introduce a new 'tegra_io_pad_vctrl' structure that contains the register offset and bit for enabling/disabling 3.3V mode and move the existing voltage control data for supported SoCs to this structure. This has an added benefit of simplifying the code in the functions tegra_io_pad_get_voltage and tegra_io_pad_set_voltage. Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
1 parent 91d5b17 commit edded7a

1 file changed

Lines changed: 259 additions & 208 deletions

File tree

0 commit comments

Comments
 (0)