Commit 031eda18 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge tag 'devfreq-next-for-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux

Pull devfreq updates for v5.16 from Chanwoo Choi:

"1. Minor update for exynos-ppmu devfreq-event driver

  - Devicetree naming convention requires the device node names
    to use hyphens instead of underlines. In order to support
    this requirement, changes the code with hyphens.

  - Simplify parsing event-type from devicetree without behavior
    changes.

 2. Strengthen check for freq_table in devfreq core

  - Check whether both freq_table is not NULL and size of freq_table
    is not zero in order to prevent the error by mistake of devfreq
    driver developer.

* tag 'devfreq-next-for-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux:
  PM / devfreq: Strengthen check for freq_table
  devfreq: exynos-ppmu: simplify parsing event-type from DT
  devfreq: exynos-ppmu: use node names with hyphens
parents 3906fe9b 5cf79c29
...@@ -827,7 +827,7 @@ struct devfreq *devfreq_add_device(struct device *dev, ...@@ -827,7 +827,7 @@ struct devfreq *devfreq_add_device(struct device *dev,
goto err_dev; goto err_dev;
} }
if (!devfreq->profile->max_state && !devfreq->profile->freq_table) { if (!devfreq->profile->max_state || !devfreq->profile->freq_table) {
mutex_unlock(&devfreq->lock); mutex_unlock(&devfreq->lock);
err = set_freq_table(devfreq); err = set_freq_table(devfreq);
if (err < 0) if (err < 0)
......
...@@ -94,11 +94,16 @@ static struct __exynos_ppmu_events { ...@@ -94,11 +94,16 @@ static struct __exynos_ppmu_events {
PPMU_EVENT(d1-general), PPMU_EVENT(d1-general),
PPMU_EVENT(d1-rt), PPMU_EVENT(d1-rt),
/* For Exynos5422 SoC */ /* For Exynos5422 SoC, deprecated (backwards compatible) */
PPMU_EVENT(dmc0_0), PPMU_EVENT(dmc0_0),
PPMU_EVENT(dmc0_1), PPMU_EVENT(dmc0_1),
PPMU_EVENT(dmc1_0), PPMU_EVENT(dmc1_0),
PPMU_EVENT(dmc1_1), PPMU_EVENT(dmc1_1),
/* For Exynos5422 SoC */
PPMU_EVENT(dmc0-0),
PPMU_EVENT(dmc0-1),
PPMU_EVENT(dmc1-0),
PPMU_EVENT(dmc1-1),
}; };
static int __exynos_ppmu_find_ppmu_id(const char *edev_name) static int __exynos_ppmu_find_ppmu_id(const char *edev_name)
...@@ -561,13 +566,10 @@ static int of_get_devfreq_events(struct device_node *np, ...@@ -561,13 +566,10 @@ static int of_get_devfreq_events(struct device_node *np,
* use default if not. * use default if not.
*/ */
if (info->ppmu_type == EXYNOS_TYPE_PPMU_V2) { if (info->ppmu_type == EXYNOS_TYPE_PPMU_V2) {
int id;
/* Not all registers take the same value for /* Not all registers take the same value for
* read+write data count. * read+write data count.
*/ */
id = __exynos_ppmu_find_ppmu_id(desc[j].name); switch (ppmu_events[i].id) {
switch (id) {
case PPMU_PMNCNT0: case PPMU_PMNCNT0:
case PPMU_PMNCNT1: case PPMU_PMNCNT1:
case PPMU_PMNCNT2: case PPMU_PMNCNT2:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment