Events: Fix a divergence that OriginallyEnabled check is not paired.

This is from Linux upstream. The OriginallyEnabled check is not paired
between AcpiInstallGpeHandler() and AcpiRemoveGpeHandler().

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Events: Fix edge-triggered GPE by disabling before acknowledging it.

Due to ACPI specificiation 5, chapter 5.6.4 General-Purpose Event Hnadling,
OSPMs need to disable GPE before clearing the status bit for edge-triggered
GPEs.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Events: Add unconditional GPE enabling support.

This patch adds unconditional GPE enabling support into AcpiSetGpe().

Originally this function checks if the GPE has been enabled with handlers
and performs acknowledging before enabling it. The combination of
acknowledging and enabling is not expected by the hardware drivers.

GPE clearing is used to acknowledge GPE and enabling means upper layer
cares about the underlying hardware. The actions could happen in different
places in an OSPM driver. While we don't have split APIs for OSPMs to
achieve flexible driver implementations.

This patch converts AcpiSetGpe(ACPI_GPE_ENABLE) to achieve this. This API
is normally used by the drivers to disable GPE temporarily, such drivers
should have implemented the handlers, thus there's also no need to check
the state of the handlers in this function.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Events: Add a flag to disable internal auto GPE clearing.

Clearing the status bit means OSPM acknowledges the GPE and hardware then
can bring follow-up events up. Acklowdging it too early causes OSPM seeing
level triggered GPE storms or missing edge-triggered GPEs if the OSPM
driver responds slowly. Some drivers may choose to implement GPE condition
clearing code in a defered execution context, in which case, GPE status
clearing may not be paired with GPE disabling (edge-triggered) or
re-enabling (level triggered).

This flag facilitates such driver designs and implementations.

Note that drivers will need to invoke AcpiClearGpe() manually in a proper
position where the cause and conditions of the GPE has been solved and the
GPE status can be safely cleared.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>