All of lore.kernel.org
 help / color / mirror / Atom feed
From: Onkalo Samu <samu.p.onkalo@nokia.com>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [RFC PATCH 09/10] lis3: Scale output values to mg
Date: Wed, 11 Nov 2009 07:32:35 +0000	[thread overview]
Message-ID: <1257924755.3507.19.camel@4fid08082> (raw)
In-Reply-To: <1257250185-7929-10-git-send-email-samu.p.onkalo@nokia.com>

On Tue, 2009-11-10 at 14:42 +0100, ext Éric Piel wrote:
> Op 10-11-09 14:31, Daniel Mack schreef:
> > Does the change to the min/max parameters to input_set_abs_params()
> > also reflect the factor in which the multiplication factor alters?
> > 
> > In other words: If I scale the read value to the full range reported by
> > the input device - will I still get the same value before and after the
> > change? If that's the case, I guess the 'breakage' would be acceptable.
> So your question is whether this changes the values of the joystick
> interface, right? I haven't tested the patch, so Samu could probably
> better answer, but looking at the code and with what I know about the
> joystick subsystem, it shouldn't as the values are always scaled between
> -32000 and 32000 (approximately).
> 

I test this on hw. When the values are read via /dev/input/jsx it
doesn't matter if the scaling is on or off. 
If the js_corr.type is set to JS_CORR_NONE, raw values are passed via
jstick interface and then the scaling naturally changes the scale.

This can be invisible change depending on the joystick interface
configuration. 

> [thinking further....]
> 
> So not only this means it's not going to break applications using only
> the joystick interface, it also means that the whole business of scaling
> the raw values for the joystick subsystem in the patch is completely
> useless. Scaling to mG should be done only for the sysfs interface.
> 
> Samu, could you confirm my understanding, and fix the patch if necessary?

Well, raw input values can be read also from /dev/input/eventx. In that
interface, scaling matter similarly as in sysfs. By scaling the values, 
sysfs and "raw" values from eventx would mean same thing for all the
different variants of the chip. Also if there will be a need to use full
scale is some cases (+- 8G for 8 bit and and +-6G for 12bit), meaning of
the output values are not changed if the scaling is in use.

From that point of view, scaling is not breaking joystick interface and
other users would get similar values regardless of the chip.

Br,
Samu



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

  parent reply	other threads:[~2009-11-11  7:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-03 12:09 [lm-sensors] [RFC PATCH 09/10] lis3: Scale output values to mg Samu Onkalo
2009-11-03 12:17 ` Daniel Mack
2009-11-03 12:30 ` samu.p.onkalo
2009-11-03 12:32 ` Daniel Mack
2009-11-03 13:25 ` Éric Piel
2009-11-06 11:55 ` samu.p.onkalo
2009-11-10 12:47 ` Daniel Mack
2009-11-10 13:23 ` Éric Piel
2009-11-10 13:31 ` Daniel Mack
2009-11-10 13:42 ` Éric Piel
2009-11-11  7:32 ` Onkalo Samu [this message]
2010-04-21 12:10 ` Daniel Mack
2010-04-22  6:33 ` samu.p.onkalo

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=1257924755.3507.19.camel@4fid08082 \
    --to=samu.p.onkalo@nokia.com \
    --cc=lm-sensors@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.