Lines Matching refs:lmu
29 static int ti_lmu_enable_hw(struct ti_lmu *lmu, enum ti_lmu_id id) in ti_lmu_enable_hw() argument
31 if (lmu->en_gpio) in ti_lmu_enable_hw()
32 gpiod_set_value(lmu->en_gpio, 1); in ti_lmu_enable_hw()
39 return regmap_update_bits(lmu->regmap, LM3631_REG_DEVCTRL, in ti_lmu_enable_hw()
49 struct ti_lmu *lmu = data; in ti_lmu_disable_hw() local
50 if (lmu->en_gpio) in ti_lmu_disable_hw()
51 gpiod_set_value(lmu->en_gpio, 0); in ti_lmu_disable_hw()
142 struct ti_lmu *lmu; in ti_lmu_probe() local
153 lmu = devm_kzalloc(dev, sizeof(*lmu), GFP_KERNEL); in ti_lmu_probe()
154 if (!lmu) in ti_lmu_probe()
157 lmu->dev = &cl->dev; in ti_lmu_probe()
166 lmu->regmap = devm_regmap_init_i2c(cl, ®map_cfg); in ti_lmu_probe()
167 if (IS_ERR(lmu->regmap)) in ti_lmu_probe()
168 return PTR_ERR(lmu->regmap); in ti_lmu_probe()
171 lmu->en_gpio = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_HIGH); in ti_lmu_probe()
172 if (IS_ERR(lmu->en_gpio)) { in ti_lmu_probe()
173 ret = PTR_ERR(lmu->en_gpio); in ti_lmu_probe()
178 ret = ti_lmu_enable_hw(lmu, id->driver_data); in ti_lmu_probe()
182 ret = devm_add_action_or_reset(dev, ti_lmu_disable_hw, lmu); in ti_lmu_probe()
191 BLOCKING_INIT_NOTIFIER_HEAD(&lmu->notifier); in ti_lmu_probe()
193 i2c_set_clientdata(cl, lmu); in ti_lmu_probe()
195 return devm_mfd_add_devices(lmu->dev, 0, data->cells, in ti_lmu_probe()