devfreq.c (39688ce6facd63de796def41a0b9012882b5cc14) devfreq.c (de9c739435b47e7d39e448b2cc4c8154cabc9e5a)
1/*
2 * devfreq: Generic Dynamic Voltage and Frequency Scaling (DVFS) Framework
3 * for Non-CPU Devices.
4 *
5 * Copyright (C) 2011 Samsung Electronics
6 * MyungJoo Ham <myungjoo.ham@samsung.com>
7 *
8 * This program is free software; you can redistribute it and/or modify

--- 513 unchanged lines hidden (view full) ---

522err_out:
523 return ERR_PTR(err);
524}
525EXPORT_SYMBOL(devfreq_add_device);
526
527/**
528 * devfreq_remove_device() - Remove devfreq feature from a device.
529 * @devfreq: the devfreq instance to be removed
1/*
2 * devfreq: Generic Dynamic Voltage and Frequency Scaling (DVFS) Framework
3 * for Non-CPU Devices.
4 *
5 * Copyright (C) 2011 Samsung Electronics
6 * MyungJoo Ham <myungjoo.ham@samsung.com>
7 *
8 * This program is free software; you can redistribute it and/or modify

--- 513 unchanged lines hidden (view full) ---

522err_out:
523 return ERR_PTR(err);
524}
525EXPORT_SYMBOL(devfreq_add_device);
526
527/**
528 * devfreq_remove_device() - Remove devfreq feature from a device.
529 * @devfreq: the devfreq instance to be removed
530 *
531 * The opposite of devfreq_add_device().
530 */
531int devfreq_remove_device(struct devfreq *devfreq)
532{
533 if (!devfreq)
534 return -EINVAL;
535
536 _remove_devfreq(devfreq, false);
537
538 return 0;
539}
540EXPORT_SYMBOL(devfreq_remove_device);
541
542/**
543 * devfreq_suspend_device() - Suspend devfreq of a device.
544 * @devfreq: the devfreq instance to be suspended
532 */
533int devfreq_remove_device(struct devfreq *devfreq)
534{
535 if (!devfreq)
536 return -EINVAL;
537
538 _remove_devfreq(devfreq, false);
539
540 return 0;
541}
542EXPORT_SYMBOL(devfreq_remove_device);
543
544/**
545 * devfreq_suspend_device() - Suspend devfreq of a device.
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 */
546int devfreq_suspend_device(struct devfreq *devfreq)
547{
548 if (!devfreq)
549 return -EINVAL;
550
551 if (!devfreq->governor)
552 return 0;
553
554 return devfreq->governor->event_handler(devfreq,
555 DEVFREQ_GOV_SUSPEND, NULL);
556}
557EXPORT_SYMBOL(devfreq_suspend_device);
558
559/**
560 * devfreq_resume_device() - Resume devfreq of a device.
561 * @devfreq: the devfreq instance to be resumed
551 */
552int devfreq_suspend_device(struct devfreq *devfreq)
553{
554 if (!devfreq)
555 return -EINVAL;
556
557 if (!devfreq->governor)
558 return 0;
559
560 return devfreq->governor->event_handler(devfreq,
561 DEVFREQ_GOV_SUSPEND, NULL);
562}
563EXPORT_SYMBOL(devfreq_suspend_device);
564
565/**
566 * devfreq_resume_device() - Resume devfreq of a device.
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 */
563int devfreq_resume_device(struct devfreq *devfreq)
564{
565 if (!devfreq)
566 return -EINVAL;
567
568 if (!devfreq->governor)
569 return 0;

--- 518 unchanged lines hidden ---
572 */
573int devfreq_resume_device(struct devfreq *devfreq)
574{
575 if (!devfreq)
576 return -EINVAL;
577
578 if (!devfreq->governor)
579 return 0;

--- 518 unchanged lines hidden ---