Commit d9b2ba67 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'platform-drivers-x86-v5.19-3' of...

Merge tag 'platform-drivers-x86-v5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform driver fixes from Hans de Goede:

 - thinkpad_acpi/ideapad-laptop: mem-leak and platform-profile fixes

 - panasonic-laptop: missing hotkey presses regression fix

 - some hardware-id additions

 - some other small fixes

* tag 'platform-drivers-x86-v5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
  platform/x86: hp-wmi: Ignore Sanitization Mode event
  platform/x86: thinkpad_acpi: do not use PSC mode on Intel platforms
  platform/x86: thinkpad-acpi: profile capabilities as integer
  platform/x86: panasonic-laptop: filter out duplicate volume up/down/mute keypresses
  platform/x86: panasonic-laptop: don't report duplicate brightness key-presses
  platform/x86: panasonic-laptop: revert "Resolve hotkey double trigger bug"
  platform/x86: panasonic-laptop: sort includes alphabetically
  platform/x86: panasonic-laptop: de-obfuscate button codes
  ACPI: video: Change how we determine if brightness key-presses are handled
  platform/x86: ideapad-laptop: Add Ideapad 5 15ITL05 to ideapad_dytc_v4_allow_table[]
  platform/x86: ideapad-laptop: Add allow_v4_dytc module parameter
  platform/x86: thinkpad_acpi: Fix a memory leak of EFCH MMIO resource
  platform/mellanox: nvsw-sn2201: fix error code in nvsw_sn2201_create_static_devices()
  platform/x86: intel/pmc: Add Alder Lake N support to PMC core driver
parents 732f3069 9ab762a8
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ module_param(device_id_scheme, bool, 0444);
static int only_lcd = -1;
module_param(only_lcd, int, 0444);

static bool has_backlight;
static int register_count;
static DEFINE_MUTEX(register_count_mutex);
static DEFINE_MUTEX(video_list_lock);
@@ -1222,6 +1223,9 @@ acpi_video_bus_get_one_device(struct acpi_device *device,
	acpi_video_device_bind(video, data);
	acpi_video_device_find_cap(data);

	if (data->cap._BCM && data->cap._BCL)
		has_backlight = true;

	mutex_lock(&video->device_list_lock);
	list_add_tail(&data->entry, &video->video_device_list);
	mutex_unlock(&video->device_list_lock);
@@ -2249,6 +2253,7 @@ void acpi_video_unregister(void)
	if (register_count) {
		acpi_bus_unregister_driver(&acpi_video_bus);
		register_count = 0;
		has_backlight = false;
	}
	mutex_unlock(&register_count_mutex);
}
@@ -2270,13 +2275,7 @@ void acpi_video_unregister_backlight(void)

bool acpi_video_handles_brightness_key_presses(void)
{
	bool have_video_busses;

	mutex_lock(&video_list_lock);
	have_video_busses = !list_empty(&video_bus_head);
	mutex_unlock(&video_list_lock);

	return have_video_busses &&
	return has_backlight &&
	       (report_key_events & REPORT_BRIGHTNESS_KEY_EVENTS);
}
EXPORT_SYMBOL(acpi_video_handles_brightness_key_presses);
+3 −1
Original line number Diff line number Diff line
@@ -890,6 +890,7 @@ nvsw_sn2201_create_static_devices(struct nvsw_sn2201 *nvsw_sn2201,
				  int size)
{
	struct mlxreg_hotplug_device *dev = devs;
	int ret;
	int i;

	/* Create I2C static devices. */
@@ -901,6 +902,7 @@ nvsw_sn2201_create_static_devices(struct nvsw_sn2201 *nvsw_sn2201,
				dev->nr, dev->brdinfo->addr);

			dev->adapter = NULL;
			ret = PTR_ERR(dev->client);
			goto fail_create_static_devices;
		}
	}
@@ -914,7 +916,7 @@ nvsw_sn2201_create_static_devices(struct nvsw_sn2201 *nvsw_sn2201,
		dev->client = NULL;
		dev->adapter = NULL;
	}
	return IS_ERR(dev->client);
	return ret;
}

static void nvsw_sn2201_destroy_static_devices(struct nvsw_sn2201 *nvsw_sn2201,
+2 −0
Original line number Diff line number Diff line
@@ -945,6 +945,8 @@ config PANASONIC_LAPTOP
	tristate "Panasonic Laptop Extras"
	depends on INPUT && ACPI
	depends on BACKLIGHT_CLASS_DEVICE
	depends on ACPI_VIDEO=n || ACPI_VIDEO
	depends on SERIO_I8042 || SERIO_I8042 = n
	select INPUT_SPARSEKMAP
	help
	  This driver adds support for access to backlight control and hotkeys
+3 −0
Original line number Diff line number Diff line
@@ -89,6 +89,7 @@ enum hp_wmi_event_ids {
	HPWMI_BACKLIT_KB_BRIGHTNESS	= 0x0D,
	HPWMI_PEAKSHIFT_PERIOD		= 0x0F,
	HPWMI_BATTERY_CHARGE_PERIOD	= 0x10,
	HPWMI_SANITIZATION_MODE		= 0x17,
};

/*
@@ -853,6 +854,8 @@ static void hp_wmi_notify(u32 value, void *context)
		break;
	case HPWMI_BATTERY_CHARGE_PERIOD:
		break;
	case HPWMI_SANITIZATION_MODE:
		break;
	default:
		pr_info("Unknown event_id - %d - 0x%x\n", event_id, event_data);
		break;
+21 −8
Original line number Diff line number Diff line
@@ -152,6 +152,10 @@ static bool no_bt_rfkill;
module_param(no_bt_rfkill, bool, 0444);
MODULE_PARM_DESC(no_bt_rfkill, "No rfkill for bluetooth.");

static bool allow_v4_dytc;
module_param(allow_v4_dytc, bool, 0444);
MODULE_PARM_DESC(allow_v4_dytc, "Enable DYTC version 4 platform-profile support.");

/*
 * ACPI Helpers
 */
@@ -871,12 +875,18 @@ static void dytc_profile_refresh(struct ideapad_private *priv)
static const struct dmi_system_id ideapad_dytc_v4_allow_table[] = {
	{
		/* Ideapad 5 Pro 16ACH6 */
		.ident = "LENOVO 82L5",
		.matches = {
			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
			DMI_MATCH(DMI_PRODUCT_NAME, "82L5")
		}
	},
	{
		/* Ideapad 5 15ITL05 */
		.matches = {
			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
			DMI_MATCH(DMI_PRODUCT_VERSION, "IdeaPad 5 15ITL05")
		}
	},
	{}
};

@@ -901,13 +911,16 @@ static int ideapad_dytc_profile_init(struct ideapad_private *priv)

	dytc_version = (output >> DYTC_QUERY_REV_BIT) & 0xF;

	if (dytc_version < 5) {
		if (dytc_version < 4 || !dmi_check_system(ideapad_dytc_v4_allow_table)) {
			dev_info(&priv->platform_device->dev,
				 "DYTC_VERSION is less than 4 or is not allowed: %d\n",
				 dytc_version);
	if (dytc_version < 4) {
		dev_info(&priv->platform_device->dev, "DYTC_VERSION < 4 is not supported\n");
		return -ENODEV;
	}

	if (dytc_version < 5 &&
	    !(allow_v4_dytc || dmi_check_system(ideapad_dytc_v4_allow_table))) {
		dev_info(&priv->platform_device->dev,
			 "DYTC_VERSION 4 support may not work. Pass ideapad_laptop.allow_v4_dytc=Y on the kernel commandline to enable\n");
		return -ENODEV;
	}

	priv->dytc = kzalloc(sizeof(*priv->dytc), GFP_KERNEL);
Loading