platform-drivers-x86 for v6.1-3

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
 
 The following is an automated git shortlog grouped by driver:
 
 ACPI:
  -  video: Add backlight=native DMI quirk for Dell G15 5515
  -  video: Make acpi_video_backlight_use_native() always return true
  -  video: Improve Chromebook checks
 
 hp_wmi:
  -  Fix rfkill causing soft blocked wifi
 
 ideapad-laptop:
  -  Disable touchpad_switch
 
 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
 
 touchscreen_dmi:
  -  Add info for the RCA Cambio W101 v2 2-in-1
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCAAyFiEEuvA7XScYQRpenhd+kuxHeUQDJ9wFAmNo7hsUHGhkZWdvZWRl
 QHJlZGhhdC5jb20ACgkQkuxHeUQDJ9y08wf/Q+GL05jx3uVprDmoQljc3DJnHCut
 haa/ZHsqq6OY2RYeY4mX1iYOzlRD20nDEQ52/2IOXvx2FOEorDewByGHD7gOJ6Xr
 IvI0JTmfPZ4yflW/N+z2ujXYpp/XlELzHEXFBA6t+62NOT0y4fu2mJx95twDgsa0
 ohgTVtmSqIwhjJVt+pQ2UVdy2M+Yv07XabZswLTPt6JZJRhvu8UzPu+DkQd0qqKi
 tvmFMkYVSkJnEKBT07Ii+QiUxXDKDzfwRPBFxSEm7m3GvkkPJp0ZqmrB9m8mK6oJ
 f83FZ8X9vcTGaG5Gjm3X5xejs4B2qeBs9AzhsrAW/maKOADsbjJdJPz7JQ==
 =aes0
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2022-11-07 10:19:04 -08:00
commit a1de832bd3
7 changed files with 130 additions and 22 deletions

View File

@ -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);

View File

@ -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();

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -19,26 +19,23 @@
#define P2SBC 0xe0
#define P2SBC_HIDE BIT(8)
#define P2SB_DEVFN_DEFAULT PCI_DEVFN(31, 1)
static const struct x86_cpu_id p2sb_cpu_ids[] = {
X86_MATCH_INTEL_FAM6_MODEL(ATOM_GOLDMONT, PCI_DEVFN(13, 0)),
X86_MATCH_INTEL_FAM6_MODEL(ATOM_GOLDMONT_D, PCI_DEVFN(31, 1)),
X86_MATCH_INTEL_FAM6_MODEL(ATOM_SILVERMONT_D, PCI_DEVFN(31, 1)),
X86_MATCH_INTEL_FAM6_MODEL(KABYLAKE, PCI_DEVFN(31, 1)),
X86_MATCH_INTEL_FAM6_MODEL(KABYLAKE_L, PCI_DEVFN(31, 1)),
X86_MATCH_INTEL_FAM6_MODEL(SKYLAKE, PCI_DEVFN(31, 1)),
X86_MATCH_INTEL_FAM6_MODEL(SKYLAKE_L, PCI_DEVFN(31, 1)),
{}
};
static int p2sb_get_devfn(unsigned int *devfn)
{
unsigned int fn = P2SB_DEVFN_DEFAULT;
const struct x86_cpu_id *id;
id = x86_match_cpu(p2sb_cpu_ids);
if (!id)
return -ENODEV;
if (id)
fn = (unsigned int)id->driver_data;
*devfn = (unsigned int)id->driver_data;
*devfn = fn;
return 0;
}

View File

@ -770,6 +770,22 @@ static const struct ts_dmi_data predia_basic_data = {
.properties = predia_basic_props,
};
static const struct property_entry rca_cambio_w101_v2_props[] = {
PROPERTY_ENTRY_U32("touchscreen-min-x", 4),
PROPERTY_ENTRY_U32("touchscreen-min-y", 20),
PROPERTY_ENTRY_U32("touchscreen-size-x", 1644),
PROPERTY_ENTRY_U32("touchscreen-size-y", 874),
PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-rca-cambio-w101-v2.fw"),
PROPERTY_ENTRY_U32("silead,max-fingers", 10),
{ }
};
static const struct ts_dmi_data rca_cambio_w101_v2_data = {
.acpi_name = "MSSL1680:00",
.properties = rca_cambio_w101_v2_props,
};
static const struct property_entry rwc_nanote_p8_props[] = {
PROPERTY_ENTRY_U32("touchscreen-min-y", 46),
PROPERTY_ENTRY_U32("touchscreen-size-x", 1728),
@ -1409,6 +1425,15 @@ const struct dmi_system_id touchscreen_dmi_table[] = {
DMI_EXACT_MATCH(DMI_BOARD_NAME, "0E57"),
},
},
{
/* RCA Cambio W101 v2 */
/* https://github.com/onitake/gsl-firmware/discussions/193 */
.driver_data = (void *)&rca_cambio_w101_v2_data,
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "RCA"),
DMI_MATCH(DMI_PRODUCT_NAME, "W101SA23T1"),
},
},
{
/* RWC NANOTE P8 */
.driver_data = (void *)&rwc_nanote_p8_data,