Commit 41982740 authored by Sascha Hauer's avatar Sascha Hauer Committed by Chanwoo Choi

PM / devfreq: rockchip-dfi: dfi store raw values in counter struct

When adding perf support to the DFI driver the perf part will
need the raw counter values, so move the fixed * 4 factor to
rockchip_dfi_get_event().

Link: https://lore.kernel.org/lkml/20230704093242.583575-6-s.hauer@pengutronix.de/Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
parent 559dc287
......@@ -97,7 +97,7 @@ static int rockchip_dfi_get_busier_ch(struct devfreq_event_dev *edev)
/* Find out which channel is busier */
for (i = 0; i < RK3399_DMC_NUM_CH; i++) {
dfi->ch_usage[i].access = readl_relaxed(dfi_regs +
DDRMON_CH0_DFI_ACCESS_NUM + i * 20) * 4;
DDRMON_CH0_DFI_ACCESS_NUM + i * 20);
dfi->ch_usage[i].total = readl_relaxed(dfi_regs +
DDRMON_CH0_COUNT_NUM + i * 20);
tmp = dfi->ch_usage[i].access;
......@@ -149,7 +149,7 @@ static int rockchip_dfi_get_event(struct devfreq_event_dev *edev,
busier_ch = rockchip_dfi_get_busier_ch(edev);
edata->load_count = dfi->ch_usage[busier_ch].access;
edata->load_count = dfi->ch_usage[busier_ch].access * 4;
edata->total_count = dfi->ch_usage[busier_ch].total;
return 0;
......
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