aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen-Yu Tsai <wens@csie.org>2017-10-14 00:02:47 -0400
committerMaxime Ripard <maxime.ripard@free-electrons.com>2017-10-16 03:53:50 -0400
commit8270249fbeaf0a37250b0c533fd3613886ca3493 (patch)
tree916e29a1cf8a7e99108407dc9aad4ce82b37e01f
parente8afb7b67fbadfbb2b4fd74bf34566e64cbcbe6f (diff)
drm/sun4i: backend: Create regmap after access is possible
The backend has various clocks and reset controls that need to be enabled and deasserted before register access is possible. Move the creation of the regmap to after the clocks and reset controls have been configured where it makes more sense. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Link: https://patchwork.freedesktop.org/patch/msgid/20171014040252.9621-3-wens@csie.org
-rw-r--r--drivers/gpu/drm/sun4i/sun4i_backend.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/gpu/drm/sun4i/sun4i_backend.c b/drivers/gpu/drm/sun4i/sun4i_backend.c
index ec5943627aa5..1cc1780f5091 100644
--- a/drivers/gpu/drm/sun4i/sun4i_backend.c
+++ b/drivers/gpu/drm/sun4i/sun4i_backend.c
@@ -369,13 +369,6 @@ static int sun4i_backend_bind(struct device *dev, struct device *master,
369 if (IS_ERR(regs)) 369 if (IS_ERR(regs))
370 return PTR_ERR(regs); 370 return PTR_ERR(regs);
371 371
372 backend->engine.regs = devm_regmap_init_mmio(dev, regs,
373 &sun4i_backend_regmap_config);
374 if (IS_ERR(backend->engine.regs)) {
375 dev_err(dev, "Couldn't create the backend regmap\n");
376 return PTR_ERR(backend->engine.regs);
377 }
378
379 backend->reset = devm_reset_control_get(dev, NULL); 372 backend->reset = devm_reset_control_get(dev, NULL);
380 if (IS_ERR(backend->reset)) { 373 if (IS_ERR(backend->reset)) {
381 dev_err(dev, "Couldn't get our reset line\n"); 374 dev_err(dev, "Couldn't get our reset line\n");
@@ -421,6 +414,13 @@ static int sun4i_backend_bind(struct device *dev, struct device *master,
421 } 414 }
422 } 415 }
423 416
417 backend->engine.regs = devm_regmap_init_mmio(dev, regs,
418 &sun4i_backend_regmap_config);
419 if (IS_ERR(backend->engine.regs)) {
420 dev_err(dev, "Couldn't create the backend regmap\n");
421 return PTR_ERR(backend->engine.regs);
422 }
423
424 list_add_tail(&backend->engine.list, &drv->engine_list); 424 list_add_tail(&backend->engine.list, &drv->engine_list);
425 425
426 /* Reset the registers */ 426 /* Reset the registers */