Lines Matching refs:lis3
31 static int lis3_reg_ctrl(struct lis3lv02d *lis3, bool state)
35 ret = regulator_bulk_disable(ARRAY_SIZE(lis3->regulators),
36 lis3->regulators);
38 ret = regulator_bulk_enable(ARRAY_SIZE(lis3->regulators),
39 lis3->regulators);
46 static inline s32 lis3_i2c_write(struct lis3lv02d *lis3, int reg, u8 value)
48 struct i2c_client *c = lis3->bus_priv;
52 static inline s32 lis3_i2c_read(struct lis3lv02d *lis3, int reg, u8 *v)
54 struct i2c_client *c = lis3->bus_priv;
59 static inline s32 lis3_i2c_blockread(struct lis3lv02d *lis3, int reg, int len,
62 struct i2c_client *c = lis3->bus_priv;
67 static int lis3_i2c_init(struct lis3lv02d *lis3)
72 lis3_reg_ctrl(lis3, LIS3_REG_ON);
74 lis3->read(lis3, WHO_AM_I, ®);
75 if (reg != lis3->whoami)
76 printk(KERN_ERR "lis3: power on failure\n");
79 ret = lis3->read(lis3, CTRL_REG1, ®);
83 if (lis3->whoami == WAI_3DLH)
88 return lis3->write(lis3, CTRL_REG1, reg);
182 struct lis3lv02d *lis3 = i2c_get_clientdata(client);
188 lis3lv02d_joystick_disable(lis3);
191 regulator_bulk_free(ARRAY_SIZE(lis3->regulators),
200 struct lis3lv02d *lis3 = i2c_get_clientdata(client);
202 if (!lis3->pdata || !lis3->pdata->wakeup_flags)
203 lis3lv02d_poweroff(lis3);
210 struct lis3lv02d *lis3 = i2c_get_clientdata(client);
217 if (!lis3->pdata || !lis3->pdata->wakeup_flags ||
219 lis3lv02d_poweron(lis3);
229 struct lis3lv02d *lis3 = i2c_get_clientdata(client);
231 lis3lv02d_poweroff(lis3);
238 struct lis3lv02d *lis3 = i2c_get_clientdata(client);
240 lis3lv02d_poweron(lis3);