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

Merge tag 'platform-drivers-x86-v6.1-3' of...

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

Pull x86 platform driver fixes from Hans de Goede:
 "The most important fixes here are a set of fixes for the ACPI
  backlight detection refactor which landed in 6.1.

  These fix regressions reported on some laptop models by making
  acpi_video_backlight_use_native() always return true for now, which in
  essence undoes some of the changes.

  I plan to take another shot at having only 1 /sys/class/backlight
  class device per panel with 6.2, with modified detection heuristics to
  avoid the (known) regressions.

  Highlights:

   - ACPI: video: Fix regressions from 6.1 backlight refactor by making
     acpi_video_backlight_use_native() always return true for now

   - Misc other bugfixes and HW id additions"

* tag 'platform-drivers-x86-v6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
  platform/x86: p2sb: Don't fail if unknown CPU is found
  platform/x86/intel/hid: Add some ACPI device IDs
  platform/x86/intel/pmt: Sapphire Rapids PMT errata fix
  platform/x86: hp_wmi: Fix rfkill causing soft blocked wifi
  platform/x86: touchscreen_dmi: Add info for the RCA Cambio W101 v2 2-in-1
  platform/x86: ideapad-laptop: Disable touchpad_switch
  ACPI: video: Add backlight=native DMI quirk for Dell G15 5515
  ACPI: video: Make acpi_video_backlight_use_native() always return true
  ACPI: video: Improve Chromebook checks
parents f0c4d9fc 53eb64c8
Loading
Loading
Loading
Loading
+32 −9
Original line number Diff line number Diff line
@@ -645,6 +645,20 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
		},
	},

	/*
	 * Models which have nvidia-ec-wmi support, but should not use it.
	 * Note this indicates a likely firmware bug on these models and should
	 * be revisited if/when Linux gets support for dynamic mux mode.
	 */
	{
	 .callback = video_detect_force_native,
	 /* Dell G15 5515 */
	 .matches = {
		DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
		DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5515"),
		},
	},

	/*
	 * Desktops which falsely report a backlight and which our heuristics
	 * for this do not catch.
@@ -670,7 +684,7 @@ static const struct dmi_system_id video_detect_dmi_table[] = {

static bool google_cros_ec_present(void)
{
	return acpi_dev_found("GOOG0004");
	return acpi_dev_found("GOOG0004") || acpi_dev_found("GOOG000C");
}

/*
@@ -718,6 +732,10 @@ static enum acpi_backlight_type __acpi_video_get_backlight_type(bool native)
	if (apple_gmux_present())
		return acpi_backlight_apple_gmux;

	/* Chromebooks should always prefer native backlight control. */
	if (google_cros_ec_present() && native_available)
		return acpi_backlight_native;

	/* On systems with ACPI video use either native or ACPI video. */
	if (video_caps & ACPI_VIDEO_BACKLIGHT) {
		/*
@@ -735,13 +753,6 @@ static enum acpi_backlight_type __acpi_video_get_backlight_type(bool native)
			return acpi_backlight_video;
	}

	/*
	 * Chromebooks that don't have backlight handle in ACPI table
	 * are supposed to use native backlight if it's available.
	 */
	if (google_cros_ec_present() && native_available)
		return acpi_backlight_native;

	/* No ACPI video (old hw), use vendor specific fw methods. */
	return acpi_backlight_vendor;
}
@@ -754,6 +765,18 @@ EXPORT_SYMBOL(acpi_video_get_backlight_type);

bool acpi_video_backlight_use_native(void)
{
	return __acpi_video_get_backlight_type(true) == acpi_backlight_native;
	/*
	 * Call __acpi_video_get_backlight_type() to let it know that
	 * a native backlight is available.
	 */
	__acpi_video_get_backlight_type(true);

	/*
	 * For now just always return true. There is a whole bunch of laptop
	 * models where (video_caps & ACPI_VIDEO_BACKLIGHT) is false causing
	 * __acpi_video_get_backlight_type() to return vendor, while these
	 * models only have a native backlight control.
	 */
	return true;
}
EXPORT_SYMBOL(acpi_video_backlight_use_native);
+10 −2
Original line number Diff line number Diff line
@@ -1300,8 +1300,16 @@ static int __init hp_wmi_bios_setup(struct platform_device *device)
	wwan_rfkill = NULL;
	rfkill2_count = 0;

	/*
	 * In pre-2009 BIOS, command 1Bh return 0x4 to indicate that
	 * BIOS no longer controls the power for the wireless
	 * devices. All features supported by this command will no
	 * longer be supported.
	 */
	if (!hp_wmi_bios_2009_later()) {
		if (hp_wmi_rfkill_setup(device))
			hp_wmi_rfkill2_setup(device);
	}

	err = hp_wmi_hwmon_init();

+24 −1
Original line number Diff line number Diff line
@@ -1533,6 +1533,24 @@ static const struct dmi_system_id hw_rfkill_list[] = {
	{}
};

static const struct dmi_system_id no_touchpad_switch_list[] = {
	{
	.ident = "Lenovo Yoga 3 Pro 1370",
	.matches = {
		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
		DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo YOGA 3"),
		},
	},
	{
	.ident = "ZhaoYang K4e-IML",
	.matches = {
		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
		DMI_MATCH(DMI_PRODUCT_VERSION, "ZhaoYang K4e-IML"),
		},
	},
	{}
};

static void ideapad_check_features(struct ideapad_private *priv)
{
	acpi_handle handle = priv->adev->handle;
@@ -1541,7 +1559,12 @@ static void ideapad_check_features(struct ideapad_private *priv)
	priv->features.hw_rfkill_switch = dmi_check_system(hw_rfkill_list);

	/* Most ideapads with ELAN0634 touchpad don't use EC touchpad switch */
	priv->features.touchpad_ctrl_via_ec = !acpi_dev_present("ELAN0634", NULL, -1);
	if (acpi_dev_present("ELAN0634", NULL, -1))
		priv->features.touchpad_ctrl_via_ec = 0;
	else if (dmi_check_system(no_touchpad_switch_list))
		priv->features.touchpad_ctrl_via_ec = 0;
	else
		priv->features.touchpad_ctrl_via_ec = 1;

	if (!read_ec_data(handle, VPCCMD_R_FAN, &val))
		priv->features.fan_mode = true;
+3 −0
Original line number Diff line number Diff line
@@ -27,6 +27,9 @@ static const struct acpi_device_id intel_hid_ids[] = {
	{"INTC1051", 0},
	{"INTC1054", 0},
	{"INTC1070", 0},
	{"INTC1076", 0},
	{"INTC1077", 0},
	{"INTC1078", 0},
	{"", 0},
};
MODULE_DEVICE_TABLE(acpi, intel_hid_ids);
+30 −1
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@
 */

#include <linux/kernel.h>
#include <linux/io-64-nonatomic-lo-hi.h>
#include <linux/module.h>
#include <linux/mm.h>
#include <linux/pci.h>
@@ -19,6 +20,7 @@
#define PMT_XA_START		0
#define PMT_XA_MAX		INT_MAX
#define PMT_XA_LIMIT		XA_LIMIT(PMT_XA_START, PMT_XA_MAX)
#define GUID_SPR_PUNIT		0x9956f43f

bool intel_pmt_is_early_client_hw(struct device *dev)
{
@@ -33,6 +35,29 @@ bool intel_pmt_is_early_client_hw(struct device *dev)
}
EXPORT_SYMBOL_GPL(intel_pmt_is_early_client_hw);

static inline int
pmt_memcpy64_fromio(void *to, const u64 __iomem *from, size_t count)
{
	int i, remain;
	u64 *buf = to;

	if (!IS_ALIGNED((unsigned long)from, 8))
		return -EFAULT;

	for (i = 0; i < count/8; i++)
		buf[i] = readq(&from[i]);

	/* Copy any remaining bytes */
	remain = count % 8;
	if (remain) {
		u64 tmp = readq(&from[i]);

		memcpy(&buf[i], &tmp, remain);
	}

	return count;
}

/*
 * sysfs
 */
@@ -54,6 +79,10 @@ intel_pmt_read(struct file *filp, struct kobject *kobj,
	if (count > entry->size - off)
		count = entry->size - off;

	if (entry->guid == GUID_SPR_PUNIT)
		/* PUNIT on SPR only supports aligned 64-bit read */
		count = pmt_memcpy64_fromio(buf, entry->base + off, count);
	else
		memcpy_fromio(buf, entry->base + off, count);

	return count;
Loading