ACPICA: Support for custom ACPICA build for ACPI 5 reduced hardware

Add ACPI_REDUCED_HARDWARE flag that removes all hardware-related
code (about 10% code, 5% static data).

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c
index 29c0fd3..d599961 100644
--- a/drivers/acpi/acpica/hwxfsleep.c
+++ b/drivers/acpi/acpica/hwxfsleep.c
@@ -48,6 +48,7 @@
 #define _COMPONENT          ACPI_HARDWARE
 ACPI_MODULE_NAME("hwxfsleep")
 
+#if (!ACPI_REDUCED_HARDWARE)
 /*******************************************************************************
  *
  * FUNCTION:    acpi_set_firmware_waking_vector
@@ -189,7 +190,7 @@
 }
 
 ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios)
-
+#endif				/* !ACPI_REDUCED_HARDWARE */
 /*******************************************************************************
  *
  * FUNCTION:    acpi_enter_sleep_state_prep
@@ -290,6 +291,7 @@
 			    acpi_gbl_sleep_type_a, acpi_gbl_sleep_type_b));
 		return_ACPI_STATUS(AE_AML_OPERAND_VALUE);
 	}
+#if (!ACPI_REDUCED_HARDWARE)
 
 	/* If Hardware Reduced flag is set, must use the extended sleep registers */
 
@@ -301,6 +303,11 @@
 		status = acpi_hw_legacy_sleep(sleep_state);
 	}
 
+#else
+	status = acpi_hw_extended_sleep(sleep_state);
+
+#endif				/* !ACPI_REDUCED_HARDWARE */
+
 	return_ACPI_STATUS(status);
 }
 
@@ -326,6 +333,8 @@
 	ACPI_FUNCTION_TRACE(acpi_leave_sleep_state);
 
 
+#if (!ACPI_REDUCED_HARDWARE)
+
 	/* If Hardware Reduced flag is set, must use the extended sleep registers */
 
 	if (acpi_gbl_reduced_hardware || acpi_gbl_FADT.sleep_control.address) {
@@ -335,6 +344,10 @@
 
 		status = acpi_hw_legacy_wake_prep(sleep_state);
 	}
+#else
+	status = acpi_hw_extended_wake_prep(sleep_state);
+
+#endif				/* !ACPI_REDUCED_HARDWARE */
 
 
 	return_ACPI_STATUS(status);
@@ -361,6 +374,8 @@
 	ACPI_FUNCTION_TRACE(acpi_leave_sleep_state);
 
 
+#if (!ACPI_REDUCED_HARDWARE)
+
 	/* If Hardware Reduced flag is set, must use the extended sleep registers */
 
 	if (acpi_gbl_reduced_hardware || acpi_gbl_FADT.sleep_control.address) {
@@ -371,6 +386,11 @@
 		status = acpi_hw_legacy_wake(sleep_state);
 	}
 
+#else
+	status = acpi_hw_extended_wake(sleep_state);
+
+#endif				/* !ACPI_REDUCED_HARDWARE */
+
 	return_ACPI_STATUS(status);
 }