PM / devfreq: rk3399_dmc: initialize min_freq and max_freq
authorFinley Xiao <finley.xiao@rock-chips.com>
Wed, 1 Mar 2017 10:00:48 +0000 (18:00 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Fri, 7 Apr 2017 03:46:55 +0000 (11:46 +0800)
In order to get correct results from sysfs, e.g.:
cat /sys/class/devfreq/dmc/min_freq
cat /sys/class/devfreq/dmc/max_freq

Change-Id: Id5921fdbacd0977c0b5378ccf0de068f0195b557
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
drivers/devfreq/rk3399_dmc.c

index 98312f9..fc6ed4d 100644 (file)
@@ -467,6 +467,10 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev)
                return PTR_ERR(data->devfreq);
        devm_devfreq_register_opp_notifier(dev, data->devfreq);
 
+       data->devfreq->min_freq = devp->freq_table[0];
+       data->devfreq->max_freq =
+               devp->freq_table[devp->max_state ? devp->max_state - 1 : 0];
+
        data->dev = dev;
        platform_set_drvdata(pdev, data);