drm/sun4i: dsi: Handle bus clock explicitly
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. To support this kind of clocking structure variants in the same dsi driver, explicit handling of common clock would require since the A64 doesn't need to mention the clock-names explicitly in dts since it support only one bus clock. Also pass clk_id NULL instead "bus" to regmap clock init function since the single clock variants no need to mention clock-names explicitly. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Message-Id: <20191025175625.8011-5-jagan@amarulasolutions.com>alistair/sunxi64-5.4-dsi
parent
60ac65c8a7
commit
aaaca412a1
|
@ -1109,7 +1109,7 @@ static int sun6i_dsi_probe(struct platform_device *pdev)
|
|||
return PTR_ERR(dsi->regulator);
|
||||
}
|
||||
|
||||
dsi->regs = devm_regmap_init_mmio_clk(dev, "bus", base,
|
||||
dsi->regs = devm_regmap_init_mmio_clk(dev, NULL, base,
|
||||
&sun6i_dsi_regmap_config);
|
||||
if (IS_ERR(dsi->regs)) {
|
||||
dev_err(dev, "Couldn't create the DSI encoder regmap\n");
|
||||
|
@ -1122,6 +1122,12 @@ static int sun6i_dsi_probe(struct platform_device *pdev)
|
|||
return PTR_ERR(dsi->reset);
|
||||
}
|
||||
|
||||
dsi->bus_clk = devm_clk_get(dev, NULL);
|
||||
if (IS_ERR(dsi->bus_clk)) {
|
||||
dev_err(dev, "Couldn't get the DSI bus clock\n");
|
||||
return PTR_ERR(dsi->bus_clk);
|
||||
}
|
||||
|
||||
if (dsi->variant->has_mod_clk) {
|
||||
dsi->mod_clk = devm_clk_get(dev, "mod");
|
||||
if (IS_ERR(dsi->mod_clk)) {
|
||||
|
@ -1196,6 +1202,7 @@ static int __maybe_unused sun6i_dsi_runtime_resume(struct device *dev)
|
|||
}
|
||||
|
||||
reset_control_deassert(dsi->reset);
|
||||
clk_prepare_enable(dsi->bus_clk);
|
||||
if (dsi->variant->has_mod_clk)
|
||||
clk_prepare_enable(dsi->mod_clk);
|
||||
|
||||
|
@ -1227,6 +1234,7 @@ static int __maybe_unused sun6i_dsi_runtime_suspend(struct device *dev)
|
|||
|
||||
if (dsi->variant->has_mod_clk)
|
||||
clk_disable_unprepare(dsi->mod_clk);
|
||||
clk_disable_unprepare(dsi->bus_clk);
|
||||
reset_control_assert(dsi->reset);
|
||||
regulator_disable(dsi->regulator);
|
||||
|
||||
|
|
Loading…
Reference in New Issue