Skip to content

Commit 172b7d7

Browse files
Dr. David Alan Gilbertsre
authored andcommitted
power: supply: ds2760: Remove unused ds2760_battery_set_charged
With power_supply_set_battery_charged() deleted in the previous patch, there's no one left to call the set_charged method. The only implemented is in ds2760, unwire it and delete the associated functions and data. (Arguably it might be time to delete ds2760 since I don't think there are any users left) Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> Link: https://lore.kernel.org/r/20250307230225.128775-3-linux@treblig.org Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
1 parent 46723e2 commit 172b7d7

File tree

1 file changed

+0
-49
lines changed

1 file changed

+0
-49
lines changed

drivers/power/supply/ds2760_battery.c

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ struct ds2760_device_info {
112112
struct power_supply_desc bat_desc;
113113
struct workqueue_struct *monitor_wqueue;
114114
struct delayed_work monitor_work;
115-
struct delayed_work set_charged_work;
116115
struct notifier_block pm_notifier;
117116
};
118117

@@ -489,50 +488,6 @@ static void ds2760_battery_external_power_changed(struct power_supply *psy)
489488
}
490489

491490

492-
static void ds2760_battery_set_charged_work(struct work_struct *work)
493-
{
494-
char bias;
495-
struct ds2760_device_info *di = container_of(work,
496-
struct ds2760_device_info, set_charged_work.work);
497-
498-
dev_dbg(di->dev, "%s\n", __func__);
499-
500-
ds2760_battery_read_status(di);
501-
502-
/* When we get notified by external circuitry that the battery is
503-
* considered fully charged now, we know that there is no current
504-
* flow any more. However, the ds2760's internal current meter is
505-
* too inaccurate to rely on - spec say something ~15% failure.
506-
* Hence, we use the current offset bias register to compensate
507-
* that error.
508-
*/
509-
510-
if (!power_supply_am_i_supplied(di->bat))
511-
return;
512-
513-
bias = (signed char) di->current_raw +
514-
(signed char) di->raw[DS2760_CURRENT_OFFSET_BIAS];
515-
516-
dev_dbg(di->dev, "%s: bias = %d\n", __func__, bias);
517-
518-
w1_ds2760_write(di->dev, &bias, DS2760_CURRENT_OFFSET_BIAS, 1);
519-
w1_ds2760_store_eeprom(di->dev, DS2760_EEPROM_BLOCK1);
520-
w1_ds2760_recall_eeprom(di->dev, DS2760_EEPROM_BLOCK1);
521-
522-
/* Write to the di->raw[] buffer directly - the CURRENT_OFFSET_BIAS
523-
* value won't be read back by ds2760_battery_read_status() */
524-
di->raw[DS2760_CURRENT_OFFSET_BIAS] = bias;
525-
}
526-
527-
static void ds2760_battery_set_charged(struct power_supply *psy)
528-
{
529-
struct ds2760_device_info *di = power_supply_get_drvdata(psy);
530-
531-
/* postpone the actual work by 20 secs. This is for debouncing GPIO
532-
* signals and to let the current value settle. See AN4188. */
533-
mod_delayed_work(di->monitor_wqueue, &di->set_charged_work, HZ * 20);
534-
}
535-
536491
static int ds2760_battery_get_property(struct power_supply *psy,
537492
enum power_supply_property psp,
538493
union power_supply_propval *val)
@@ -692,7 +647,6 @@ static int w1_ds2760_add_slave(struct w1_slave *sl)
692647
di->bat_desc.set_property = ds2760_battery_set_property;
693648
di->bat_desc.property_is_writeable =
694649
ds2760_battery_property_is_writeable;
695-
di->bat_desc.set_charged = ds2760_battery_set_charged;
696650
di->bat_desc.external_power_changed =
697651
ds2760_battery_external_power_changed;
698652

@@ -747,8 +701,6 @@ static int w1_ds2760_add_slave(struct w1_slave *sl)
747701
}
748702

749703
INIT_DELAYED_WORK(&di->monitor_work, ds2760_battery_work);
750-
INIT_DELAYED_WORK(&di->set_charged_work,
751-
ds2760_battery_set_charged_work);
752704
di->monitor_wqueue = alloc_ordered_workqueue(name, WQ_MEM_RECLAIM);
753705
if (!di->monitor_wqueue) {
754706
retval = -ESRCH;
@@ -774,7 +726,6 @@ static void w1_ds2760_remove_slave(struct w1_slave *sl)
774726

775727
unregister_pm_notifier(&di->pm_notifier);
776728
cancel_delayed_work_sync(&di->monitor_work);
777-
cancel_delayed_work_sync(&di->set_charged_work);
778729
destroy_workqueue(di->monitor_wqueue);
779730
}
780731

0 commit comments

Comments
 (0)