summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0057-i2c-prescalar-fix-i2c-fixed-prescalar-setting-issue.patch
blob: feb27c57ec58bdd3688158476cc9c6b8a9bc80b0 (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
From 3c530584c31f8e61a47a931dedca2f9e75165b9f Mon Sep 17 00:00:00 2001
From: Al Pacifico <adpacifico@users.sourceforge.net>
Date: Mon, 21 May 2012 11:50:32 -0700
Subject: [PATCH 57/79] i2c-prescalar-fix: i2c: fixed prescalar setting issue

Applied Steve's i2c prescalar fix patches.
See https://groups.google.com/d/msg/beagleboard/Q1pDr1lT7Gk/jvxOxgg8_2MJ

Signed-off-by: Al Pacifico <adpacifico@users.sourceforge.net>
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
 arch/arm/mach-omap2/omap_hwmod_33xx_data.c |    3 ++-
 drivers/i2c/busses/i2c-omap.c              |    2 ++
 include/linux/i2c-omap.h                   |    1 +
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
index 9d3c9a5..946e6b5 100644
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
@@ -1243,7 +1243,8 @@ static struct omap_hwmod_class_sysconfig am33xx_i2c_sysc = {
 
 static struct omap_i2c_dev_attr i2c_dev_attr = {
 	.flags		= OMAP_I2C_FLAG_BUS_SHIFT_NONE |
-					OMAP_I2C_FLAG_RESET_REGS_POSTIDLE,
+					OMAP_I2C_FLAG_RESET_REGS_POSTIDLE |
+					OMAP_I2C_FLAG_FORCE_12000_INT_CLK,
 };
 
 static struct omap_hwmod_class i2c_class = {
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index e0733b7..0ca6960 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -408,6 +408,8 @@ static int omap_i2c_init(struct omap_i2c_dev *dev)
 		if (dev->speed > 400 ||
 			       pdata->flags & OMAP_I2C_FLAG_FORCE_19200_INT_CLK)
 			internal_clk = 19200;
+		else if (pdata->flags & OMAP_I2C_FLAG_FORCE_12000_INT_CLK)
+			internal_clk = 12000;
 		else if (dev->speed > 100)
 			internal_clk = 9600;
 		else
diff --git a/include/linux/i2c-omap.h b/include/linux/i2c-omap.h
index fd38249..818f5bf 100644
--- a/include/linux/i2c-omap.h
+++ b/include/linux/i2c-omap.h
@@ -24,6 +24,7 @@
 #define OMAP_I2C_FLAG_APPLY_ERRATA_I207	BIT(4)
 #define OMAP_I2C_FLAG_ALWAYS_ARMXOR_CLK	BIT(5)
 #define OMAP_I2C_FLAG_FORCE_19200_INT_CLK	BIT(6)
+#define OMAP_I2C_FLAG_FORCE_12000_INT_CLK        BIT(9)
 /* how the CPU address bus must be translated for I2C unit access */
 #define OMAP_I2C_FLAG_BUS_SHIFT_NONE 0
 #define OMAP_I2C_FLAG_BUS_SHIFT_1		BIT(7)
-- 
1.7.10