| .. | .. |
|---|
| 777 | 777 | static int sun4i_tcon_init_clocks(struct device *dev, |
|---|
| 778 | 778 | struct sun4i_tcon *tcon) |
|---|
| 779 | 779 | { |
|---|
| 780 | | - tcon->clk = devm_clk_get(dev, "ahb"); |
|---|
| 780 | + tcon->clk = devm_clk_get_enabled(dev, "ahb"); |
|---|
| 781 | 781 | if (IS_ERR(tcon->clk)) { |
|---|
| 782 | 782 | dev_err(dev, "Couldn't get the TCON bus clock\n"); |
|---|
| 783 | 783 | return PTR_ERR(tcon->clk); |
|---|
| 784 | 784 | } |
|---|
| 785 | | - clk_prepare_enable(tcon->clk); |
|---|
| 786 | 785 | |
|---|
| 787 | 786 | if (tcon->quirks->has_channel_0) { |
|---|
| 788 | | - tcon->sclk0 = devm_clk_get(dev, "tcon-ch0"); |
|---|
| 787 | + tcon->sclk0 = devm_clk_get_enabled(dev, "tcon-ch0"); |
|---|
| 789 | 788 | if (IS_ERR(tcon->sclk0)) { |
|---|
| 790 | 789 | dev_err(dev, "Couldn't get the TCON channel 0 clock\n"); |
|---|
| 791 | 790 | return PTR_ERR(tcon->sclk0); |
|---|
| 792 | 791 | } |
|---|
| 793 | 792 | } |
|---|
| 794 | | - clk_prepare_enable(tcon->sclk0); |
|---|
| 795 | 793 | |
|---|
| 796 | 794 | if (tcon->quirks->has_channel_1) { |
|---|
| 797 | 795 | tcon->sclk1 = devm_clk_get(dev, "tcon-ch1"); |
|---|
| .. | .. |
|---|
| 802 | 800 | } |
|---|
| 803 | 801 | |
|---|
| 804 | 802 | return 0; |
|---|
| 805 | | -} |
|---|
| 806 | | - |
|---|
| 807 | | -static void sun4i_tcon_free_clocks(struct sun4i_tcon *tcon) |
|---|
| 808 | | -{ |
|---|
| 809 | | - clk_disable_unprepare(tcon->sclk0); |
|---|
| 810 | | - clk_disable_unprepare(tcon->clk); |
|---|
| 811 | 803 | } |
|---|
| 812 | 804 | |
|---|
| 813 | 805 | static int sun4i_tcon_init_irq(struct device *dev, |
|---|
| .. | .. |
|---|
| 1224 | 1216 | ret = sun4i_tcon_init_regmap(dev, tcon); |
|---|
| 1225 | 1217 | if (ret) { |
|---|
| 1226 | 1218 | dev_err(dev, "Couldn't init our TCON regmap\n"); |
|---|
| 1227 | | - goto err_free_clocks; |
|---|
| 1219 | + goto err_assert_reset; |
|---|
| 1228 | 1220 | } |
|---|
| 1229 | 1221 | |
|---|
| 1230 | 1222 | if (tcon->quirks->has_channel_0) { |
|---|
| 1231 | 1223 | ret = sun4i_dclk_create(dev, tcon); |
|---|
| 1232 | 1224 | if (ret) { |
|---|
| 1233 | 1225 | dev_err(dev, "Couldn't create our TCON dot clock\n"); |
|---|
| 1234 | | - goto err_free_clocks; |
|---|
| 1226 | + goto err_assert_reset; |
|---|
| 1235 | 1227 | } |
|---|
| 1236 | 1228 | } |
|---|
| 1237 | 1229 | |
|---|
| .. | .. |
|---|
| 1294 | 1286 | err_free_dotclock: |
|---|
| 1295 | 1287 | if (tcon->quirks->has_channel_0) |
|---|
| 1296 | 1288 | sun4i_dclk_free(tcon); |
|---|
| 1297 | | -err_free_clocks: |
|---|
| 1298 | | - sun4i_tcon_free_clocks(tcon); |
|---|
| 1299 | 1289 | err_assert_reset: |
|---|
| 1300 | 1290 | reset_control_assert(tcon->lcd_rst); |
|---|
| 1301 | 1291 | return ret; |
|---|
| .. | .. |
|---|
| 1309 | 1299 | list_del(&tcon->list); |
|---|
| 1310 | 1300 | if (tcon->quirks->has_channel_0) |
|---|
| 1311 | 1301 | sun4i_dclk_free(tcon); |
|---|
| 1312 | | - sun4i_tcon_free_clocks(tcon); |
|---|
| 1313 | 1302 | } |
|---|
| 1314 | 1303 | |
|---|
| 1315 | 1304 | static const struct component_ops sun4i_tcon_ops = { |
|---|