PM / devfreq: rockchip-dfi: account for multiple DDRMON_CTRL registers
authorSascha Hauer <s.hauer@pengutronix.de>
Wed, 18 Oct 2023 06:17:06 +0000 (08:17 +0200)
committerChanwoo Choi <cw00.choi@samsung.com>
Thu, 19 Oct 2023 12:17:42 +0000 (21:17 +0900)
commitbbe7cbd07406b75ec845eb261f25373bf88b276a
treee1e8e0918743cdc50e4895be7484441a2d17c79b
parentd1d0b3fe95d888f1ae82a0cf6a594fa0c3cbfa79
PM / devfreq: rockchip-dfi: account for multiple DDRMON_CTRL registers

The currently supported RK3399 has a set of registers per channel, but
it has only a single DDRMON_CTRL register. With upcoming RK3588 this
will be different, the RK3588 has a DDRMON_CTRL register per channel.

Instead of expecting a single DDRMON_CTRL register, loop over the
channels and write the channel specific DDRMON_CTRL register. Break
out early out of the loop when there is only a single DDRMON_CTRL
register like on the RK3399.

Link: https://lore.kernel.org/all/20231018061714.3553817-19-s.hauer@pengutronix.de/
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
drivers/devfreq/event/rockchip-dfi.c