Skip to content

Commit

Permalink
Merge branches 'acpi-utils', 'acpi-resource', 'acpi-property' and 'ac…
Browse files Browse the repository at this point in the history
…pi-soc'

Merge ACPI utilities updates, ACPI resource management updates, ACPI
device properties management updates and ACPI LPSS (Intel SoC) driver
update for 6.7-rc1:

 - Rework acpi_handle_list handling so as to manage it dynamically,
   including size computation (Rafael Wysocki).

 - Clean up ACPI utilities code so as to make it follow the kernel
   coding style (Jonathan Bergh).

 - Consolidate IRQ trigger-type override DMI tables and drop .ident
   values from dmi_system_id tables used for ACPI resources management
   quirks (Hans de Goede).

 - Add ACPI IRQ override for TongFang GMxXGxx (Werner Sembach).

 - Allow _DSD buffer data only for byte accessors and document the _DSD
   data buffer GUID (Andy Shevchenko).

 - Drop BayTrail and Lynxpoint pinctrl device IDs from the ACPI LPSS
   driver, because it does not need them (Raag Jadav).

* acpi-utils:
  ACPI: utils: Remove redundant braces around individual statement
  ACPI: utils: Fix up white space in a few places
  ACPI: utils: Dynamically determine acpi_handle_list size
  ACPI: thermal: Merge trip initialization functions
  ACPI: thermal: Collapse trip devices update function wrappers
  ACPI: thermal: Collapse trip devices update functions
  ACPI: thermal: Add device list to struct acpi_thermal_trip
  ACPI: thermal: Fix a small leak in acpi_thermal_add()
  ACPI: thermal: Drop valid flag from struct acpi_thermal_trip
  ACPI: thermal: Drop redundant trip point flags
  ACPI: thermal: Untangle initialization and updates of active trips
  ACPI: thermal: Untangle initialization and updates of the passive trip
  ACPI: thermal: Simplify critical and hot trips representation
  ACPI: thermal: Create and populate trip points table earlier
  ACPI: thermal: Determine the number of trip points earlier
  ACPI: thermal: Fold acpi_thermal_get_info() into its caller
  ACPI: thermal: Simplify initialization of critical and hot trips

* acpi-resource:
  ACPI: resource: Do IRQ override on TongFang GMxXGxx
  ACPI: resource: Drop .ident values from dmi_system_id tables
  ACPI: resource: Consolidate IRQ trigger-type override DMI tables

* acpi-property:
  ACPI: property: Document the _DSD data buffer GUID
  ACPI: property: Allow _DSD buffer data only for byte accessors

* acpi-soc:
  ACPI: LPSS: drop BayTrail and Lynxpoint pinctrl HIDs
  • Loading branch information
rafaeljw committed Oct 26, 2023
5 parents 93003de + 6b54bdd + 0da9ecc + 43451c4 + bda3df1 commit ea40075
Show file tree
Hide file tree
Showing 8 changed files with 509 additions and 424 deletions.
21 changes: 10 additions & 11 deletions drivers/acpi/acpi_lpss.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,16 +368,13 @@ static const struct acpi_device_id acpi_lpss_device_ids[] = {
{ "INT33C4", LPSS_ADDR(lpt_uart_dev_desc) },
{ "INT33C5", LPSS_ADDR(lpt_uart_dev_desc) },
{ "INT33C6", LPSS_ADDR(lpt_sdio_dev_desc) },
{ "INT33C7", },

/* BayTrail LPSS devices */
{ "80860F09", LPSS_ADDR(byt_pwm_dev_desc) },
{ "80860F0A", LPSS_ADDR(byt_uart_dev_desc) },
{ "80860F0E", LPSS_ADDR(byt_spi_dev_desc) },
{ "80860F14", LPSS_ADDR(byt_sdio_dev_desc) },
{ "80860F41", LPSS_ADDR(byt_i2c_dev_desc) },
{ "INT33B2", },
{ "INT33FC", },

/* Braswell LPSS devices */
{ "80862286", LPSS_ADDR(lpss_dma_desc) },
Expand All @@ -396,7 +393,6 @@ static const struct acpi_device_id acpi_lpss_device_ids[] = {
{ "INT3434", LPSS_ADDR(lpt_uart_dev_desc) },
{ "INT3435", LPSS_ADDR(lpt_uart_dev_desc) },
{ "INT3436", LPSS_ADDR(lpt_sdio_dev_desc) },
{ "INT3437", },

/* Wildcat Point LPSS devices */
{ "INT3438", LPSS_ADDR(lpt_spi_dev_desc) },
Expand Down Expand Up @@ -578,6 +574,7 @@ static bool acpi_lpss_dep(struct acpi_device *adev, acpi_handle handle)
{
struct acpi_handle_list dep_devices;
acpi_status status;
bool ret = false;
int i;

if (!acpi_has_method(adev->handle, "_DEP"))
Expand All @@ -591,11 +588,14 @@ static bool acpi_lpss_dep(struct acpi_device *adev, acpi_handle handle)
}

for (i = 0; i < dep_devices.count; i++) {
if (dep_devices.handles[i] == handle)
return true;
if (dep_devices.handles[i] == handle) {
ret = true;
break;
}
}

return false;
acpi_handle_list_free(&dep_devices);
return ret;
}

static void acpi_lpss_link_consumer(struct device *dev1,
Expand Down Expand Up @@ -657,10 +657,9 @@ static int acpi_lpss_create_device(struct acpi_device *adev,
int ret;

dev_desc = (const struct lpss_device_desc *)id->driver_data;
if (!dev_desc) {
pdev = acpi_create_platform_device(adev, NULL);
return IS_ERR_OR_NULL(pdev) ? PTR_ERR(pdev) : 1;
}
if (!dev_desc)
return -EINVAL;

pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
if (!pdata)
return -ENOMEM;
Expand Down
20 changes: 11 additions & 9 deletions drivers/acpi/property.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ static const guid_t ads_guid =
GUID_INIT(0xdbb8e3e6, 0x5886, 0x4ba6,
0x87, 0x95, 0x13, 0x19, 0xf5, 0x2a, 0x96, 0x6b);

/* ACPI _DSD data buffer GUID: edb12dd0-363d-4085-a3d2-49522ca160c4 */
static const guid_t buffer_prop_guid =
GUID_INIT(0xedb12dd0, 0x363d, 0x4085,
0xa3, 0xd2, 0x49, 0x52, 0x2c, 0xa1, 0x60, 0xc4);
Expand Down Expand Up @@ -1102,25 +1103,26 @@ static int acpi_data_prop_read(const struct acpi_device_data *data,
switch (proptype) {
case DEV_PROP_STRING:
break;
case DEV_PROP_U8 ... DEV_PROP_U64:
default:
if (obj->type == ACPI_TYPE_BUFFER) {
if (nval > obj->buffer.length)
return -EOVERFLOW;
break;
} else {
if (nval > obj->package.count)
return -EOVERFLOW;
}
fallthrough;
default:
if (nval > obj->package.count)
return -EOVERFLOW;
break;
}
if (nval == 0)
return -EINVAL;

if (obj->type != ACPI_TYPE_BUFFER)
items = obj->package.elements;
else
if (obj->type == ACPI_TYPE_BUFFER) {
if (proptype != DEV_PROP_U8)
return -EPROTO;
items = obj;
} else {
items = obj->package.elements;
}

switch (proptype) {
case DEV_PROP_U8:
Expand Down
94 changes: 48 additions & 46 deletions drivers/acpi/resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,127 +385,144 @@ unsigned int acpi_dev_get_irq_type(int triggering, int polarity)
}
EXPORT_SYMBOL_GPL(acpi_dev_get_irq_type);

static const struct dmi_system_id medion_laptop[] = {
/*
* DMI matches for boards where the DSDT specifies the kbd IRQ as
* level active-low and using the override changes this to rising edge,
* stopping the keyboard from working.
*/
static const struct dmi_system_id irq1_level_low_skip_override[] = {
{
.ident = "MEDION P15651",
/* MEDION P15651 */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
DMI_MATCH(DMI_BOARD_NAME, "M15T"),
},
},
{
.ident = "MEDION S17405",
/* MEDION S17405 */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
DMI_MATCH(DMI_BOARD_NAME, "M17T"),
},
},
{
.ident = "MEDION S17413",
/* MEDION S17413 */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
DMI_MATCH(DMI_BOARD_NAME, "M1xA"),
},
},
{ }
};

static const struct dmi_system_id asus_laptop[] = {
{
.ident = "Asus Vivobook K3402ZA",
/* Asus Vivobook K3402ZA */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_BOARD_NAME, "K3402ZA"),
},
},
{
.ident = "Asus Vivobook K3502ZA",
/* Asus Vivobook K3502ZA */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_BOARD_NAME, "K3502ZA"),
},
},
{
.ident = "Asus Vivobook S5402ZA",
/* Asus Vivobook S5402ZA */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_BOARD_NAME, "S5402ZA"),
},
},
{
.ident = "Asus Vivobook S5602ZA",
/* Asus Vivobook S5602ZA */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_BOARD_NAME, "S5602ZA"),
},
},
{
.ident = "Asus ExpertBook B1402CBA",
/* Asus ExpertBook B1402CBA */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_BOARD_NAME, "B1402CBA"),
},
},
{
.ident = "Asus ExpertBook B1502CBA",
/* Asus ExpertBook B1502CBA */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_BOARD_NAME, "B1502CBA"),
},
},
{
.ident = "Asus ExpertBook B2402CBA",
/* Asus ExpertBook B2402CBA */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_BOARD_NAME, "B2402CBA"),
},
},
{
.ident = "Asus ExpertBook B2402FBA",
/* Asus ExpertBook B2402FBA */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_BOARD_NAME, "B2402FBA"),
},
},
{
.ident = "Asus ExpertBook B2502",
/* Asus ExpertBook B2502 */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_BOARD_NAME, "B2502CBA"),
},
},
{
/* LG Electronics 17U70P */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"),
DMI_MATCH(DMI_BOARD_NAME, "17U70P"),
},
},
{ }
};

static const struct dmi_system_id tongfang_gm_rg[] = {
/*
* DMI matches for AMD Zen boards where the DSDT specifies the kbd IRQ
* as falling edge and this must be overridden to rising edge,
* to have a working keyboard.
*/
static const struct dmi_system_id irq1_edge_low_force_override[] = {
{
.ident = "TongFang GMxRGxx/XMG CORE 15 (M22)/TUXEDO Stellaris 15 Gen4 AMD",
/* TongFang GMxRGxx/XMG CORE 15 (M22)/TUXEDO Stellaris 15 Gen4 AMD */
.matches = {
DMI_MATCH(DMI_BOARD_NAME, "GMxRGxx"),
},
},
{ }
};

static const struct dmi_system_id maingear_laptop[] = {
{
.ident = "MAINGEAR Vector Pro 2 15",
/* TongFang GMxXGxx/TUXEDO Polaris 15 Gen5 AMD */
.matches = {
DMI_MATCH(DMI_BOARD_NAME, "GMxXGxx"),
},
},
{
/* TongFang GM6XGxX/TUXEDO Stellaris 16 Gen5 AMD */
.matches = {
DMI_MATCH(DMI_BOARD_NAME, "GM6XGxX"),
},
},
{
/* MAINGEAR Vector Pro 2 15 */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Micro Electronics Inc"),
DMI_MATCH(DMI_PRODUCT_NAME, "MG-VCP2-15A3070T"),
}
},
{
.ident = "MAINGEAR Vector Pro 2 17",
/* MAINGEAR Vector Pro 2 17 */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Micro Electronics Inc"),
DMI_MATCH(DMI_PRODUCT_NAME, "MG-VCP2-17A3070T"),
},
},
{ }
};

static const struct dmi_system_id pcspecialist_laptop[] = {
{
/* TongFang GM6BGEQ / PCSpecialist Elimina Pro 16 M, RTX 3050 */
.matches = {
Expand All @@ -527,17 +544,6 @@ static const struct dmi_system_id pcspecialist_laptop[] = {
{ }
};

static const struct dmi_system_id lg_laptop[] = {
{
.ident = "LG Electronics 17U70P",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"),
DMI_MATCH(DMI_BOARD_NAME, "17U70P"),
},
},
{ }
};

struct irq_override_cmp {
const struct dmi_system_id *system;
unsigned char irq;
Expand All @@ -548,12 +554,8 @@ struct irq_override_cmp {
};

static const struct irq_override_cmp override_table[] = {
{ medion_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
{ asus_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
{ tongfang_gm_rg, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true },
{ maingear_laptop, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true },
{ pcspecialist_laptop, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true },
{ lg_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
{ irq1_level_low_skip_override, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
{ irq1_edge_low_force_override, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true },
};

static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity,
Expand Down
1 change: 1 addition & 0 deletions drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -2032,6 +2032,7 @@ static u32 acpi_scan_check_dep(acpi_handle handle, bool check_dep)
mutex_unlock(&acpi_dep_list_lock);
}

acpi_handle_list_free(&dep_devices);
return count;
}

Expand Down
Loading

0 comments on commit ea40075

Please sign in to comment.