atomic_t enabled;
int on_before_suspend;
struct regulator *regulator;
+ struct regulator *io_regulator;
u8 resume_state[5];
};
if (!atomic_cmpxchg(&barom->enabled, 0, 1)) {
if (barom->regulator)
err = regulator_enable(barom->regulator);
+ err = regulator_enable(barom->io_regulator);
if (err < 0) {
atomic_set(&barom->enabled, 0);
return err;
cancel_delayed_work_sync(&barom->input_work);
if (barom->regulator)
regulator_disable(barom->regulator);
+ regulator_disable(barom->io_regulator);
}
barom->measurement_cycle = NO_CYCLE;
dev_err(&client->dev, "unable to get regulator\n");
barom->regulator = NULL;
}
+ barom->io_regulator = regulator_get(&client->dev, "vio");
+ if (IS_ERR(barom->io_regulator))
+ barom->io_regulator = NULL;
err = bmp085_input_init(barom);
if (err < 0)
err3:
if (barom->regulator)
regulator_put(barom->regulator);
+ if (barom->io_regulator)
+ regulator_put(barom->io_regulator);
err_req_irq_failed:
err1_1:
mutex_unlock(&barom->lock);
bmp085_disable(barom);
if (barom->regulator)
regulator_put(barom->regulator);
+ if (barom->io_regulator)
+ regulator_put(barom->io_regulator);
#ifdef DEBUG
device_remove_file(&client->dev, &dev_attr_registers);
#endif