Commit 1dade3a7 authored by Mika Westerberg's avatar Mika Westerberg Committed by Rafael J. Wysocki

ACPICA: Introduce ACPI_ACCESS_BYTE_WIDTH() macro

Sometimes it is useful to find the access_width field value in bytes and
not in bits so add a helper that can be used for this purpose.
Suggested-by: default avatarJean Delvare <jdelvare@suse.de>
Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: default avatarJean Delvare <jdelvare@suse.de>
Cc: 4.16+ <stable@vger.kernel.org> # 4.16+
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 3f9e12e0
...@@ -532,11 +532,12 @@ typedef u64 acpi_integer; ...@@ -532,11 +532,12 @@ typedef u64 acpi_integer;
strnlen (a, ACPI_NAMESEG_SIZE) == ACPI_NAMESEG_SIZE) strnlen (a, ACPI_NAMESEG_SIZE) == ACPI_NAMESEG_SIZE)
/* /*
* Algorithm to obtain access bit width. * Algorithm to obtain access bit or byte width.
* Can be used with access_width of struct acpi_generic_address and access_size of * Can be used with access_width of struct acpi_generic_address and access_size of
* struct acpi_resource_generic_register. * struct acpi_resource_generic_register.
*/ */
#define ACPI_ACCESS_BIT_WIDTH(size) (1 << ((size) + 2)) #define ACPI_ACCESS_BIT_WIDTH(size) (1 << ((size) + 2))
#define ACPI_ACCESS_BYTE_WIDTH(size) (1 << ((size) - 1))
/******************************************************************************* /*******************************************************************************
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment