/* * devfreq: Generic Dynamic Voltage and Frequency Scaling (DVFS) Framework * for Non-CPU Devices. * * Copyright (C) 2011 Samsung Electronics * MyungJoo Ham <myungjoo.ham@samsung.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */#include<linux/kernel.h>#include<linux/sched.h>#include<linux/errno.h>#include<linux/err.h>#include<linux/init.h>#include<linux/module.h>#include<linux/slab.h>#include<linux/stat.h>#include<linux/pm_opp.h>#include<linux/devfreq.h>#include<linux/workqueue.h>#include<linux/platform_device.h>#include<linux/list.h>#include<linux/printk.h>#include<linux/hrtimer.h>#include<linux/of.h>#include"governor.h"staticstructclass*devfreq_class;/* * devfreq core provides delayed work based load monitoring helper * functions. Governors can use these or can implement their own * monitoring mechanism. */staticstructworkqueue_struct*devfreq_wq;/* The list of all device-devfreq governors */staticLIST_HEAD(devfreq_governor_list);/* The list of all device-devfreq */staticLIST_HEAD(devfreq_list);staticDEFINE_MUTEX(devfreq_list_lock);/** * find_device_devfreq() - find devfreq struct using device pointer * @dev: device pointer used to lookup device devfreq. * * Search the list of device devfreqs and return the matched device's * devfreq info. devfreq_list_lock should be held by the caller. */staticstructdevfreq*find_device_devfreq(structdevice*dev){structdevfreq*tmp_devfreq;if(IS_ERR_OR_NULL(dev)){pr_err("DEVFREQ: %s: Invalid parameters\n",__func__);