Lines Matching refs:collie_bat_main

52 static struct collie_bat collie_bat_main;  variable
195 collie_bat_update(&collie_bat_main); in collie_bat_work()
230 static struct collie_bat collie_bat_main = { variable
293 collie_bat_main.status == POWER_SUPPLY_STATUS_CHARGING) in collie_bat_suspend()
294 wakeup_enabled = !enable_irq_wake(gpiod_to_irq(collie_bat_main.gpio_full)); in collie_bat_suspend()
304 disable_irq_wake(gpiod_to_irq(collie_bat_main.gpio_full)); in collie_bat_resume()
327 collie_bat_main.gpio_full = gpiod_get(&dev->ucb->dev, in collie_bat_probe()
330 if (IS_ERR(collie_bat_main.gpio_full)) in collie_bat_probe()
331 return PTR_ERR(collie_bat_main.gpio_full); in collie_bat_probe()
341 collie_bat_main.gpio_charge_on = gpiod_get(&dev->ucb->dev, in collie_bat_probe()
344 if (IS_ERR(collie_bat_main.gpio_charge_on)) { in collie_bat_probe()
345 ret = PTR_ERR(collie_bat_main.gpio_charge_on); in collie_bat_probe()
350 collie_bat_main.gpio_bat = gpiochip_request_own_desc(gc, in collie_bat_probe()
355 if (IS_ERR(collie_bat_main.gpio_bat)) { in collie_bat_probe()
356 ret = PTR_ERR(collie_bat_main.gpio_bat); in collie_bat_probe()
361 collie_bat_main.gpio_temp = gpiochip_request_own_desc(gc, in collie_bat_probe()
366 if (IS_ERR(collie_bat_main.gpio_temp)) { in collie_bat_probe()
367 ret = PTR_ERR(collie_bat_main.gpio_temp); in collie_bat_probe()
385 mutex_init(&collie_bat_main.work_lock); in collie_bat_probe()
389 psy_main_cfg.drv_data = &collie_bat_main; in collie_bat_probe()
390 collie_bat_main.psy = power_supply_register(&dev->ucb->dev, in collie_bat_probe()
393 if (IS_ERR(collie_bat_main.psy)) { in collie_bat_probe()
394 ret = PTR_ERR(collie_bat_main.psy); in collie_bat_probe()
407 ret = request_irq(gpiod_to_irq(collie_bat_main.gpio_full), in collie_bat_probe()
410 "main full", &collie_bat_main); in collie_bat_probe()
422 power_supply_unregister(collie_bat_main.psy); in collie_bat_probe()
428 gpiochip_free_own_desc(collie_bat_main.gpio_temp); in collie_bat_probe()
430 gpiochip_free_own_desc(collie_bat_main.gpio_bat); in collie_bat_probe()
432 gpiod_put(collie_bat_main.gpio_charge_on); in collie_bat_probe()
436 gpiod_put(collie_bat_main.gpio_full); in collie_bat_probe()
443 free_irq(gpiod_to_irq(collie_bat_main.gpio_full), &collie_bat_main); in collie_bat_remove()
445 power_supply_unregister(collie_bat_main.psy); in collie_bat_remove()
448 gpiod_put(collie_bat_main.gpio_full); in collie_bat_remove()
450 gpiod_put(collie_bat_main.gpio_charge_on); in collie_bat_remove()
452 gpiochip_free_own_desc(collie_bat_main.gpio_bat); in collie_bat_remove()
453 gpiochip_free_own_desc(collie_bat_main.gpio_temp); in collie_bat_remove()