All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: "J, KEERTHY" <j-keerthy@ti.com>
Cc: lm-sensors@lm-sensors.org, guenter.roeck@ericsson.com,
	sameo@linux.intel.com, khali@linux-fr.org,
	mikko.k.ylinen@nokia.com, linux-omap@vger.kernel.org,
	amit.kucheria@canonical.com, balajitk@ti.com
Subject: Re: [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc module
Date: Fri, 7 Jan 2011 10:44:55 +0000	[thread overview]
Message-ID: <20110107104455.GB9209@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <AANLkTinuwejAgJ+F0e4LFAhR-gL8bfFmyOwHdSEWAsRw@mail.gmail.com>

On Fri, Jan 07, 2011 at 02:55:45PM +0530, J, KEERTHY wrote:
> On Thu, Jan 6, 2011 at 5:34 PM, Mark Brown
> > On Thu, Jan 06, 2011 at 09:26:40AM +0530, Keerthy wrote:

> >> +static ssize_t madc_read(struct device *dev,
> >> +                      struct device_attribute *devattr, char *buf)
> >> +{
> >> +     struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);

...

> >> +     return sprintf(buf, "%ld\n", val);

> > Does this return data in the appropriate units - milivolts for voltages?

> This function returns the raw channel values read and not in terms of the
> units.

It needs to convert the values into real world units before they go to
userspace - look at what applications like sensors do with the values.

> >> +     case TWL4030_MADC_RT:
> >> +     default:
> >> +             break;

> > This looks odd - the function won't actually do anything for non-SW
> > conversions but won't return an error?

> Ok. In the case of RT conversion request no software setting is required
> and it is signal driven. So the function does nothing in case of RT.

Again, the biggest problem is that the code isn't clear.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: "J, KEERTHY" <j-keerthy@ti.com>
Cc: lm-sensors@lm-sensors.org, guenter.roeck@ericsson.com,
	sameo@linux.intel.com, khali@linux-fr.org,
	mikko.k.ylinen@nokia.com, linux-omap@vger.kernel.org,
	amit.kucheria@canonical.com, balajitk@ti.com
Subject: Re: [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc
Date: Fri, 07 Jan 2011 10:44:55 +0000	[thread overview]
Message-ID: <20110107104455.GB9209@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <AANLkTinuwejAgJ+F0e4LFAhR-gL8bfFmyOwHdSEWAsRw@mail.gmail.com>

On Fri, Jan 07, 2011 at 02:55:45PM +0530, J, KEERTHY wrote:
> On Thu, Jan 6, 2011 at 5:34 PM, Mark Brown
> > On Thu, Jan 06, 2011 at 09:26:40AM +0530, Keerthy wrote:

> >> +static ssize_t madc_read(struct device *dev,
> >> +                      struct device_attribute *devattr, char *buf)
> >> +{
> >> +     struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);

...

> >> +     return sprintf(buf, "%ld\n", val);

> > Does this return data in the appropriate units - milivolts for voltages?

> This function returns the raw channel values read and not in terms of the
> units.

It needs to convert the values into real world units before they go to
userspace - look at what applications like sensors do with the values.

> >> +     case TWL4030_MADC_RT:
> >> +     default:
> >> +             break;

> > This looks odd - the function won't actually do anything for non-SW
> > conversions but won't return an error?

> Ok. In the case of RT conversion request no software setting is required
> and it is signal driven. So the function does nothing in case of RT.

Again, the biggest problem is that the code isn't clear.

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

  reply	other threads:[~2011-01-07 10:44 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-06  3:56 [PATCH v3] hwmon: twl4030: Driver for twl4030 madc module Keerthy
2011-01-06  3:59 ` [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc Keerthy
2011-01-06  4:04 ` [PATCH v3] hwmon: twl4030: Driver for twl4030 madc module J, KEERTHY
2011-01-06  4:16   ` [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc J, KEERTHY
2011-01-06 12:04 ` [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc module Mark Brown
2011-01-06 12:04   ` [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc Mark Brown
2011-01-07  9:25   ` [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc module J, KEERTHY
2011-01-07  9:37     ` [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc J, KEERTHY
2011-01-07 10:44     ` Mark Brown [this message]
2011-01-07 10:44       ` Mark Brown
2011-01-07 11:20       ` [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc module J, KEERTHY
2011-01-07 11:32         ` [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc J, KEERTHY
  -- strict thread matches above, loose matches on Subject: below --
2011-01-06  4:17 [PATCH v3] hwmon: twl4030: Driver for twl4030 madc module Keerthy
2011-01-06  4:29 ` [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc Keerthy
2011-01-06  5:33 ` [PATCH v3] hwmon: twl4030: Driver for twl4030 madc module Guenter Roeck
2011-01-06  5:33   ` [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc Guenter Roeck
2011-01-06 12:07   ` [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc module Mark Brown
2011-01-06 12:07     ` [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc Mark Brown
2011-01-06 15:04     ` [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc module Guenter Roeck
2011-01-06 15:04       ` [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc Guenter Roeck
2011-01-06 20:21       ` [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc module Mark Brown
2011-01-06 20:21         ` [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc Mark Brown
2011-01-06 21:55         ` [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc module Guenter Roeck
2011-01-06 21:55           ` [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc Guenter Roeck
2011-01-07 12:12           ` [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc module J, KEERTHY
2011-01-07 12:24             ` [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc J, KEERTHY
2011-01-07 14:45             ` [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc module Guenter Roeck
2011-01-07 14:45               ` [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc Guenter Roeck
2011-01-22 16:49             ` [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc module J, KEERTHY
2011-01-22 16:52               ` [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc J, KEERTHY
2011-01-31 10:43               ` [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc module Samuel Ortiz
2011-01-31 10:43                 ` [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc Samuel Ortiz
2011-01-06  5:58 ` [PATCH v3] hwmon: twl4030: Driver for twl4030 madc module Kalliguddi, Hema
2011-01-06  6:10   ` [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc Kalliguddi, Hema
2011-01-07  8:40   ` [PATCH v3] hwmon: twl4030: Driver for twl4030 madc module J, KEERTHY
2011-01-07  8:52     ` [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc J, 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=20110107104455.GB9209@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=amit.kucheria@canonical.com \
    --cc=balajitk@ti.com \
    --cc=guenter.roeck@ericsson.com \
    --cc=j-keerthy@ti.com \
    --cc=khali@linux-fr.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.org \
    --cc=mikko.k.ylinen@nokia.com \
    --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.