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

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>

authored by

Suman Anna and committed by
Tony Lindgren
ea05d2ea b6a89194

+7
+7
arch/arm/plat-omap/dmtimer.c
··· 36 36 */ 37 37 38 38 #include <linux/clk.h> 39 + #include <linux/clk-provider.h> 39 40 #include <linux/module.h> 40 41 #include <linux/io.h> 41 42 #include <linux/device.h> ··· 533 532 534 533 if (IS_ERR(timer->fclk)) 535 534 return -EINVAL; 535 + 536 + #if defined(CONFIG_COMMON_CLK) 537 + /* Check if the clock has configurable parents */ 538 + if (clk_hw_get_num_parents(__clk_get_hw(timer->fclk)) < 2) 539 + return 0; 540 + #endif 536 541 537 542 switch (source) { 538 543 case OMAP_TIMER_SRC_SYS_CLK: