Skip to content

Commit 527953e

Browse files
committed
Merge tag 'acpi-5.19-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull more ACPI updates from Rafael Wysocki: "These add some new device IDs, update a few drivers (processor, battery, backlight) and clean up code in a few places. Specifics: - Add Meteor Lake ACPI IDs for DPTF devices (Sumeet Pawnikar) - Rearrange find_child_checks() to simplify code (Rafael Wysocki) - Use memremap() to map the UCSI mailbox that is always in main memory and drop acpi_release_memory() that has no more users (Heikki Krogerus, Dan Carpenter) - Make max_cstate/nocst/bm_check_disable processor module parameters visible in sysfs (Yajun Deng) - Fix typo in the CPPC driver (Julia Lawall) - Make the ACPI battery driver show the "not-charging" status by default unless "charging" or "full" is directly indicated (Werner Sembach) - Improve the PM notifier in the ACPI backlight driver (Zhang Rui) - Clean up some white space in the ACPI code (Ian Cowan)" * tag 'acpi-5.19-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: usb: typec: ucsi: acpi: fix a NULL vs IS_ERR() check in probe ACPI: DPTF: Support Meteor Lake ACPI: CPPC: fix typo in comment ACPI: video: improve PM notifer callback ACPI: clean up white space in a few places for consistency ACPI: glue: Rearrange find_child_checks() ACPI: processor: idle: Expose max_cstate/nocst/bm_check_disable read-only in sysfs ACPI: battery: Make "not-charging" the default on no charging or full info ACPI: OSL: Remove the helper for deactivating memory region usb: typec: ucsi: acpi: Map the mailbox with memremap()
2 parents 2c5ca23 + 4a577fc commit 527953e

File tree

15 files changed

+51
-160
lines changed

15 files changed

+51
-160
lines changed

drivers/acpi/ac.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ MODULE_AUTHOR("Paul Diefenbaugh");
3232
MODULE_DESCRIPTION("ACPI AC Adapter Driver");
3333
MODULE_LICENSE("GPL");
3434

35-
3635
static int acpi_ac_add(struct acpi_device *device);
3736
static int acpi_ac_remove(struct acpi_device *device);
3837
static void acpi_ac_notify(struct acpi_device *device, u32 event);
@@ -125,6 +124,7 @@ static int get_ac_property(struct power_supply *psy,
125124
default:
126125
return -EINVAL;
127126
}
127+
128128
return 0;
129129
}
130130

@@ -286,6 +286,7 @@ static int acpi_ac_resume(struct device *dev)
286286
return 0;
287287
if (old_state != ac->state)
288288
kobject_uevent(&ac->charger->dev.kobj, KOBJ_CHANGE);
289+
289290
return 0;
290291
}
291292
#else
@@ -296,7 +297,6 @@ static int acpi_ac_remove(struct acpi_device *device)
296297
{
297298
struct acpi_ac *ac = NULL;
298299

299-
300300
if (!device || !acpi_driver_data(device))
301301
return -EINVAL;
302302

drivers/acpi/acpi_video.c

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1707,24 +1707,23 @@ static int acpi_video_resume(struct notifier_block *nb,
17071707
int i;
17081708

17091709
switch (val) {
1710-
case PM_HIBERNATION_PREPARE:
1711-
case PM_SUSPEND_PREPARE:
1712-
case PM_RESTORE_PREPARE:
1713-
return NOTIFY_DONE;
1714-
}
1715-
1716-
video = container_of(nb, struct acpi_video_bus, pm_nb);
1717-
1718-
dev_info(&video->device->dev, "Restoring backlight state\n");
1710+
case PM_POST_HIBERNATION:
1711+
case PM_POST_SUSPEND:
1712+
case PM_POST_RESTORE:
1713+
video = container_of(nb, struct acpi_video_bus, pm_nb);
1714+
1715+
dev_info(&video->device->dev, "Restoring backlight state\n");
1716+
1717+
for (i = 0; i < video->attached_count; i++) {
1718+
video_device = video->attached_array[i].bind_info;
1719+
if (video_device && video_device->brightness)
1720+
acpi_video_device_lcd_set_level(video_device,
1721+
video_device->brightness->curr);
1722+
}
17191723

1720-
for (i = 0; i < video->attached_count; i++) {
1721-
video_device = video->attached_array[i].bind_info;
1722-
if (video_device && video_device->brightness)
1723-
acpi_video_device_lcd_set_level(video_device,
1724-
video_device->brightness->curr);
1724+
return NOTIFY_OK;
17251725
}
1726-
1727-
return NOTIFY_OK;
1726+
return NOTIFY_DONE;
17281727
}
17291728

17301729
static acpi_status

drivers/acpi/battery.c

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ static bool battery_driver_registered;
5252
static int battery_bix_broken_package;
5353
static int battery_notification_delay_ms;
5454
static int battery_ac_is_broken;
55-
static int battery_quirk_notcharging;
5655
static unsigned int cache_time = 1000;
5756
module_param(cache_time, uint, 0644);
5857
MODULE_PARM_DESC(cache_time, "cache time in milliseconds");
@@ -216,10 +215,8 @@ static int acpi_battery_get_property(struct power_supply *psy,
216215
val->intval = POWER_SUPPLY_STATUS_CHARGING;
217216
else if (acpi_battery_is_charged(battery))
218217
val->intval = POWER_SUPPLY_STATUS_FULL;
219-
else if (battery_quirk_notcharging)
220-
val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING;
221218
else
222-
val->intval = POWER_SUPPLY_STATUS_UNKNOWN;
219+
val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING;
223220
break;
224221
case POWER_SUPPLY_PROP_PRESENT:
225222
val->intval = acpi_battery_present(battery);
@@ -1105,12 +1102,6 @@ battery_ac_is_broken_quirk(const struct dmi_system_id *d)
11051102
return 0;
11061103
}
11071104

1108-
static int __init battery_quirk_not_charging(const struct dmi_system_id *d)
1109-
{
1110-
battery_quirk_notcharging = 1;
1111-
return 0;
1112-
}
1113-
11141105
static const struct dmi_system_id bat_dmi_table[] __initconst = {
11151106
{
11161107
/* NEC LZ750/LS */
@@ -1139,19 +1130,6 @@ static const struct dmi_system_id bat_dmi_table[] __initconst = {
11391130
DMI_MATCH(DMI_BIOS_DATE, "08/22/2014"),
11401131
},
11411132
},
1142-
{
1143-
/*
1144-
* On Lenovo ThinkPads the BIOS specification defines
1145-
* a state when the bits for charging and discharging
1146-
* are both set to 0. That state is "Not Charging".
1147-
*/
1148-
.callback = battery_quirk_not_charging,
1149-
.ident = "Lenovo ThinkPad",
1150-
.matches = {
1151-
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
1152-
DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad"),
1153-
},
1154-
},
11551133
{
11561134
/* Microsoft Surface Go 3 */
11571135
.callback = battery_notification_delay_quirk,

drivers/acpi/cppc_acpi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ static int send_pcc_cmd(int pcc_ss_id, u16 cmd)
315315
goto end;
316316
}
317317

318-
/* wait for completion and check for PCC errro bit */
318+
/* wait for completion and check for PCC error bit */
319319
ret = check_pcc_chan(pcc_ss_id, true);
320320

321321
if (pcc_ss_data->pcc_mrtt)

drivers/acpi/dptf/dptf_pch_fivr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ static int pch_fivr_remove(struct platform_device *pdev)
151151
static const struct acpi_device_id pch_fivr_device_ids[] = {
152152
{"INTC1045", 0},
153153
{"INTC1049", 0},
154+
{"INTC1064", 0},
154155
{"INTC10A3", 0},
155156
{"", 0},
156157
};

drivers/acpi/dptf/dptf_power.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@ static const struct acpi_device_id int3407_device_ids[] = {
232232
{"INTC1050", 0},
233233
{"INTC1060", 0},
234234
{"INTC1061", 0},
235+
{"INTC1065", 0},
236+
{"INTC1066", 0},
235237
{"INTC10A4", 0},
236238
{"INTC10A5", 0},
237239
{"", 0},

drivers/acpi/dptf/int340x_thermal.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ static const struct acpi_device_id int340x_thermal_device_ids[] = {
2727
{"INT3532"},
2828
{"INTC1040"},
2929
{"INTC1041"},
30+
{"INTC1042"},
3031
{"INTC1043"},
3132
{"INTC1044"},
3233
{"INTC1045"},
@@ -37,6 +38,11 @@ static const struct acpi_device_id int340x_thermal_device_ids[] = {
3738
{"INTC1050"},
3839
{"INTC1060"},
3940
{"INTC1061"},
41+
{"INTC1062"},
42+
{"INTC1063"},
43+
{"INTC1064"},
44+
{"INTC1065"},
45+
{"INTC1066"},
4046
{"INTC10A0"},
4147
{"INTC10A1"},
4248
{"INTC10A2"},

drivers/acpi/fan.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
{"INT3404", }, /* Fan */ \
1515
{"INTC1044", }, /* Fan for Tiger Lake generation */ \
1616
{"INTC1048", }, /* Fan for Alder Lake generation */ \
17+
{"INTC1063", }, /* Fan for Meteor Lake generation */ \
1718
{"INTC10A2", }, /* Fan for Raptor Lake generation */ \
1819
{"PNP0C0B", } /* Generic ACPI fan */
1920

drivers/acpi/glue.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,17 @@ static struct acpi_bus_type *acpi_get_bus_type(struct device *dev)
7979

8080
static int find_child_checks(struct acpi_device *adev, bool check_children)
8181
{
82-
bool sta_present = true;
8382
unsigned long long sta;
8483
acpi_status status;
8584

85+
if (check_children && list_empty(&adev->children))
86+
return -ENODEV;
87+
8688
status = acpi_evaluate_integer(adev->handle, "_STA", NULL, &sta);
8789
if (status == AE_NOT_FOUND)
88-
sta_present = false;
89-
else if (ACPI_FAILURE(status) || !(sta & ACPI_STA_DEVICE_ENABLED))
90-
return -ENODEV;
90+
return FIND_CHILD_MIN_SCORE;
9191

92-
if (check_children && list_empty(&adev->children))
92+
if (ACPI_FAILURE(status) || !(sta & ACPI_STA_DEVICE_ENABLED))
9393
return -ENODEV;
9494

9595
/*
@@ -99,8 +99,10 @@ static int find_child_checks(struct acpi_device *adev, bool check_children)
9999
* matched going forward. [This means a second spec violation in a row,
100100
* so whatever we do here is best effort anyway.]
101101
*/
102-
return sta_present && !adev->pnp.type.platform_id ?
103-
FIND_CHILD_MAX_SCORE : FIND_CHILD_MIN_SCORE;
102+
if (adev->pnp.type.platform_id)
103+
return FIND_CHILD_MIN_SCORE;
104+
105+
return FIND_CHILD_MAX_SCORE;
104106
}
105107

106108
struct acpi_device *acpi_find_child_device(struct acpi_device *parent,

drivers/acpi/osl.c

Lines changed: 0 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#include <linux/io-64-nonatomic-lo-hi.h>
3737

3838
#include "acpica/accommon.h"
39-
#include "acpica/acnamesp.h"
4039
#include "internal.h"
4140

4241
/* Definitions for ACPI_DEBUG_PRINT() */
@@ -1496,91 +1495,6 @@ int acpi_check_region(resource_size_t start, resource_size_t n,
14961495
}
14971496
EXPORT_SYMBOL(acpi_check_region);
14981497

1499-
static acpi_status acpi_deactivate_mem_region(acpi_handle handle, u32 level,
1500-
void *_res, void **return_value)
1501-
{
1502-
struct acpi_mem_space_context **mem_ctx;
1503-
union acpi_operand_object *handler_obj;
1504-
union acpi_operand_object *region_obj2;
1505-
union acpi_operand_object *region_obj;
1506-
struct resource *res = _res;
1507-
acpi_status status;
1508-
1509-
region_obj = acpi_ns_get_attached_object(handle);
1510-
if (!region_obj)
1511-
return AE_OK;
1512-
1513-
handler_obj = region_obj->region.handler;
1514-
if (!handler_obj)
1515-
return AE_OK;
1516-
1517-
if (region_obj->region.space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY)
1518-
return AE_OK;
1519-
1520-
if (!(region_obj->region.flags & AOPOBJ_SETUP_COMPLETE))
1521-
return AE_OK;
1522-
1523-
region_obj2 = acpi_ns_get_secondary_object(region_obj);
1524-
if (!region_obj2)
1525-
return AE_OK;
1526-
1527-
mem_ctx = (void *)&region_obj2->extra.region_context;
1528-
1529-
if (!(mem_ctx[0]->address >= res->start &&
1530-
mem_ctx[0]->address < res->end))
1531-
return AE_OK;
1532-
1533-
status = handler_obj->address_space.setup(region_obj,
1534-
ACPI_REGION_DEACTIVATE,
1535-
NULL, (void **)mem_ctx);
1536-
if (ACPI_SUCCESS(status))
1537-
region_obj->region.flags &= ~(AOPOBJ_SETUP_COMPLETE);
1538-
1539-
return status;
1540-
}
1541-
1542-
/**
1543-
* acpi_release_memory - Release any mappings done to a memory region
1544-
* @handle: Handle to namespace node
1545-
* @res: Memory resource
1546-
* @level: A level that terminates the search
1547-
*
1548-
* Walks through @handle and unmaps all SystemMemory Operation Regions that
1549-
* overlap with @res and that have already been activated (mapped).
1550-
*
1551-
* This is a helper that allows drivers to place special requirements on memory
1552-
* region that may overlap with operation regions, primarily allowing them to
1553-
* safely map the region as non-cached memory.
1554-
*
1555-
* The unmapped Operation Regions will be automatically remapped next time they
1556-
* are called, so the drivers do not need to do anything else.
1557-
*/
1558-
acpi_status acpi_release_memory(acpi_handle handle, struct resource *res,
1559-
u32 level)
1560-
{
1561-
acpi_status status;
1562-
1563-
if (!(res->flags & IORESOURCE_MEM))
1564-
return AE_TYPE;
1565-
1566-
status = acpi_walk_namespace(ACPI_TYPE_REGION, handle, level,
1567-
acpi_deactivate_mem_region, NULL,
1568-
res, NULL);
1569-
if (ACPI_FAILURE(status))
1570-
return status;
1571-
1572-
/*
1573-
* Wait for all of the mappings queued up for removal by
1574-
* acpi_deactivate_mem_region() to actually go away.
1575-
*/
1576-
synchronize_rcu();
1577-
rcu_barrier();
1578-
flush_scheduled_work();
1579-
1580-
return AE_OK;
1581-
}
1582-
EXPORT_SYMBOL_GPL(acpi_release_memory);
1583-
15841498
/*
15851499
* Let drivers know whether the resource checks are effective
15861500
*/

0 commit comments

Comments
 (0)