Skip to content

Commit dc690bc

Browse files
committed
Merge tag 'platform-drivers-x86-v6.13-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
Pull x86 platform driver fixes from Ilpo Järvinen: - alienware-wmi: - Add support for Alienware m16 R1 AMD - Do not setup legacy LED control with X and G Series - intel/ifs: Clearwater Forest support - intel/vsec: Panther Lake support - p2sb: Do not hide the device if BIOS left it unhidden - touchscreen_dmi: Add SARY Tab 3 tablet information * tag 'platform-drivers-x86-v6.13-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86/intel/vsec: Add support for Panther Lake platform/x86/intel/ifs: Add Clearwater Forest to CPU support list platform/x86: touchscreen_dmi: Add info for SARY Tab 3 tablet p2sb: Do not scan and remove the P2SB device when it is unhidden p2sb: Move P2SB hide and unhide code to p2sb_scan_and_cache() p2sb: Introduce the global flag p2sb_hidden_by_bios p2sb: Factor out p2sb_read_from_cache() alienware-wmi: Adds support to Alienware m16 R1 AMD alienware-wmi: Fix X Series and G Series quirks
2 parents 78d4f34 + 83848e3 commit dc690bc

File tree

5 files changed

+103
-27
lines changed

5 files changed

+103
-27
lines changed

drivers/platform/x86/dell/alienware-wmi.c

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ static struct quirk_entry quirk_asm201 = {
190190
};
191191

192192
static struct quirk_entry quirk_g_series = {
193-
.num_zones = 2,
193+
.num_zones = 0,
194194
.hdmi_mux = 0,
195195
.amplifier = 0,
196196
.deepslp = 0,
@@ -199,7 +199,7 @@ static struct quirk_entry quirk_g_series = {
199199
};
200200

201201
static struct quirk_entry quirk_x_series = {
202-
.num_zones = 2,
202+
.num_zones = 0,
203203
.hdmi_mux = 0,
204204
.amplifier = 0,
205205
.deepslp = 0,
@@ -241,6 +241,15 @@ static const struct dmi_system_id alienware_quirks[] __initconst = {
241241
},
242242
.driver_data = &quirk_asm201,
243243
},
244+
{
245+
.callback = dmi_matched,
246+
.ident = "Alienware m16 R1 AMD",
247+
.matches = {
248+
DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
249+
DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m16 R1 AMD"),
250+
},
251+
.driver_data = &quirk_x_series,
252+
},
244253
{
245254
.callback = dmi_matched,
246255
.ident = "Alienware m17 R5",
@@ -687,6 +696,9 @@ static void alienware_zone_exit(struct platform_device *dev)
687696
{
688697
u8 zone;
689698

699+
if (!quirks->num_zones)
700+
return;
701+
690702
sysfs_remove_group(&dev->dev.kobj, &zone_attribute_group);
691703
led_classdev_unregister(&global_led);
692704
if (zone_dev_attrs) {
@@ -1229,9 +1241,11 @@ static int __init alienware_wmi_init(void)
12291241
goto fail_prep_thermal_profile;
12301242
}
12311243

1232-
ret = alienware_zone_init(platform_device);
1233-
if (ret)
1234-
goto fail_prep_zones;
1244+
if (quirks->num_zones > 0) {
1245+
ret = alienware_zone_init(platform_device);
1246+
if (ret)
1247+
goto fail_prep_zones;
1248+
}
12351249

12361250
return 0;
12371251

drivers/platform/x86/intel/ifs/core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ static const struct x86_cpu_id ifs_cpu_ids[] __initconst = {
2020
X86_MATCH(INTEL_GRANITERAPIDS_X, ARRAY_GEN0),
2121
X86_MATCH(INTEL_GRANITERAPIDS_D, ARRAY_GEN0),
2222
X86_MATCH(INTEL_ATOM_CRESTMONT_X, ARRAY_GEN1),
23+
X86_MATCH(INTEL_ATOM_DARKMONT_X, ARRAY_GEN1),
2324
{}
2425
};
2526
MODULE_DEVICE_TABLE(x86cpu, ifs_cpu_ids);

drivers/platform/x86/intel/vsec.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ static const struct intel_vsec_platform_info lnl_info = {
423423
#define PCI_DEVICE_ID_INTEL_VSEC_RPL 0xa77d
424424
#define PCI_DEVICE_ID_INTEL_VSEC_TGL 0x9a0d
425425
#define PCI_DEVICE_ID_INTEL_VSEC_LNL_M 0x647d
426+
#define PCI_DEVICE_ID_INTEL_VSEC_PTL 0xb07d
426427
static const struct pci_device_id intel_vsec_pci_ids[] = {
427428
{ PCI_DEVICE_DATA(INTEL, VSEC_ADL, &tgl_info) },
428429
{ PCI_DEVICE_DATA(INTEL, VSEC_DG1, &dg1_info) },
@@ -432,6 +433,7 @@ static const struct pci_device_id intel_vsec_pci_ids[] = {
432433
{ PCI_DEVICE_DATA(INTEL, VSEC_RPL, &tgl_info) },
433434
{ PCI_DEVICE_DATA(INTEL, VSEC_TGL, &tgl_info) },
434435
{ PCI_DEVICE_DATA(INTEL, VSEC_LNL_M, &lnl_info) },
436+
{ PCI_DEVICE_DATA(INTEL, VSEC_PTL, &mtl_info) },
435437
{ }
436438
};
437439
MODULE_DEVICE_TABLE(pci, intel_vsec_pci_ids);

drivers/platform/x86/p2sb.c

Lines changed: 55 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ struct p2sb_res_cache {
4343
};
4444

4545
static struct p2sb_res_cache p2sb_resources[NR_P2SB_RES_CACHE];
46+
static bool p2sb_hidden_by_bios;
4647

4748
static void p2sb_get_devfn(unsigned int *devfn)
4849
{
@@ -97,13 +98,21 @@ static void p2sb_scan_and_cache_devfn(struct pci_bus *bus, unsigned int devfn)
9798

9899
static int p2sb_scan_and_cache(struct pci_bus *bus, unsigned int devfn)
99100
{
101+
/*
102+
* The BIOS prevents the P2SB device from being enumerated by the PCI
103+
* subsystem, so we need to unhide and hide it back to lookup the BAR.
104+
*/
105+
pci_bus_write_config_dword(bus, devfn, P2SBC, 0);
106+
100107
/* Scan the P2SB device and cache its BAR0 */
101108
p2sb_scan_and_cache_devfn(bus, devfn);
102109

103110
/* On Goldmont p2sb_bar() also gets called for the SPI controller */
104111
if (devfn == P2SB_DEVFN_GOLDMONT)
105112
p2sb_scan_and_cache_devfn(bus, SPI_DEVFN_GOLDMONT);
106113

114+
pci_bus_write_config_dword(bus, devfn, P2SBC, P2SBC_HIDE);
115+
107116
if (!p2sb_valid_resource(&p2sb_resources[PCI_FUNC(devfn)].res))
108117
return -ENOENT;
109118

@@ -129,7 +138,7 @@ static int p2sb_cache_resources(void)
129138
u32 value = P2SBC_HIDE;
130139
struct pci_bus *bus;
131140
u16 class;
132-
int ret;
141+
int ret = 0;
133142

134143
/* Get devfn for P2SB device itself */
135144
p2sb_get_devfn(&devfn_p2sb);
@@ -152,22 +161,53 @@ static int p2sb_cache_resources(void)
152161
*/
153162
pci_lock_rescan_remove();
154163

164+
pci_bus_read_config_dword(bus, devfn_p2sb, P2SBC, &value);
165+
p2sb_hidden_by_bios = value & P2SBC_HIDE;
166+
155167
/*
156-
* The BIOS prevents the P2SB device from being enumerated by the PCI
157-
* subsystem, so we need to unhide and hide it back to lookup the BAR.
158-
* Unhide the P2SB device here, if needed.
168+
* If the BIOS does not hide the P2SB device then its resources
169+
* are accesilble. Cache them only if the P2SB device is hidden.
159170
*/
160-
pci_bus_read_config_dword(bus, devfn_p2sb, P2SBC, &value);
161-
if (value & P2SBC_HIDE)
162-
pci_bus_write_config_dword(bus, devfn_p2sb, P2SBC, 0);
171+
if (p2sb_hidden_by_bios)
172+
ret = p2sb_scan_and_cache(bus, devfn_p2sb);
163173

164-
ret = p2sb_scan_and_cache(bus, devfn_p2sb);
174+
pci_unlock_rescan_remove();
165175

166-
/* Hide the P2SB device, if it was hidden */
167-
if (value & P2SBC_HIDE)
168-
pci_bus_write_config_dword(bus, devfn_p2sb, P2SBC, P2SBC_HIDE);
176+
return ret;
177+
}
169178

170-
pci_unlock_rescan_remove();
179+
static int p2sb_read_from_cache(struct pci_bus *bus, unsigned int devfn,
180+
struct resource *mem)
181+
{
182+
struct p2sb_res_cache *cache = &p2sb_resources[PCI_FUNC(devfn)];
183+
184+
if (cache->bus_dev_id != bus->dev.id)
185+
return -ENODEV;
186+
187+
if (!p2sb_valid_resource(&cache->res))
188+
return -ENOENT;
189+
190+
memcpy(mem, &cache->res, sizeof(*mem));
191+
192+
return 0;
193+
}
194+
195+
static int p2sb_read_from_dev(struct pci_bus *bus, unsigned int devfn,
196+
struct resource *mem)
197+
{
198+
struct pci_dev *pdev;
199+
int ret = 0;
200+
201+
pdev = pci_get_slot(bus, devfn);
202+
if (!pdev)
203+
return -ENODEV;
204+
205+
if (p2sb_valid_resource(pci_resource_n(pdev, 0)))
206+
p2sb_read_bar0(pdev, mem);
207+
else
208+
ret = -ENOENT;
209+
210+
pci_dev_put(pdev);
171211

172212
return ret;
173213
}
@@ -188,24 +228,17 @@ static int p2sb_cache_resources(void)
188228
*/
189229
int p2sb_bar(struct pci_bus *bus, unsigned int devfn, struct resource *mem)
190230
{
191-
struct p2sb_res_cache *cache;
192-
193231
bus = p2sb_get_bus(bus);
194232
if (!bus)
195233
return -ENODEV;
196234

197235
if (!devfn)
198236
p2sb_get_devfn(&devfn);
199237

200-
cache = &p2sb_resources[PCI_FUNC(devfn)];
201-
if (cache->bus_dev_id != bus->dev.id)
202-
return -ENODEV;
238+
if (p2sb_hidden_by_bios)
239+
return p2sb_read_from_cache(bus, devfn, mem);
203240

204-
if (!p2sb_valid_resource(&cache->res))
205-
return -ENOENT;
206-
207-
memcpy(mem, &cache->res, sizeof(*mem));
208-
return 0;
241+
return p2sb_read_from_dev(bus, devfn, mem);
209242
}
210243
EXPORT_SYMBOL_GPL(p2sb_bar);
211244

drivers/platform/x86/touchscreen_dmi.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,23 @@ static const struct ts_dmi_data rwc_nanote_next_data = {
855855
.properties = rwc_nanote_next_props,
856856
};
857857

858+
static const struct property_entry sary_tab_3_props[] = {
859+
PROPERTY_ENTRY_U32("touchscreen-size-x", 1730),
860+
PROPERTY_ENTRY_U32("touchscreen-size-y", 1151),
861+
PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"),
862+
PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
863+
PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
864+
PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-sary-tab-3.fw"),
865+
PROPERTY_ENTRY_U32("silead,max-fingers", 10),
866+
PROPERTY_ENTRY_BOOL("silead,home-button"),
867+
{ }
868+
};
869+
870+
static const struct ts_dmi_data sary_tab_3_data = {
871+
.acpi_name = "MSSL1680:00",
872+
.properties = sary_tab_3_props,
873+
};
874+
858875
static const struct property_entry schneider_sct101ctm_props[] = {
859876
PROPERTY_ENTRY_U32("touchscreen-size-x", 1715),
860877
PROPERTY_ENTRY_U32("touchscreen-size-y", 1140),
@@ -1615,6 +1632,15 @@ const struct dmi_system_id touchscreen_dmi_table[] = {
16151632
DMI_MATCH(DMI_BIOS_VERSION, "S8A70R100-V005"),
16161633
},
16171634
},
1635+
{
1636+
/* SARY Tab 3 */
1637+
.driver_data = (void *)&sary_tab_3_data,
1638+
.matches = {
1639+
DMI_MATCH(DMI_SYS_VENDOR, "SARY"),
1640+
DMI_MATCH(DMI_PRODUCT_NAME, "C210C"),
1641+
DMI_MATCH(DMI_PRODUCT_SKU, "TAB3"),
1642+
},
1643+
},
16181644
{
16191645
/* Schneider SCT101CTM */
16201646
.driver_data = (void *)&schneider_sct101ctm_data,

0 commit comments

Comments
 (0)