Skip to contentSkip to conversation

clk: tegra: provide tegra_periph_reset_assert alternative

PATCH New Arnd Bergmann 3 participants 4 messages Jun 21, 2013 – Jun 24, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: tegra: provide tegra_periph_reset_assert alternative

We have some tegra device drivers that are written to be platform independent but still use the tegra specific tegra_periph_reset_assert function. In order to build and link them without errors, this provides a static inline version of these functions that does nothing when Tegra support is disabled.

include/linux/clk/tegra.h +5 -0
index 642789b..1397190 100644
@@ -120,8 +120,13 @@ static inline void tegra_cpu_clock_resume(void)
 }
 #endif
 
+#ifdef ARCH_TEGRA
 void tegra_periph_reset_deassert(struct clk *c);
 void tegra_periph_reset_assert(struct clk *c);
+#else
+static inline void tegra_periph_reset_deassert(struct clk *c) {}
+static inline void tegra_periph_reset_assert(struct clk *c) {}
+#endif
 void tegra_clocks_init(void);
 void tegra_clocks_apply_init_table(void);
 
#1 lore raw

PATCH 1/1 clk: tegra: provide tegra_periph_reset_assert alternative

Quoted 5 lines · Arnd Bergmann

We have some tegra device drivers that are written to be platform independent but still use the tegra specific tegra_periph_reset_assert function. In order to build and link them without errors, this provides a static inline version of these functions that does nothing when Tegra support is disabled.

Oh, I thought this had been applied already.

Hopefully we'll be replacing these custom APIs with the standard module reset APIs soon (post 3.11 though). I've seen internally the first round of patches from Prashant for this, so chances are good they'll be finalized and sent upstream in the not-too-distant future.

#2 lore raw

PATCH 1/1 clk: tegra: provide tegra_periph_reset_assert alternative

Quoting Stephen Warren (2013-06-21 14:19:51)

Quoted 7 lines · Arnd Bergmann
Quoted 5 lines

We have some tegra device drivers that are written to be platform independent but still use the tegra specific tegra_periph_reset_assert function. In order to build and link them without errors, this provides a static inline version of these functions that does nothing when Tegra support is disabled.

Quoted 8 lines

Oh, I thought this had been applied already.

Hopefully we'll be replacing these custom APIs with the standard module reset APIs soon (post 3.11 though). I've seen internally the first round of patches from Prashant for this, so chances are good they'll be finalized and sent upstream in the not-too-distant future.

This fix has been taken into clk-next for 3.11. tegra_clocks_init() is missing in the clock tree so the patch below is what actually got merged.

Thanks,
Mike

commit 7064f6bd86278029348c36d30bd325e7e05b6fee

Author: Arnd Bergmann <[email protected]>
Date:   Fri Jun 21 22:32:26 2013 +0200

clk: tegra: provide tegra_periph_reset_assert alternative

We have some tegra device drivers that are written to be platform independent but still use the tegra specific tegra_periph_reset_assert function. In order to build and link them without errors, this provides a static inline version of these functions that does nothing when Tegra support is disabled.

[mturquette at linaro.org: fixed up trivial merge issue]
include/linux/clk/tegra.h +5 -0
index 3670a4f..e3cc872 100644
@@ -120,8 +120,13 @@ static inline void tegra_cpu_clock_resume(void)
 }
 #endif
 
+#ifdef ARCH_TEGRA
 void tegra_periph_reset_deassert(struct clk *c);
 void tegra_periph_reset_assert(struct clk *c);
+#else
+static inline void tegra_periph_reset_deassert(struct clk *c) {}
+static inline void tegra_periph_reset_assert(struct clk *c) {}
+#endif
 void tegra_clocks_apply_init_table(void);
 
 #endif /* __LINUX_CLK_TEGRA_H_ */
#3 lore raw

PATCH 1/1 clk: tegra: provide tegra_periph_reset_assert alternative

In reply to Arnd Bergmann

include/linux/clk/tegra.h static inline void tegra_cpu_clock_resume(void) · line 123

Quoted 9 lines · Arnd Bergmann

We have some tegra device drivers that are written to be platform independent but still use the tegra specific tegra_periph_reset_assert function. In order to build and link them without errors, this provides a static inline version of these functions that does nothing when Tegra support is disabled.

include/linux/clk/tegra.h +1 -0
 
+#ifdef ARCH_TEGRA

That should be CONFIG_ARCH_TEGRA, right? Sorry I didn't notice that before. This causes the Tegra i2c driver to fail on some platforms in next-20130624, resulting in a BUG() during boot.

Do you want to amend this patch, or should I send a fixup?