@@ -110,6 +110,13 @@ static const struct regmap_config adp5585_regmap_configs[] = {
},
};
+static void adp5585_osc_disable(void *data)
+{
+ const struct adp5585_dev *adp5585 = data;
+
+ regmap_write(adp5585->regmap, ADP5585_GENERAL_CFG, 0);
+}
+
static int adp5585_i2c_probe(struct i2c_client *i2c)
{
const struct regmap_config *regmap_config;
@@ -138,6 +145,15 @@ static int adp5585_i2c_probe(struct i2c_client *i2c)
return dev_err_probe(&i2c->dev, -ENODEV,
"Invalid device ID 0x%02x\n", id);
+ ret = regmap_set_bits(adp5585->regmap, ADP5585_GENERAL_CFG,
+ ADP5585_OSC_EN);
+ if (ret)
+ return ret;
+
+ ret = devm_add_action_or_reset(&i2c->dev, adp5585_osc_disable, adp5585);
+ if (ret)
+ return ret;
+
ret = devm_mfd_add_devices(&i2c->dev, PLATFORM_DEVID_AUTO,
adp5585_devs, ARRAY_SIZE(adp5585_devs),
NULL, 0, NULL);