Lines Matching refs:lmu
28 static int ti_lmu_enable_hw(struct ti_lmu *lmu, enum ti_lmu_id id) in ti_lmu_enable_hw() argument
30 if (lmu->en_gpio) in ti_lmu_enable_hw()
31 gpiod_set_value(lmu->en_gpio, 1); in ti_lmu_enable_hw()
38 return regmap_update_bits(lmu->regmap, LM3631_REG_DEVCTRL, in ti_lmu_enable_hw()
48 struct ti_lmu *lmu = data; in ti_lmu_disable_hw() local
49 if (lmu->en_gpio) in ti_lmu_disable_hw()
50 gpiod_set_value(lmu->en_gpio, 0); in ti_lmu_disable_hw()
141 struct ti_lmu *lmu; in ti_lmu_probe() local
152 lmu = devm_kzalloc(dev, sizeof(*lmu), GFP_KERNEL); in ti_lmu_probe()
153 if (!lmu) in ti_lmu_probe()
156 lmu->dev = &cl->dev; in ti_lmu_probe()
165 lmu->regmap = devm_regmap_init_i2c(cl, ®map_cfg); in ti_lmu_probe()
166 if (IS_ERR(lmu->regmap)) in ti_lmu_probe()
167 return PTR_ERR(lmu->regmap); in ti_lmu_probe()
170 lmu->en_gpio = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_HIGH); in ti_lmu_probe()
171 if (IS_ERR(lmu->en_gpio)) { in ti_lmu_probe()
172 ret = PTR_ERR(lmu->en_gpio); in ti_lmu_probe()
177 ret = ti_lmu_enable_hw(lmu, id->driver_data); in ti_lmu_probe()
181 ret = devm_add_action_or_reset(dev, ti_lmu_disable_hw, lmu); in ti_lmu_probe()
190 BLOCKING_INIT_NOTIFIER_HEAD(&lmu->notifier); in ti_lmu_probe()
192 i2c_set_clientdata(cl, lmu); in ti_lmu_probe()
194 return devm_mfd_add_devices(lmu->dev, 0, data->cells, in ti_lmu_probe()