Commit de9c739435b47e7d39e448b2cc4c8154cabc9e5a

Authored by MyungJoo Ham
1 parent 39688ce6fa

PM / devfreq: add comments and Documentation

- Added missing ABI documents
- Added comments to clarify the objectives of functions

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Acked-by: Nishanth Menon <nm@ti.com>
Acked-by: Rajagopal Venkat <rajagopal.venkat@linaro.org>

Showing 3 changed files with 32 additions and 0 deletions Side-by-side Diff

Documentation/ABI/testing/sysfs-class-devfreq
... ... @@ -78,4 +78,24 @@
78 78 Description:
79 79 The /sys/class/devfreq/.../available_governors shows
80 80 currently available governors in the system.
  81 +
  82 +What: /sys/class/devfreq/.../min_freq
  83 +Date: January 2013
  84 +Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
  85 +Description:
  86 + The /sys/class/devfreq/.../min_freq shows and stores
  87 + the minimum frequency requested by users. It is 0 if
  88 + the user does not care. min_freq overrides the
  89 + frequency requested by governors.
  90 +
  91 +What: /sys/class/devfreq/.../max_freq
  92 +Date: January 2013
  93 +Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
  94 +Description:
  95 + The /sys/class/devfreq/.../max_freq shows and stores
  96 + the maximum frequency requested by users. It is 0 if
  97 + the user does not care. max_freq overrides the
  98 + frequency requested by governors and min_freq.
  99 + The max_freq overrides min_freq because max_freq may be
  100 + used to throttle devices to avoid overheating.
drivers/devfreq/devfreq.c
... ... @@ -527,6 +527,8 @@
527 527 /**
528 528 * devfreq_remove_device() - Remove devfreq feature from a device.
529 529 * @devfreq: the devfreq instance to be removed
  530 + *
  531 + * The opposite of devfreq_add_device().
530 532 */
531 533 int devfreq_remove_device(struct devfreq *devfreq)
532 534 {
... ... @@ -542,6 +544,10 @@
542 544 /**
543 545 * devfreq_suspend_device() - Suspend devfreq of a device.
544 546 * @devfreq: the devfreq instance to be suspended
  547 + *
  548 + * This function is intended to be called by the pm callbacks
  549 + * (e.g., runtime_suspend, suspend) of the device driver that
  550 + * holds the devfreq.
545 551 */
546 552 int devfreq_suspend_device(struct devfreq *devfreq)
547 553 {
... ... @@ -559,6 +565,10 @@
559 565 /**
560 566 * devfreq_resume_device() - Resume devfreq of a device.
561 567 * @devfreq: the devfreq instance to be resumed
  568 + *
  569 + * This function is intended to be called by the pm callbacks
  570 + * (e.g., runtime_resume, resume) of the device driver that
  571 + * holds the devfreq.
562 572 */
563 573 int devfreq_resume_device(struct devfreq *devfreq)
564 574 {
include/linux/devfreq.h
... ... @@ -181,6 +181,8 @@
181 181 const char *governor_name,
182 182 void *data);
183 183 extern int devfreq_remove_device(struct devfreq *devfreq);
  184 +
  185 +/* Supposed to be called by PM_SLEEP/PM_RUNTIME callbacks */
184 186 extern int devfreq_suspend_device(struct devfreq *devfreq);
185 187 extern int devfreq_resume_device(struct devfreq *devfreq);
186 188