Commit 527953ef authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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()
parents 2c5ca23f 4a577fca
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ MODULE_AUTHOR("Paul Diefenbaugh");
MODULE_DESCRIPTION("ACPI AC Adapter Driver");
MODULE_LICENSE("GPL");


static int acpi_ac_add(struct acpi_device *device);
static int acpi_ac_remove(struct acpi_device *device);
static void acpi_ac_notify(struct acpi_device *device, u32 event);
@@ -125,6 +124,7 @@ static int get_ac_property(struct power_supply *psy,
	default:
		return -EINVAL;
	}

	return 0;
}

@@ -286,6 +286,7 @@ static int acpi_ac_resume(struct device *dev)
		return 0;
	if (old_state != ac->state)
		kobject_uevent(&ac->charger->dev.kobj, KOBJ_CHANGE);

	return 0;
}
#else
@@ -296,7 +297,6 @@ static int acpi_ac_remove(struct acpi_device *device)
{
	struct acpi_ac *ac = NULL;


	if (!device || !acpi_driver_data(device))
		return -EINVAL;

+15 −16
Original line number Diff line number Diff line
@@ -1707,12 +1707,9 @@ static int acpi_video_resume(struct notifier_block *nb,
	int i;

	switch (val) {
	case PM_HIBERNATION_PREPARE:
	case PM_SUSPEND_PREPARE:
	case PM_RESTORE_PREPARE:
		return NOTIFY_DONE;
	}

	case PM_POST_HIBERNATION:
	case PM_POST_SUSPEND:
	case PM_POST_RESTORE:
		video = container_of(nb, struct acpi_video_bus, pm_nb);

		dev_info(&video->device->dev, "Restoring backlight state\n");
@@ -1726,6 +1723,8 @@ static int acpi_video_resume(struct notifier_block *nb,

		return NOTIFY_OK;
	}
	return NOTIFY_DONE;
}

static acpi_status
acpi_video_bus_match(acpi_handle handle, u32 level, void *context,
+1 −23
Original line number Diff line number Diff line
@@ -52,7 +52,6 @@ static bool battery_driver_registered;
static int battery_bix_broken_package;
static int battery_notification_delay_ms;
static int battery_ac_is_broken;
static int battery_quirk_notcharging;
static unsigned int cache_time = 1000;
module_param(cache_time, uint, 0644);
MODULE_PARM_DESC(cache_time, "cache time in milliseconds");
@@ -216,10 +215,8 @@ static int acpi_battery_get_property(struct power_supply *psy,
			val->intval = POWER_SUPPLY_STATUS_CHARGING;
		else if (acpi_battery_is_charged(battery))
			val->intval = POWER_SUPPLY_STATUS_FULL;
		else if (battery_quirk_notcharging)
			val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING;
		else
			val->intval = POWER_SUPPLY_STATUS_UNKNOWN;
			val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING;
		break;
	case POWER_SUPPLY_PROP_PRESENT:
		val->intval = acpi_battery_present(battery);
@@ -1105,12 +1102,6 @@ battery_ac_is_broken_quirk(const struct dmi_system_id *d)
	return 0;
}

static int __init battery_quirk_not_charging(const struct dmi_system_id *d)
{
	battery_quirk_notcharging = 1;
	return 0;
}

static const struct dmi_system_id bat_dmi_table[] __initconst = {
	{
		/* NEC LZ750/LS */
@@ -1139,19 +1130,6 @@ static const struct dmi_system_id bat_dmi_table[] __initconst = {
			DMI_MATCH(DMI_BIOS_DATE, "08/22/2014"),
		},
	},
	{
		/*
		 * On Lenovo ThinkPads the BIOS specification defines
		 * a state when the bits for charging and discharging
		 * are both set to 0. That state is "Not Charging".
		 */
		.callback = battery_quirk_not_charging,
		.ident = "Lenovo ThinkPad",
		.matches = {
			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
			DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad"),
		},
	},
	{
		/* Microsoft Surface Go 3 */
		.callback = battery_notification_delay_quirk,
+1 −1
Original line number Diff line number Diff line
@@ -315,7 +315,7 @@ static int send_pcc_cmd(int pcc_ss_id, u16 cmd)
		goto end;
	}

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

	if (pcc_ss_data->pcc_mrtt)
+1 −0
Original line number Diff line number Diff line
@@ -151,6 +151,7 @@ static int pch_fivr_remove(struct platform_device *pdev)
static const struct acpi_device_id pch_fivr_device_ids[] = {
	{"INTC1045", 0},
	{"INTC1049", 0},
	{"INTC1064", 0},
	{"INTC10A3", 0},
	{"", 0},
};
Loading