Lines Matching refs:drc
25 struct sun6i_drc *drc; in sun6i_drc_bind() local
28 drc = devm_kzalloc(dev, sizeof(*drc), GFP_KERNEL); in sun6i_drc_bind()
29 if (!drc) in sun6i_drc_bind()
31 dev_set_drvdata(dev, drc); in sun6i_drc_bind()
33 drc->reset = devm_reset_control_get(dev, NULL); in sun6i_drc_bind()
34 if (IS_ERR(drc->reset)) { in sun6i_drc_bind()
36 return PTR_ERR(drc->reset); in sun6i_drc_bind()
39 ret = reset_control_deassert(drc->reset); in sun6i_drc_bind()
45 drc->bus_clk = devm_clk_get(dev, "ahb"); in sun6i_drc_bind()
46 if (IS_ERR(drc->bus_clk)) { in sun6i_drc_bind()
48 ret = PTR_ERR(drc->bus_clk); in sun6i_drc_bind()
51 clk_prepare_enable(drc->bus_clk); in sun6i_drc_bind()
53 drc->mod_clk = devm_clk_get(dev, "mod"); in sun6i_drc_bind()
54 if (IS_ERR(drc->mod_clk)) { in sun6i_drc_bind()
56 ret = PTR_ERR(drc->mod_clk); in sun6i_drc_bind()
60 ret = clk_set_rate_exclusive(drc->mod_clk, 300000000); in sun6i_drc_bind()
66 clk_prepare_enable(drc->mod_clk); in sun6i_drc_bind()
71 clk_disable_unprepare(drc->bus_clk); in sun6i_drc_bind()
73 reset_control_assert(drc->reset); in sun6i_drc_bind()
80 struct sun6i_drc *drc = dev_get_drvdata(dev); in sun6i_drc_unbind() local
82 clk_rate_exclusive_put(drc->mod_clk); in sun6i_drc_unbind()
83 clk_disable_unprepare(drc->mod_clk); in sun6i_drc_unbind()
84 clk_disable_unprepare(drc->bus_clk); in sun6i_drc_unbind()
85 reset_control_assert(drc->reset); in sun6i_drc_unbind()