Linux IIO development
 help / color / mirror / Atom feed
From: Beomho Seo <beomho.seo@samsung.com>
To: undisclosed-recipients: ;
Cc: linux-iio@vger.kernel.org, Peter Meerwald <pmeerw@pmeerw.net>,
	Jonathan Cameron <jic23@kernel.org>
Subject: Re: [PATCH 0/2] iio: ak8975: Fix calculation formula and add device name
Date: Tue, 04 Feb 2014 14:52:49 +0900	[thread overview]
Message-ID: <52F08031.50703@samsung.com> (raw)
In-Reply-To: <alpine.DEB.2.01.1401290949450.17833@pmeerw.net>

On 01/29/2014 05:53 PM, Peter Meerwald wrote:
> Hello,
> 
>>  Three months ago Lars-Peter revised description of device driver[1].
> 
> me, not Lars-Peter
> 

I'm really sorry, my mistake.

>> Correctly, device's sensitivity is 0.3 uT/LSB typ and One micro tesla equal 0.01 gauss[2].
>> So I have fixed calculation formula,And then add RAW_TO_GAUSS macro.
>> Scale are returned as VAL_INT_PLUS_MICRO.
>> Additionally, I have add device name.
> 
> +#define RAW_TO_GAUSS(asa) ((((asa) + 128) * 3000) / 256)
> 
>   *
>   * Since 1uT = 0.01 gauss, our final scale factor becomes:
>   *
> - * Hadj = H * ((ASA + 128) / 256) * 3/10 * 100
> - * Hadj = H * ((ASA + 128) * 30 / 256
> + * Hadj = H * ((ASA + 128) / 256) * 3/10 * 1/100
> + * Hadj = H * ((ASA + 128) * 0.003) / 256
>   *
>   * Since ASA doesn't change, we cache the resultant scale factor into the
>   * device context in ak8975_setup().
>   */
> -       data->raw_to_gauss[0] = ((data->asa[0] + 128) * 30) >> 8;
> +       data->raw_to_gauss[0] = RAW_TO_GAUSS(data->asa[0]);
> 
> thank you for following up on this; I don't have the hardware, so I didn't 
> dare to change the driver...
> 
> the RAW_TO_GAUSS() macro doesn't match the comment Hadj = H * ... anymore
> 
> maybe put this explanation in the patch comment, not the cover letter?
> 

OK. I will resend explanation in the patch comment.

> regards, p.
> 


-- 
Best Regards,

Beomho Seo, Assistant Engineer
System S/W Lab., Software Center, Samsung Electronics

      reply	other threads:[~2014-02-04  5:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-29  5:05 [PATCH 0/2] iio: ak8975: Fix calculation formula and add device name Beomho Seo
2014-01-29  8:53 ` Peter Meerwald
2014-02-04  5:52   ` Beomho Seo [this message]

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=52F08031.50703@samsung.com \
    --to=beomho.seo@samsung.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /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