]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/blob - recipes-kernel/linux/linux-3.0/madc/0001-Enabling-Hwmon-driver-for-twl4030-madc.patch
90ba6372c3df598c9b1f41f2e6f9dda45d8bd5e3
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-3.0 / madc / 0001-Enabling-Hwmon-driver-for-twl4030-madc.patch
1 From 922c70f408f5b6631272b373c4724d2065cc9414 Mon Sep 17 00:00:00 2001
2 From: Keerthy <j-keerthy@ti.com>
3 Date: Wed, 4 May 2011 01:14:50 +0530
4 Subject: [PATCH 1/2] Enabling Hwmon driver for twl4030-madc
6 Signed-off-by: Keerthy <j-keerthy@ti.com>
7 ---
8  drivers/mfd/twl-core.c |   15 +++++++++++++++
9  1 files changed, 15 insertions(+), 0 deletions(-)
11 diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
12 index b8f2a4e..463ee67 100644
13 --- a/drivers/mfd/twl-core.c
14 +++ b/drivers/mfd/twl-core.c
15 @@ -83,6 +83,13 @@
16  #define twl_has_madc() false
17  #endif
18  
19 +#if defined(CONFIG_SENSORS_TWL4030_MADC) ||\
20 +        defined(CONFIG_SENSORS_TWL4030_MADC_MODULE)
21 +#define twl_has_madc_hwmon()  true
22 +#else
23 +#define twl_has_madc_hwmon()  false
24 +#endif
25 +
26  #ifdef CONFIG_TWL4030_POWER
27  #define twl_has_power()        true
28  #else
29 @@ -669,6 +676,14 @@ add_children(struct twl4030_platform_data *pdata, unsigned long features)
30                         return PTR_ERR(child);
31         }
32  
33 +if (twl_has_madc_hwmon()) {
34 +               child = add_child(2, "twl4030_madc_hwmon",
35 +                               NULL, 0,
36 +                               true, pdata->irq_base + MADC_INTR_OFFSET, 0);
37 +               if (IS_ERR(child))
38 +                       return PTR_ERR(child);
39 +       }
40 +
41         if (twl_has_rtc()) {
42                 /*
43                  * REVISIT platform_data here currently might expose the
44 -- 
45 1.6.6.1