lkml.org 
[lkml]   [2012]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC][PATCH] hwmon: add support for Sensirion C1 sensor
From
On Fri, Jul 20, 2012 at 5:14 PM, Oliver Neukum <oneukum@suse.de> wrote:
> On Friday 20 July 2012 17:13:51 Johannes Winkelmann wrote:
>> On Fri, Jul 20, 2012 at 4:03 PM, Oliver Neukum <oneukum@suse.de> wrote:
>
>> > We have dedicated macros for conversion of endianness.
>>
>> Like this:
>> val = swab16p((__le16 *)buf);
>> data->temperature = ((21875 * val) >> 13) - 45000;
>> val = swab16p((__le16 *)(buf+2));
>> data->humidity = ((15000 * val) >> 13) - 10000;
>
> I was thinking of be16_to_cpu()

Ok, fixed locally; I'll collect some more feedback and will resubmit v2

Thanks,
Johannes
--
Johannes Winkelmann
jw@smts.ch


\
 
 \ /
  Last update: 2012-07-20 18:21    [W:0.071 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site