Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 164538
b: refs/heads/master
c: 8873c33
h: refs/heads/master
v: v3
  • Loading branch information
Daniel Mack authored and Linus Torvalds committed Sep 22, 2009
1 parent a250735 commit 45429f8
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 7 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: 0ec48915e8bbb37dea3df85c41e4c3498b95664b
refs/heads/master: 8873c33483e62988ed886230aab71ef4c678f710
9 changes: 9 additions & 0 deletions trunk/drivers/hwmon/lis3lv02d.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,15 @@ int lis3lv02d_init_device(struct lis3lv02d *dev)
(p->click_thresh_y << 4));
}

if (p->wakeup_flags && (dev->whoami == LIS_SINGLE_ID)) {
dev->write(dev, FF_WU_CFG_1, p->wakeup_flags);
dev->write(dev, FF_WU_THS_1, p->wakeup_thresh & 0x7f);
/* default to 2.5ms for now */
dev->write(dev, FF_WU_DURATION_1, 1);
/* enable high pass filter for both free-fall units */
dev->write(dev, CTRL_REG2, HP_FF_WU1 | HP_FF_WU2);
}

if (p->irq_cfg)
dev->write(dev, CTRL_REG3, p->irq_cfg);
}
Expand Down
24 changes: 18 additions & 6 deletions trunk/drivers/hwmon/lis3lv02d.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,17 @@ enum lis3_reg {
OUTZ_L = 0x2C,
OUTZ_H = 0x2D,
OUTZ = 0x2D,
FF_WU_CFG = 0x30,
FF_WU_SRC = 0x31,
FF_WU_ACK = 0x32,
FF_WU_THS_L = 0x34,
FF_WU_THS_H = 0x35,
FF_WU_DURATION = 0x36,
};

enum lis302d_reg {
FF_WU_CFG_1 = 0x30,
FF_WU_SRC_1 = 0x31,
FF_WU_THS_1 = 0x32,
FF_WU_DURATION_1 = 0x33,
FF_WU_CFG_2 = 0x34,
FF_WU_SRC_2 = 0x35,
FF_WU_THS_2 = 0x36,
FF_WU_DURATION_2 = 0x37,
CLICK_CFG = 0x38,
CLICK_SRC = 0x39,
CLICK_THSY_X = 0x3B,
Expand All @@ -77,6 +79,12 @@ enum lis302d_reg {
};

enum lis3lv02d_reg {
FF_WU_CFG = 0x30,
FF_WU_SRC = 0x31,
FF_WU_ACK = 0x32,
FF_WU_THS_L = 0x34,
FF_WU_THS_H = 0x35,
FF_WU_DURATION = 0x36,
DD_CFG = 0x38,
DD_SRC = 0x39,
DD_ACK = 0x3A,
Expand Down Expand Up @@ -107,6 +115,10 @@ enum lis3lv02d_ctrl2 {
CTRL2_FS = 0x80, /* Full Scale selection */
};

enum lis302d_ctrl2 {
HP_FF_WU2 = 0x08,
HP_FF_WU1 = 0x04,
};

enum lis3lv02d_ctrl3 {
CTRL3_CFS0 = 0x01,
Expand Down
9 changes: 9 additions & 0 deletions trunk/include/linux/lis3lv02d.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ struct lis3lv02d_platform_data {
#define LIS3_IRQ_OPEN_DRAIN (1 << 6)
#define LIS3_IRQ_ACTIVE_LOW (1 << 7)
unsigned char irq_cfg;

#define LIS3_WAKEUP_X_LO (1 << 0)
#define LIS3_WAKEUP_X_HI (1 << 1)
#define LIS3_WAKEUP_Y_LO (1 << 2)
#define LIS3_WAKEUP_Y_HI (1 << 3)
#define LIS3_WAKEUP_Z_LO (1 << 4)
#define LIS3_WAKEUP_Z_HI (1 << 5)
unsigned char wakeup_flags;
unsigned char wakeup_thresh;
};

#endif /* __LIS3LV02D_H_ */

0 comments on commit 45429f8

Please sign in to comment.