drm/sun4i: dsi: Handle bus clock via regmap_mmio_attach_clk
authorJagan Teki <jagan@amarulasolutions.com>
Sun, 22 Dec 2019 13:22:26 +0000 (18:52 +0530)
committerMaxime Ripard <maxime@cerno.tech>
Thu, 26 Dec 2019 09:36:31 +0000 (10:36 +0100)
commit66dbdc7c61627a3d3b50017a1d202dc637a10f53
tree7bb2b90ac15512c095351a18c87a40ae430f3a85
parent26a839b3c286060ff3a6d7b14194ae845ec5aa96
drm/sun4i: dsi: Handle bus clock via regmap_mmio_attach_clk

regmap has special API to enable the controller bus clock while
initializing register space, and current driver is using
devm_regmap_init_mmio_clk which require to specify bus
clk_id argument as "bus"

But, the usage of clocks are varies between different Allwinner
DSI controllers. Clocking in A33 would need bus and mod clocks
where as A64 would need only bus clock.

Since A64 support only single bus clock, it is optional to
specify the clock-names on the controller device tree node.
So using NULL on clk_id would get the attached clock.

To support clk_id as "bus" and "NULL" during clock enablement
between controllers, this patch add generic code to handle
the bus clock using regmap_mmio_attach_clk with associated
regmap APIs.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20191222132229.30276-5-jagan@amarulasolutions.com
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c