linux 3.0: enable 1GHz for beagle and add 2 MADC patches from sakomans tree
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-3.0 / madc / 0002-mfd-twl-core-enable-madc-clock.patch
1 From a5931ecd1718f6936fa3d84821b4d9a874251ff7 Mon Sep 17 00:00:00 2001
2 From: Steve Sakoman <steve@sakoman.com>
3 Date: Sat, 23 Jan 2010 06:26:54 -0800
4 Subject: [PATCH 2/2] mfd: twl-core: enable madc clock
6 Now that the madc driver has been merged it is also necessary to enable the clock to the madc block
8 Signed-off-by: Steve Sakoman <steve@sakoman.com>
9 ---
10  drivers/mfd/twl-core.c  |    8 ++++++++
11  include/linux/i2c/twl.h |    1 +
12  2 files changed, 9 insertions(+), 0 deletions(-)
14 diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
15 index 463ee67..e659d4e 100644
16 --- a/drivers/mfd/twl-core.c
17 +++ b/drivers/mfd/twl-core.c
18 @@ -217,6 +217,11 @@
19  
20  /* Few power values */
21  #define R_CFG_BOOT                     0x05
22 +#define R_GPBR1                                0x0C
23 +
24 +/* MADC clock values for R_GPBR1 */
25 +#define MADC_HFCLK_EN                  0x80
26 +#define DEFAULT_MADC_CLK_EN            0x10
27  
28  /* some fields in R_CFG_BOOT */
29  #define HFCLK_FREQ_19p2_MHZ            (1 << 0)
30 @@ -1152,6 +1157,9 @@ static void clocks_init(struct device *dev,
31  
32         e |= unprotect_pm_master();
33         /* effect->MADC+USB ck en */
34 +       if (twl_has_madc())
35 +               e |= twl_i2c_write_u8(TWL_MODULE_INTBR,
36 +                               MADC_HFCLK_EN | DEFAULT_MADC_CLK_EN, R_GPBR1);
37         e |= twl_i2c_write_u8(TWL_MODULE_PM_MASTER, ctrl, R_CFG_BOOT);
38         e |= protect_pm_master();
39  
40 diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
41 index ba4f886..6802efc 100644
42 --- a/include/linux/i2c/twl.h
43 +++ b/include/linux/i2c/twl.h
44 @@ -74,6 +74,7 @@
45  
46  #define TWL_MODULE_USB         TWL4030_MODULE_USB
47  #define TWL_MODULE_AUDIO_VOICE TWL4030_MODULE_AUDIO_VOICE
48 +#define TWL_MODULE_INTBR       TWL4030_MODULE_INTBR
49  #define TWL_MODULE_PIH         TWL4030_MODULE_PIH
50  #define TWL_MODULE_MADC                TWL4030_MODULE_MADC
51  #define TWL_MODULE_MAIN_CHARGE TWL4030_MODULE_MAIN_CHARGE
52 -- 
53 1.6.6.1