aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuman Anna <s-anna@ti.com>2015-10-05 19:28:21 -0400
committerTony Lindgren <tony@atomide.com>2015-11-30 16:18:23 -0500
commitea05d2eaf66543e1305a6eb0f1a46db1257731c4 (patch)
tree2a5b46da46e8c80035a6881a5bec0c75f87a23cc
parentb6a89194182fe7a33d383463b8b9af6e117d8146 (diff)
ARM: OMAP: dmtimer: check for fixed timers during config
The omap_dm_timer_set_source() function provides a means for client users to configure the mux parent for a GPTimer's functional clock. However, not all timers are configurable (Eg: Timer12 on DRA7 is fed by an internal 32k oscillator clock, and does not have configurable parent clocks). So, check for such cases and proceed with out throwing an error. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r--arch/arm/plat-omap/dmtimer.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 160061208868..7a327bd32521 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -36,6 +36,7 @@
36 */ 36 */
37 37
38#include <linux/clk.h> 38#include <linux/clk.h>
39#include <linux/clk-provider.h>
39#include <linux/module.h> 40#include <linux/module.h>
40#include <linux/io.h> 41#include <linux/io.h>
41#include <linux/device.h> 42#include <linux/device.h>
@@ -533,6 +534,12 @@ int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source)
533 if (IS_ERR(timer->fclk)) 534 if (IS_ERR(timer->fclk))
534 return -EINVAL; 535 return -EINVAL;
535 536
537#if defined(CONFIG_COMMON_CLK)
538 /* Check if the clock has configurable parents */
539 if (clk_hw_get_num_parents(__clk_get_hw(timer->fclk)) < 2)
540 return 0;
541#endif
542
536 switch (source) { 543 switch (source) {
537 case OMAP_TIMER_SRC_SYS_CLK: 544 case OMAP_TIMER_SRC_SYS_CLK:
538 parent_name = "timer_sys_ck"; 545 parent_name = "timer_sys_ck";