Skip to content

Commit e339295

Browse files
t-8chandy-shev
authored andcommitted
platform/x86: thinkpad_acpi: use standard charge control attribute names
The standard attributes were only introduced after the ones from thinkpad_acpi in commit 813cab8 ("power: supply: core: Add CHARGE_CONTROL_{START_THRESHOLD,END_THRESHOLD} properties"). The new standard attributes are aliased to their previous names, preserving backwards compatibility. Signed-off-by: Thomas Weißschuh <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
1 parent c1c04fb commit e339295

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

drivers/platform/x86/thinkpad_acpi.c

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9603,38 +9603,52 @@ static ssize_t tpacpi_battery_show(int what,
96039603
return sprintf(buf, "%d\n", ret);
96049604
}
96059605

9606-
static ssize_t charge_start_threshold_show(struct device *device,
9606+
static ssize_t charge_control_start_threshold_show(struct device *device,
96079607
struct device_attribute *attr,
96089608
char *buf)
96099609
{
96109610
return tpacpi_battery_show(THRESHOLD_START, device, buf);
96119611
}
96129612

9613-
static ssize_t charge_stop_threshold_show(struct device *device,
9613+
static ssize_t charge_control_end_threshold_show(struct device *device,
96149614
struct device_attribute *attr,
96159615
char *buf)
96169616
{
96179617
return tpacpi_battery_show(THRESHOLD_STOP, device, buf);
96189618
}
96199619

9620-
static ssize_t charge_start_threshold_store(struct device *dev,
9620+
static ssize_t charge_control_start_threshold_store(struct device *dev,
96219621
struct device_attribute *attr,
96229622
const char *buf, size_t count)
96239623
{
96249624
return tpacpi_battery_store(THRESHOLD_START, dev, buf, count);
96259625
}
96269626

9627-
static ssize_t charge_stop_threshold_store(struct device *dev,
9627+
static ssize_t charge_control_end_threshold_store(struct device *dev,
96289628
struct device_attribute *attr,
96299629
const char *buf, size_t count)
96309630
{
96319631
return tpacpi_battery_store(THRESHOLD_STOP, dev, buf, count);
96329632
}
96339633

9634-
static DEVICE_ATTR_RW(charge_start_threshold);
9635-
static DEVICE_ATTR_RW(charge_stop_threshold);
9634+
static DEVICE_ATTR_RW(charge_control_start_threshold);
9635+
static DEVICE_ATTR_RW(charge_control_end_threshold);
9636+
struct device_attribute dev_attr_charge_start_threshold = __ATTR(
9637+
charge_start_threshold,
9638+
0644,
9639+
charge_control_start_threshold_show,
9640+
charge_control_start_threshold_store
9641+
);
9642+
struct device_attribute dev_attr_charge_stop_threshold = __ATTR(
9643+
charge_stop_threshold,
9644+
0644,
9645+
charge_control_end_threshold_show,
9646+
charge_control_end_threshold_store
9647+
);
96369648

96379649
static struct attribute *tpacpi_battery_attrs[] = {
9650+
&dev_attr_charge_control_start_threshold.attr,
9651+
&dev_attr_charge_control_end_threshold.attr,
96389652
&dev_attr_charge_start_threshold.attr,
96399653
&dev_attr_charge_stop_threshold.attr,
96409654
NULL,

0 commit comments

Comments
 (0)