forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 95099d4622f8cb224d94e314c7a8e0df60b13f87
kernel/drivers/acpi/acpica/hwvalid.c
....@@ -3,7 +3,7 @@
33 *
44 * Module Name: hwvalid - I/O request validation
55 *
6
- * Copyright (C) 2000 - 2018, Intel Corp.
6
+ * Copyright (C) 2000 - 2020, Intel Corp.
77 *
88 *****************************************************************************/
99
....@@ -292,3 +292,33 @@
292292
293293 return (AE_OK);
294294 }
295
+
296
+/******************************************************************************
297
+ *
298
+ * FUNCTION: acpi_hw_validate_io_block
299
+ *
300
+ * PARAMETERS: Address Address of I/O port/register blobk
301
+ * bit_width Number of bits (8,16,32) in each register
302
+ * count Number of registers in the block
303
+ *
304
+ * RETURN: Status
305
+ *
306
+ * DESCRIPTION: Validates a block of I/O ports/registers.
307
+ *
308
+ ******************************************************************************/
309
+
310
+acpi_status acpi_hw_validate_io_block(u64 address, u32 bit_width, u32 count)
311
+{
312
+ acpi_status status;
313
+
314
+ while (count--) {
315
+ status = acpi_hw_validate_io_request((acpi_io_address)address,
316
+ bit_width);
317
+ if (ACPI_FAILURE(status))
318
+ return_ACPI_STATUS(status);
319
+
320
+ address += ACPI_DIV_8(bit_width);
321
+ }
322
+
323
+ return_ACPI_STATUS(AE_OK);
324
+}