Skip to content
Snippets Groups Projects

hi846 additions

All threads resolved!
1 file
+ 13
14
Compare changes
  • Side-by-side
  • Inline
+ 13
14
@@ -1172,6 +1172,15 @@ static int hi846_regulator_enable(struct hi846 *hi846)
return regulator_enable(hi846->vdd1_regulator);
}
static void hi846_regulator_disable(struct hi846 *hi846)
{
if (regulator_is_enabled(hi846->vdd1_regulator))
regulator_disable(hi846->vdd1_regulator);
if (regulator_is_enabled(hi846->vdd_regulator))
regulator_disable(hi846->vdd_regulator);
}
static int __maybe_unused hi846_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
@@ -1186,11 +1195,7 @@ static int __maybe_unused hi846_suspend(struct device *dev)
if (!IS_ERR(hi846->clock))
clk_disable_unprepare(hi846->clock);
if (regulator_is_enabled(hi846->vdd1_regulator))
regulator_disable(hi846->vdd1_regulator);
if (regulator_is_enabled(hi846->vdd_regulator))
regulator_disable(hi846->vdd_regulator);
hi846_regulator_disable(hi846);
return 0;
}
@@ -1204,7+1209,7 @@
dev_dbg(dev, "%s\n", __func__);
ret = hi846_regulator_enable(hi846);
if (ret) {
dev_err(dev, "enable regulator failed: %d\n", ret);
return ret;
@@ -1234,7+1239,7 @@
hi846->streaming = 0;
error_regulator:
regulator_disable(hi846->vdd1_regulator);
if (regulator_is_enabled(hi846->vdd_regulator))
regulator_disable(hi846->vdd_regulator);
hi846_regulator_disable(hi846);
return ret;
}
@@ -1552,9 +1555,7 @@ static int hi846_remove(struct i2c_client *client)
pm_runtime_set_suspended(&client->dev);
pm_runtime_put_noidle(&client->dev);
mutex_destroy(&hi846->mutex);
regulator_disable(hi846->vdd1_regulator);
if (regulator_is_enabled(hi846->vdd_regulator))
regulator_disable(hi846->vdd_regulator);
hi846_regulator_disable(hi846);
return 0;
}
@@ -1718,9 +1719,7 @@ static int hi846_probe(struct i2c_client *client)
mutex_destroy(&hi846->mutex);
probe_error_regulator:
regulator_disable(hi846->vdd1_regulator);
if (regulator_is_enabled(hi846->vdd_regulator))
regulator_disable(hi846->vdd_regulator);
hi846_regulator_disable(hi846);
return ret;
}
Loading