[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / beaglebone / 0057-i2c-prescalar-fix-i2c-fixed-prescalar-setting-issue.patch
1 From 2436d7177f75ffa852dc008ce5fe63e92cec963a Mon Sep 17 00:00:00 2001
2 From: Al Pacifico <adpacifico@users.sourceforge.net>
3 Date: Mon, 21 May 2012 11:50:32 -0700
4 Subject: [PATCH 57/61] i2c-prescalar-fix: i2c: fixed prescalar setting issue
6 Applied Steve's i2c prescalar fix patches.
7 See https://groups.google.com/d/msg/beagleboard/Q1pDr1lT7Gk/jvxOxgg8_2MJ
9 Signed-off-by: Al Pacifico <adpacifico@users.sourceforge.net>
10 Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
11 ---
12 arch/arm/mach-omap2/omap_hwmod_33xx_data.c | 3 ++-
13 drivers/i2c/busses/i2c-omap.c | 2 ++
14 include/linux/i2c-omap.h | 1 +
15 3 files changed, 5 insertions(+), 1 deletions(-)
17 diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
18 index 9d3c9a5..946e6b5 100644
19 --- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
20 +++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
21 @@ -1243,7 +1243,8 @@ static struct omap_hwmod_class_sysconfig am33xx_i2c_sysc = {
23 static struct omap_i2c_dev_attr i2c_dev_attr = {
24 .flags = OMAP_I2C_FLAG_BUS_SHIFT_NONE |
25 - OMAP_I2C_FLAG_RESET_REGS_POSTIDLE,
26 + OMAP_I2C_FLAG_RESET_REGS_POSTIDLE |
27 + OMAP_I2C_FLAG_FORCE_12000_INT_CLK,
28 };
30 static struct omap_hwmod_class i2c_class = {
31 diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
32 index e0733b7..0ca6960 100644
33 --- a/drivers/i2c/busses/i2c-omap.c
34 +++ b/drivers/i2c/busses/i2c-omap.c
35 @@ -408,6 +408,8 @@ static int omap_i2c_init(struct omap_i2c_dev *dev)
36 if (dev->speed > 400 ||
37 pdata->flags & OMAP_I2C_FLAG_FORCE_19200_INT_CLK)
38 internal_clk = 19200;
39 + else if (pdata->flags & OMAP_I2C_FLAG_FORCE_12000_INT_CLK)
40 + internal_clk = 12000;
41 else if (dev->speed > 100)
42 internal_clk = 9600;
43 else
44 diff --git a/include/linux/i2c-omap.h b/include/linux/i2c-omap.h
45 index fd38249..818f5bf 100644
46 --- a/include/linux/i2c-omap.h
47 +++ b/include/linux/i2c-omap.h
48 @@ -24,6 +24,7 @@
49 #define OMAP_I2C_FLAG_APPLY_ERRATA_I207 BIT(4)
50 #define OMAP_I2C_FLAG_ALWAYS_ARMXOR_CLK BIT(5)
51 #define OMAP_I2C_FLAG_FORCE_19200_INT_CLK BIT(6)
52 +#define OMAP_I2C_FLAG_FORCE_12000_INT_CLK BIT(9)
53 /* how the CPU address bus must be translated for I2C unit access */
54 #define OMAP_I2C_FLAG_BUS_SHIFT_NONE 0
55 #define OMAP_I2C_FLAG_BUS_SHIFT_1 BIT(7)
56 --
57 1.7.7.6