Skip to content

Commit 8eb99e9

Browse files
jwrdegoederafaeljw
authored andcommitted
ACPI: utils: Add acpi_reduced_hardware() helper
Add a getter for the acpi_gbl_reduced_hardware variable so that modules can check if they are running on an ACPI reduced-hw platform or not. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent e49d033 commit 8eb99e9

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

drivers/acpi/utils.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,17 @@ acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv)
872872
}
873873
EXPORT_SYMBOL(acpi_dev_get_first_match_dev);
874874

875+
/**
876+
* acpi_reduced_hardware - Return if this is an ACPI-reduced-hw machine
877+
*
878+
* Return true when running on an ACPI-reduced-hw machine, false otherwise.
879+
*/
880+
bool acpi_reduced_hardware(void)
881+
{
882+
return acpi_gbl_reduced_hardware;
883+
}
884+
EXPORT_SYMBOL_GPL(acpi_reduced_hardware);
885+
875886
/*
876887
* acpi_backlight= handling, this is done here rather then in video_detect.c
877888
* because __setup cannot be used in modules.

include/acpi/acpi_bus.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ acpi_evaluate_dsm_typed(acpi_handle handle, const guid_t *guid, u64 rev,
7878

7979
bool acpi_dev_found(const char *hid);
8080
bool acpi_dev_present(const char *hid, const char *uid, s64 hrv);
81+
bool acpi_reduced_hardware(void);
8182

8283
#ifdef CONFIG_ACPI
8384

include/linux/acpi.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,11 @@ acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv)
748748
return NULL;
749749
}
750750

751+
static inline bool acpi_reduced_hardware(void)
752+
{
753+
return false;
754+
}
755+
751756
static inline void acpi_dev_put(struct acpi_device *adev) {}
752757

753758
static inline bool is_acpi_node(const struct fwnode_handle *fwnode)

0 commit comments

Comments
 (0)