aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/devfreq (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-11-02License cleanup: add SPDX GPL-2.0 license identifier to files with no licenseGreg Kroah-Hartman1-0/+1
Many source files in the tree are missing licensing information, which makes it harder for compliance tools to determine the correct license. By default all files without license information are under the default license of the kernel, which is GPL version 2. Update the files which contain no license information with the 'GPL-2.0' SPDX license identifier. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This patch is based on work done by Thomas Gleixner and Kate Stewart and Philippe Ombredanne. How this work was done: Patches were generated and checked against linux-4.14-rc6 for a subset of the use cases: - file had no licensing information it it. - file was a */uapi/* one with no licensing information in it, - file was a */uapi/* one with existing licensing information, Further patches will be generated in subsequent months to fix up cases where non-standard license headers were used, and references to license had to be inferred by heuristics based on keywords. The analysis to determine which SPDX License Identifier to be applied to a file was done in a spreadsheet of side by side results from of the output of two independent scanners (ScanCode & Windriver) producing SPDX tag:value files created by Philippe Ombredanne. Philippe prepared the base worksheet, and did an initial spot review of a few 1000 files. The 4.13 kernel was the starting point of the analysis with 60,537 files assessed. Kate Stewart did a file by file comparison of the scanner results in the spreadsheet to determine which SPDX license identifier(s) to be applied to the file. She confirmed any determination that was not immediately clear with lawyers working with the Linux Foundation. Criteria used to select files for SPDX license identifier tagging was: - Files considered eligible had to be source code files. - Make and config files were included as candidates if they contained >5 lines of source - File already had some variant of a license header in it (even if <5 lines). All documentation files were explicitly excluded. The following heuristics were used to determine which SPDX license identifiers to apply. - when both scanners couldn't find any license traces, file was considered to have no license information in it, and the top level COPYING file license applied. For non */uapi/* files that summary was: SPDX license identifier # files ---------------------------------------------------|------- GPL-2.0 11139 and resulted in the first patch in this series. If that file was a */uapi/* path one, it was "GPL-2.0 WITH Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was: SPDX license identifier # files ---------------------------------------------------|------- GPL-2.0 WITH Linux-syscall-note 930 and resulted in the second patch in this series. - if a file had some form of licensing information in it, and was one of the */uapi/* ones, it was denoted with the Linux-syscall-note if any GPL family license was found in the file or had no licensing in it (per prior point). Results summary: SPDX license identifier # files ---------------------------------------------------|------ GPL-2.0 WITH Linux-syscall-note 270 GPL-2.0+ WITH Linux-syscall-note 169 ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21 ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17 LGPL-2.1+ WITH Linux-syscall-note 15 GPL-1.0+ WITH Linux-syscall-note 14 ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5 LGPL-2.0+ WITH Linux-syscall-note 4 LGPL-2.1 WITH Linux-syscall-note 3 ((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3 ((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1 and that resulted in the third patch in this series. - when the two scanners agreed on the detected license(s), that became the concluded license(s). - when there was disagreement between the two scanners (one detected a license but the other didn't, or they both detected different licenses) a manual inspection of the file occurred. - In most cases a manual inspection of the information in the file resulted in a clear resolution of the license that should apply (and which scanner probably needed to revisit its heuristics). - When it was not immediately clear, the license identifier was confirmed with lawyers working with the Linux Foundation. - If there was any question as to the appropriate license identifier, the file was flagged for further research and to be revisited later in time. In total, over 70 hours of logged manual review was done on the spreadsheet to determine the SPDX license identifiers to apply to the source files by Kate, Philippe, Thomas and, in some cases, confirmation by lawyers working with the Linux Foundation. Kate also obtained a third independent scan of the 4.13 code base from FOSSology, and compared selected files where the other two scanners disagreed against that SPDX file, to see if there was new insights. The Windriver scanner is based on an older version of FOSSology in part, so they are related. Thomas did random spot checks in about 500 files from the spreadsheets for the uapi headers and agreed with SPDX license identifier in the files he inspected. For the non-uapi files Thomas did random spot checks in about 15000 files. In initial set of patches against 4.14-rc6, 3 files were found to have copy/paste license identifier errors, and have been fixed to reflect the correct identifier. Additionally Philippe spent 10 hours this week doing a detailed manual inspection and review of the 12,461 patched files from the initial patch version early this week with: - a full scancode scan run, collecting the matched texts, detected license ids and scores - reviewing anything where there was a license detected (about 500+ files) to ensure that the applied SPDX license was correct - reviewing anything where there was no detection but the patch license was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied SPDX license was correct This produced a worksheet with 20 files needing minor correction. This worksheet was then exported into 3 different .csv files for the different types of files to be modified. These .csv files were then reviewed by Greg. Thomas wrote a script to parse the csv files and add the proper SPDX tag to the file, in the format that the file expected. This script was further refined by Greg based on the output to detect more types of files automatically and to distinguish between header and source .c files (which need different comment types.) Finally Greg ran the script using the .csv files to generate the patches. Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-28PM / devfreq: Fix memory leak when fail to register deviceChanwoo Choi1-1/+4
When the devfreq_add_device fails to register deivce, the memory leak of devfreq instance happen. So, this patch fix the memory leak issue. Before freeing the devfreq instance checks whether devfreq instance is NULL or not because the device_unregister() frees the devfreq instance when jumping to the 'err_init'. It is to prevent the duplicate the kfee(devfreq). Cc: stable@vger.kernel.org Fixes: ac4b281176a5 ("PM / devfreq: fix duplicated kfree on devfreq pointer") Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2017-08-28PM / devfreq: Add dependency on PM_OPPChanwoo Choi1-0/+1
The devfreq ues the OPP library to handle the voltage and frequency for the device basically. This patch adds the dependency on CONFIG_PM_OPP in order to prevent either the build break or the unknow behavior. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2017-08-28PM / devfreq: Move private devfreq_update_stats() into devfreqChanwoo Choi1-0/+4
THe devfreq_update_stats() updates the 'struct devfreq_dev_status' in order to get current status of devfreq device. It is only used for the governors. This patch moves the devfreq_update_stats() into devfreq directory. Signed-off-by: Chanwoo Choi <cwchoi00@gmail.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2017-08-28PM / devfreq: Convert to using %pOF instead of full_nameRob Herring1-2/+2
Now that we have a custom printf format specifier, convert users of full_name to use %pOF instead. This is preparation to remove storing of the full path string for each node. Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: linux-pm@vger.kernel.org
2017-07-06PM / devfreq: constify attribute_group structures.Arvind Yadav1-1/+1
attribute_groups are not supposed to change at runtime. All functions working with attribute_groups provided by <linux/sysfs.h> work with const attribute_group. So mark the non-const structs as const. File size before: text data bss dec hex filename 621 176 0 797 31d drivers/devfreq/governor_userspace.o File size After adding 'const': text data bss dec hex filename 670 144 0 814 32e drivers/devfreq/governor_userspace.o Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2017-07-06PM / devfreq: tegra: fix error return code in tegra_devfreq_probe()Gustavo A. R. Silva1-3/+3
platform_get_irq() returns an error code, but the tegra-devfreq driver ignores it and always returns -ENODEV. This is not correct, and prevents -EPROBE_DEFER from being propagated properly. Notice that platform_get_irq() no longer returns 0 on error: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e330b9a6bb35dc7097a4f02cb1ae7b6f96df92af Print and propagate the return value of platform_get_irq on failure. Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2017-07-06PM / devfreq: rk3399_dmc: fix error return code in rk3399_dmcfreq_probe()Gustavo A. R. Silva1-2/+3
platform_get_irq() returns an error code, but the rk3399_dmc driver ignores it and always returns -EINVAL. This is not correct, and prevents -EPROBE_DEFER from being propagated properly. Notice that platform_get_irq() no longer returns 0 on error: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e330b9a6bb35dc7097a4f02cb1ae7b6f96df92af Print and propagate the return value of platform_get_irq on failure. Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2017-06-12PM / devfreq: exynos-ppmu: Staticize event listKrzysztof Kozlowski1-1/+1
The ppmu_events array is accessed only in this compilation unit so it can be made static. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2017-06-12PM / devfreq: exynos-ppmu: Handle return value of clk_prepare_enableArvind Yadav1-1/+5
clk_prepare_enable() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2017-06-12PM / devfreq: exynos-nocp: Handle return value of clk_prepare_enableArvind Yadav1-1/+5
clk_prepare_enable() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2017-04-12PM / devfreq: Move struct devfreq_governor to devfreq directoryChanwoo Choi1-0/+29
This patch moves the struct devfreq_governor from header file to the devfreq directory because this structure is private data and it have to be only accessed by the devfreq core. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2017-02-27scripts/spelling.txt: add "followings" pattern and fix typo instancesMasahiro Yamada1-1/+1
Fix typos and add the following to the scripts/spelling.txt: followings||following While we are here, add a missing colon in the boilerplate in DT binding documents. The "you SoC" in allwinner,sunxi-pinctrl.txt was fixed as well. I reworded "as the followings:" to "as follows:" for drivers/usb/gadget/udc/renesas_usb3.c. Link: http://lkml.kernel.org/r/1481573103-11329-32-git-send-email-yamada.masahiro@socionext.com Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-02-20Merge branch 'pm-devfreq'Rafael J. Wysocki7-126/+308
* pm-devfreq: PM / devfreq: Modify the device name as devfreq(X) for sysfs PM / devfreq: Simplify the sysfs name of devfreq-event device PM / devfreq: Remove unnecessary separate _remove_devfreq() PM / devfreq: Fix wrong trans_stat of passive devfreq device PM / devfreq: Fix available_governor sysfs PM / devfreq: exynos-ppmu: Show the registred device for ppmu device PM / devfreq: Fix the wrong description for userspace governor PM / devfreq: Fix the checkpatch warnings PM / devfreq: exynos-bus: Print the real clock rate of bus PM / devfreq: exynos-ppmu: Use the regmap interface to handle the registers PM / devfreq: exynos-bus: Add the detailed correlation for Exynos5433 PM / devfreq: Don't delete sysfs group twice
2017-01-31PM / devfreq: Modify the device name as devfreq(X) for sysfsChanwoo Choi1-1/+3
This patch modifies the device name as devfreq(X) for sysfs by using the 'devfreq' prefix word instead of separate device name. On user-space aspect, user would find the some devfreq drvier with 'devfreq(X)' pattern. So, this patch modify the device name as following: - /sys/class/devfreq/[non-standard device name] -> /sys/class/devfreq/devfreq(X) Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2017-01-31PM / devfreq: Simplify the sysfs name of devfreq-event deviceChanwoo Choi1-2/+2
This patch just removes '.' character from the sysfs name of devfreq-event device as following. Usually, the subsystem uses the similiar naming style such as {framework name}{Number}. - old : /sys/class/devfreq-event/event.(X) - new : /sys/class/devfreq-event/event(X) And this patch initializes the value of 'event_no' with -1 in order to remove the unneeded operation (-1) when calling the atomic_inc_return(&event_no). Lastly, this patch adds the ABI document for devfreq-event class. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2017-01-31PM / devfreq: Remove unnecessary separate _remove_devfreq()Chanwoo Choi1-16/+7
The _remove_devfreq() releases the all resources of the devfreq device. This function is only called in the devfreq_dev_release(). For that reason, the devfreq core doesn't need to leave the _remove_devfreq() separately. This patch releases the all resources in the devfreq_dev_release() and then removes the _remove_devfreq(). Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2017-01-31PM / devfreq: Fix wrong trans_stat of passive devfreq deviceChanwoo Choi3-1/+9
Until now, the trans_stat information of passive devfreq is not updated. This patch updates the trans_stat information after setting the target frequency of passive devfreq device. Fixes: 996133119f57 ("PM / devfreq: Add new passive governor") Cc: stable@vger.kernel.org Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2017-01-31PM / devfreq: Fix available_governor sysfsChanwoo Choi2-4/+28
The devfreq using passive governor is not able to change the governor. So, the user can not change the governor through 'available_governor' sysfs entry. Also, the devfreq which don't use the passive governor is not able to change to 'passive' governor on the fly. Fixes: 996133119f57 ("PM / devfreq: Add new passive governor") Cc: stable@vger.kernel.org Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2017-01-31PM / devfreq: exynos-ppmu: Show the registred device for ppmu deviceChanwoo Choi1-0/+3
This patch just adds the simple log to show the PPMU device's registration during the kernel booting. Cc: Kukjin Kim <kgene@kernel.org> Cc: Krzysztof Kozlowski <krzk@kernel.org> Cc: Javier Martinez Canillas <javier@osg.samsung.com> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2017-01-31PM / devfreq: Fix the wrong description for userspace governorChanwoo Choi1-2/+1
This patch fixes the wrong description of governor_userspace.c and removes the unneeded blank line. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2017-01-31PM / devfreq: Fix the checkpatch warningsChanwoo Choi1-6/+7
This patch just fixes the checkpatch warnings. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2017-01-31PM / devfreq: exynos-bus: Print the real clock rate of busChanwoo Choi1-4/+4
This patch shows the real clock rate after calling clk_set_rate() to debug it. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2017-01-31PM / devfreq: exynos-ppmu: Use the regmap interface to handle the registersChanwoo Choi1-89/+237
This patch uses the regmap interface to read and write the registers for exynos PPMU device instead of the legacy memory map functions. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2017-01-31PM / devfreq: Don't delete sysfs group twiceChris Diamand1-1/+7
The 'userspace' governor adds a sysfs entry, which is removed when the governor is changed, or the devfreq device is released. However, when the latter occurs via device_unregister(), device_del() is called first, which removes the sysfs entries recursively and deletes the kobject. This means we get an Oops when the governor calls sysfs_remove_group() on the deleted kobject. Fix this by only doing the call when kobj *hasn't* been kobject_del()'d. Note that we can't just remove the call to sysfs_remove_group() entirely - it's needed for when the governor is changed to one which doesn't need a sysfs entry. Signed-off-by: Chris Diamand <chris.diamand@arm.com> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2017-01-30PM / OPP: Update OPP users to put referenceViresh Kumar5-35/+17
This patch updates dev_pm_opp_find_freq_*() routines to get a reference to the OPPs returned by them. Also updates the users of dev_pm_opp_find_freq_*() routines to call dev_pm_opp_put() after they are done using the OPPs. As it is guaranteed the that OPPs wouldn't get freed while being used, the RCU read side locking present with the users isn't required anymore. Drop it as well. This patch also updates all users of devfreq_recommended_opp() which was returning an OPP received from the OPP core. Note that some of the OPP core routines have gained rcu_read_{lock|unlock}() calls, as those still use RCU specific APIs within them. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> [Devfreq] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-01-27PM / OPP: Don't expose srcu_head to register notifiersViresh Kumar1-24/+2
Let the OPP core provide helpers to register notifiers for any device, instead of exposing srcu_head outside of the core. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-01-03PM / devfreq: exynos-bus: Fix the wrong return valueChanwoo Choi1-1/+1
This patch fixes the wrong return value. If devfreq driver requires the wrong and non-available governor, it is fail. So, this patch returns the error insead of -EPROBE_DEFER. Fixes: 403e0689d2a9 (PM / devfreq: exynos: Add support of bus frequency of sub-blocks using passive governor) Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-01-03PM / devfreq: Fix the bug of devfreq_add_device when governor is NULLChanwoo Choi1-5/+10
This patch fixes the bug of devfreq_add_device(). The devfreq device must have the default governor. If find_devfreq_governor() returns error, devfreq_add_device() fail to add the devfreq instance. Fixes: 1b5c1be2c88e (PM / devfreq: map devfreq drivers to governor using name) Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-12-08devfreq: rk3399_dmc: Don't use OPP structures outside of RCU locksViresh Kumar1-6/+5
The OPP structures are abused to the best here, without understanding how the OPP core and RCU locks work. In short, the OPP pointer saved in 'rk3399_dmcfreq' can become invalid under your nose, as the OPP core may free it. Fix various abuses around OPP structures and calls. Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-12-08devfreq: rk3399_dmc: Remove dangling rcu_read_unlock()Viresh Kumar1-1/+0
This call never had the rcu_read_lock() counterpart. Remove the unlock part as well. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-12-08devfreq: exynos: Don't use OPP structures outside of RCU locksViresh Kumar1-15/+14
The OPP structures are abused to the best here, without understanding how the OPP core and RCU locks work. In short, the OPP pointer saved 'struct exynos_bus' can become invalid under your nose, as the OPP core may free it. Fix various abuses around OPP structures and calls. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Tested-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-11-17PM / devfreq: rk3399_dmc: Use the resource-managed function to add devfreq devChanwoo Choi1-1/+1
This patch uses the resource-managed to add the devfreq device. This function will make it easy to handle the devfreq device. - struct devfreq *devm_devfreq_add_device(struct device *dev, struct devfreq_dev_profile *profile, const char *governor_name, void *data); Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-11-17PM / devfreq: correct comment typo.MyungJoo Ham1-1/+1
The function name in the comment was incorrect. Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-11-17PM / devfreq: exynos-ppmu: Remove unused mutex from struct exynos_ppmuAxel Lin1-3/+0
The mutex is not used at all, remove it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-11-17PM / devfreq: exynos-ppmu: ppmu_events array should not be NULL terminatedAxel Lin1-2/+0
The rest of the code uses ARRAY_SIZE to count the number of entries in ppmu_events array. The NULL terminated entry makes ARRAY_SIZE return off-by-one value. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-11-17PM / devfreq: exynos-ppmu: Fix module autoloadJavier Martinez Canillas1-0/+1
If the driver is built as a module, autoload won't work because the module alias information is not filled. So user-space can't match the registered device with the corresponding module. Export the module alias information using the MODULE_DEVICE_TABLE() macro. Before this patch: $ modinfo drivers/devfreq/event/exynos-ppmu.ko | grep alias $ After this patch: $ modinfo drivers/devfreq/event/exynos-ppmu.ko | grep alias alias: of:N*T*Csamsung,exynos-ppmu-v2C* alias: of:N*T*Csamsung,exynos-ppmu-v2 alias: of:N*T*Csamsung,exynos-ppmuC* alias: of:N*T*Csamsung,exynos-ppmu Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-11-17PM / devfreq: rockchip-dfi: Fix module autoloadJavier Martinez Canillas1-0/+1
If the driver is built as a module, autoload won't work because the module alias information is not filled. So user-space can't match the registered device with the corresponding module. Export the module alias information using the MODULE_DEVICE_TABLE() macro. Before this patch: $ modinfo drivers/devfreq/event/rockchip-dfi.ko | grep alias $ After this patch: $ modinfo drivers/devfreq/event/rockchip-dfi.ko | grep alias alias: of:N*T*Crockchip,rk3399-dfiC* alias: of:N*T*Crockchip,rk3399-dfi Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-11-17PM / devfreq: exynos-nocp: Fix module autoloadJavier Martinez Canillas1-0/+1
If the driver is built as a module, autoload won't work because the module alias information is not filled. So user-space can't match the registered device with the corresponding module. Export the module alias information using the MODULE_DEVICE_TABLE() macro. Before this patch: $ modinfo drivers/devfreq/event/exynos-nocp.ko | grep alias $ After this patch: $ modinfo drivers/devfreq/event/exynos-nocp.ko | grep alias alias: of:N*T*Csamsung,exynos5420-nocpC* alias: of:N*T*Csamsung,exynos5420-nocp Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-11-17PM / devfreq: rk3399_dmc: Fix module autoloadJavier Martinez Canillas1-0/+1
If the driver is built as a module, autoload won't work because the module alias information is not filled. So user-space can't match the registered device with the corresponding module. Export the module alias information using the MODULE_DEVICE_TABLE() macro. Before this patch: $ modinfo drivers/devfreq/rk3399_dmc.ko | grep alias $ After this patch: $ modinfo drivers/devfreq/rk3399_dmc.ko | grep alias alias: of:N*T*Crockchip,rk3399-dmcC* alias: of:N*T*Crockchip,rk3399-dmc Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2016-10-11PM / devfreq: Skip status update on uninitialized previous_freqTobias Jakobi1-0/+4
In case devfreq->previous_freq is still uninitialized in devfreq_update_status(), i.e. it has value '0', the lookups in that function fail, eventually leading to some error message: [ 3.041292] devfreq bus_dmc: Couldn't update frequency transition information. Just skip the statup update in this situation. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-10-11PM / devfreq: Add proper locking around list_del()Axel Lin1-1/+3
Use devfreq_list_lock around list_del() to prevent list corruption. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-10-10PM / devfreq: exynos-nocp: Remove redundant codeAxel Lin1-3/+0
load_count/total_count are reset by devfreq_event_get_event(), so remove the redundant code in exynos_nocp_get_event(). Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> [ rjw: Subject/changelog ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-10-10PM / devfreq: exynos-nocp: Select REGMAP_MMIOAxel Lin1-0/+1
This driver uses devm_regmap_init_mmio(), so select REGMAP_MMIO to avoid build failure. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-09-19PM / devfreq: rk3399_dmc: Remove explictly regulator_put call in .removeAxel Lin1-10/+0
Current code uses devm_regulator_get() in .probe so a regulator_put() will be automatically called when unload the module. Remove the explictly regulator_put() call and then we can also remove rk3399_dmcfreq_remove(). Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-09-19PM / devfreq: rockchip: add PM_DEVFREQ_EVENT dependencyArnd Bergmann1-0/+1
The newly added ARM_RK3399_DMC_DEVFREQ driver requires the DEVFREQ_EVENT_ROCKCHIP_DFI driver and tries to turn that on through a 'select' statement, and that in turn has a dependency on PM_DEVFREQ_EVENT, which may be disabled here: warning: (ARM_RK3399_DMC_DEVFREQ) selects DEVFREQ_EVENT_ROCKCHIP_DFI which has unmet direct dependencies (PM_DEVFREQ && PM_DEVFREQ_EVENT && ARCH_ROCKCHIP) We probably want a 'depends on' here, but other drivers use 'select' too, so for consistency I'm doing the same. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: 5a893e31a636 (PM / devfreq: rockchip: add devfreq driver for rk3399 dmc) Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-09-14partial revert of "PM / devfreq: Add COMPILE_TEST for build coverage"Stephen Rothwell1-1/+1
This reverts the Tegra part of commit 797da5598f3a (PM / devfreq: Add COMPILE_TEST for build coverage) that introduced a build failute in in linux-next. [ rjw: Changelog ] Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-09-06PM / devfreq: rockchip: add devfreq driver for rk3399 dmcLin Huang3-0/+492
base on dfi result, we do ddr frequency scaling, register dmc driver to devfreq framework, and use simple-ondemand policy. Signed-off-by: Lin Huang <hl@rock-chips.com> Signed-off-by: MyngJoo Ham <myngjoo.ham@samsung.com> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-09-06PM / devfreq: event: support rockchip dfi controllerLin Huang3-0/+264
on rk3399 platform, there is dfi conroller can monitor ddr load, base on this result, we can do ddr freqency scaling. Signed-off-by: Lin Huang <hl@rock-chips.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-09-06PM / devfreq: fix Kconfig indent styleJisheng Zhang1-8/+8
Use tab rather than space to indent, and tab + two spaces to indent help message. Signed-off-by: Jisheng Zhang <jszhang@marvell.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>