Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | drivers/acpi/device_pm.c |
int acpi_bus_set_power(acpi_handle handle, int state) {
struct acpi_device *device = acpi_fetch_acpi_dev(handle);
if (device)
return acpi_device_set_power(device, state);
return -ENODEV;
} | [
0,
0
] |
Linux Kernel | drivers/acpi/device_pm.c |
static int fix_up_power_if_applicable(struct acpi_device *adev,
void *not_used) {
if (adev->status.present && adev->status.enabled)
acpi_device_fix_up_power(adev);
return 0;
} | [
1,
0
] |
Linux Kernel | drivers/acpi/device_pm.c | void acpi_dev_power_up_children_with_adr(struct acpi_device *adev) {
acpi_dev_for_each_child(adev, acpi_power_up_if_adr_present, NULL);
} | [
0,
0
] |
Linux Kernel | drivers/acpi/device_pm.c | acpi_status
acpi_add_pm_notifier(struct acpi_device *adev, struct device *dev,
void (*func)(struct acpi_device_wakeup_context *context)) {
acpi_status status = AE_ALREADY_EXISTS;
if (!dev && !func)
return AE_BAD_PARAMETER;
mutex_lock(&acpi_pm_notifier_install_lock);
if (adev->wakeup.... | [
0,
0
] |
Linux Kernel | drivers/acpi/device_pm.c | int acpi_pm_set_device_wakeup(struct device *dev, bool enable) {
struct acpi_device *adev;
int error;
adev = ACPI_COMPANION(dev);
if (!adev) {
dev_dbg(dev, "ACPI companion missing in %s!\n", __func__);
return -ENODEV;
}
if (!acpi_device_can_wakeup(adev))
return -EINVAL;
if (!enable) {
a... | [
0,
0
] |
Linux Kernel | drivers/acpi/device_pm.c | int acpi_subsys_suspend_noirq(struct device *dev) {
int ret;
if (dev_pm_skip_suspend(dev))
return 0;
ret = pm_generic_suspend_noirq(dev);
if (ret)
return ret;
/*
* If the target system sleep state is suspend-to-idle, it is sufficient
* to check whether or not the device's wakeup settings are ... | [
0,
0
] |
Linux Kernel | drivers/acpi/device_pm.c | static int acpi_subsys_resume(struct device *dev) {
const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
int ret = 0;
if (!dev_pm_skip_resume(dev) && pm && !pm->resume_early) {
dev_dbg(dev, "executing postponed D0 transition\n");
ret = acpi_dev_resume(dev);
}
return ret ? ret : pm_gen... | [
1,
0
] |
Linux Kernel | drivers/acpi/device_pm.c | int acpi_subsys_poweroff(struct device *dev) {
if (!dev_pm_test_driver_flags(dev, DPM_FLAG_SMART_SUSPEND) ||
acpi_dev_needs_resume(dev, ACPI_COMPANION(dev)))
pm_runtime_resume(dev);
return pm_generic_poweroff(dev);
} | [
0,
0
] |
Linux Kernel | drivers/acpi/device_pm.c | static int acpi_subsys_poweroff_late(struct device *dev) {
int ret;
if (dev_pm_skip_suspend(dev))
return 0;
ret = pm_generic_poweroff_late(dev);
if (ret)
return ret;
return acpi_dev_suspend(dev, device_may_wakeup(dev));
} | [
0,
0
] |
Linux Kernel | drivers/acpi/device_pm.c | bool acpi_storage_d3(struct device *dev) {
struct acpi_device *adev = ACPI_COMPANION(dev);
u8 val;
if (force_storage_d3())
return true;
if (!adev)
return false;
if (fwnode_property_read_u8(acpi_fwnode_handle(adev), "StorageD3Enable",
&val))
return false;
return va... | [
0,
0
] |
Linux Kernel | drivers/acpi/device_pm.c | bool acpi_dev_state_d0(struct device *dev) {
struct acpi_device *adev = ACPI_COMPANION(dev);
if (!adev)
return true;
return adev->power.state == ACPI_STATE_D0;
} | [
0,
0
] |
Linux Kernel | drivers/acpi/device_sysfs.c |
static ssize_t acpi_data_node_attr_show(struct kobject *kobj,
struct attribute *attr, char *buf) {
struct acpi_data_node *dn = to_data_node(kobj);
struct acpi_data_node_attr *dn_attr = to_attr(attr);
return dn_attr->show ? dn_attr->show(dn, buf) : -ENXIO;
} | [
0,
0
] |
Linux Kernel | drivers/acpi/device_sysfs.c |
static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
char *buf) {
return __acpi_device_modalias(to_acpi_device(dev), buf, 1024);
} | [
0,
0
] |
Linux Kernel | drivers/acpi/device_sysfs.c |
static ssize_t hid_show(struct device *dev, struct device_attribute *attr,
char *buf) {
struct acpi_device *acpi_dev = to_acpi_device(dev);
return sprintf(buf, "%s\n", acpi_device_hid(acpi_dev));
} | [
1,
0
] |
Linux Kernel | drivers/acpi/device_sysfs.c |
static ssize_t adr_show(struct device *dev, struct device_attribute *attr,
char *buf) {
struct acpi_device *acpi_dev = to_acpi_device(dev);
if (acpi_dev->pnp.bus_address > U32_MAX)
return sprintf(buf, "0x%016llx\n", acpi_dev->pnp.bus_address);
else
return sprintf(buf, "0x%08llx\n... | [
1,
0
] |
Linux Kernel | drivers/acpi/device_sysfs.c |
static ssize_t sun_show(struct device *dev, struct device_attribute *attr,
char *buf) {
struct acpi_device *acpi_dev = to_acpi_device(dev);
acpi_status status;
unsigned long long sun;
status = acpi_evaluate_integer(acpi_dev->handle, "_SUN", NULL, &sun);
if (ACPI_FAILURE(status))
... | [
1,
0
] |
Linux Kernel | drivers/acpi/device_sysfs.c |
static ssize_t hrv_show(struct device *dev, struct device_attribute *attr,
char *buf) {
struct acpi_device *acpi_dev = to_acpi_device(dev);
acpi_status status;
unsigned long long hrv;
status = acpi_evaluate_integer(acpi_dev->handle, "_HRV", NULL, &hrv);
if (ACPI_FAILURE(status))
... | [
1,
0
] |
Linux Kernel | drivers/acpi/dock.c | static int add_dock_dependent_device(struct dock_station *ds,
struct acpi_device *adev) {
struct dock_dependent_device *dd;
dd = kzalloc(sizeof(*dd), GFP_KERNEL);
if (!dd)
return -ENOMEM;
dd->adev = adev;
INIT_LIST_HEAD(&dd->list);
list_add_tail(&dd->list, &ds->dep... | [
0,
0
] |
Linux Kernel | drivers/acpi/dock.c |
static struct dock_station *find_dock_station(acpi_handle handle) {
struct dock_station *ds;
list_for_each_entry(ds, &dock_stations,
sibling) if (ds->handle == handle) return ds;
return NULL;
} | [
0,
0
] |
Linux Kernel | drivers/acpi/dock.c | int is_dock_device(struct acpi_device *adev) {
struct dock_station *dock_station;
if (!dock_station_count)
return 0;
if (acpi_dock_match(adev->handle))
return 1;
list_for_each_entry(
dock_station, &dock_stations,
sibling) if (find_dock_dependent_device(dock_station, adev)) return 1;
re... | [
0,
0
] |
Linux Kernel | drivers/acpi/dock.c | static int dock_present(struct dock_station *ds) {
unsigned long long sta;
acpi_status status;
if (ds) {
status = acpi_evaluate_integer(ds->handle, "_STA", NULL, &sta);
if (ACPI_SUCCESS(status) && sta)
return 1;
}
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/acpi/dock.c | static void hotplug_dock_devices(struct dock_station *ds, u32 event) {
struct dock_dependent_device *dd;
list_for_each_entry(dd, &ds->dependent_devices, list)
dock_hotplug_event(dd, event, DOCK_CALL_FIXUP);
/* Call driver specific hotplug functions. */
list_for_each_entry(dd, &ds->dependent_devices, lis... | [
0,
0
] |
Linux Kernel | drivers/acpi/dock.c | static void dock_event(struct dock_station *ds, u32 event, int num) {
struct device *dev = &ds->dock_device->dev;
char event_string[13];
char *envp[] = {event_string, NULL};
struct dock_dependent_device *dd;
if (num == UNDOCK_EVENT)
sprintf(event_string, "EVENT=undock");
else
sprintf(event_string, ... | [
1,
0
] |
Linux Kernel | drivers/acpi/dock.c |
static inline void undock(struct dock_station *ds) { handle_dock(ds, 0); } | [
0,
0
] |
Linux Kernel | drivers/acpi/dock.c |
static inline void begin_undock(struct dock_station *ds) {
ds->flags |= DOCK_UNDOCKING;
} | [
0,
0
] |
Linux Kernel | drivers/acpi/dock.c | static ssize_t docked_show(struct device *dev, struct device_attribute *attr,
char *buf) {
struct dock_station *dock_station = dev->platform_data;
struct acpi_device *adev = acpi_fetch_acpi_dev(dock_station->handle);
return sysfs_emit(buf, "%u\n", acpi_device_enumerated(adev));
} | [
0,
0
] |
Linux Kernel | drivers/acpi/dock.c | static ssize_t flags_show(struct device *dev, struct device_attribute *attr,
char *buf) {
struct dock_station *dock_station = dev->platform_data;
return sysfs_emit(buf, "%d\n", dock_station->flags);
} | [
0,
0
] |
Linux Kernel | drivers/acpi/dock.c | static ssize_t undock_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count) {
int ret;
struct dock_station *dock_station = dev->platform_data;
if (!count)
return -EINVAL;
acpi_scan_lock_acquire();
begin_undock(dock_station);
ret = handle_ej... | [
0,
0
] |
Linux Kernel | drivers/acpi/dock.c | static ssize_t uid_show(struct device *dev, struct device_attribute *attr,
char *buf) {
unsigned long long lbuf;
struct dock_station *dock_station = dev->platform_data;
acpi_status status =
acpi_evaluate_integer(dock_station->handle, "_UID", NULL, &lbuf);
if (ACPI_FAILURE(status))... | [
0,
0
] |
Linux Kernel | drivers/acpi/dock.c |
static ssize_t type_show(struct device *dev, struct device_attribute *attr,
char *buf) {
struct dock_station *dock_station = dev->platform_data;
char *type;
if (dock_station->flags & DOCK_IS_DOCK)
type = "dock_station";
else if (dock_station->flags & DOCK_IS_ATA)
type = "ata_b... | [
0,
0
] |
Linux Kernel | drivers/acpi/ec.c | static inline bool acpi_ec_gpe_status_set(struct acpi_ec *ec) {
acpi_event_status gpe_status = 0;
(void)acpi_get_gpe_status(NULL, ec->gpe, &gpe_status);
return !!(gpe_status & ACPI_EVENT_FLAG_STATUS_SET);
} | [
0,
0
] |
Linux Kernel | drivers/acpi/ec.c | static bool acpi_ec_submit_flushable_request(struct acpi_ec *ec) {
if (!acpi_ec_started(ec))
return false;
acpi_ec_submit_request(ec);
return true;
} | [
0,
0
] |
Linux Kernel | drivers/acpi/ec.c |
static void acpi_ec_close_event(struct acpi_ec *ec) {
if (ec->event_state != EC_EVENT_READY)
ec_dbg_evt("Command(%s) unblocked",
acpi_ec_cmd_string(ACPI_EC_COMMAND_QUERY));
ec->event_state = EC_EVENT_READY;
acpi_ec_unmask_events(ec);
} | [
0,
0
] |
Linux Kernel | drivers/acpi/ec.c | static inline void __acpi_ec_enable_event(struct acpi_ec *ec) {
if (!test_and_set_bit(EC_FLAGS_QUERY_ENABLED, &ec->flags))
ec_log_drv("event unblocked");
advance_transaction(ec, false);
} | [
0,
0
] |
Linux Kernel | drivers/acpi/ec.c |
static inline void __acpi_ec_disable_event(struct acpi_ec *ec) {
if (test_and_clear_bit(EC_FLAGS_QUERY_ENABLED, &ec->flags))
ec_log_drv("event blocked");
} | [
0,
0
] |
Linux Kernel | drivers/acpi/ec.c | static void acpi_ec_enable_event(struct acpi_ec *ec) {
unsigned long flags;
spin_lock_irqsave(&ec->lock, flags);
if (acpi_ec_started(ec))
__acpi_ec_enable_event(ec);
spin_unlock_irqrestore(&ec->lock, flags);
if (EC_FLAGS_CLEAR_ON_RESUME)
acpi_ec_clear(ec);
}
#ifdef CONFIG_PM_SLEEP | [
0,
0
] |
Linux Kernel | drivers/acpi/ec.c | static void acpi_ec_disable_event(struct acpi_ec *ec) {
unsigned long flags;
spin_lock_irqsave(&ec->lock, flags);
__acpi_ec_disable_event(ec);
spin_unlock_irqrestore(&ec->lock, flags);
__acpi_ec_flush_work();
} | [
0,
0
] |
Linux Kernel | drivers/acpi/ec.c | static void acpi_ec_spurious_interrupt(struct acpi_ec *ec,
struct transaction *t) {
if (t->irq_count < ec_storm_threshold)
++t->irq_count;
if (t->irq_count == ec_storm_threshold)
acpi_ec_mask_events(ec);
} | [
1,
0
] |
Linux Kernel | drivers/acpi/ec.c | static int ec_guard(struct acpi_ec *ec) {
unsigned long guard = usecs_to_jiffies(ec->polling_guard);
unsigned long timeout = ec->timestamp + guard;
do {
if (ec->busy_polling) {
/* Perform busy polling */
if (ec_transaction_completed(ec))
return 0;
udelay(jiffies_to_usecs(guard));
... | [
1,
0
] |
Linux Kernel | drivers/acpi/ec.c |
static int acpi_ec_burst_enable(struct acpi_ec *ec) {
u8 d;
struct transaction t = {.command = ACPI_EC_BURST_ENABLE,
.wdata = NULL,
.rdata = &d,
.wlen = 0,
.rlen = 1};
return acpi_ec_transaction(ec, &t);
} | [
0,
0
] |
Linux Kernel | drivers/acpi/ec.c |
static int acpi_ec_write(struct acpi_ec *ec, u8 address, u8 data) {
u8 wdata[2] = {address, data};
struct transaction t = {.command = ACPI_EC_COMMAND_WRITE,
.wdata = wdata,
.rdata = NULL,
.wlen = 2,
.rlen = 0};
... | [
0,
0
] |
Linux Kernel | drivers/acpi/ec.c | acpi_handle ec_get_handle(void) {
if (!first_ec)
return NULL;
return first_ec->handle;
} | [
0,
0
] |
Linux Kernel | drivers/acpi/ec.c | static void acpi_ec_start(struct acpi_ec *ec, bool resuming) {
unsigned long flags;
spin_lock_irqsave(&ec->lock, flags);
if (!test_and_set_bit(EC_FLAGS_STARTED, &ec->flags)) {
ec_dbg_drv("Starting EC");
if (!resuming) {
acpi_ec_submit_request(ec);
ec_dbg_ref(ec, "Increase driver");
}
... | [
0,
0
] |
Linux Kernel | drivers/acpi/ec.c |
static bool acpi_ec_stopped(struct acpi_ec *ec) {
unsigned long flags;
bool flushed;
spin_lock_irqsave(&ec->lock, flags);
flushed = acpi_ec_flushed(ec);
spin_unlock_irqrestore(&ec->lock, flags);
return flushed;
} | [
0,
0
] |
Linux Kernel | drivers/acpi/ec.c | void acpi_ec_block_transactions(void) {
struct acpi_ec *ec = first_ec;
if (!ec)
return;
mutex_lock(&ec->mutex);
acpi_ec_stop(ec, true);
mutex_unlock(&ec->mutex);
} | [
0,
0
] |
Linux Kernel | drivers/acpi/ec.c | static struct acpi_ec_query_handler *
acpi_ec_get_query_handler_by_value(struct acpi_ec *ec, u8 value) {
struct acpi_ec_query_handler *handler;
mutex_lock(&ec->mutex);
list_for_each_entry(handler, &ec->list, node) {
if (value == handler->query_bit) {
kref_get(&handler->kref);
mutex_unlock(&ec->mu... | [
0,
0
] |
Linux Kernel | drivers/acpi/ec.c |
static void acpi_ec_query_handler_release(struct kref *kref) {
struct acpi_ec_query_handler *handler =
container_of(kref, struct acpi_ec_query_handler, kref);
kfree(handler);
} | [
0,
0
] |
Linux Kernel | drivers/acpi/ec.c |
static struct acpi_ec_query *acpi_ec_create_query(struct acpi_ec *ec,
u8 *pval) {
struct acpi_ec_query *q;
struct transaction *t;
q = kzalloc(sizeof(struct acpi_ec_query), GFP_KERNEL);
if (!q)
return NULL;
INIT_WORK(&q->work, acpi_ec_event_processor);
... | [
0,
0
] |
Linux Kernel | drivers/acpi/ec.c |
static u32 acpi_ec_gpe_handler(acpi_handle gpe_device, u32 gpe_number,
void *data) {
acpi_ec_handle_interrupt(data);
return ACPI_INTERRUPT_HANDLED;
} | [
0,
0
] |
Linux Kernel | drivers/acpi/ec.c | static acpi_status acpi_ec_space_handler(u32 function,
acpi_physical_address address,
u32 bits, u64 *value64,
void *handler_context,
void *region_context) {... | [
1,
0
] |
Linux Kernel | drivers/acpi/ec.c |
static struct acpi_ec *acpi_ec_alloc(void) {
struct acpi_ec *ec = kzalloc(sizeof(struct acpi_ec), GFP_KERNEL);
if (!ec)
return NULL;
mutex_init(&ec->mutex);
init_waitqueue_head(&ec->wait);
INIT_LIST_HEAD(&ec->list);
spin_lock_init(&ec->lock);
INIT_WORK(&ec->work, acpi_ec_event_handler);
ec->timest... | [
0,
0
] |
Linux Kernel | drivers/acpi/ec.c | static acpi_status ec_parse_device(acpi_handle handle, u32 Level, void *context,
void **retval) {
acpi_status status;
unsigned long long tmp = 0;
struct acpi_ec *ec = context;
ec->command_addr = ec->data_addr = 0;
status = acpi_walk_resources(handle, METHOD_NAME__CRS, ec_p... | [
1,
1
] |
Linux Kernel | drivers/acpi/ec.c | static void ec_remove_handlers(struct acpi_ec *ec) {
if (test_bit(EC_FLAGS_EC_HANDLER_INSTALLED, &ec->flags)) {
if (ACPI_FAILURE(acpi_remove_address_space_handler(
ec->handle, ACPI_ADR_SPACE_EC, &acpi_ec_space_handler)))
pr_err("failed to remove space handler\n");
clear_bit(EC_FLAGS_EC_HANDL... | [
0,
0
] |
Linux Kernel | drivers/acpi/ec.c | void __init acpi_ec_dsdt_probe(void) {
struct acpi_ec *ec;
acpi_status status;
int ret;
if (boot_ec)
return;
ec = acpi_ec_alloc();
if (!ec)
return;
/*
* At this point, the namespace is initialized, so start to find
* the namespace objects.
*/
status = acpi_get_devices(ec_device_ids[0... | [
0,
0
] |
Linux Kernel | drivers/acpi/ec.c | void __init acpi_ec_ecdt_probe(void) {
struct acpi_table_ecdt *ecdt_ptr;
struct acpi_ec *ec;
acpi_status status;
int ret;
dmi_check_system(ec_dmi_table);
status =
acpi_get_table(ACPI_SIG_ECDT, 1, (struct acpi_table_header **)&ecdt_ptr);
if (ACPI_FAILURE(status))
return;
if (!ecdt_ptr->contro... | [
0,
0
] |
Linux Kernel | drivers/acpi/ec.c |
static int acpi_ec_resume(struct device *dev) {
struct acpi_ec *ec = acpi_driver_data(to_acpi_device(dev));
acpi_ec_enable_event(ec);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/acpi/ec.c |
static int param_get_event_clearing(char *buffer,
const struct kernel_param *kp) {
switch (ec_event_clearing) {
case ACPI_EC_EVT_TIMING_STATUS:
return sprintf(buffer, "status\n");
case ACPI_EC_EVT_TIMING_QUERY:
return sprintf(buffer, "query\n");
case ACPI_EC_EVT_TIMI... | [
1,
0
] |
Linux Kernel | drivers/acpi/ec_sys.c | static ssize_t acpi_ec_read_io(struct file *f, char __user *buf, size_t count,
loff_t *off) {
unsigned int size = EC_SPACE_SIZE;
loff_t init_off = *off;
int err = 0;
if (*off >= size)
return 0;
if (*off + count >= size) {
size -= *off;
count = size;
} else
si... | [
1,
0
] |
Linux Kernel | drivers/acpi/ec_sys.c |
static void acpi_ec_add_debugfs(struct acpi_ec *ec,
unsigned int ec_device_count) {
struct dentry *dev_dir;
char name[64];
umode_t mode = 0400;
if (ec_device_count == 0)
acpi_ec_debugfs_dir = debugfs_create_dir("ec", NULL);
sprintf(name, "ec%u", ec_device_count);
dev_d... | [
1,
0
] |
Linux Kernel | drivers/acpi/event.c | int acpi_bus_generate_netlink_event(const char *device_class,
const char *bus_id, u8 type, int data) {
struct sk_buff *skb;
struct nlattr *attr;
struct acpi_genl_event *event;
void *msg_header;
int size;
size = nla_total_size(sizeof(struct acpi_genl_event)) + nla_total_s... | [
1,
0
] |
Linux Kernel | drivers/acpi/event.c |
static int __init acpi_event_genetlink_init(void) {
return genl_register_family(&acpi_event_genl_family);
}
#else | [
0,
0
] |
Linux Kernel | drivers/acpi/fan_attr.c |
static ssize_t show_state(struct device *dev, struct device_attribute *attr,
char *buf) {
struct acpi_fan_fps *fps = container_of(attr, struct acpi_fan_fps, dev_attr);
int count;
if (fps->control == 0xFFFFFFFF || fps->control > 100)
count = scnprintf(buf, PAGE_SIZE, "not-defined:")... | [
1,
0
] |
Linux Kernel | drivers/acpi/fan_attr.c |
static ssize_t show_fan_speed(struct device *dev, struct device_attribute *attr,
char *buf) {
struct acpi_device *acpi_dev = container_of(dev, struct acpi_device, dev);
struct acpi_fan_fst fst;
int status;
status = acpi_fan_get_fst(acpi_dev, &fst);
if (status)
return status... | [
1,
0
] |
Linux Kernel | drivers/acpi/fan_attr.c |
void acpi_fan_delete_attributes(struct acpi_device *device) {
struct acpi_fan *fan = acpi_driver_data(device);
int i;
for (i = 0; i < fan->fps_count; ++i)
sysfs_remove_file(&device->dev.kobj, &fan->fps[i].dev_attr.attr);
sysfs_remove_file(&device->dev.kobj, &fan->fst_speed.attr);
sysfs_remove_file(&dev... | [
0,
0
] |
Linux Kernel | drivers/acpi/fan_core.c | static int fan_get_state_acpi4(struct acpi_device *device,
unsigned long *state) {
struct acpi_fan *fan = acpi_driver_data(device);
struct acpi_fan_fst fst;
int status, i;
status = acpi_fan_get_fst(device, &fst);
if (status)
return status;
if (fan->fif.fine_grain_ctrl) {... | [
0,
0
] |
Linux Kernel | drivers/acpi/fan_core.c | static int acpi_fan_get_fif(struct acpi_device *device) {
struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
struct acpi_fan *fan = acpi_driver_data(device);
struct acpi_buffer format = {sizeof("NNNN"), "NNNN"};
u64 fields[4];
struct acpi_buffer fif = {sizeof(fields), fields};
union acpi_object *obj;... | [
1,
0
] |
Linux Kernel | drivers/acpi/fan_core.c | static int acpi_fan_suspend(struct device *dev) {
struct acpi_fan *fan = dev_get_drvdata(dev);
if (fan->acpi4)
return 0;
acpi_device_set_power(ACPI_COMPANION(dev), ACPI_STATE_D0);
return AE_OK;
} | [
0,
0
] |
Linux Kernel | drivers/acpi/fan_core.c |
static int acpi_fan_resume(struct device *dev) {
int result;
struct acpi_fan *fan = dev_get_drvdata(dev);
if (fan->acpi4)
return 0;
result = acpi_device_update_power(ACPI_COMPANION(dev), NULL);
if (result)
dev_err(dev, "Error updating fan power state\n");
return result;
} | [
0,
0
] |
Linux Kernel | drivers/acpi/glue.c |
static bool acpi_dev_has_children(struct acpi_device *adev) {
return acpi_dev_for_each_child(adev, match_any, NULL) > 0;
} | [
0,
0
] |
Linux Kernel | drivers/acpi/glue.c |
struct acpi_device *acpi_find_child_by_adr(struct acpi_device *adev,
acpi_bus_address adr) {
return acpi_find_child(adev, adr, false, false);
} | [
0,
0
] |
Linux Kernel | drivers/acpi/hed.c |
int register_acpi_hed_notifier(struct notifier_block *nb) {
return blocking_notifier_chain_register(&acpi_hed_notify_list, nb);
} | [
0,
0
] |
Linux Kernel | drivers/acpi/hed.c | static int acpi_hed_add(struct acpi_device *device) {
if (hed_handle)
return -EINVAL;
hed_handle = device->handle;
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/acpi/internal.h | static inline void acpi_pci_root_init(void) {} | [
0,
0
] |
Linux Kernel | drivers/acpi/internal.h | static inline int acpi_ioapic_remove(struct acpi_pci_root *root) { return 0; }
#endif
#ifdef CONFIG_ACPI_DOCK | [
0,
0
] |
Linux Kernel | drivers/acpi/internal.h | static inline int dock_notify(struct acpi_device *adev, u32 event) {
return -ENODEV;
} | [
0,
0
] |
Linux Kernel | drivers/acpi/internal.h | static inline void acpi_debugfs_init(void) { return; }
#endif
#ifdef CONFIG_PCI | [
0,
0
] |
Linux Kernel | drivers/acpi/internal.h | static inline void acpi_early_processor_set_pdc(void) {}
#endif
#ifdef CONFIG_X86 | [
0,
0
] |
Linux Kernel | drivers/acpi/internal.h | static inline int acpi_sleep_init(void) { return -ENXIO; }
#endif
#ifdef CONFIG_ACPI_SLEEP | [
0,
0
] |
Linux Kernel | drivers/acpi/internal.h | static inline void suspend_nvs_free(void) {} | [
0,
0
] |
Linux Kernel | drivers/acpi/ioapic.c | static acpi_status setup_res(struct acpi_resource *acpi_res, void *data) {
struct resource *res = data;
struct resource_win win;
memset(&win, 0, sizeof(win));
res->flags = 0;
if (acpi_dev_filter_resource_type(acpi_res, IORESOURCE_MEM))
return AE_OK;
if (!acpi_dev_resource_memory(acpi_res, res)) {
... | [
1,
0
] |
Linux Kernel | drivers/acpi/ioapic.c |
void pci_ioapic_remove(struct acpi_pci_root *root) {
struct acpi_pci_ioapic *ioapic, *tmp;
mutex_lock(&ioapic_list_lock);
list_for_each_entry_safe(ioapic, tmp, &ioapic_list, list) {
if (root->device->handle != ioapic->root_handle)
continue;
if (ioapic->pdev) {
pci_release_region(ioapic->pdev... | [
1,
0
] |
Linux Kernel | drivers/acpi/irq.c | int acpi_register_gsi(struct device *dev, u32 gsi, int trigger, int polarity) {
struct irq_fwspec fwspec;
fwspec.fwnode = acpi_get_gsi_domain_id(gsi);
if (WARN_ON(!fwspec.fwnode)) {
pr_warn("GSI: No registered irqchip, giving up\n");
return -EINVAL;
}
fwspec.param[0] = gsi;
fwspec.param[1] = acpi_... | [
0,
0
] |
Linux Kernel | drivers/acpi/irq.c | static struct fwnode_handle *
acpi_get_irq_source_fwhandle(const struct acpi_resource_source *source,
u32 gsi) {
struct fwnode_handle *result;
struct acpi_device *device;
acpi_handle handle;
acpi_status status;
if (!source->string_length)
return acpi_get_gsi_domain_id(gsi);
... | [
0,
0
] |
Linux Kernel | drivers/acpi/irq.c | static acpi_status acpi_irq_parse_one_cb(struct acpi_resource *ares,
void *context) {
struct acpi_irq_parse_one_ctx *ctx = context;
struct acpi_resource_irq *irq;
struct acpi_resource_extended_irq *eirq;
struct fwnode_handle *fwnode;
switch (ares->type) {
case ACPI_... | [
1,
0
] |
Linux Kernel | drivers/acpi/irq.c | void __init acpi_set_gsi_to_irq_fallback(u32 (*fn)(u32)) {
acpi_gsi_to_irq_fallback = fn;
} | [
0,
0
] |
Linux Kernel | drivers/acpi/nfit/core.c | static const guid_t *to_nfit_bus_uuid(int family) {
if (WARN_ONCE(family == NVDIMM_BUS_FAMILY_NFIT,
"only secondary bus families can be translated\n"))
return NULL;
return to_nfit_uuid(family + NVDIMM_FAMILY_MAX);
} | [
0,
0
] |
Linux Kernel | drivers/acpi/nfit/core.c |
static int xlat_status(struct nvdimm *nvdimm, void *buf, unsigned int cmd,
u32 status) {
if (!nvdimm)
return xlat_bus_status(buf, cmd, status);
return xlat_nvdimm_status(nvdimm, buf, cmd, status);
} | [
0,
0
] |
Linux Kernel | drivers/acpi/nfit/core.c | static union acpi_object *pkg_to_buf(union acpi_object *pkg) {
int i;
void *dst;
size_t size = 0;
union acpi_object *buf = NULL;
if (pkg->type != ACPI_TYPE_PACKAGE) {
WARN_ONCE(1, "BIOS bug, unexpected element type: %d\n", pkg->type);
goto err;
}
for (i = 0; i < pkg->package.count; i++) {
un... | [
1,
0
] |
Linux Kernel | drivers/acpi/nfit/core.c |
static union acpi_object *acpi_label_info(acpi_handle handle) {
acpi_status rc;
struct acpi_buffer buf = {ACPI_ALLOCATE_BUFFER, NULL};
rc = acpi_evaluate_object(handle, "_LSI", NULL, &buf);
if (ACPI_FAILURE(rc))
return NULL;
return pkg_to_buf(buf.pointer);
} | [
0,
0
] |
Linux Kernel | drivers/acpi/nfit/core.c |
static bool payload_dumpable(struct nvdimm *nvdimm, unsigned int func) {
struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm);
if (nfit_mem && nfit_mem->family == NVDIMM_FAMILY_INTEL &&
func >= NVDIMM_INTEL_GET_SECURITY_STATE &&
func <= NVDIMM_INTEL_MASTER_SECURE_ERASE)
return IS_ENABLED(CONFI... | [
1,
0
] |
Linux Kernel | drivers/acpi/nfit/core.c |
static size_t sizeof_flush(struct acpi_nfit_flush_address *flush) {
if (flush->header.length < sizeof(*flush))
return 0;
return sizeof(*flush) + sizeof(u64) * (flush->hint_count - 1);
} | [
1,
0
] |
Linux Kernel | drivers/acpi/nfit/core.c |
static bool add_platform_cap(struct acpi_nfit_desc *acpi_desc,
struct acpi_nfit_capabilities *pcap) {
struct device *dev = acpi_desc->dev;
u32 mask;
mask = (1 << (pcap->highest_capability + 1)) - 1;
acpi_desc->platform_cap = pcap->capabilities & mask;
dev_dbg(dev, "cap: %#x\n", ... | [
1,
0
] |
Linux Kernel | drivers/acpi/nfit/core.c |
static void *add_table(struct acpi_nfit_desc *acpi_desc,
struct nfit_table_prev *prev, void *table,
const void *end) {
struct device *dev = acpi_desc->dev;
struct acpi_nfit_header *hdr;
void *err = ERR_PTR(-ENOMEM);
if (table >= end)
return NULL;
hdr = tabl... | [
0,
0
] |
Linux Kernel | drivers/acpi/nfit/core.c |
static int nfit_mem_cmp(void *priv, const struct list_head *_a,
const struct list_head *_b) {
struct nfit_mem *a = container_of(_a, typeof(*a), list);
struct nfit_mem *b = container_of(_b, typeof(*b), list);
u32 handleA, handleB;
handleA = __to_nfit_memdev(a)->device_handle;
handleB ... | [
0,
0
] |
Linux Kernel | drivers/acpi/nfit/core.c |
static ssize_t revision_show(struct device *dev, struct device_attribute *attr,
char *buf) {
struct nvdimm_bus *nvdimm_bus = to_nvdimm_bus(dev);
struct nvdimm_bus_descriptor *nd_desc = to_nd_desc(nvdimm_bus);
struct acpi_nfit_desc *acpi_desc = to_acpi_desc(nd_desc);
return sprintf... | [
1,
0
] |
Linux Kernel | drivers/acpi/nfit/core.c |
static ssize_t scrub_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t size) {
struct nvdimm_bus_descriptor *nd_desc;
ssize_t rc;
long val;
rc = kstrtol(buf, 0, &val);
if (rc)
return rc;
if (val != 1)
return -EINVAL;
device_lock(dev);
... | [
0,
0
] |
Linux Kernel | drivers/acpi/nfit/core.c |
static ssize_t phys_id_show(struct device *dev, struct device_attribute *attr,
char *buf) {
struct acpi_nfit_memory_map *memdev = to_nfit_memdev(dev);
return sprintf(buf, "%#x\n", memdev->physical_id);
} | [
1,
0
] |
Linux Kernel | drivers/acpi/nfit/core.c |
static ssize_t vendor_show(struct device *dev, struct device_attribute *attr,
char *buf) {
struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev);
return sprintf(buf, "0x%04x\n", be16_to_cpu(dcr->vendor_id));
} | [
1,
0
] |
Linux Kernel | drivers/acpi/nfit/core.c |
static ssize_t device_show(struct device *dev, struct device_attribute *attr,
char *buf) {
struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev);
return sprintf(buf, "0x%04x\n", be16_to_cpu(dcr->device_id));
} | [
1,
0
] |
Linux Kernel | drivers/acpi/nfit/core.c |
static ssize_t format_show(struct device *dev, struct device_attribute *attr,
char *buf) {
struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev);
return sprintf(buf, "0x%04x\n", le16_to_cpu(dcr->code));
} | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.