Commit ea400752 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge branches 'acpi-utils', 'acpi-resource', 'acpi-property' and 'acpi-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
Loading
Loading
Loading
+10 −11
Original line number Diff line number Diff line
@@ -368,7 +368,6 @@ 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) },
@@ -376,8 +375,6 @@ static const struct acpi_device_id acpi_lpss_device_ids[] = {
	{ "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) },
@@ -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) },
@@ -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"))
@@ -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,
@@ -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;
+11 −9
Original line number Diff line number Diff line
@@ -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);
@@ -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;
		}
		fallthrough;
	default:
		} else {
			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:
+48 −46
Original line number Diff line number Diff line
@@ -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 = {
@@ -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;
@@ -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,
+1 −0
Original line number Diff line number Diff line
@@ -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;
}

+364 −346

File changed.

Preview size limit exceeded, changes collapsed.

Loading