Lines Matching +full:rtq6752 +full:- +full:pavdd

1 // SPDX-License-Identifier: GPL-2.0+
36 #define RTQ6752_ENABLE_MASK (BIT(RTQ6752_IDX_MAX) - 1)
56 mutex_lock(&priv->lock); in rtq6752_set_vdd_enable()
57 if (!priv->enable_flag) { in rtq6752_set_vdd_enable()
58 if (priv->enable_gpio) { in rtq6752_set_vdd_enable()
59 gpiod_set_value(priv->enable_gpio, 1); in rtq6752_set_vdd_enable()
65 regcache_cache_only(priv->regmap, false); in rtq6752_set_vdd_enable()
66 ret = regcache_sync(priv->regmap); in rtq6752_set_vdd_enable()
68 mutex_unlock(&priv->lock); in rtq6752_set_vdd_enable()
73 priv->enable_flag |= BIT(rid); in rtq6752_set_vdd_enable()
74 mutex_unlock(&priv->lock); in rtq6752_set_vdd_enable()
88 mutex_lock(&priv->lock); in rtq6752_set_vdd_disable()
89 priv->enable_flag &= ~BIT(rid); in rtq6752_set_vdd_disable()
91 if (!priv->enable_flag) { in rtq6752_set_vdd_disable()
92 regcache_cache_only(priv->regmap, true); in rtq6752_set_vdd_disable()
93 regcache_mark_dirty(priv->regmap); in rtq6752_set_vdd_disable()
95 if (priv->enable_gpio) in rtq6752_set_vdd_disable()
96 gpiod_set_value(priv->enable_gpio, 0); in rtq6752_set_vdd_disable()
99 mutex_unlock(&priv->lock); in rtq6752_set_vdd_disable()
112 ret = regmap_read(rdev->regmap, RTQ6752_REG_FAULT, &val); in rtq6752_get_error_flags()
136 .name = "rtq6752-pavdd",
137 .of_match = of_match_ptr("pavdd"),
155 .name = "rtq6752-navdd",
180 /* Configure PAVDD on and softstart delay time to the minimum */ in rtq6752_init_device_properties()
181 ret = regmap_raw_write(priv->regmap, RTQ6752_REG_PAVDDONDLY, raw_vals, in rtq6752_init_device_properties()
187 return regmap_raw_write(priv->regmap, RTQ6752_REG_NAVDDONDLY, raw_vals, in rtq6752_init_device_properties()
226 priv = devm_kzalloc(&i2c->dev, sizeof(*priv), GFP_KERNEL); in rtq6752_probe()
228 return -ENOMEM; in rtq6752_probe()
230 mutex_init(&priv->lock); in rtq6752_probe()
232 priv->enable_gpio = devm_gpiod_get_optional(&i2c->dev, "enable", in rtq6752_probe()
234 if (IS_ERR(priv->enable_gpio)) { in rtq6752_probe()
235 dev_err(&i2c->dev, "Failed to get 'enable' gpio\n"); in rtq6752_probe()
236 return PTR_ERR(priv->enable_gpio); in rtq6752_probe()
240 /* Default EN pin to high, PAVDD and NAVDD will be on */ in rtq6752_probe()
241 priv->enable_flag = RTQ6752_ENABLE_MASK; in rtq6752_probe()
243 priv->regmap = devm_regmap_init_i2c(i2c, &rtq6752_regmap_config); in rtq6752_probe()
244 if (IS_ERR(priv->regmap)) { in rtq6752_probe()
245 dev_err(&i2c->dev, "Failed to init regmap\n"); in rtq6752_probe()
246 return PTR_ERR(priv->regmap); in rtq6752_probe()
251 dev_err(&i2c->dev, "Failed to init device properties\n"); in rtq6752_probe()
255 reg_cfg.dev = &i2c->dev; in rtq6752_probe()
256 reg_cfg.regmap = priv->regmap; in rtq6752_probe()
260 rdev = devm_regulator_register(&i2c->dev, in rtq6752_probe()
264 dev_err(&i2c->dev, "Failed to init %d regulator\n", i); in rtq6752_probe()
273 { .compatible = "richtek,rtq6752", },
280 .name = "rtq6752",
289 MODULE_DESCRIPTION("Richtek RTQ6752 Regulator Driver");