aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/omap
diff options
context:
space:
mode:
authorPankajJindal <pankajjindal@ti.com>2011-11-04 04:50:57 -0700
committerSimon Wilson <simonwilson@google.com>2011-11-11 12:44:16 -0800
commit514e99bca64832b4f7748dac1cf7d904fe00c6d3 (patch)
tree7438957cad2ff114ef183fb48a6ac87124c11eb1 /sound/soc/omap
parenta4ab38ec9cb46ff12ad427b437eb8f7d0b89f916 (diff)
downloadkernel_samsung_tuna-514e99bca64832b4f7748dac1cf7d904fe00c6d3.zip
kernel_samsung_tuna-514e99bca64832b4f7748dac1cf7d904fe00c6d3.tar.gz
kernel_samsung_tuna-514e99bca64832b4f7748dac1cf7d904fe00c6d3.tar.bz2
ASoC: McPDM: Bail out if module is not enabled
If McPDM MODULEMODE is in disable state, any interconnect access to the module will result in an error and ultimately to a kernel crash. If we hit that condition, it means that clocks are not properly enabled and it is pointless to continue using the DAI, so bailing out early, warning about this unexpected condition. Change-Id: I476eddfdde9e9c82e3525b3723e9da8546c5c3da Signed-off-by: PankajJindal <pankajjindal@ti.com>
Diffstat (limited to 'sound/soc/omap')
-rw-r--r--sound/soc/omap/omap-mcpdm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c
index dfddd0c..43722ca 100644
--- a/sound/soc/omap/omap-mcpdm.c
+++ b/sound/soc/omap/omap-mcpdm.c
@@ -397,8 +397,11 @@ static int omap_mcpdm_dai_startup(struct snd_pcm_substream *substream,
pm_runtime_get_sync(mcpdm->dev);
val = __raw_readl(OMAP4430_CM1_ABE_PDM_CLKCTRL);
- if ((val & CLKCTRL_MODULEMODE_MASK) != CLKCTRL_MODULEMODE_ENABLED)
- dev_err(mcpdm->dev, "Clock not enabled: PDM_CLKCTRL=0x%x\n", val);
+ if ((val & CLKCTRL_MODULEMODE_MASK) != CLKCTRL_MODULEMODE_ENABLED) {
+ WARN(1, "Clock not enabled: PDM_CLKCTRL=0x%x\n", val);
+ pm_runtime_put_sync(mcpdm->dev);
+ goto out;
+ }
/* Enable McPDM watch dog for ES above ES 1.0 to avoid saturation */
if (omap_rev() != OMAP4430_REV_ES1_0) {