Lines Matching +full:oc +full:- +full:level +full:- +full:select
1 // SPDX-License-Identifier: GPL-2.0+
31 #define RT6245_NUM_VOUT ((RT6245_VOUT_MAXUV - RT6245_VOUT_MINUV) / RT6245_VOUT_STEPUV + 1)
44 if (!priv->enable_gpio) in rt6245_enable()
47 gpiod_direction_output(priv->enable_gpio, 1); in rt6245_enable()
55 priv->enable_state = true; in rt6245_enable()
64 if (!priv->enable_gpio) in rt6245_disable()
65 return -EINVAL; in rt6245_disable()
70 gpiod_direction_output(priv->enable_gpio, 0); in rt6245_disable()
72 priv->enable_state = false; in rt6245_disable()
80 return priv->enable_state ? 1 : 0; in rt6245_is_enabled()
99 .name = "rt6245-regulator",
120 { "richtek,oc-level-select", RT6245_VIRT_OCLIMIT }, in rt6245_init_device_properties()
121 { "richtek,ot-level-select", RT6245_VIRT_OTLEVEL }, in rt6245_init_device_properties()
122 { "richtek,pgdly-time-select", RT6245_VIRT_PGDLYTIME }, in rt6245_init_device_properties()
123 { "richtek,switch-freq-select", RT6245_VIRT_SWFREQ } in rt6245_init_device_properties()
196 priv = devm_kzalloc(&i2c->dev, sizeof(*priv), GFP_KERNEL); in rt6245_probe()
198 return -ENOMEM; in rt6245_probe()
200 priv->enable_state = true; in rt6245_probe()
202 priv->enable_gpio = devm_gpiod_get_optional(&i2c->dev, "enable", GPIOD_OUT_HIGH); in rt6245_probe()
203 if (IS_ERR(priv->enable_gpio)) { in rt6245_probe()
204 dev_err(&i2c->dev, "Failed to get 'enable' gpio\n"); in rt6245_probe()
205 return PTR_ERR(priv->enable_gpio); in rt6245_probe()
210 regmap = devm_regmap_init(&i2c->dev, NULL, i2c, &rt6245_regmap_config); in rt6245_probe()
212 dev_err(&i2c->dev, "Failed to initialize the regmap\n"); in rt6245_probe()
216 ret = rt6245_init_device_properties(&i2c->dev); in rt6245_probe()
218 dev_err(&i2c->dev, "Failed to initialize device properties\n"); in rt6245_probe()
222 regulator_cfg.dev = &i2c->dev; in rt6245_probe()
223 regulator_cfg.of_node = i2c->dev.of_node; in rt6245_probe()
226 regulator_cfg.init_data = of_get_regulator_init_data(&i2c->dev, i2c->dev.of_node, in rt6245_probe()
228 rdev = devm_regulator_register(&i2c->dev, &rt6245_regulator_desc, ®ulator_cfg); in rt6245_probe()
230 dev_err(&i2c->dev, "Failed to register regulator\n"); in rt6245_probe()