Skip to content

Commit a1de832

Browse files
committed
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
2 parents f0c4d9f + 53eb64c commit a1de832

7 files changed

Lines changed: 130 additions & 22 deletions

File tree

drivers/acpi/video_detect.c

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,20 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
645645
},
646646
},
647647

648+
/*
649+
* Models which have nvidia-ec-wmi support, but should not use it.
650+
* Note this indicates a likely firmware bug on these models and should
651+
* be revisited if/when Linux gets support for dynamic mux mode.
652+
*/
653+
{
654+
.callback = video_detect_force_native,
655+
/* Dell G15 5515 */
656+
.matches = {
657+
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
658+
DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5515"),
659+
},
660+
},
661+
648662
/*
649663
* Desktops which falsely report a backlight and which our heuristics
650664
* for this do not catch.
@@ -670,7 +684,7 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
670684

671685
static bool google_cros_ec_present(void)
672686
{
673-
return acpi_dev_found("GOOG0004");
687+
return acpi_dev_found("GOOG0004") || acpi_dev_found("GOOG000C");
674688
}
675689

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

735+
/* Chromebooks should always prefer native backlight control. */
736+
if (google_cros_ec_present() && native_available)
737+
return acpi_backlight_native;
738+
721739
/* On systems with ACPI video use either native or ACPI video. */
722740
if (video_caps & ACPI_VIDEO_BACKLIGHT) {
723741
/*
@@ -735,13 +753,6 @@ static enum acpi_backlight_type __acpi_video_get_backlight_type(bool native)
735753
return acpi_backlight_video;
736754
}
737755

738-
/*
739-
* Chromebooks that don't have backlight handle in ACPI table
740-
* are supposed to use native backlight if it's available.
741-
*/
742-
if (google_cros_ec_present() && native_available)
743-
return acpi_backlight_native;
744-
745756
/* No ACPI video (old hw), use vendor specific fw methods. */
746757
return acpi_backlight_vendor;
747758
}
@@ -754,6 +765,18 @@ EXPORT_SYMBOL(acpi_video_get_backlight_type);
754765

755766
bool acpi_video_backlight_use_native(void)
756767
{
757-
return __acpi_video_get_backlight_type(true) == acpi_backlight_native;
768+
/*
769+
* Call __acpi_video_get_backlight_type() to let it know that
770+
* a native backlight is available.
771+
*/
772+
__acpi_video_get_backlight_type(true);
773+
774+
/*
775+
* For now just always return true. There is a whole bunch of laptop
776+
* models where (video_caps & ACPI_VIDEO_BACKLIGHT) is false causing
777+
* __acpi_video_get_backlight_type() to return vendor, while these
778+
* models only have a native backlight control.
779+
*/
780+
return true;
758781
}
759782
EXPORT_SYMBOL(acpi_video_backlight_use_native);

drivers/platform/x86/hp-wmi.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,8 +1300,16 @@ static int __init hp_wmi_bios_setup(struct platform_device *device)
13001300
wwan_rfkill = NULL;
13011301
rfkill2_count = 0;
13021302

1303-
if (hp_wmi_rfkill_setup(device))
1304-
hp_wmi_rfkill2_setup(device);
1303+
/*
1304+
* In pre-2009 BIOS, command 1Bh return 0x4 to indicate that
1305+
* BIOS no longer controls the power for the wireless
1306+
* devices. All features supported by this command will no
1307+
* longer be supported.
1308+
*/
1309+
if (!hp_wmi_bios_2009_later()) {
1310+
if (hp_wmi_rfkill_setup(device))
1311+
hp_wmi_rfkill2_setup(device);
1312+
}
13051313

13061314
err = hp_wmi_hwmon_init();
13071315

drivers/platform/x86/ideapad-laptop.c

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1533,6 +1533,24 @@ static const struct dmi_system_id hw_rfkill_list[] = {
15331533
{}
15341534
};
15351535

1536+
static const struct dmi_system_id no_touchpad_switch_list[] = {
1537+
{
1538+
.ident = "Lenovo Yoga 3 Pro 1370",
1539+
.matches = {
1540+
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
1541+
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo YOGA 3"),
1542+
},
1543+
},
1544+
{
1545+
.ident = "ZhaoYang K4e-IML",
1546+
.matches = {
1547+
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
1548+
DMI_MATCH(DMI_PRODUCT_VERSION, "ZhaoYang K4e-IML"),
1549+
},
1550+
},
1551+
{}
1552+
};
1553+
15361554
static void ideapad_check_features(struct ideapad_private *priv)
15371555
{
15381556
acpi_handle handle = priv->adev->handle;
@@ -1541,7 +1559,12 @@ static void ideapad_check_features(struct ideapad_private *priv)
15411559
priv->features.hw_rfkill_switch = dmi_check_system(hw_rfkill_list);
15421560

15431561
/* Most ideapads with ELAN0634 touchpad don't use EC touchpad switch */
1544-
priv->features.touchpad_ctrl_via_ec = !acpi_dev_present("ELAN0634", NULL, -1);
1562+
if (acpi_dev_present("ELAN0634", NULL, -1))
1563+
priv->features.touchpad_ctrl_via_ec = 0;
1564+
else if (dmi_check_system(no_touchpad_switch_list))
1565+
priv->features.touchpad_ctrl_via_ec = 0;
1566+
else
1567+
priv->features.touchpad_ctrl_via_ec = 1;
15451568

15461569
if (!read_ec_data(handle, VPCCMD_R_FAN, &val))
15471570
priv->features.fan_mode = true;

drivers/platform/x86/intel/hid.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ static const struct acpi_device_id intel_hid_ids[] = {
2727
{"INTC1051", 0},
2828
{"INTC1054", 0},
2929
{"INTC1070", 0},
30+
{"INTC1076", 0},
31+
{"INTC1077", 0},
32+
{"INTC1078", 0},
3033
{"", 0},
3134
};
3235
MODULE_DEVICE_TABLE(acpi, intel_hid_ids);

drivers/platform/x86/intel/pmt/class.c

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010

1111
#include <linux/kernel.h>
12+
#include <linux/io-64-nonatomic-lo-hi.h>
1213
#include <linux/module.h>
1314
#include <linux/mm.h>
1415
#include <linux/pci.h>
@@ -19,6 +20,7 @@
1920
#define PMT_XA_START 0
2021
#define PMT_XA_MAX INT_MAX
2122
#define PMT_XA_LIMIT XA_LIMIT(PMT_XA_START, PMT_XA_MAX)
23+
#define GUID_SPR_PUNIT 0x9956f43f
2224

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

38+
static inline int
39+
pmt_memcpy64_fromio(void *to, const u64 __iomem *from, size_t count)
40+
{
41+
int i, remain;
42+
u64 *buf = to;
43+
44+
if (!IS_ALIGNED((unsigned long)from, 8))
45+
return -EFAULT;
46+
47+
for (i = 0; i < count/8; i++)
48+
buf[i] = readq(&from[i]);
49+
50+
/* Copy any remaining bytes */
51+
remain = count % 8;
52+
if (remain) {
53+
u64 tmp = readq(&from[i]);
54+
55+
memcpy(&buf[i], &tmp, remain);
56+
}
57+
58+
return count;
59+
}
60+
3661
/*
3762
* sysfs
3863
*/
@@ -54,7 +79,11 @@ intel_pmt_read(struct file *filp, struct kobject *kobj,
5479
if (count > entry->size - off)
5580
count = entry->size - off;
5681

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

5988
return count;
6089
}

drivers/platform/x86/p2sb.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,23 @@
1919
#define P2SBC 0xe0
2020
#define P2SBC_HIDE BIT(8)
2121

22+
#define P2SB_DEVFN_DEFAULT PCI_DEVFN(31, 1)
23+
2224
static const struct x86_cpu_id p2sb_cpu_ids[] = {
2325
X86_MATCH_INTEL_FAM6_MODEL(ATOM_GOLDMONT, PCI_DEVFN(13, 0)),
24-
X86_MATCH_INTEL_FAM6_MODEL(ATOM_GOLDMONT_D, PCI_DEVFN(31, 1)),
25-
X86_MATCH_INTEL_FAM6_MODEL(ATOM_SILVERMONT_D, PCI_DEVFN(31, 1)),
26-
X86_MATCH_INTEL_FAM6_MODEL(KABYLAKE, PCI_DEVFN(31, 1)),
27-
X86_MATCH_INTEL_FAM6_MODEL(KABYLAKE_L, PCI_DEVFN(31, 1)),
28-
X86_MATCH_INTEL_FAM6_MODEL(SKYLAKE, PCI_DEVFN(31, 1)),
29-
X86_MATCH_INTEL_FAM6_MODEL(SKYLAKE_L, PCI_DEVFN(31, 1)),
3026
{}
3127
};
3228

3329
static int p2sb_get_devfn(unsigned int *devfn)
3430
{
31+
unsigned int fn = P2SB_DEVFN_DEFAULT;
3532
const struct x86_cpu_id *id;
3633

3734
id = x86_match_cpu(p2sb_cpu_ids);
38-
if (!id)
39-
return -ENODEV;
35+
if (id)
36+
fn = (unsigned int)id->driver_data;
4037

41-
*devfn = (unsigned int)id->driver_data;
38+
*devfn = fn;
4239
return 0;
4340
}
4441

drivers/platform/x86/touchscreen_dmi.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,22 @@ static const struct ts_dmi_data predia_basic_data = {
770770
.properties = predia_basic_props,
771771
};
772772

773+
static const struct property_entry rca_cambio_w101_v2_props[] = {
774+
PROPERTY_ENTRY_U32("touchscreen-min-x", 4),
775+
PROPERTY_ENTRY_U32("touchscreen-min-y", 20),
776+
PROPERTY_ENTRY_U32("touchscreen-size-x", 1644),
777+
PROPERTY_ENTRY_U32("touchscreen-size-y", 874),
778+
PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
779+
PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-rca-cambio-w101-v2.fw"),
780+
PROPERTY_ENTRY_U32("silead,max-fingers", 10),
781+
{ }
782+
};
783+
784+
static const struct ts_dmi_data rca_cambio_w101_v2_data = {
785+
.acpi_name = "MSSL1680:00",
786+
.properties = rca_cambio_w101_v2_props,
787+
};
788+
773789
static const struct property_entry rwc_nanote_p8_props[] = {
774790
PROPERTY_ENTRY_U32("touchscreen-min-y", 46),
775791
PROPERTY_ENTRY_U32("touchscreen-size-x", 1728),
@@ -1409,6 +1425,15 @@ const struct dmi_system_id touchscreen_dmi_table[] = {
14091425
DMI_EXACT_MATCH(DMI_BOARD_NAME, "0E57"),
14101426
},
14111427
},
1428+
{
1429+
/* RCA Cambio W101 v2 */
1430+
/* https://github.com/onitake/gsl-firmware/discussions/193 */
1431+
.driver_data = (void *)&rca_cambio_w101_v2_data,
1432+
.matches = {
1433+
DMI_MATCH(DMI_SYS_VENDOR, "RCA"),
1434+
DMI_MATCH(DMI_PRODUCT_NAME, "W101SA23T1"),
1435+
},
1436+
},
14121437
{
14131438
/* RWC NANOTE P8 */
14141439
.driver_data = (void *)&rwc_nanote_p8_data,

0 commit comments

Comments
 (0)