public inbox for linux-omap@vger.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

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

Thread overview: 14+ 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  4:04 ` J, KEERTHY
2011-01-06 12:04 ` [lm-sensors] " Mark Brown
2011-01-07  9:25   ` J, KEERTHY
2011-01-07 10:44     ` Mark Brown [this message]
2011-01-07 11:20       ` J, KEERTHY
  -- strict thread matches above, loose matches on Subject: below --
2011-01-06  4:17 Keerthy
2011-01-06  5:33 ` Guenter Roeck
2011-01-06 12:07   ` [lm-sensors] " Mark Brown
2011-01-06 15:04     ` Guenter Roeck
2011-01-06 20:21       ` Mark Brown
2011-01-06 21:55         ` Guenter Roeck
2011-01-07 12:12           ` J, KEERTHY
2011-01-07 14:45             ` Guenter Roeck
2011-01-22 16:49             ` J, KEERTHY
2011-01-31 10:43               ` Samuel Ortiz

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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox