Re: [lm-sensors] [PATCH v3] hwmon: twl4030: Driver for twl4030 madc module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 7, 2011 at 4:14 PM, Mark Brown
<broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> 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.
>
Ok. Converting to the real world units will be added.

>> >> +     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.

OK. I will add comments explaining the flow.
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux