Lines Matching refs:tosa_bat_main
47 static struct tosa_bat tosa_bat_main; variable
197 tosa_bat_update(&tosa_bat_main); in tosa_bat_work()
249 static struct tosa_bat tosa_bat_main = { variable
343 tosa_bat_main.gpiod_charge_off = devm_gpiod_get(dev, "main charge off", GPIOD_OUT_HIGH); in tosa_bat_probe()
344 if (IS_ERR(tosa_bat_main.gpiod_charge_off)) in tosa_bat_probe()
345 return dev_err_probe(dev, PTR_ERR(tosa_bat_main.gpiod_charge_off), in tosa_bat_probe()
353 tosa_bat_main.gpiod_bat = devm_gpiod_get(dev, "main battery", GPIOD_OUT_LOW); in tosa_bat_probe()
354 if (IS_ERR(tosa_bat_main.gpiod_bat)) in tosa_bat_probe()
355 return dev_err_probe(dev, PTR_ERR(tosa_bat_main.gpiod_bat), in tosa_bat_probe()
367 tosa_bat_main.gpiod_full = devm_gpiod_get(dev, "main battery full", GPIOD_IN); in tosa_bat_probe()
368 if (IS_ERR(tosa_bat_main.gpiod_full)) in tosa_bat_probe()
369 return dev_err_probe(dev, PTR_ERR(tosa_bat_main.gpiod_full), in tosa_bat_probe()
377 tosa_bat_main.gpiod_temp = devm_gpiod_get(dev, "main battery temp", GPIOD_OUT_LOW); in tosa_bat_probe()
378 if (IS_ERR(tosa_bat_main.gpiod_temp)) in tosa_bat_probe()
379 return dev_err_probe(dev, PTR_ERR(tosa_bat_main.gpiod_temp), in tosa_bat_probe()
408 mutex_init(&tosa_bat_main.work_lock); in tosa_bat_probe()
413 main_psy_cfg.drv_data = &tosa_bat_main; in tosa_bat_probe()
414 tosa_bat_main.psy = power_supply_register(dev, in tosa_bat_probe()
417 if (IS_ERR(tosa_bat_main.psy)) { in tosa_bat_probe()
418 ret = PTR_ERR(tosa_bat_main.psy); in tosa_bat_probe()
439 ret = request_irq(gpiod_to_irq(tosa_bat_main.gpiod_full), in tosa_bat_probe()
442 "main full", &tosa_bat_main); in tosa_bat_probe()
464 free_irq(gpiod_to_irq(tosa_bat_main.gpiod_full), &tosa_bat_main); in tosa_bat_probe()
470 power_supply_unregister(tosa_bat_main.psy); in tosa_bat_probe()
483 free_irq(gpiod_to_irq(tosa_bat_main.gpiod_full), &tosa_bat_main); in tosa_bat_remove()
487 power_supply_unregister(tosa_bat_main.psy); in tosa_bat_remove()