aboutsummaryrefslogtreecommitdiffstats
path: root/bsp/pandaboard/ASoC-McPDM-Enable-wd-reset-for-ES2.0.patch
blob: e6058a829f2804ca6d4588f8c2e3d7754d54fc58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
From a161a0d72a09ea2679b5eab227ad286b1be04624 Mon Sep 17 00:00:00 2001
From: Sebastien Guiriec <s-guiriec@ti.com>
Date: Wed, 28 Jul 2010 12:32:05 +0200
Subject: [PATCH 32/60] ASoC: McPDM: Enable wd reset for ES2.0

commit 984595e0c85201cccd5128d63999a190563dddaa upstream

With revision ES2.0 a new bit is provide to enable the
pdm watchdog logic.

Signed-off-by: Margarita Olaya Cabrera <magi.olaya@ti.com>
Integrated-by: Jingdong Lu <jingdong.lu@windriver.com>
---
 sound/soc/omap/omap-mcpdm.c |    9 +++++++++
 sound/soc/omap/omap-mcpdm.h |    3 +++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c
index cb093fd..145871f 100644
--- a/sound/soc/omap/omap-mcpdm.c
+++ b/sound/soc/omap/omap-mcpdm.c
@@ -386,6 +386,7 @@ static int omap_mcpdm_request(struct omap_mcpdm *mcpdm)
 	struct platform_device *pdev;
 	struct omap_mcpdm_platform_data *pdata;
 	int ret;
+	int ctrl;
 
 	pdev = container_of(mcpdm->dev, struct platform_device, dev);
 	pdata = pdev->dev.platform_data;
@@ -414,6 +415,14 @@ static int omap_mcpdm_request(struct omap_mcpdm *mcpdm)
 		dev_err(mcpdm->dev, "Request for McPDM IRQ failed\n");
 		goto err;
 	}
+
+	if (omap_rev() != OMAP4430_REV_ES1_0) {
+		/* Enable McPDM watch dog for ES above ES 1.0 to avoid saturation */
+		ctrl = omap_mcpdm_read(mcpdm, MCPDM_CTRL);
+		ctrl |= WD_EN;
+		omap_mcpdm_write(mcpdm, MCPDM_CTRL, ctrl);
+	}
+
 	return 0;
 
 err:
diff --git a/sound/soc/omap/omap-mcpdm.h b/sound/soc/omap/omap-mcpdm.h
index d926cfe..108e434 100644
--- a/sound/soc/omap/omap-mcpdm.h
+++ b/sound/soc/omap/omap-mcpdm.h
@@ -85,6 +85,7 @@
 #define STATUS_INT		0x0400
 #define SW_UP_RST		0x0800
 #define SW_DN_RST		0x1000
+#define WD_EN			0x4000
 #define PDM_UP_MASK		0x007
 #define PDM_DN_MASK		0x0F8
 #define PDM_CMD_MASK		0x200
@@ -124,7 +125,9 @@ struct omap_mcpdm_link {
 
 struct omap_mcpdm;
 
+/*
 extern int omap_mcpdm_set_offset(struct omap_mcpdm *mcpdm,
 		int offset1, int offset2);
+*/
 
 #endif	/* End of __OMAP_MCPDM_H__ */
-- 
1.7.4.1