Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 217112
b: refs/heads/master
c: 477bc91
h: refs/heads/master
v: v3
  • Loading branch information
Samu Onkalo authored and Guenter Roeck committed Oct 25, 2010
1 parent 7b95be9 commit cc190ca
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cc23aa1ce2631b2fe1e3fba82ee444460f5ee3b7
refs/heads/master: 477bc918c2323a51f577cd892ca49376f6feb5d5
18 changes: 14 additions & 4 deletions trunk/drivers/hwmon/lis3lv02d.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@
#define LIS3_SENSITIVITY_12B ((LIS3_ACCURACY * 1000) / 1024)
#define LIS3_SENSITIVITY_8B (18 * LIS3_ACCURACY)

#define LIS3_DEFAULT_FUZZ 3
#define LIS3_DEFAULT_FLAT 3
#define LIS3_DEFAULT_FUZZ_12B 3
#define LIS3_DEFAULT_FLAT_12B 3
#define LIS3_DEFAULT_FUZZ_8B 1
#define LIS3_DEFAULT_FLAT_8B 1

struct lis3lv02d lis3_dev = {
.misc_wait = __WAIT_QUEUE_HEAD_INITIALIZER(lis3_dev.misc_wait),
Expand Down Expand Up @@ -564,8 +566,16 @@ int lis3lv02d_joystick_enable(void)

set_bit(EV_ABS, input_dev->evbit);
max_val = (lis3_dev.mdps_max_val * lis3_dev.scale) / LIS3_ACCURACY;
fuzz = (LIS3_DEFAULT_FUZZ * lis3_dev.scale) / LIS3_ACCURACY;
flat = (LIS3_DEFAULT_FLAT * lis3_dev.scale) / LIS3_ACCURACY;
if (lis3_dev.whoami == WAI_12B) {
fuzz = LIS3_DEFAULT_FUZZ_12B;
flat = LIS3_DEFAULT_FLAT_12B;
} else {
fuzz = LIS3_DEFAULT_FUZZ_8B;
flat = LIS3_DEFAULT_FLAT_8B;
}
fuzz = (fuzz * lis3_dev.scale) / LIS3_ACCURACY;
flat = (flat * lis3_dev.scale) / LIS3_ACCURACY;

input_set_abs_params(input_dev, ABS_X, -max_val, max_val, fuzz, flat);
input_set_abs_params(input_dev, ABS_Y, -max_val, max_val, fuzz, flat);
input_set_abs_params(input_dev, ABS_Z, -max_val, max_val, fuzz, flat);
Expand Down

0 comments on commit cc190ca

Please sign in to comment.