linux/drivers/acpi/power.c
<<
>>
Prefs
   1/*
   2 *  acpi_power.c - ACPI Bus Power Management ($Revision: 39 $)
   3 *
   4 *  Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
   5 *  Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
   6 *
   7 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   8 *
   9 *  This program is free software; you can redistribute it and/or modify
  10 *  it under the terms of the GNU General Public License as published by
  11 *  the Free Software Foundation; either version 2 of the License, or (at
  12 *  your option) any later version.
  13 *
  14 *  This program is distributed in the hope that it will be useful, but
  15 *  WITHOUT ANY WARRANTY; without even the implied warranty of
  16 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  17 *  General Public License for more details.
  18 *
  19 *  You should have received a copy of the GNU General Public License along
  20 *  with this program; if not, write to the Free Software Foundation, Inc.,
  21 *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  22 *
  23 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  24 */
  25
  26/*
  27 * ACPI power-managed devices may be controlled in two ways:
  28 * 1. via "Device Specific (D-State) Control"
  29 * 2. via "Power Resource Control".
  30 * This module is used to manage devices relying on Power Resource Control.
  31 * 
  32 * An ACPI "power resource object" describes a software controllable power
  33 * plane, clock plane, or other resource used by a power managed device.
  34 * A device may rely on multiple power resources, and a power resource
  35 * may be shared by multiple devices.
  36 */
  37
  38#include <linux/kernel.h>
  39#include <linux/module.h>
  40#include <linux/init.h>
  41#include <linux/types.h>
  42#include <linux/slab.h>
  43#include <linux/pm_runtime.h>
  44#include <linux/sysfs.h>
  45#include <acpi/acpi_bus.h>
  46#include <acpi/acpi_drivers.h>
  47#include "sleep.h"
  48#include "internal.h"
  49
  50#define PREFIX "ACPI: "
  51
  52#define _COMPONENT                      ACPI_POWER_COMPONENT
  53ACPI_MODULE_NAME("power");
  54#define ACPI_POWER_CLASS                "power_resource"
  55#define ACPI_POWER_DEVICE_NAME          "Power Resource"
  56#define ACPI_POWER_FILE_INFO            "info"
  57#define ACPI_POWER_FILE_STATUS          "state"
  58#define ACPI_POWER_RESOURCE_STATE_OFF   0x00
  59#define ACPI_POWER_RESOURCE_STATE_ON    0x01
  60#define ACPI_POWER_RESOURCE_STATE_UNKNOWN 0xFF
  61
  62struct acpi_power_dependent_device {
  63        struct list_head node;
  64        struct acpi_device *adev;
  65        struct work_struct work;
  66};
  67
  68struct acpi_power_resource {
  69        struct acpi_device device;
  70        struct list_head list_node;
  71        struct list_head dependent;
  72        char *name;
  73        u32 system_level;
  74        u32 order;
  75        unsigned int ref_count;
  76        bool wakeup_enabled;
  77        struct mutex resource_lock;
  78};
  79
  80struct acpi_power_resource_entry {
  81        struct list_head node;
  82        struct acpi_power_resource *resource;
  83};
  84
  85static LIST_HEAD(acpi_power_resource_list);
  86static DEFINE_MUTEX(power_resource_list_lock);
  87
  88/* --------------------------------------------------------------------------
  89                             Power Resource Management
  90   -------------------------------------------------------------------------- */
  91
  92static inline
  93struct acpi_power_resource *to_power_resource(struct acpi_device *device)
  94{
  95        return container_of(device, struct acpi_power_resource, device);
  96}
  97
  98static struct acpi_power_resource *acpi_power_get_context(acpi_handle handle)
  99{
 100        struct acpi_device *device;
 101
 102        if (acpi_bus_get_device(handle, &device))
 103                return NULL;
 104
 105        return to_power_resource(device);
 106}
 107
 108static int acpi_power_resources_list_add(acpi_handle handle,
 109                                         struct list_head *list)
 110{
 111        struct acpi_power_resource *resource = acpi_power_get_context(handle);
 112        struct acpi_power_resource_entry *entry;
 113
 114        if (!resource || !list)
 115                return -EINVAL;
 116
 117        entry = kzalloc(sizeof(*entry), GFP_KERNEL);
 118        if (!entry)
 119                return -ENOMEM;
 120
 121        entry->resource = resource;
 122        if (!list_empty(list)) {
 123                struct acpi_power_resource_entry *e;
 124
 125                list_for_each_entry(e, list, node)
 126                        if (e->resource->order > resource->order) {
 127                                list_add_tail(&entry->node, &e->node);
 128                                return 0;
 129                        }
 130        }
 131        list_add_tail(&entry->node, list);
 132        return 0;
 133}
 134
 135void acpi_power_resources_list_free(struct list_head *list)
 136{
 137        struct acpi_power_resource_entry *entry, *e;
 138
 139        list_for_each_entry_safe(entry, e, list, node) {
 140                list_del(&entry->node);
 141                kfree(entry);
 142        }
 143}
 144
 145int acpi_extract_power_resources(union acpi_object *package, unsigned int start,
 146                                 struct list_head *list)
 147{
 148        unsigned int i;
 149        int err = 0;
 150
 151        for (i = start; i < package->package.count; i++) {
 152                union acpi_object *element = &package->package.elements[i];
 153                acpi_handle rhandle;
 154
 155                if (element->type != ACPI_TYPE_LOCAL_REFERENCE) {
 156                        err = -ENODATA;
 157                        break;
 158                }
 159                rhandle = element->reference.handle;
 160                if (!rhandle) {
 161                        err = -ENODEV;
 162                        break;
 163                }
 164                err = acpi_add_power_resource(rhandle);
 165                if (err)
 166                        break;
 167
 168                err = acpi_power_resources_list_add(rhandle, list);
 169                if (err)
 170                        break;
 171        }
 172        if (err)
 173                acpi_power_resources_list_free(list);
 174
 175        return err;
 176}
 177
 178static int acpi_power_get_state(acpi_handle handle, int *state)
 179{
 180        acpi_status status = AE_OK;
 181        unsigned long long sta = 0;
 182        char node_name[5];
 183        struct acpi_buffer buffer = { sizeof(node_name), node_name };
 184
 185
 186        if (!handle || !state)
 187                return -EINVAL;
 188
 189        status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
 190        if (ACPI_FAILURE(status))
 191                return -ENODEV;
 192
 193        *state = (sta & 0x01)?ACPI_POWER_RESOURCE_STATE_ON:
 194                              ACPI_POWER_RESOURCE_STATE_OFF;
 195
 196        acpi_get_name(handle, ACPI_SINGLE_NAME, &buffer);
 197
 198        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] is %s\n",
 199                          node_name,
 200                                *state ? "on" : "off"));
 201
 202        return 0;
 203}
 204
 205static int acpi_power_get_list_state(struct list_head *list, int *state)
 206{
 207        struct acpi_power_resource_entry *entry;
 208        int cur_state;
 209
 210        if (!list || !state)
 211                return -EINVAL;
 212
 213        /* The state of the list is 'on' IFF all resources are 'on'. */
 214        list_for_each_entry(entry, list, node) {
 215                struct acpi_power_resource *resource = entry->resource;
 216                acpi_handle handle = resource->device.handle;
 217                int result;
 218
 219                mutex_lock(&resource->resource_lock);
 220                result = acpi_power_get_state(handle, &cur_state);
 221                mutex_unlock(&resource->resource_lock);
 222                if (result)
 223                        return result;
 224
 225                if (cur_state != ACPI_POWER_RESOURCE_STATE_ON)
 226                        break;
 227        }
 228
 229        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource list is %s\n",
 230                          cur_state ? "on" : "off"));
 231
 232        *state = cur_state;
 233        return 0;
 234}
 235
 236static void acpi_power_resume_dependent(struct work_struct *work)
 237{
 238        struct acpi_power_dependent_device *dep;
 239        struct acpi_device_physical_node *pn;
 240        struct acpi_device *adev;
 241        int state;
 242
 243        dep = container_of(work, struct acpi_power_dependent_device, work);
 244        adev = dep->adev;
 245        if (acpi_power_get_inferred_state(adev, &state))
 246                return;
 247
 248        if (state > ACPI_STATE_D0)
 249                return;
 250
 251        mutex_lock(&adev->physical_node_lock);
 252
 253        list_for_each_entry(pn, &adev->physical_node_list, node)
 254                pm_request_resume(pn->dev);
 255
 256        list_for_each_entry(pn, &adev->power_dependent, node)
 257                pm_request_resume(pn->dev);
 258
 259        mutex_unlock(&adev->physical_node_lock);
 260}
 261
 262static int __acpi_power_on(struct acpi_power_resource *resource)
 263{
 264        acpi_status status = AE_OK;
 265
 266        status = acpi_evaluate_object(resource->device.handle, "_ON", NULL, NULL);
 267        if (ACPI_FAILURE(status))
 268                return -ENODEV;
 269
 270        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Power resource [%s] turned on\n",
 271                          resource->name));
 272
 273        return 0;
 274}
 275
 276static int acpi_power_on_unlocked(struct acpi_power_resource *resource)
 277{
 278        int result = 0;
 279
 280        if (resource->ref_count++) {
 281                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
 282                                  "Power resource [%s] already on\n",
 283                                  resource->name));
 284        } else {
 285                result = __acpi_power_on(resource);
 286                if (result) {
 287                        resource->ref_count--;
 288                } else {
 289                        struct acpi_power_dependent_device *dep;
 290
 291                        list_for_each_entry(dep, &resource->dependent, node)
 292                                schedule_work(&dep->work);
 293                }
 294        }
 295        return result;
 296}
 297
 298static int acpi_power_on(struct acpi_power_resource *resource)
 299{
 300        int result;
 301
 302        mutex_lock(&resource->resource_lock);
 303        result = acpi_power_on_unlocked(resource);
 304        mutex_unlock(&resource->resource_lock);
 305        return result;
 306}
 307
 308static int __acpi_power_off(struct acpi_power_resource *resource)
 309{
 310        acpi_status status;
 311
 312        status = acpi_evaluate_object(resource->device.handle, "_OFF",
 313                                      NULL, NULL);
 314        if (ACPI_FAILURE(status))
 315                return -ENODEV;
 316
 317        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Power resource [%s] turned off\n",
 318                          resource->name));
 319        return 0;
 320}
 321
 322static int acpi_power_off_unlocked(struct acpi_power_resource *resource)
 323{
 324        int result = 0;
 325
 326        if (!resource->ref_count) {
 327                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
 328                                  "Power resource [%s] already off\n",
 329                                  resource->name));
 330                return 0;
 331        }
 332
 333        if (--resource->ref_count) {
 334                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
 335                                  "Power resource [%s] still in use\n",
 336                                  resource->name));
 337        } else {
 338                result = __acpi_power_off(resource);
 339                if (result)
 340                        resource->ref_count++;
 341        }
 342        return result;
 343}
 344
 345static int acpi_power_off(struct acpi_power_resource *resource)
 346{
 347        int result;
 348
 349        mutex_lock(&resource->resource_lock);
 350        result = acpi_power_off_unlocked(resource);
 351        mutex_unlock(&resource->resource_lock);
 352        return result;
 353}
 354
 355static int acpi_power_off_list(struct list_head *list)
 356{
 357        struct acpi_power_resource_entry *entry;
 358        int result = 0;
 359
 360        list_for_each_entry_reverse(entry, list, node) {
 361                result = acpi_power_off(entry->resource);
 362                if (result)
 363                        goto err;
 364        }
 365        return 0;
 366
 367 err:
 368        list_for_each_entry_continue(entry, list, node)
 369                acpi_power_on(entry->resource);
 370
 371        return result;
 372}
 373
 374static int acpi_power_on_list(struct list_head *list)
 375{
 376        struct acpi_power_resource_entry *entry;
 377        int result = 0;
 378
 379        list_for_each_entry(entry, list, node) {
 380                result = acpi_power_on(entry->resource);
 381                if (result)
 382                        goto err;
 383        }
 384        return 0;
 385
 386 err:
 387        list_for_each_entry_continue_reverse(entry, list, node)
 388                acpi_power_off(entry->resource);
 389
 390        return result;
 391}
 392
 393static void acpi_power_add_dependent(struct acpi_power_resource *resource,
 394                                     struct acpi_device *adev)
 395{
 396        struct acpi_power_dependent_device *dep;
 397
 398        mutex_lock(&resource->resource_lock);
 399
 400        list_for_each_entry(dep, &resource->dependent, node)
 401                if (dep->adev == adev)
 402                        goto out;
 403
 404        dep = kzalloc(sizeof(*dep), GFP_KERNEL);
 405        if (!dep)
 406                goto out;
 407
 408        dep->adev = adev;
 409        INIT_WORK(&dep->work, acpi_power_resume_dependent);
 410        list_add_tail(&dep->node, &resource->dependent);
 411
 412 out:
 413        mutex_unlock(&resource->resource_lock);
 414}
 415
 416static void acpi_power_remove_dependent(struct acpi_power_resource *resource,
 417                                        struct acpi_device *adev)
 418{
 419        struct acpi_power_dependent_device *dep;
 420        struct work_struct *work = NULL;
 421
 422        mutex_lock(&resource->resource_lock);
 423
 424        list_for_each_entry(dep, &resource->dependent, node)
 425                if (dep->adev == adev) {
 426                        list_del(&dep->node);
 427                        work = &dep->work;
 428                        break;
 429                }
 430
 431        mutex_unlock(&resource->resource_lock);
 432
 433        if (work) {
 434                cancel_work_sync(work);
 435                kfree(dep);
 436        }
 437}
 438
 439static struct attribute *attrs[] = {
 440        NULL,
 441};
 442
 443static struct attribute_group attr_groups[] = {
 444        [ACPI_STATE_D0] = {
 445                .name = "power_resources_D0",
 446                .attrs = attrs,
 447        },
 448        [ACPI_STATE_D1] = {
 449                .name = "power_resources_D1",
 450                .attrs = attrs,
 451        },
 452        [ACPI_STATE_D2] = {
 453                .name = "power_resources_D2",
 454                .attrs = attrs,
 455        },
 456        [ACPI_STATE_D3_HOT] = {
 457                .name = "power_resources_D3hot",
 458                .attrs = attrs,
 459        },
 460};
 461
 462static struct attribute_group wakeup_attr_group = {
 463        .name = "power_resources_wakeup",
 464        .attrs = attrs,
 465};
 466
 467static void acpi_power_hide_list(struct acpi_device *adev,
 468                                 struct list_head *resources,
 469                                 struct attribute_group *attr_group)
 470{
 471        struct acpi_power_resource_entry *entry;
 472
 473        if (list_empty(resources))
 474                return;
 475
 476        list_for_each_entry_reverse(entry, resources, node) {
 477                struct acpi_device *res_dev = &entry->resource->device;
 478
 479                sysfs_remove_link_from_group(&adev->dev.kobj,
 480                                             attr_group->name,
 481                                             dev_name(&res_dev->dev));
 482        }
 483        sysfs_remove_group(&adev->dev.kobj, attr_group);
 484}
 485
 486static void acpi_power_expose_list(struct acpi_device *adev,
 487                                   struct list_head *resources,
 488                                   struct attribute_group *attr_group)
 489{
 490        struct acpi_power_resource_entry *entry;
 491        int ret;
 492
 493        if (list_empty(resources))
 4=acpi_device" class="sreturn;
 3949/a>
 3949/a>        ret;
 atsfs_recrea_group" a>(&adev->dev.kobj, attr_group);
 39497a>        if (ret;
 3949/a>                  turn;
 394
 405        list_for_each_entry(entry, resources, node) {
 405                ifruct acpi_device *res_dev = &entry->resource->device;
 4050/a>
 4050/a>                .< href="+code=lit" class="sref">ret;
 atsfs_red_tank_frtoroup" a>(&adev->dev.kobj,  4050/a>                                     st       .< href="+code=litr_group" class="sref">attr_group->name,
 4050/a>                .<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<res_dev->dev))a href="+code=kobj" class="sref">kobj,  405                go                   st       .< href="+code=liv_name" class="sref">dev_name(&res_dev->dev));
 4050/a>                   (ret;
<
 4050/a>                           href="+code=acpi_power_hide_list" class="sref">acpi_power_hide_list(st href="+code=adev" class="sref">adev,
resources, attr_group);
 4050/a>                          eak;
 4151/a>                   4151/a>        }
 4151/a>}
 4151/a>
 4151/a>static inid acpi_power_expose_lide_la>(struct acpi_device *adev,
 4151/a>                .<<<<<<<<<<<<<<<<<<<list_head *resources,
 4151/a>                go                   ruct attribute_group *attr_group)
 415                                      href="+code=atboo class="sref">liboo a>    href="+code=entose_lclass="sref">entose_la>;
 415{
entose_la>;
 4252/a>                   href="+code=acpi_power_expose_list" class="sref">acpi_power_expose_list(st href="+code=adev" class="sref">adev,
resources, attr_group);
 4252/a>        }
se {a href="drivers/acpi/power.c#L485" id="L415" class="line" name="L425"> 4252/a>                   href="+code=acpi_power_hide_list" class="sref">acpi_power_hide_list(st href="+code=adev" class="sref">adev,
resources, attr_group);
 4252/a>}
 4252/a>
 425  id acpi_power_ded_demove_depece" a>(struct acpi_device *adev,
<  href="+code=atboo class="sref">liboo a>    href="+code=end_dclass="sref">adevda>;
 4252/a>{
 4252/a>        struct acpi_device *at[] 425          ruct acpi_power_resource_entry *entry;
 425          t acatic a> * 435
 435        adev->adkeup&qa>))a href="+code=koflag class="sref">atflag a>))a href="+code=kovalidclass="sref">advalida>;
 4353/a>                   href="+code=acpi_power_hipose_lide_lclass="sref">acpi_power_expose_lide_la>(st href="+code=adev" class="sref">adev,
< mp;adev->adkeup&qa>))a href="+code=kosources" class="sref">resources,
 4353/a>                .<<<<<<<<<<<<<<<<<<<<<<<wakeup_attr_group =adevda>;
< 4353/a>
 435           (!adev->at))a href="+code=koflag class="sref">atflag a>))a href="+code=kower_resources_wclass="sref">at))
a href="drivers/acpi/power.c#L355" id="L415" class="line" name="L435"> 4353/a>                goturn;
 4353/a>
 4353/a>        at[] &adev->at))a href="+code=koatic  class="sref">atatic  a>))a href="+code=ACPI_STATE_D0" class="sref">ACPI_STATE_D0] = 4353/a>        list_for_each_entry(entry, at[]gt;resources, node) {
 4454/a>                  ruct acpi_power_resource *resource,
 entry->resource-& 4454/a>
 4454/a>                if (adevda>;
 4454/a>                .<<<<<<<<< href="+code=acpi_power_add_dependent" class="sref">acpi_power_add_dependent(st href="+code=resource" class="sref">resource-&adev) { 4454/a>                  se {a href="drivers/acpi/power.c#L485" id="L445" class="line" name="L445"> 445                .<<<<<<<<< href="+code=acpi_power_admove_dependent" class="sref">acpi_power_remove_dependent(st href="+code=resource" class="sref">resource-&adev) { 445           4454/a>
 445        [acatic a> * ACPI_STATE_D0] ;a href="+code=reatic class="sref">acatic a> * <ACPI_STATE_D3_HOT] ;a href="+code=reatic class="sref">acatic a> *++ 445                .< href="+code=acpi_power_hipose_lide_lclass="sref">acpi_power_expose_lide_la>(st href="+code=adev" class="sref">adev,
 455                .<<<<<<<<<<<<<<<<<<<<<<<adev->at))a href="+code=koatic  class="sref">atatic  a>))a href="+code=ACatic class="sref">acatic a> *]a href="+code=kosources" class="sref">resources,
 4555/a>                                         mp;attr_groups[]  href="+code=ACatic class="sref">acatic a> *]adevda>;
< 4555/a>}
 4555/a>
 455  t acpi_power_rekeup_atst_foini a>(struct list_head *list, atsfstem_level_ a>;
 4555/a>{
 455        [acpi_power_resource_entry *entry;
 455          t atsfstem_levela> *  4555/a>
 4555/a>        list_for_each_entry(entry, list, node) {
 4656/a>                  ruct acpi_power_resource *resource,
 entry->resource-& 4656/a>                   href="+code=acpi_pohandl class="sref">acpi_pohandl a>    href="+code=enhandl class="sref">achandl a>   resource->device;
a href="+code=kohandl class="sref">achandl a>   4656/a>                if  result;
 4656/a>                .acatic a> * 4656/a>
 4656/a>                mutex_lock(&resource->resource_lock);
 465
 4656/a>                   href="+code=ret"lt" class="sref">result;
 acpi_dewer_regeteatic a>(achandl a>  acatic a> *
 465                   (result;
{
 465                           href="+code=kftex_lolock" class="sref">mutex_unlock(&resource->resource_lock);
 4757/a>                .<<<<<<<<result;
 4757/a>                   4757/a>                if (acatic a> * <ACPI_STPOWER_RESOURCETATE_D3ONa>;
{
 4757/a>                .<<<<<<<<< href="+code=acsource" class="sref">resource->acsof_cou" a> *++ 475                re<<<<<<<< href="+code=acsource" class="sref">resource->likeup_atenable a>;
 reuct a>;
 4757/a>                 4757/a>                go (atsfstem_levela> * t;resource->atsfstem_levela> * 475                st<<<<<<<< href="+code=acafstem_levelclass="sref">atsfstem_levela> * resource->atsfstem_levela> * 475
 475                mutex_unlock(&resource->resource_lock);
 485           485          a href="+code=resystem_level_ class="sref">atsfstem_level_ a>;
 atsfstem_levela> * 485        }
turn;
a0 4858/a>}
 4858/a>
 485
/* --------------------------------------------------------------------------span>,
a href="drivers/acpi/power.c#L355" id="L465" class="line" name="L485"> 485stpan class="stcommt" c>              st<<<<<<<<<<<<an>,
a href="drivers/acpi/power.c#L355" id="L475" class="line" name="L485"> 485  pan class="stcommt" c>   -------------------------------------------------------------------------- */a>an>,
a href="drivers/acpi/power.c#L355" id="L445" class="line" name="L485"> 4858/a>
 485{
pan class="stcommt" c>/**a>an>,
a href="drivers/acpi/power.c#L355" id="L495" class="line" name="L495"> 495  pan class="stcommt" c> * pi_devicean>,
a href="drivers/acpi/power.c#L355" id="L485" class="line" name="L495"> 495  pan class="stcommt" c> *                          PI_S 3.0) _PSW (Per.c Stic  Weup)a>an>,
a href="drivers/acpi/power.c#L355" id="L485" class="line" name="L495"> 495
 * @vic:an>,
a href="drivers/acpi/power.c#L355" id="L475" class="line" name="L495"> 495  pan class="stcommt" c> * @enable: 0 - disable, 1 - enable the keup capabilities of the vicean>,
a href="drivers/acpi/power.c#L355" id="L485" class="line" name="L495"> 4=5cpi_depan class="stcommt" c> * @sleepeatic : Target sleep atic  of the sfstem.a>an>,
a href="drivers/acpi/power.c#L355" id="L485" class="line" name="L395"> 3959/a>
 * @viceatic : Target wer.c atic  of the vicean>,
a href="drivers/acpi/power.c#L355" id="L465" class="line" name="L395"> 3959/a>stpan class="stcommt" c> *a>an>,
a href="drivers/acpi/power.c#L355" id="L475" class="line" name="L395"> 3959/a>  pan class="stcommt" c> * Execex_ _DSW (Dicean>,
a href="drivers/acpi/power.c#L355" id="L445" class="line" name="L395"> 3959/a>  pan class="stcommt" c> * Stic  Weup)an>,
a href="drivers/acpi/power.c#L355" id="L485" class="line" name="L395"> 3959/a>{
pan class="stcommt" c> * keup_a.flag .valid flag.a>an>,
a href="drivers/acpi/power.c#L356" id="L406" class="line" name="L406"> 4060/a>  pan class="stcommt" c> *a>an>,
a href="drivers/acpi/power.c#L356"1id="L406" class="line" name="L496"> 4060/a>  pan class="stcommt" c> * RETURN VALUE:a>an>,
a href="drivers/acpi/power.c#L356"2id="L406" class="line" name="L496"> 4060/a>
 * 0o (an>,
a href="drivers/acpi/power.c#L356"3id="L406" class="line" name="L496"> 4060/a>  pan class="stcommt" c> * 0o (an>,
a href="drivers/acpi/power.c#L356"4id="L406" class="line" name="L496"> 4060pi_depan class="stcommt" c> * -ENODEVo (an>,
a href="drivers/acpi/power.c#L356"5id="L406" class="line" name="L396"> 4060/a>
 */a>an>,
a href="drivers/acpi/power.c#L356"6id="L406" class="line" name="L396"> 406  t acpi_device(struct acpi_device *dev)) 4060/a>                             t entrablea>, atsleepeatic a>, dev,  4060/a>{
 4060/a>          union  href="+code=acpi_deobjec class="sref">acpi_poobjec a>    href="+code=enin_argclass="sref">acin_arga>[] 3= 4161/a>        struct acpi_poobjec ist" a>    href="+code=enargist" class="sref">acprgist" a>;
 acin_arga>[] 
 4161/a>        atti_poaticu a>    href="+code=enaticu class="sref">ataticu a>   ACPE_OKa> * 4161/a>
 4161/a>        /*a>an>,
a href="drivers/acpi/power.c#L356" id="L416" class="line" name="L416"> 4161pi_depan class="stcommt" c>         a Try to execex_ _DSW first.a>an>,
a href="drivers/acpi/power.c#L356" id="L416" class="line" name="L416"> 4161/a>
         a >an>,
a href="drivers/acpi/power.c#L356"6id="L406" class="line" name="L416"> 4161/a>stpan class="stcommt" c>         a Tef=e agrumt" s are need d r_ean>,
a href="drivers/acpi/power.c#L356" id="L406" class="line" name="L416"> 4161/a>  pan class="stcommt" c>         a Argumt"  0: enable/disable the keup capabilitiesa>an>,
a href="drivers/acpi/power.c#L356"8id="L406" class="line" name="L416"> 4161/a>  pan class="stcommt" c>         a Argumt"  1: target sfstem atic a>an>,
a href="drivers/acpi/power.c#L356" id="L406" class="line" name="L416power61/a>{
pan class="stcommt" c>         a Argumt"  2: target vicean>,
a href="drivers/acpi/power.c#L356" id="L426" class="line" name="L426"> 4262/a>  pan class="stcommt" c>         a When _DSW _bjec  is call_d to disable the keup capabilities, mayb a>an>,
a href="drivers/acpi/power.c#L356" id="L416" class="line" name="L426"> 4262/a>  pan class="stcommt" c>         a the first argumt"  is fill_d. Tee values of the other two agrumt" sa>an>,
a href="drivers/acpi/power.c#L356" id="L416" class="line" name="L426"> 4262/a>
         a are meaningless.a>an>,
a href="drivers/acpi/power.c#L356" id="L416" class="line" name="L426"> 4262/a>  pan class="stcommt" c>         a/a>an>,
a href="drivers/acpi/power.c#L356" id="L426" class="line" name="L426"> 42624a>        acin_arga>[] 0]a href="+code=kotyp class="sref">reuyp a>   ACPI_STTYPE_INTEGERa> * 42625a>        acin_arga>[] 0]a href="+code=kot att ;
a href="+code=kovalueclass="sref">atvaluea>,
 entrablea>,  4262/a>        acin_arga>[] 1]a href="+code=kotyp class="sref">reuyp a>   ACPI_STTYPE_INTEGERa> * 4262/a>        st href="+code=liin_argclass="sref">acin_arga>[] 1]a href="+code=kot att ;
a href="+code=kovalueclass="sref">atvaluea>,
 atsleepeatic a>,  4262/a>        acin_arga>[] 2]a href="+code=kotyp class="sref">reuyp a>   ACPI_STTYPE_INTEGERa> * 4262/a>        acin_arga>[] 2]a href="+code=kot att ;
a href="+code=kovalueclass="sref">atvaluea>,
 dev,  4363/a>        ataticu a>   acpi_poevalua_grobjec a>(dev))gt;achandl a>  "po_DSWuot;,
< mp;acprgist" a>;
acNULLa>);
 436        ACPI_STAUCCESSa>(ataticu a>  ){
 4363/a>                  turn;
a0 4363/a>          } se {f (ataticu a>   !ACPE_NOT_FOUNDa>;
{
 4363/a>                re href="+code=atpng"t class="sref">repng"t a>(ACKERN_ERRa>    href="+code=enPREFIXclass="sref">ACPREFIXa>    an class="string">"po_DSW execexion fail_d\nuot;,

 4363/a>                dev))gt;adkeup&qa>))a href="+code=koflag class="sref">atflag a>))a href="+code=kovalidclass="sref">advalida>;
  4363/a>                goturn;
 - href="+code=koENODEVclass="sref">adENODEVa>,  4363/a>        st 4363/a>
 4363/a>        /* Execex_ _PSW a/a>an>,
a href="drivers/acpi/power.c#L356" id="L446" class="line" name="L446"> 4464/a>        acprgist" a>;
a href="+code=kocou" class="sref">accou" a> *  4464/a>        acin_arga>[] 0]a href="+code=kot att ;
a href="+code=kovalueclass="sref">atvaluea>,
 entrablea>,  4464/a>           href="+code=liaticu class="sref">ataticu a>   acpi_poevalua_grobjec a>(dev))gt;achandl a>  "po_PSWuot;,
< mp;acprgist" a>;
acNULLa>);
 4464/a>           (ACPI_STFAILUREa>(ataticu a>  ) mp;ataticu a>   !ACPE_NOT_FOUNDa>;
{{
 4464/a>                   href="+code=atpng"t class="sref">repng"t a>(ACKERN_ERRa>    href="+code=enPREFIXclass="sref">ACPREFIXa>    an class="string">"po_PSW execexion fail_d\nuot;,

 446                .< href="+code=env" class="sref">dev))gt;adkeup&qa>))a href="+code=koflag class="sref">atflag a>))a href="+code=kovalidclass="sref">advalida>;
  4464/a>                goturn;
 - href="+code=koENODEVclass="sref">adENODEVa>,  4464/a>        st 4464/a>
 446          turn;
a0 456   4565/a>
 4565/a>
/*a>an>,
a href="drivers/acpi/power.c#L356" id="L456" class="line" name="L456"> 4565/a>  pan class="stcommt" c> * Prepare a keup_a vicean>,
a href="drivers/acpi/power.c#L356" id="L456" class="line" name="L456"> 4565pi_depan class="stcommt" c> * 1. Per.c on the wer.c sourcesan>,
a href="drivers/acpi/power.c#L356" id="L446" class="line" name="L456"> 4565/a>
 * 2. Execex_ _DSW (Dicean>,
a href="drivers/acpi/power.c#L356" id="L456" class="line" name="L456"> 4565/a>stpan class="stcommt" c> *    Stic  Weup)an>,
a href="drivers/acpi/power.c#L356" id="L446" class="line" name="L456"> 4565/a>  pan class="stcommt" c> */a>an>,
a href="drivers/acpi/power.c#L356" id="L446" class="line" name="L456"> 4565/a>
acpi_poerableekeup_atvice(acpi_device *dev))atsleepeatic a>,  4565/a>{
 4666/a>        struct acpi_power_resource_entry *entry;
 4666/a>        int acerda>;
  4666/a>
 4666/a>           (dev)) || a href="+code=dev" class="sref">dev))gt;adkeup&qa>))a href="+code=koflag class="sref">atflag a>))a href="+code=kovalidclass="sref">advalida>;
 4666pi_device" class="sreturn;
 - href="+code=koEINVALclass="sref">acEINVALa>;
 4666/a>
 4666/a>        mutex_lock(&mupi_device);
 4666/a>
 466           (dev))gt;adkeup&qa>))a href="+code=koprepare_cou" class="sref">acprepare_cou" a>))++ 466                  gotoa href="+code=liou class="sref">acou a>;
 4767/a>
 4767/a>        list_for_each_entry(entry, dev))gt;adkeup&qa>))a href="+code=kosource"  class="sref">resources, node) {
 4767/a>                ifruct acpi_power_resource *resource,
 entry->resource-& 4767/a>
 476                re href="+code=litex_lock" class="sref">mutex_lock(&resource->resource_lock);
 4767/a>
 4767/a>                go (resource->likeup_atenable a>;
{
 476                st<<<<<<<< href="+code=acerdclass="sref">acerda>;
 lipi_power_reonnlock(resource-&
 4767/a>                           (acerda>;
 476                resource->likeup_atenable a>;
 reuct a>;
 4868/a>                .< 4868/a>
 4868/a>                if href="+code=litex_lolock" class="sref">mutex_unlock(&resource->resource_lock);
 4868/a>
 4868/a>                re (acerda>;
<
 4868/a>                .<<<<<<<<< href="+code=acvacv(&dev))gt;dev)) 4868/a>                go                 an class="string">"poCannot rn;
 keup_a wer.c sources,

 4868/a>                st<<<<<<<< href="+code=acv" class="sref">dev))gt;adkeup&qa>))a href="+code=koflag class="sref">atflag a>))a href="+code=kovalidclass="sref">advalida>;
  4868/a>                          gotoa href="+code=liou class="sref">acou a>;
 4868/a>                 4969/a>           4969/a>        /*a>an>,
a href="drivers/acpi/power.c#L356" id="L486" class="line" name="L496"> 496
         * Ps="g"> 3 asan>,
a href="drivers/acpi/power.c#L356" id="L476" class="line" name="L496"> 496  pan class="stcommt" c>         * putnt an>,
a href="drivers/acpi/power.c#L356" id="L486" class="line" name="L496"> 4=6cpi_depan class="stcommt" c>         */a>an>,
a href="drivers/acpi/power.c#L356" id="L486" class="line" name="L396"> 39695a>        acerda>;
 acpi_device(st href="+code=adv" class="sref">dev))atsleepeatic a>,  3969/a>           (acerda>;
 3969/a>                   href="+code=rev" class="sref">dev))gt;adkeup&qa>))a href="+code=koprepare_cou" class="sref">acprepare_cou" a>))  3969/a>
 3969/a>{
a href="+code=liou class="sref">acou a>;
:a href="drivers/acpi/power.c#L477" id="L407" class="line" name="L407"> 4070/a>        mutex_unlock(&mupi_device);
 4070/a>        acerda>;
 4070/a>}
 4070/a>
 4070pi_depan class="stcommt" c>/*a>an>,
a href="drivers/acpi/power.c#L357"5id="L407" class="line" name="L397"> 4070/a>
 * Shutdown a keup_a vicean>,
a href="drivers/acpi/power.c#L357"6id="L407" class="line" name="L397"> 4070/a>stpan class="stcommt" c> * 1. Execex_ _DSW (Dicean>,
a href="drivers/acpi/power.c#L357" id="L407" class="line" name="L407"> 4070/a>  pan class="stcommt" c> *    Stic  Weup)an>,
a href="drivers/acpi/power.c#L357"8id="L407" class="line" name="L397"> 4070/a>  pan class="stcommt" c> * 2. Shutdown down the wer.c sourcesan>,
a href="drivers/acpi/power.c#L357"9id="L407" class="line" name="L397"> 4070/a>{
pan class="stcommt" c> */a>an>,
a href="drivers/acpi/power.c#L357" id="L417" class="line" name="L417"> 4171/a>  t acpi_povisableekeup_atvice(acpi_device *dev)) 4171/a>   4171/a>          ruct acpi_power_resource_entry *entry;
 4171/a>        acerda>;
  4171/a>
 41715a>        dev)) || a href="+code=dev" class="sref">dev))gt;adkeup&qa>))a href="+code=koflag class="sref">atflag a>))a href="+code=kovalidclass="sref">advalida>;
 4171/a>                goturn;
 - href="+code=koEINVALclass="sref">acEINVALa>;
 4171/a>
 4171/a>        mutex_lock(&mupi_device);
 42720a>        dev))gt;adkeup&qa>))a href="+code=koprepare_cou" class="sref">acprepare_cou" a>)) t; 4272/a>                  gotoa href="+code=liou class="sref">acou a>;
 4272/a>
 4272/a>        /*a>an>,
a href="drivers/acpi/power.c#L357" id="L427" class="line" name="L427"> 4272pi_depan class="stcommt" c>         a Execexg"> the de=l below eveno (an>,
a href="drivers/acpi/power.c#L357" id="L427" class="line" name="L427"> 4272/a>
         a the funcxion is call_d may b  useful,an>,
a href="drivers/acpi/power.c#L357"6id="L407" class="line" name="L427"> 4272/a>stpan class="stcommt" c>         a/a>an>,
a href="drivers/acpi/power.c#L357" id="L407" class="line" name="L427"> 4272/a>        st (dev))gt;adkeup&qa>))a href="+code=koprepare_cou" class="sref">acprepare_cou" a>)) <<0 4272/a>                   href="+code=liv" class="sref">dev))gt;adkeup&qa>))a href="+code=koprepare_cou" class="sref">acprepare_cou" a>))  4272/a>{
a href="drivers/acpi/power.c#L437" id="L437" class="line" name="L437"> 4373/a>        acerda>;
 acpi_device(st href="+code=adv" class="sref">dev)) 437        acerda>;
 4373/a>                  gotoa href="+code=liou class="sref">acou a>;
 4373/a>
 4373/a>           href="+code=list_for_each_entry" class="sref">list_for_each_entry(entry, dev))gt;adkeup&qa>))a href="+code=kosource"  class="sref">resources, node) {
 4373/a>                acpi_power_resource *resource,
 entry->resource-& 4373/a>
 4373/a>                   href="+code=retex_lock" class="sref">mutex_lock(&resource->resource_lock);
 4373/a>
 4373/a>                resource->likeup_atenable a>;
{
 4474/a>                .<<<<<<<<< href="+code=lierdclass="sref">acerda>;
 lipi_power_reoffnlock(resource-&
 4474/a>                        acerda>;
 4474/a>                        .<<<<<<<<< href="+code=lisource" class="sref">resource->likeup_atenable a>;
 refals a>-& 4474/a>                   4474/a>
 447                .< href="+code=entex_lolock" class="sref">mutex_unlock(&resource->resource_lock);
 4474/a>
 4474/a>                   (acerda>;
<
 4474/a>                           href="+code=env" etrdclass="sref">acv(&dev))gt;dev)) 4474/a>                "poCannot rn;
 keup_a wer.c sources,

 4575/a>                .<<<<<<<<< href="+code=liv" class="sref">dev))gt;adkeup&qa>))a href="+code=koflag class="sref">atflag a>))a href="+code=kovalidclass="sref">advalida>;
  4575/a>                         4575/a>                   4575/a>          }a href="drivers/acpi/power.c#L377" id="L427" class="line" name="L457"> 4575/a>
 4575/a>
acou a>;
:a href="drivers/acpi/power.c#L477" id="L457" class="line" name="L457"> 4575/a>        mutex_unlock(&mupi_device);
 4575/a>          turn;
a href="+code=retrdclass="sref">acerda>;
 4575/a>
<}a href="drivers/acpi/power.c#L377" id="L427" class="line" name="L457"> 4575/a>{
a href="drivers/acpi/power.c#L437" id="L467" class="line" name="L467"> 4676/a>  t atpi_power_reget_inferdedeatic a>(acpi_device *acvice *atstic a>,  4676/a>   4676/a>          t acsouul a>;
  4676/a>        atst_foatic a>;
  4676pi_device" clt atia>;
  4676/a>
 4676/a>           (acvice * || a href="+code=deatic class="sref">atstic a>,  4676/a>                  turn;
 - href="+code=koEINVALclass="sref">acEINVALa>;
 4676/a>
 4676/a>        /*a>an>,
a href="drivers/acpi/power.c#L357" id="L477" class="line" name="L477"> 4777/a>  pan class="stcommt" c>         a We know a vicean>,
a href="drivers/acpi/power.c#L357" id="L477" class="line" name="L477"> 4777/a>  pan class="stcommt" c>         a soquir d r_ean>,
a href="drivers/acpi/power.c#L357" id="L477" class="line" name="L477"> 4777/a>
         */a>an>,
a href="drivers/acpi/power.c#L357" id="L467" class="line" name="L477"> 4777/a>        atia>;
 atPI_STATATE_D0a>;
atia>;
 <atPI_STATATE_D3_HOTa>;
atia>;
++<
 477                reruct adst_foheada> *acst" a>;
 acvice *gt;acwer_da>(atatic, [ href="+code=reiclass="sref">atia>;
]a href="+code=kosource"  class="sref">resources,  4777/a>
 4777/a>                go (list_foempt a>(acst" a>;
) 477                st<<<<<<< 4777/a>
 477                acsouul a>;
 atpi_power_reget_st_foatic a>(acst" a>;
atst_foatic a>;

 4878/a>                .< (acsouul a>;
 4878/a>                        acsouul a>;
 4878/a>
 4878/a>                   (atst_foatic a>;
 <atPI_STPOWER_RESOURCETATATE_ONa>;
<
 4878/a>                reeeeeeeeea href="+code=adatic class="sref">atstic a>,  atia>;
 4878/a>                .<<<<<<<< 4878/a>                go}a href="drivers/acpi/power.c#L377" id="L477" class="line" name="L487"> 4878/a>        st 4878/a>
 4878/a>          a href="+code=adatic class="sref">atstic a>,  atPI_STATATE_D3a>;
 4979/a>          turn;
a0 4979/a>   4979/a>
 497  t repi_power_reon_source"  a>(acpi_device *acvice *atstic a>,  4=7cpi_de 39795a>        acvice * ||  href="+code=adatic class="sref">atstic a>,  << href="+code=liPI_STATATE_D0class="sref">atPI_STATATE_D0a>;
 ||  href="+code=adatic class="sref">atstic a>,  >< href="+code=liPI_STATATE_D3_HOTclass="sref">atPI_STATATE_D3_HOTa>;
 3979/a>                goturn;
 - href="+code=koEINVALclass="sref">acEINVALa>;
 3979/a>
 39798a>          turn;
a href="+code=repi_power_reon_st" class="sref">acpi_power_reon_st" a>(&acvice *gt;acwer_da>(atatic, [ href="+code=reatic class="sref">atstic a>, ]a href="+code=kosource"  class="sref">resources, 
 3979/a>{
 4080/a>
 4080/a>  t acpi_power_retransixiona>(acpi_device *acvice *atstic a>,  4080/a>}
 4080/a>        acsouul a>;
  4080/a>
 40805a>        acvice * || a href="+code=reatic class="sref">atstic a>,  << href="+code=liPI_STATATE_D0class="sref">atPI_STATATE_D0a>;
) || a href="+code=reatic class="sref">atstic a>,  >< href="+code=liPI_STATATE_D3_COLDclass="sref">ACPI_STATATE_D3_COLDa>;
) 4080/a>                goturn;
 - href="+code=koEINVALclass="sref">acEINVALa>;
 4080/a>
 4080/a>           (acvice *gt;acwer_da>(atstic a>,  <atstic a>,  || a href="+code=dev" e" class="sref">acvice *gt;atflag a>))a href="+code=kower_remanageableclass="sref">enwer_remanageablea>,  4080/a>                 4181/a>
 4181/a>        acvice *gt;acwer_da>(atstic a>,  << href="+code=liPI_STATATE_D0class="sref">atPI_STATATE_D0a>;
)a href="drivers/acpi/power.c#L438"2id="L408" class="line" name="L418"> 4181/a>              || a href="+code=rev" e" class="sref">acvice *gt;acwer_da>(atstic a>,  >< href="+code=liPI_STATATE_D3_COLDclass="sref">ACPI_STATATE_D3_COLDa>;
) 4181/a>                  turn;
 - href="+code=koENODEVclass="sref">adENODEVa>,  4181/a>
 41815a>        /* TBD: Rourcesan>,
a href="drivers/acpi/power.c#L358"6id="L408" class="line" name="L418"> 4181/a>
 41817a>        /*a>an>,
a href="drivers/acpi/power.c#L358"8id="L408" class="line" name="L418"> 4181/a>  pan class="stcommt" c>         a Firs  we soference all wer.c sourcesan>,
a href="drivers/acpi/power.c#L358"9id="L408" class="line" name="L418power81/a>{
pan class="stcommt" c>         a (e.g. soan>,
a href="drivers/acpi/power.c#L358" id="L428" class="line" name="L428"> 4282/a>  pan class="stcommt" c>         a we visoference all wer.c sourcesan>,
a href="drivers/acpi/power.c#L358" id="L418" class="line" name="L428"> 4282/a>  pan class="stcommt" c>         a/a>an>,
a href="drivers/acpi/power.c#L358" id="L418" class="line" name="L428"> 42822a>           (atstic a>,  << href="+code=liPI_STATATE_D3_COLDclass="sref">ACPI_STATATE_D3_COLDa>;
)a href="drivers/acpi/power.c#L358" id="L418" class="line" name="L428"> 4282/a>                   href="+code=resouul class="sref">acsouul a>;
 acpi_power_reon_st" a>(&aa href="drivers/acpi/power.c#L358" id="L418" class="line" name="L428"> 4282/a>                reeeeeeeeemp;acvice *gt;acwer_da>(atatic, [ href="+code=reatic class="sref">atstic a>, ]a href="+code=kosource"  class="sref">resources, 
 4282/a>
 4282/a>           (acsouul a>;
 mp;acvice *gt;acwer_da>(atstic a>,  << href="+code=liPI_STATATE_D3_COLDclass="sref">ACPI_STATATE_D3_COLDa>;
)a href="drivers/acpi/power.c#L358" id="L408" class="line" name="L428"> 4282/a>                   href="+code=repi_power_reoffnst" class="sref">acpi_power_reoffnst" a>(&aa href="drivers/acpi/power.c#L358"8id="L408" class="line" name="L428"> 4282/a>                  eeeeeeeemp;acvice *gt;acwer_da>(atatic, [ href="+code=rev" e" class="sref">acvice *gt;acwer_da>(atstic a>, ]a href="+code=kosource"  class="sref">resources, 
 4282/a>{
a href="drivers/acpi/power.c#L438" id="L438" class="line" name="L438"> 4383/a>        /* We shouldn't change the atic  unlessan>,
a href="drivers/acpi/power.c#L358" id="L438" class="line" name="L438"> 4383/a>        acvice *gt;acwer_da>(atstic a>,  <  href="+code=resouul class="sref">acsouul a>;
 ?< href="+code=liPI_STATATE_UNKNOWNclass="sref">atPI_STATATE_UNKNOWNa>;
 :a href="+code=atstic class="sref">atstic a>,  4383/a>
 4383/a>          turn;
a href="+code=ret"lul class="sref">acsouul a>;
 4383/a>   4383/a>
 4383/a>
acpi_poreleaseower_resource" a>(acvice * a href="+code=adv" class="sref">acvica>;
)a href="drivers/acpi/power.c#L358" id="L408" class="line" name="L438"> 4383/a>   4383/a>          ruct acpi_device *acvice * acuo_pi_device" a>(acvica>;
) 4383/a>          ruct acpi_power_resource *resource,
 4484/a>
 4484/a>        resource,
 recontae" reofa>(acvice *acpi_power_resource *acvice *) 4484/a>
 4484/a>           href="+code=kotex_lock" class="sref">mutex_lock(&muwer_resource *) 4484/a>           href="+code=list_fodelclass="sref">must_fodela>(&resource->nost_fode" a> *) 448           href="+code=kotex_lolock" class="sref">mutex_unlock(&muwer_resource *) 4484/a>
 4484/a>           href="+code=acpi_pofreeownp_id class="sref">repi_pofreeownp_id a>(&acvice *gt;adwnqa> *) 4484/a>        adkfreea>(resource-&
 4484/a>{
 4585/a>
 4585/a>  sticic  href="+code=atssize_ class="sref">acssize_ a>    href="+code=acpi_power_rein_useoshowclass="sref">acpi_power_rein_useoshowa>(acvice * a href="+code=adv" class="sref">acvica>;
 4585/a>                                        ruct atv" e" _attribuc a> * a href="+code=adattrclass="sref">acpttra>;
 4585/a>                                        char a href="+code=adbufclass="sref">rebufa>-&

 4585/a>          ruct acpi_power_resource *resource,
 4585/a>
 4585/a>        resource,
 acuo_wer_resource" a>(acuo_pi_device" a>(acvica>;
)
 4585/a>          turn;
a href="+code=resprintfclass="sref">resprintfa>(rebufa>-&,< an class="string">"po%u\nuot;,
, !a href="+code=desource" class="sref">resource->acf="_cou" a>-&
 4585/a>
<}a href="drivers/acpi/power.c#L378" id="L428" class="line" name="L458"> 4585/a>{
sticic  href="+code=atDEVICE_ATTRclass="sref">acDEVICE_ATTRa>(resource-&,<0444acpi_power_rein_useoshowa>(<acNULLa>-&
 4686/a>
 4686/a>  sticic void  href="+code=repi_power_resysfsesomov class="sref">acpi_power_resysfsesomov a>(acpi_device *acvice *)a href="drivers/acpi/power.c#L358" id="L458" class="line" name="L468"> 4686/a>}
 4686/a>           href="+code=kov" e" _somov _fileclass="sref">env" e" _somov _filea>(&acvice *gt;dev))rev" _attr_source" ein_usea>-&
 4686/a>   4686/a>
 4686/a>  t acpi_poaddower_resource" a>(enpi_pohandlea>    href="+code=achandleclass="sref">enhandlea>  )a href="drivers/acpi/power.c#L358" id="L448" class="line" name="L468"> 4686/a>   4686/a>          ruct acpi_power_resource *resource,
 4686/a>          ruct acpi_device *acvice * acNULLa>-& 4787/a>        acpi_poobjec a>    href="+code=acpi_poobjec class="sref">acpi_poobjec a>   47871a>          ruct acpi_pobuff_da>    href="+code=acbuff_dclass="sref">acbuff_da>   = { sizeofa href="+code=adpi_poobjec class="sref">acpi_poobjec a>  )acpi_poobjec a>   } 47872a>           href="+code=kopi_posticu class="sref">repi_posticu a>    href="+code=acsticu class="sref">resticu a>   4787/a>        atstic a>, acsouul a>;
 adENODEVa>,  4787/a>
 4787/a>           href="+code=kopi_pobuseget_vice" class="sref">acpi_debuseget_vice" a>(enhandlea>  acvice *) 4787/a>           (acvice *)a href="drivers/acpi/power.c#L358" id="L468" class="line" name="L478"> 478                stturn;
a0 4787/a>
 478           href="+code=lisource" class="sref">resource,
 adkzalloca>(resource,
)acGFP_KERNELa> *) 48880a>        resource-&)a href="drivers/acpi/power.c#L358" id="L488" class="line" name="L488"> 4888/a>                  turn;
 - href="+code=koENOMEMclass="sref">adENOMEMa>,  4888/a>
 4888/a>           href="+code=kov" e" class="sref">acvice * resource->acvice * 4888/a>           href="+code=lipi_deini _vice" oobjec class="sref">acpi_poini _vice" oobjec a>(acvice *enhandlea>  enPI_STBUS_TYPETPOWERa>;
 4888/a>                .<<<<<<<<<         href="+code=liPI_STATA_DEFAULTclass="sref">atPI_STATA_DEFAULTa> *) 4888/a>        mutex_unini a>(&resource->resource_lock);
 4888/a>           href="+code=acINIT_LIST_HEADclass="sref">ACINIT_LIST_HEADa>(&resource->acdepende" a>);
 4888/a>        ACINIT_LIST_HEADa>(&resource->nost_fode" a> *) 4888/a>           href="+code=lisource" class="sref">resource,
gt;reme="a>,
 acvice *gt;adwnqa> *a href="+code=kobuseidclass="sref">adbuseida> * 4989/a>        liruccp a>(repi_povice" ome="a>(acvice *)atPI_STPOWER_DEVICE_NAMEa> *) 4989/a>        liruccp a>(repi_povice" oass="a>(acvice *)atPI_STPOWER_CLASSa> *) 49892a>           href="+code=kov" e" class="sref">acvice *gt;acwer_da>(atstic a>,  <  href="+code=rePI_STATATE_UNKNOWNclass="sref">atPI_STATATE_UNKNOWNa>;
 4989/a>
 4=89/a>           an class="stcommt" c>/* Evalex_an>,
a href="drivers/acpi/power.c#L358" id="L488" class="line" name="L398"> 3989/a>           href="+code=kosticu class="sref">resticu a>   acpi_poevaleic oobjec a>(enhandlea>  acNULLa>-&acNULLa>-&acbuff_da>  ) 3989/a>           (atPI_STFAILUREa>(resticu a>  ) 3989/a>                stgotoa href="+code=litrdclass="sref">acerda>;
 3989/a>
 3989/a>           href="+code=lisource" class="sref">resource,
gt;resystem_levela>   acpi_poobjec a>  a href="+code=kower_resource" class="sref">rewer_resource *a href="+code=koaystem_levelclass="sref">resystem_levela>   4090/a>        resource,
gt;reordera>   acpi_poobjec a>  a href="+code=kower_resource" class="sref">rewer_resource *a href="+code=kosource_loorderclass="sref">resource_loordera>   4090/a>  a href="drivers/acpi/power.c#L439"2id="L409" class="line" name="L499"> 40902a>           href="+code=kosouul class="sref">acsouul a>;
 atpi_power_reget_atic a>(enhandlea>  atstic a>, < 4090/a>        acsouul a>;
 4090/a>                regotoa href="+code=litrdclass="sref">acerda>;
 4090/a>
 4090/a>        muwrint a>(muKERN_INFOa>    href="+code=acPREFIXclass="sref">muPREFIXa>    an class="string">"po%s [%s] (%s)\nuot;,
,  href="+code=adpi_povice" ome="class="sref">repi_povice" ome="a>(acvice *) 4090/a>                s href="+code=adpi_povice" obidclass="sref">adpi_povice" obida>(acvice *)atstic a>,  ?  an class="string">"poonuot;,
 :a an class="string">"pooffuot;,

 4090/a>
 4090/a>           href="+code=liv" e" class="sref">acvice *gt;atflag a>))a href="+code=komatch_ivers/class="sref">mutatch_ivers/a>;
 acuru a>;
 4191/a>        acsouul a>;
 adpi_povice" oadda>(acvice *acpi_poreleaseower_resource" a>(<
 4191/a>        acsouul a>;
 4191/a>                regotoa href="+code=litrdclass="sref">acerda>;
 4191/a>
 41914a>        env" e" _creic ofilea>(&acvice *gt;dev))rev" _attr_source" ein_usea>-&
 41915a>        acvice *gt;acsomov a>(< acpi_power_resysfsesomov a>(< 4191/a>
 4191/a>           href="+code=actex_lock" class="sref">mutex_lock(&muwer_resource *) 4191/a>        adst_foadda>(&resource->nost_fode" a> *acpi_power_resource *)mutex_unlock(&muwer_resource *) 4292/a>        repi_povice" oaddofinaliz"a>(acvice *) 4292/a>         4292/a>
 4292/a>    href="+code=litrdclass="sref">acerda>;
:a href="drivers/acpi/power.c#L479" id="L419" class="line" name="L429"> 4292/a>           href="+code=lipi_dereleaseower_resource" class="sref">acpi_poreleaseower_resource" a>(acvice *gt;dev))) 42925a>        acsouul a>;
 4292/a>   4292/a>
 4292/a>  #ifdefa href="+code=liCONFIG_PI_STALEEPclass="sref">acCONFIG_PI_STALEEPa>
 4292/a>{
void  href="+code=repi_poresumeower_resource" "class="sref">repi_poresumeower_resource" "a>( 4393/a>   43931a>          ruct acpi_power_resource *resource,
 4393/a>
 4393/a>           href="+code=kotex_lock" class="sref">mutex_lock(&muwer_resource *) 4393/a>
 4393/a>           href="+code=kost_fofor_each_entr class="sref">list_fofor_each_entr a>(resource,
acpi_power_resource *nost_fode" a> *)
 4393/a>                go  acsouul a>;
atstic a>,  4393/a>
 4393/a>                   href="+code=kotex_lock" class="sref">mutex_lock(&resource->resource_lock);
 4393/a>{
a href="drivers/acpi/power.c#L439" id="L449" class="line" name="L449"> 4494/a>                .< href="+code=kosouul class="sref">acsouul a>;
 atpi_power_reget_atic a>(resource->acvice *a href="+code=kohandleclass="sref">enhandlea>  atstic a>, < 4494/a>                   (acsouul a>;
 4494/a>                          continue 4494/a>
 4494/a>                re (atstic a>,  <atPI_STPOWER_RESOURCETATATE_OFFa>
 44945a>        resource->acf="_cou" a>-&

 4494/a>                go      .< href="+code=kov" _infoclass="sref">rev" _infoa>(&resource->acvice *a href="+code=kov" class="sref">dev))"poTn;
g"> ON\nuot;,
< 4494/a>                st      .< href="+code=ko__pi_power_reonclass="sref">ac__pi_power_reona>(resource-&< 4494/a>                  } elsee (atstic a>,  <atPI_STPOWER_RESOURCETATATE_ONa>;
a href="drivers/acpi/power.c#L439"9id="L409" class="line" name="L449"> 4494/a>                resource->acf="_cou" a>-&

 4595/a>                .<      .< href="+code=kov" _infoclass="sref">rev" _infoa>(&resource->acvice *a href="+code=kov" class="sref">dev))"poTn;
g"> OFF\nuot;,
< 4595/a>                        .< href="+code=ko__pi_power_reoffclass="sref">re__pi_power_reoffa>(resource-&< 4595/a>                   4595/a>
 4595/a>                re href="+code=litex_lolock" class="sref">mutex_unlock(&resource->resource_lock);
 45955a>         4595/a>
 4595/a>           href="+code=actex_lolock" class="sref">mutex_unlock(&muwer_resource *) 4595/a>
<}a href="drivers/acpi/power.c#L379" id="L429" class="line" name="L459"> 4595/a>{
#endifa href="drivers/acpi/power.c#L379" id="L469" class="line" name="L469"> 4696/a>
<


The original LXR software by the href="drhttp://urceLXR communitya>))lxr@ne"ux.noa> *a
lxr.ne"ux.no kindly hosted by href="drhttp://www.redpill-ne"pro.no">Redpill Le"pro ASa>)) and operaxions serce