svn commit: r358819 - head/sys/dev/acpica
Vladimir Kondratyev
wulf at FreeBSD.org
Mon Mar 9 20:28:47 UTC 2020
Author: wulf
Date: Mon Mar 9 20:28:45 2020
New Revision: 358819
URL: https://svnweb.freebsd.org/changeset/base/358819
Log:
acpi: Export functions required by upcoming acpi_iicbus driver.
Modified:
head/sys/dev/acpica/acpi.c
head/sys/dev/acpica/acpivar.h
Modified: head/sys/dev/acpica/acpi.c
==============================================================================
--- head/sys/dev/acpica/acpi.c Mon Mar 9 20:27:25 2020 (r358818)
+++ head/sys/dev/acpica/acpi.c Mon Mar 9 20:28:45 2020 (r358819)
@@ -150,7 +150,6 @@ static ACPI_STATUS acpi_device_scan_cb(ACPI_HANDLE h,
void *context, void **retval);
static ACPI_STATUS acpi_device_scan_children(device_t bus, device_t dev,
int max_depth, acpi_scan_cb_t user_fn, void *arg);
-static int acpi_set_powerstate(device_t child, int state);
static int acpi_isa_pnp_probe(device_t bus, device_t child,
struct isa_pnp_id *ids);
static void acpi_probe_children(device_t bus);
@@ -162,7 +161,6 @@ static ACPI_STATUS acpi_sleep_disable(struct acpi_soft
static ACPI_STATUS acpi_EnterSleepState(struct acpi_softc *sc, int state);
static void acpi_shutdown_final(void *arg, int howto);
static void acpi_enable_fixed_events(struct acpi_softc *sc);
-static BOOLEAN acpi_has_hid(ACPI_HANDLE handle);
static void acpi_resync_clock(struct acpi_softc *sc);
static int acpi_wake_sleep_prep(ACPI_HANDLE handle, int sstate);
static int acpi_wake_run_prep(ACPI_HANDLE handle, int sstate);
@@ -883,14 +881,12 @@ acpi_child_location_str_method(device_t cbdev, device_
}
/* PnP information for devctl(8) */
-static int
-acpi_child_pnpinfo_str_method(device_t cbdev, device_t child, char *buf,
- size_t buflen)
+int
+acpi_pnpinfo_str(ACPI_HANDLE handle, char *buf, size_t buflen)
{
- struct acpi_device *dinfo = device_get_ivars(child);
ACPI_DEVICE_INFO *adinfo;
- if (ACPI_FAILURE(AcpiGetObjectInfo(dinfo->ad_handle, &adinfo))) {
+ if (ACPI_FAILURE(AcpiGetObjectInfo(handle, &adinfo))) {
snprintf(buf, buflen, "unknown");
return (0);
}
@@ -908,6 +904,15 @@ acpi_child_pnpinfo_str_method(device_t cbdev, device_t
return (0);
}
+static int
+acpi_child_pnpinfo_str_method(device_t cbdev, device_t child, char *buf,
+ size_t buflen)
+{
+ struct acpi_device *dinfo = device_get_ivars(child);
+
+ return (acpi_pnpinfo_str(dinfo->ad_handle, buf, buflen));
+}
+
/*
* Handle device deletion.
*/
@@ -1840,7 +1845,7 @@ acpi_device_scan_children(device_t bus, device_t dev,
* Even though ACPI devices are not PCI, we use the PCI approach for setting
* device power states since it's close enough to ACPI.
*/
-static int
+int
acpi_set_powerstate(device_t child, int state)
{
ACPI_HANDLE h;
@@ -2285,7 +2290,7 @@ acpi_BatteryIsPresent(device_t dev)
/*
* Returns true if a device has at least one valid device ID.
*/
-static BOOLEAN
+BOOLEAN
acpi_has_hid(ACPI_HANDLE h)
{
ACPI_DEVICE_INFO *devinfo;
Modified: head/sys/dev/acpica/acpivar.h
==============================================================================
--- head/sys/dev/acpica/acpivar.h Mon Mar 9 20:27:25 2020 (r358818)
+++ head/sys/dev/acpica/acpivar.h Mon Mar 9 20:28:45 2020 (r358819)
@@ -371,6 +371,7 @@ int acpi_bus_alloc_gas(device_t dev, int *type, int *
u_int flags);
void acpi_walk_subtables(void *first, void *end,
acpi_subtable_handler *handler, void *arg);
+BOOLEAN acpi_has_hid(ACPI_HANDLE handle);
int acpi_MatchHid(ACPI_HANDLE h, const char *hid);
#define ACPI_MATCHHID_NOMATCH 0
#define ACPI_MATCHHID_HID 1
@@ -434,6 +435,7 @@ ACPI_STATUS acpi_pwr_wake_enable(ACPI_HANDLE consumer,
ACPI_STATUS acpi_pwr_switch_consumer(ACPI_HANDLE consumer, int state);
int acpi_device_pwr_for_sleep(device_t bus, device_t dev,
int *dstate);
+int acpi_set_powerstate(device_t child, int state);
/* APM emulation */
void acpi_apm_init(struct acpi_softc *);
@@ -468,6 +470,7 @@ int acpi_wakeup_machdep(struct acpi_softc *sc, int st
int sleep_result, int intr_enabled);
int acpi_table_quirks(int *quirks);
int acpi_machdep_quirks(int *quirks);
+int acpi_pnpinfo_str(ACPI_HANDLE handle, char *buf, size_t buflen);
uint32_t hpet_get_uid(device_t dev);
More information about the svn-src-head
mailing list