From: Keerthy <a0393675@ti.com>
To: sameo@linux.intel.com
Cc: "J, KEERTHY" <j-keerthy@ti.com>,
"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
"Krishnamoorthy, Balaji T" <balajitk@ti.com>,
"lm-sensors@lm-sensors.org" <lm-sensors@lm-sensors.org>,
Guenter Roeck <guenter.roeck@ericsson.com>
Subject: Re: [lm-sensors] [PATCH 1/2] hwmon: twl4030: Driver for twl4030 madc module
Date: Mon, 27 Sep 2010 14:49:06 +0530 [thread overview]
Message-ID: <4CA0618A.9030207@ti.com> (raw)
In-Reply-To: <20100920143834.GA1500@ericsson.com>
Hello Sameo,
twl4030-madc driver patch can be found here:
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg34947.html
Based on the received inputs.
Can the twl4030-madc driver or part of the driver reside under mfd?
Regards,
Keerthy
On Monday 20 September 2010 08:08 PM, Guenter Roeck wrote:
> On Mon, Sep 20, 2010 at 10:09:05AM -0400, Guenter Roeck wrote:
>
>> Hi,
>> On Mon, Sep 20, 2010 at 06:34:24AM -0400, J, KEERTHY wrote:
>>
>>>
>>>
>>>> -----Original Message-----
>>>> From: Guenter Roeck [mailto:guenter.roeck@ericsson.com]
>>>> Sent: Thursday, September 16, 2010 8:48 PM
>>>> To: J, KEERTHY
>>>> Cc: linux-omap@vger.kernel.org; lm-sensors@lm-sensors.org; Krishnamoorthy,
>>>> Balaji T
>>>> Subject: Re: [lm-sensors] [PATCH 1/2] hwmon: twl4030: Driver for twl4030
>>>> madc module
>>>>
>>>>
>> [...]
>>
>>>>> +EXPORT_SYMBOL(twl4030_madc_conversion);
>>>>> +
>>>>>
>>>> If this function is going to be called from external code, it should not
>>>> really be defined here. I would suggest to move it to a global location
>>>> such as
>>>> mfd instead, including all related functions.
>>>>
>>>> The existence of this function export indicates that another non-hwmon
>>>> driver depends on this one, which should not really be the case. Another
>>>> reason to have a separate common driver instead, and mfd might just be the
>>>> place for it.
>>>>
>>> Few kernel modules need to perform ADC conversion to measure battery
>>> voltage, battery temperature, VBUS voltage via twl4030_madc_conversion.
>>> the_madc is needed as those drivers will not have this device pointer.
>>>
>>>
>> The point I was trying to make is that this function (as well as the ioctl)
>> should not be in this driver in the first place. hwmon is about providing
>> hwmon information, not about providing adc readings to another driver.
>>
>> Or, in other words, hwmon should be a consumer of information from other drivers,
>> not a producer of information to other drivers.
>>
>> There should be a higher level driver (presumably a mfd driver) to provide
>> adc readings to all consumers, ie to all callers of twl4030_madc_conversion().
>> This driver can provide all data and information needed by more than one driver,
>> and would also be the logical place for the ioctl providing raw adc readings
>> to the user.
>>
>>
> I just noticed that there already is a mfd core driver for tw4030. You might want
> to consider moving the functionality to read adc values into that driver.
>
> Guenter
>
WARNING: multiple messages have this Message-ID (diff)
From: Keerthy <a0393675@ti.com>
To: sameo@linux.intel.com
Cc: "J, KEERTHY" <j-keerthy@ti.com>,
"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
"Krishnamoorthy, Balaji T" <balajitk@ti.com>,
"lm-sensors@lm-sensors.org" <lm-sensors@lm-sensors.org>,
Guenter Roeck <guenter.roeck@ericsson.com>
Subject: Re: [lm-sensors] [PATCH 1/2] hwmon: twl4030: Driver for twl4030
Date: Mon, 27 Sep 2010 09:31:06 +0000 [thread overview]
Message-ID: <4CA0618A.9030207@ti.com> (raw)
In-Reply-To: <20100920143834.GA1500@ericsson.com>
Hello Sameo,
twl4030-madc driver patch can be found here:
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg34947.html
Based on the received inputs.
Can the twl4030-madc driver or part of the driver reside under mfd?
Regards,
Keerthy
On Monday 20 September 2010 08:08 PM, Guenter Roeck wrote:
> On Mon, Sep 20, 2010 at 10:09:05AM -0400, Guenter Roeck wrote:
>
>> Hi,
>> On Mon, Sep 20, 2010 at 06:34:24AM -0400, J, KEERTHY wrote:
>>
>>>
>>>
>>>> -----Original Message-----
>>>> From: Guenter Roeck [mailto:guenter.roeck@ericsson.com]
>>>> Sent: Thursday, September 16, 2010 8:48 PM
>>>> To: J, KEERTHY
>>>> Cc: linux-omap@vger.kernel.org; lm-sensors@lm-sensors.org; Krishnamoorthy,
>>>> Balaji T
>>>> Subject: Re: [lm-sensors] [PATCH 1/2] hwmon: twl4030: Driver for twl4030
>>>> madc module
>>>>
>>>>
>> [...]
>>
>>>>> +EXPORT_SYMBOL(twl4030_madc_conversion);
>>>>> +
>>>>>
>>>> If this function is going to be called from external code, it should not
>>>> really be defined here. I would suggest to move it to a global location
>>>> such as
>>>> mfd instead, including all related functions.
>>>>
>>>> The existence of this function export indicates that another non-hwmon
>>>> driver depends on this one, which should not really be the case. Another
>>>> reason to have a separate common driver instead, and mfd might just be the
>>>> place for it.
>>>>
>>> Few kernel modules need to perform ADC conversion to measure battery
>>> voltage, battery temperature, VBUS voltage via twl4030_madc_conversion.
>>> the_madc is needed as those drivers will not have this device pointer.
>>>
>>>
>> The point I was trying to make is that this function (as well as the ioctl)
>> should not be in this driver in the first place. hwmon is about providing
>> hwmon information, not about providing adc readings to another driver.
>>
>> Or, in other words, hwmon should be a consumer of information from other drivers,
>> not a producer of information to other drivers.
>>
>> There should be a higher level driver (presumably a mfd driver) to provide
>> adc readings to all consumers, ie to all callers of twl4030_madc_conversion().
>> This driver can provide all data and information needed by more than one driver,
>> and would also be the logical place for the ioctl providing raw adc readings
>> to the user.
>>
>>
> I just noticed that there already is a mfd core driver for tw4030. You might want
> to consider moving the functionality to read adc values into that driver.
>
> Guenter
>
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next prev parent reply other threads:[~2010-09-27 9:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-16 10:23 [PATCH 1/2] hwmon: twl4030: Driver for twl4030 madc module Keerthy
2010-09-16 10:35 ` [lm-sensors] [PATCH 1/2] hwmon: twl4030: Driver for twl4030 madc Keerthy
2010-09-16 15:17 ` [lm-sensors] [PATCH 1/2] hwmon: twl4030: Driver for twl4030 madc module Guenter Roeck
2010-09-16 15:17 ` [lm-sensors] [PATCH 1/2] hwmon: twl4030: Driver for twl4030 Guenter Roeck
2010-09-20 10:34 ` [lm-sensors] [PATCH 1/2] hwmon: twl4030: Driver for twl4030 madc module J, KEERTHY
2010-09-20 10:46 ` [lm-sensors] [PATCH 1/2] hwmon: twl4030: Driver for twl4030 J, KEERTHY
2010-09-20 14:09 ` [lm-sensors] [PATCH 1/2] hwmon: twl4030: Driver for twl4030 madc module Guenter Roeck
2010-09-20 14:09 ` [lm-sensors] [PATCH 1/2] hwmon: twl4030: Driver for twl4030 Guenter Roeck
2010-09-20 14:38 ` [lm-sensors] [PATCH 1/2] hwmon: twl4030: Driver for twl4030 madc module Guenter Roeck
2010-09-20 14:38 ` [lm-sensors] [PATCH 1/2] hwmon: twl4030: Driver for twl4030 Guenter Roeck
2010-09-27 9:19 ` Keerthy [this message]
2010-09-27 9:31 ` Keerthy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4CA0618A.9030207@ti.com \
--to=a0393675@ti.com \
--cc=balajitk@ti.com \
--cc=guenter.roeck@ericsson.com \
--cc=j-keerthy@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=lm-sensors@lm-sensors.org \
--cc=sameo@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.