Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b938a229 authored by Bjorn Helgaas's avatar Bjorn Helgaas
Browse files

ACPI: Rename OSC_QUERY_TYPE to OSC_QUERY_DWORD



OSC_QUERY_TYPE isn't a "type"; it's an index into the _OSC Capabilities
Buffer of DWORDs.  Rename OSC_QUERY_TYPE, OSC_SUPPORT_TYPE, and
OSC_CONTROL_TYPE to OSC_QUERY_DWORD, etc., to make this clear.
No functional change.

Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent dedf1e4d
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -758,9 +758,9 @@ int apei_osc_setup(void)
		.cap.pointer	= capbuf,
		.cap.pointer	= capbuf,
	};
	};


	capbuf[OSC_QUERY_TYPE] = OSC_QUERY_ENABLE;
	capbuf[OSC_QUERY_DWORD] = OSC_QUERY_ENABLE;
	capbuf[OSC_SUPPORT_TYPE] = 1;
	capbuf[OSC_SUPPORT_DWORD] = 1;
	capbuf[OSC_CONTROL_TYPE] = 0;
	capbuf[OSC_CONTROL_DWORD] = 0;


	if (ACPI_FAILURE(acpi_get_handle(NULL, "\\_SB", &handle))
	if (ACPI_FAILURE(acpi_get_handle(NULL, "\\_SB", &handle))
	    || ACPI_FAILURE(acpi_run_osc(handle, &context)))
	    || ACPI_FAILURE(acpi_run_osc(handle, &context)))
+9 −9
Original line number Original line Diff line number Diff line
@@ -255,7 +255,7 @@ acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context)
			acpi_print_osc_error(handle, context,
			acpi_print_osc_error(handle, context,
				"_OSC invalid revision");
				"_OSC invalid revision");
		if (errors & OSC_CAPABILITIES_MASK_ERROR) {
		if (errors & OSC_CAPABILITIES_MASK_ERROR) {
			if (((u32 *)context->cap.pointer)[OSC_QUERY_TYPE]
			if (((u32 *)context->cap.pointer)[OSC_QUERY_DWORD]
			    & OSC_QUERY_ENABLE)
			    & OSC_QUERY_ENABLE)
				goto out_success;
				goto out_success;
			status = AE_SUPPORT;
			status = AE_SUPPORT;
@@ -295,30 +295,30 @@ static void acpi_bus_osc_support(void)
	};
	};
	acpi_handle handle;
	acpi_handle handle;


	capbuf[OSC_QUERY_TYPE] = OSC_QUERY_ENABLE;
	capbuf[OSC_QUERY_DWORD] = OSC_QUERY_ENABLE;
	capbuf[OSC_SUPPORT_TYPE] = OSC_SB_PR3_SUPPORT; /* _PR3 is in use */
	capbuf[OSC_SUPPORT_DWORD] = OSC_SB_PR3_SUPPORT; /* _PR3 is in use */
#if defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR) ||\
#if defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR) ||\
			defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR_MODULE)
			defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR_MODULE)
	capbuf[OSC_SUPPORT_TYPE] |= OSC_SB_PAD_SUPPORT;
	capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_PAD_SUPPORT;
#endif
#endif


#if defined(CONFIG_ACPI_PROCESSOR) || defined(CONFIG_ACPI_PROCESSOR_MODULE)
#if defined(CONFIG_ACPI_PROCESSOR) || defined(CONFIG_ACPI_PROCESSOR_MODULE)
	capbuf[OSC_SUPPORT_TYPE] |= OSC_SB_PPC_OST_SUPPORT;
	capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_PPC_OST_SUPPORT;
#endif
#endif


#ifdef ACPI_HOTPLUG_OST
#ifdef ACPI_HOTPLUG_OST
	capbuf[OSC_SUPPORT_TYPE] |= OSC_SB_HOTPLUG_OST_SUPPORT;
	capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_HOTPLUG_OST_SUPPORT;
#endif
#endif


	if (!ghes_disable)
	if (!ghes_disable)
		capbuf[OSC_SUPPORT_TYPE] |= OSC_SB_APEI_SUPPORT;
		capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_APEI_SUPPORT;
	if (ACPI_FAILURE(acpi_get_handle(NULL, "\\_SB", &handle)))
	if (ACPI_FAILURE(acpi_get_handle(NULL, "\\_SB", &handle)))
		return;
		return;
	if (ACPI_SUCCESS(acpi_run_osc(handle, &context))) {
	if (ACPI_SUCCESS(acpi_run_osc(handle, &context))) {
		u32 *capbuf_ret = context.ret.pointer;
		u32 *capbuf_ret = context.ret.pointer;
		if (context.ret.length > OSC_SUPPORT_TYPE)
		if (context.ret.length > OSC_SUPPORT_DWORD)
			osc_sb_apei_support_acked =
			osc_sb_apei_support_acked =
				capbuf_ret[OSC_SUPPORT_TYPE] & OSC_SB_APEI_SUPPORT;
				capbuf_ret[OSC_SUPPORT_DWORD] & OSC_SB_APEI_SUPPORT;
		kfree(context.ret.pointer);
		kfree(context.ret.pointer);
	}
	}
	/* do we need to check other returned cap? Sounds no */
	/* do we need to check other returned cap? Sounds no */
+7 −7
Original line number Original line Diff line number Diff line
@@ -158,14 +158,14 @@ static acpi_status acpi_pci_query_osc(struct acpi_pci_root *root,
	support &= OSC_PCI_SUPPORT_MASKS;
	support &= OSC_PCI_SUPPORT_MASKS;
	support |= root->osc_support_set;
	support |= root->osc_support_set;


	capbuf[OSC_QUERY_TYPE] = OSC_QUERY_ENABLE;
	capbuf[OSC_QUERY_DWORD] = OSC_QUERY_ENABLE;
	capbuf[OSC_SUPPORT_TYPE] = support;
	capbuf[OSC_SUPPORT_DWORD] = support;
	if (control) {
	if (control) {
		*control &= OSC_PCI_CONTROL_MASKS;
		*control &= OSC_PCI_CONTROL_MASKS;
		capbuf[OSC_CONTROL_TYPE] = *control | root->osc_control_set;
		capbuf[OSC_CONTROL_DWORD] = *control | root->osc_control_set;
	} else {
	} else {
		/* Run _OSC query only with existing controls. */
		/* Run _OSC query only with existing controls. */
		capbuf[OSC_CONTROL_TYPE] = root->osc_control_set;
		capbuf[OSC_CONTROL_DWORD] = root->osc_control_set;
	}
	}


	status = acpi_pci_run_osc(root->device->handle, capbuf, &result);
	status = acpi_pci_run_osc(root->device->handle, capbuf, &result);
@@ -357,9 +357,9 @@ acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 *mask, u32 req)
		goto out;
		goto out;
	}
	}


	capbuf[OSC_QUERY_TYPE] = 0;
	capbuf[OSC_QUERY_DWORD] = 0;
	capbuf[OSC_SUPPORT_TYPE] = root->osc_support_set;
	capbuf[OSC_SUPPORT_DWORD] = root->osc_support_set;
	capbuf[OSC_CONTROL_TYPE] = ctrl;
	capbuf[OSC_CONTROL_DWORD] = ctrl;
	status = acpi_pci_run_osc(handle, capbuf, mask);
	status = acpi_pci_run_osc(handle, capbuf, mask);
	if (ACPI_SUCCESS(status))
	if (ACPI_SUCCESS(status))
		root->osc_control_set = *mask;
		root->osc_control_set = *mask;
+4 −3
Original line number Original line Diff line number Diff line
@@ -300,9 +300,10 @@ struct acpi_osc_context {
	struct acpi_buffer ret; /* free by caller if success */
	struct acpi_buffer ret; /* free by caller if success */
};
};


#define OSC_QUERY_TYPE			0
/* Indexes into _OSC Capabilities Buffer (DWORDs 2 & 3 are device-specific) */
#define OSC_SUPPORT_TYPE 		1
#define OSC_QUERY_DWORD				0	/* DWORD 1 */
#define OSC_CONTROL_TYPE		2
#define OSC_SUPPORT_DWORD			1	/* DWORD 2 */
#define OSC_CONTROL_DWORD			2	/* DWORD 3 */


/* _OSC Capabilities DWORD 1: Query/Control and Error Returns (generic) */
/* _OSC Capabilities DWORD 1: Query/Control and Error Returns (generic) */
#define OSC_QUERY_ENABLE			0x00000001  /* input */
#define OSC_QUERY_ENABLE			0x00000001  /* input */