Re: [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.
>

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



[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux