public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH V2 1/2] ARM: tegra: add function to clear pinmux CLAMPING bit
@ 2015-02-18 20:27 Stephen Warren
  2015-02-18 20:27 ` [U-Boot] [PATCH V2 2/2] ARM: tegra: import latest Jetson TK1 pinmux Stephen Warren
  2015-02-19 18:53 ` [U-Boot] [PATCH V2 1/2] ARM: tegra: add function to clear pinmux CLAMPING bit Simon Glass
  0 siblings, 2 replies; 5+ messages in thread
From: Stephen Warren @ 2015-02-18 20:27 UTC (permalink / raw)
  To: u-boot

From: Stephen Warren <swarren@nvidia.com>

This is needed to correctly apply the new Jetson TK1 pinmux config.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
v2:
* Use clrbits_le32() rather than open-code read/modify/write statements.
* Update pinmux_set_tristate_input_clamping to match.
---
 arch/arm/cpu/tegra-common/pinmux-common.c | 12 ++++++++----
 arch/arm/include/asm/arch-tegra/pinmux.h  |  3 ++-
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/arch/arm/cpu/tegra-common/pinmux-common.c b/arch/arm/cpu/tegra-common/pinmux-common.c
index 6e3ab0c14ca2..64baed45d591 100644
--- a/arch/arm/cpu/tegra-common/pinmux-common.c
+++ b/arch/arm/cpu/tegra-common/pinmux-common.c
@@ -94,11 +94,15 @@
 void pinmux_set_tristate_input_clamping(void)
 {
 	u32 *reg = _R(APB_MISC_PP_PINMUX_GLOBAL_0);
-	u32 val;
 
-	val = readl(reg);
-	val |= CLAMP_INPUTS_WHEN_TRISTATED;
-	writel(val, reg);
+	setbits_le32(reg, CLAMP_INPUTS_WHEN_TRISTATED);
+}
+
+void pinmux_clear_tristate_input_clamping(void)
+{
+	u32 *reg = _R(APB_MISC_PP_PINMUX_GLOBAL_0);
+
+	clrbits_le32(reg, CLAMP_INPUTS_WHEN_TRISTATED);
 }
 #endif
 
diff --git a/arch/arm/include/asm/arch-tegra/pinmux.h b/arch/arm/include/asm/arch-tegra/pinmux.h
index da477697bf02..ab764960fa7f 100644
--- a/arch/arm/include/asm/arch-tegra/pinmux.h
+++ b/arch/arm/include/asm/arch-tegra/pinmux.h
@@ -81,8 +81,9 @@ struct pmux_pingrp_config {
 };
 
 #if !defined(CONFIG_TEGRA20) && !defined(CONFIG_TEGRA30)
-/* Set the pinmux CLAMP_INPUTS_WHEN_TRISTATED bit */
+/* Set/clear the pinmux CLAMP_INPUTS_WHEN_TRISTATED bit */
 void pinmux_set_tristate_input_clamping(void);
+void pinmux_clear_tristate_input_clamping(void);
 #endif
 
 /* Set the mux function for a pin group */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-03-03 20:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-18 20:27 [U-Boot] [PATCH V2 1/2] ARM: tegra: add function to clear pinmux CLAMPING bit Stephen Warren
2015-02-18 20:27 ` [U-Boot] [PATCH V2 2/2] ARM: tegra: import latest Jetson TK1 pinmux Stephen Warren
2015-03-03 20:18   ` Stephen Warren
2015-03-03 20:58     ` Tom Warren
2015-02-19 18:53 ` [U-Boot] [PATCH V2 1/2] ARM: tegra: add function to clear pinmux CLAMPING bit Simon Glass

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox