@@ -337,6 +337,20 @@ static inline void pm_runtime_release_supplier(struct device_link *link) {}
337
337
* Invoke the "idle check" callback of @dev and, depending on its return value,
338
338
* set up autosuspend of @dev or suspend it (depending on whether or not
339
339
* autosuspend has been enabled for it).
340
+ *
341
+ * Return:
342
+ * * 0: Success.
343
+ * * -EINVAL: Runtime PM error.
344
+ * * -EACCES: Runtime PM disabled.
345
+ * * -EAGAIN: Runtime PM usage_count non-zero, Runtime PM status change ongoing
346
+ * or device not in %RPM_ACTIVE state.
347
+ * * -EBUSY: Runtime PM child_count non-zero.
348
+ * * -EPERM: Device PM QoS resume latency 0.
349
+ * * -EINPROGRESS: Suspend already in progress.
350
+ * * -ENOSYS: CONFIG_PM not enabled.
351
+ * * 1: Device already suspended.
352
+ * Other values and conditions for the above values are possible as returned by
353
+ * Runtime PM idle and suspend callbacks.
340
354
*/
341
355
static inline int pm_runtime_idle (struct device * dev )
342
356
{
@@ -346,6 +360,18 @@ static inline int pm_runtime_idle(struct device *dev)
346
360
/**
347
361
* pm_runtime_suspend - Suspend a device synchronously.
348
362
* @dev: Target device.
363
+ *
364
+ * Return:
365
+ * * 0: Success.
366
+ * * -EINVAL: Runtime PM error.
367
+ * * -EACCES: Runtime PM disabled.
368
+ * * -EAGAIN: Runtime PM usage_count non-zero or Runtime PM status change ongoing.
369
+ * * -EBUSY: Runtime PM child_count non-zero.
370
+ * * -EPERM: Device PM QoS resume latency 0.
371
+ * * -ENOSYS: CONFIG_PM not enabled.
372
+ * * 1: Device already suspended.
373
+ * Other values and conditions for the above values are possible as returned by
374
+ * Runtime PM suspend callbacks.
349
375
*/
350
376
static inline int pm_runtime_suspend (struct device * dev )
351
377
{
@@ -358,6 +384,18 @@ static inline int pm_runtime_suspend(struct device *dev)
358
384
*
359
385
* Set up autosuspend of @dev or suspend it (depending on whether or not
360
386
* autosuspend is enabled for it) without engaging its "idle check" callback.
387
+ *
388
+ * Return:
389
+ * * 0: Success.
390
+ * * -EINVAL: Runtime PM error.
391
+ * * -EACCES: Runtime PM disabled.
392
+ * * -EAGAIN: Runtime PM usage_count non-zero or Runtime PM status change ongoing.
393
+ * * -EBUSY: Runtime PM child_count non-zero.
394
+ * * -EPERM: Device PM QoS resume latency 0.
395
+ * * -ENOSYS: CONFIG_PM not enabled.
396
+ * * 1: Device already suspended.
397
+ * Other values and conditions for the above values are possible as returned by
398
+ * Runtime PM suspend callbacks.
361
399
*/
362
400
static inline int pm_runtime_autosuspend (struct device * dev )
363
401
{
@@ -379,6 +417,18 @@ static inline int pm_runtime_resume(struct device *dev)
379
417
*
380
418
* Queue up a work item to run an equivalent of pm_runtime_idle() for @dev
381
419
* asynchronously.
420
+ *
421
+ * Return:
422
+ * * 0: Success.
423
+ * * -EINVAL: Runtime PM error.
424
+ * * -EACCES: Runtime PM disabled.
425
+ * * -EAGAIN: Runtime PM usage_count non-zero, Runtime PM status change ongoing
426
+ * or device not in %RPM_ACTIVE state.
427
+ * * -EBUSY: Runtime PM child_count non-zero.
428
+ * * -EPERM: Device PM QoS resume latency 0.
429
+ * * -EINPROGRESS: Suspend already in progress.
430
+ * * -ENOSYS: CONFIG_PM not enabled.
431
+ * * 1: Device already suspended.
382
432
*/
383
433
static inline int pm_request_idle (struct device * dev )
384
434
{
@@ -400,6 +450,17 @@ static inline int pm_request_resume(struct device *dev)
400
450
*
401
451
* Queue up a work item to run an equivalent pm_runtime_autosuspend() for @dev
402
452
* asynchronously.
453
+ *
454
+ * Return:
455
+ * * 0: Success.
456
+ * * -EINVAL: Runtime PM error.
457
+ * * -EACCES: Runtime PM disabled.
458
+ * * -EAGAIN: Runtime PM usage_count non-zero or Runtime PM status change ongoing.
459
+ * * -EBUSY: Runtime PM child_count non-zero.
460
+ * * -EPERM: Device PM QoS resume latency 0.
461
+ * * -EINPROGRESS: Suspend already in progress.
462
+ * * -ENOSYS: CONFIG_PM not enabled.
463
+ * * 1: Device already suspended.
403
464
*/
404
465
static inline int pm_request_autosuspend (struct device * dev )
405
466
{
@@ -464,6 +525,17 @@ static inline int pm_runtime_resume_and_get(struct device *dev)
464
525
*
465
526
* Decrement the runtime PM usage counter of @dev and if it turns out to be
466
527
* equal to 0, queue up a work item for @dev like in pm_request_idle().
528
+ *
529
+ * Return:
530
+ * * 0: Success.
531
+ * * -EINVAL: Runtime PM error.
532
+ * * -EACCES: Runtime PM disabled.
533
+ * * -EAGAIN: Runtime PM usage_count non-zero or Runtime PM status change ongoing.
534
+ * * -EBUSY: Runtime PM child_count non-zero.
535
+ * * -EPERM: Device PM QoS resume latency 0.
536
+ * * -EINPROGRESS: Suspend already in progress.
537
+ * * -ENOSYS: CONFIG_PM not enabled.
538
+ * * 1: Device already suspended.
467
539
*/
468
540
static inline int pm_runtime_put (struct device * dev )
469
541
{
@@ -478,6 +550,17 @@ DEFINE_FREE(pm_runtime_put, struct device *, if (_T) pm_runtime_put(_T))
478
550
*
479
551
* Decrement the runtime PM usage counter of @dev and if it turns out to be
480
552
* equal to 0, queue up a work item for @dev like in pm_request_autosuspend().
553
+ *
554
+ * Return:
555
+ * * 0: Success.
556
+ * * -EINVAL: Runtime PM error.
557
+ * * -EACCES: Runtime PM disabled.
558
+ * * -EAGAIN: Runtime PM usage_count non-zero or Runtime PM status change ongoing.
559
+ * * -EBUSY: Runtime PM child_count non-zero.
560
+ * * -EPERM: Device PM QoS resume latency 0.
561
+ * * -EINPROGRESS: Suspend already in progress.
562
+ * * -ENOSYS: CONFIG_PM not enabled.
563
+ * * 1: Device already suspended.
481
564
*/
482
565
static inline int __pm_runtime_put_autosuspend (struct device * dev )
483
566
{
@@ -490,6 +573,17 @@ static inline int __pm_runtime_put_autosuspend(struct device *dev)
490
573
*
491
574
* Decrement the runtime PM usage counter of @dev and if it turns out to be
492
575
* equal to 0, queue up a work item for @dev like in pm_request_autosuspend().
576
+ *
577
+ * Return:
578
+ * * 0: Success.
579
+ * * -EINVAL: Runtime PM error.
580
+ * * -EACCES: Runtime PM disabled.
581
+ * * -EAGAIN: Runtime PM usage_count non-zero or Runtime PM status change ongoing.
582
+ * * -EBUSY: Runtime PM child_count non-zero.
583
+ * * -EPERM: Device PM QoS resume latency 0.
584
+ * * -EINPROGRESS: Suspend already in progress.
585
+ * * -ENOSYS: CONFIG_PM not enabled.
586
+ * * 1: Device already suspended.
493
587
*/
494
588
static inline int pm_runtime_put_autosuspend (struct device * dev )
495
589
{
@@ -506,9 +600,20 @@ static inline int pm_runtime_put_autosuspend(struct device *dev)
506
600
* return value, set up autosuspend of @dev or suspend it (depending on whether
507
601
* or not autosuspend has been enabled for it).
508
602
*
509
- * The possible return values of this function are the same as for
510
- * pm_runtime_idle() and the runtime PM usage counter of @dev remains
511
- * decremented in all cases, even if it returns an error code.
603
+ * The runtime PM usage counter of @dev remains decremented in all cases, even
604
+ * if it returns an error code.
605
+ *
606
+ * Return:
607
+ * * 0: Success.
608
+ * * -EINVAL: Runtime PM error.
609
+ * * -EACCES: Runtime PM disabled.
610
+ * * -EAGAIN: Runtime PM usage_count non-zero or Runtime PM status change ongoing.
611
+ * * -EBUSY: Runtime PM child_count non-zero.
612
+ * * -EPERM: Device PM QoS resume latency 0.
613
+ * * -ENOSYS: CONFIG_PM not enabled.
614
+ * * 1: Device already suspended.
615
+ * Other values and conditions for the above values are possible as returned by
616
+ * Runtime PM suspend callbacks.
512
617
*/
513
618
static inline int pm_runtime_put_sync (struct device * dev )
514
619
{
@@ -522,9 +627,21 @@ static inline int pm_runtime_put_sync(struct device *dev)
522
627
* Decrement the runtime PM usage counter of @dev and if it turns out to be
523
628
* equal to 0, carry out runtime-suspend of @dev synchronously.
524
629
*
525
- * The possible return values of this function are the same as for
526
- * pm_runtime_suspend() and the runtime PM usage counter of @dev remains
527
- * decremented in all cases, even if it returns an error code.
630
+ * The runtime PM usage counter of @dev remains decremented in all cases, even
631
+ * if it returns an error code.
632
+ *
633
+ * Return:
634
+ * * 0: Success.
635
+ * * -EINVAL: Runtime PM error.
636
+ * * -EACCES: Runtime PM disabled.
637
+ * * -EAGAIN: Runtime PM usage_count non-zero or Runtime PM status change ongoing.
638
+ * * -EAGAIN: usage_count non-zero or Runtime PM status change ongoing.
639
+ * * -EBUSY: Runtime PM child_count non-zero.
640
+ * * -EPERM: Device PM QoS resume latency 0.
641
+ * * -ENOSYS: CONFIG_PM not enabled.
642
+ * * 1: Device already suspended.
643
+ * Other values and conditions for the above values are possible as returned by
644
+ * Runtime PM suspend callbacks.
528
645
*/
529
646
static inline int pm_runtime_put_sync_suspend (struct device * dev )
530
647
{
@@ -539,9 +656,21 @@ static inline int pm_runtime_put_sync_suspend(struct device *dev)
539
656
* equal to 0, set up autosuspend of @dev or suspend it synchronously (depending
540
657
* on whether or not autosuspend has been enabled for it).
541
658
*
542
- * The possible return values of this function are the same as for
543
- * pm_runtime_autosuspend() and the runtime PM usage counter of @dev remains
544
- * decremented in all cases, even if it returns an error code.
659
+ * The runtime PM usage counter of @dev remains decremented in all cases, even
660
+ * if it returns an error code.
661
+ *
662
+ * Return:
663
+ * * 0: Success.
664
+ * * -EINVAL: Runtime PM error.
665
+ * * -EACCES: Runtime PM disabled.
666
+ * * -EAGAIN: Runtime PM usage_count non-zero or Runtime PM status change ongoing.
667
+ * * -EBUSY: Runtime PM child_count non-zero.
668
+ * * -EPERM: Device PM QoS resume latency 0.
669
+ * * -EINPROGRESS: Suspend already in progress.
670
+ * * -ENOSYS: CONFIG_PM not enabled.
671
+ * * 1: Device already suspended.
672
+ * Other values and conditions for the above values are possible as returned by
673
+ * Runtime PM suspend callbacks.
545
674
*/
546
675
static inline int pm_runtime_put_sync_autosuspend (struct device * dev )
547
676
{
0 commit comments