acpi: Export functions required by upcoming acpi_iicbus driver.

This commit is contained in:
Vladimir Kondratyev 2020-03-09 20:28:45 +00:00
parent 709749aa29
commit ddf8c230b1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=358819
2 changed files with 17 additions and 9 deletions

View File

@ -150,7 +150,6 @@ static ACPI_STATUS acpi_device_scan_cb(ACPI_HANDLE h, UINT32 level,
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_softc *sc);
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_t child, char *buf,
}
/* 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 child, char *buf,
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, int max_depth,
* 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;

View File

@ -371,6 +371,7 @@ int acpi_bus_alloc_gas(device_t dev, int *type, int *rid,
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, int enable);
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 state,
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);