From patchwork Tue May 3 19:49:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "J, KEERTHY" X-Patchwork-Id: 751252 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p43JnLEf025697 for ; Tue, 3 May 2011 19:49:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752751Ab1ECTtU (ORCPT ); Tue, 3 May 2011 15:49:20 -0400 Received: from na3sys009aog117.obsmtp.com ([74.125.149.242]:48603 "EHLO na3sys009aog117.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751299Ab1ECTtU (ORCPT ); Tue, 3 May 2011 15:49:20 -0400 Received: from mail-iw0-f178.google.com ([209.85.214.178]) (using TLSv1) by na3sys009aob117.postini.com ([74.125.148.12]) with SMTP ID DSNKTcBcP9MMGb71w7qmXO87oOr2bE0+zWPt@postini.com; Tue, 03 May 2011 12:49:19 PDT Received: by mail-iw0-f178.google.com with SMTP id 9so364303iwn.9 for ; Tue, 03 May 2011 12:49:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.42.100.141 with SMTP id a13mr426992ico.72.1304452158974; Tue, 03 May 2011 12:49:18 -0700 (PDT) Received: by 10.231.186.42 with HTTP; Tue, 3 May 2011 12:49:18 -0700 (PDT) In-Reply-To: References: <1298986926-31180-1-git-send-email-j-keerthy@ti.com> <20110302101512.GC16181@sortiz-mobl> Date: Wed, 4 May 2011 01:19:18 +0530 Message-ID: Subject: Re: [PATCH 0/2 v5] twl4030-madc driver From: "J, KEERTHY" To: Steve Sakoman Cc: lm-sensors@lm-sensors.org, guenter.roeck@ericsson.com, mikko.k.ylinen@nokia.com, amit.kucheria@canonical.com, linux-omap@vger.kernel.org, Samuel Ortiz Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 03 May 2011 19:49:22 +0000 (UTC) Hello Steve, Can you try adding this patch? Regards, Keerthy On Tue, May 3, 2011 at 8:44 PM, Steve Sakoman wrote: > On Wed, Mar 2, 2011 at 2:15 AM, Samuel Ortiz wrote: >> Hi Keerthy, >> >> On Tue, Mar 01, 2011 at 07:12:06PM +0530, Keerthy wrote: >>> MADC(Monitoring ADC) driver enables monitoring analog signals using >>> analog-to-digital conversion (ADC) on the input source. >>> The previous discussion concluded in keeping the generic ADC >>> functionality and the hwmon separate. The discussion can be found here: >>> >>> http://www.mail-archive.com/linux-omap@vger.kernel.org/msg41805.html >> Thanks a lot, I applied those 2 patches. > > I'm attempting to use this drive on the Overo platform with 2.6.39-rc5. > > Other than enabling the module with CONFIG_SENSORS_TWL4030_MADC=m are > there any board file modifications required other than the below? > > I have setup the platform data for the twl4030 madc driver: > > diff --git a/arch/arm/mach-omap2/board-overo.c > b/arch/arm/mach-omap2/board-overo.c > index 112dfc9..05dd3eb 100644 > --- a/arch/arm/mach-omap2/board-overo.c > +++ b/arch/arm/mach-omap2/board-overo.c > @@ -637,10 +637,15 @@ static struct twl4030_codec_data overo_codec_data = { >        .audio = &overo_audio_data, >  }; > > +static struct twl4030_madc_platform_data overo_madc_data = { > +       .irq_line       = 1, > +}; > + >  static struct twl4030_platform_data overo_twldata = { >        .irq_base       = TWL4030_IRQ_BASE, >        .irq_end        = TWL4030_IRQ_END, >        .gpio           = &overo_gpio_data, > +       .madc           = &overo_madc_data, >        .usb            = &overo_usb_data, >        .codec          = &overo_codec_data, >        .vmmc1          = &overo_vmmc1, > > However, I am not seeing the sysfs entry created: > > # modprobe twl4030-madc-hwmon > twl4030_madc_hwmon_init entry > > # lsmod > Module                  Size  Used by > twl4030_madc_hwmon      2594  0 > ipv6                  224256  16 > libertas_sdio          14867  0 > libertas               92429  1 libertas_sdio > cfg80211              144256  1 libertas > lib80211                5027  1 libertas > firmware_class          5859  2 libertas_sdio,libertas > > # ls /sys/class/hwmon/ > # > > I added a couple of printk's to the driver at the entry points of init > and probe, and as you can see above the init message is printed, but > not the probe. > > Am I missing something really obvious here? > > Steve > From a05c6cbb4494173e03ea5957666216caedb22d84 Mon Sep 17 00:00:00 2001 From: Keerthy Date: Wed, 4 May 2011 01:14:50 +0530 Subject: [PATCH] Enabling Hwmon driver for twl4030-madc Signed-off-by: Keerthy --- drivers/mfd/twl-core.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c index 960b5be..e6e99db 100644 --- a/drivers/mfd/twl-core.c +++ b/drivers/mfd/twl-core.c @@ -83,6 +83,13 @@ #define twl_has_madc() false #endif +#if defined(CONFIG_SENSORS_TWL4030_MADC) ||\ + defined(CONFIG_SENSORS_TWL4030_MADC_MODULE) +#define twl_has_madc_hwmon() true +#else +#define twl_has_madc_hwmon() false +#endif + #ifdef CONFIG_TWL4030_POWER #define twl_has_power() true #else @@ -609,6 +616,14 @@ add_children(struct twl4030_platform_data *pdata, unsigned long features) return PTR_ERR(child); } +if (twl_has_madc_hwmon()) { + child = add_child(2, "twl4030_madc_hwmon", + NULL, 0, + true, pdata->irq_base + MADC_INTR_OFFSET, 0); + if (IS_ERR(child)) + return PTR_ERR(child); + } + if (twl_has_rtc()) { /* * REVISIT platform_data here currently might expose the -- 1.7.0.4