rgb.c (1ac731c529cd4d6adbce134754b51ff7d822b145) rgb.c (20a176aeba9a11980b3443e2007a2794a26cadb0)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (C) 2012 Avionic Design GmbH
4 * Copyright (C) 2012 NVIDIA CORPORATION. All rights reserved.
5 */
6
7#include <linux/clk.h>
8#include <linux/of.h>

--- 201 unchanged lines hidden (view full) ---

210
211 err = tegra_output_probe(&rgb->output);
212 if (err < 0)
213 return err;
214
215 rgb->clk = devm_clk_get(dc->dev, NULL);
216 if (IS_ERR(rgb->clk)) {
217 dev_err(dc->dev, "failed to get clock\n");
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (C) 2012 Avionic Design GmbH
4 * Copyright (C) 2012 NVIDIA CORPORATION. All rights reserved.
5 */
6
7#include <linux/clk.h>
8#include <linux/of.h>

--- 201 unchanged lines hidden (view full) ---

210
211 err = tegra_output_probe(&rgb->output);
212 if (err < 0)
213 return err;
214
215 rgb->clk = devm_clk_get(dc->dev, NULL);
216 if (IS_ERR(rgb->clk)) {
217 dev_err(dc->dev, "failed to get clock\n");
218 return PTR_ERR(rgb->clk);
218 err = PTR_ERR(rgb->clk);
219 goto remove;
219 }
220
221 rgb->clk_parent = devm_clk_get(dc->dev, "parent");
222 if (IS_ERR(rgb->clk_parent)) {
223 dev_err(dc->dev, "failed to get parent clock\n");
220 }
221
222 rgb->clk_parent = devm_clk_get(dc->dev, "parent");
223 if (IS_ERR(rgb->clk_parent)) {
224 dev_err(dc->dev, "failed to get parent clock\n");
224 return PTR_ERR(rgb->clk_parent);
225 err = PTR_ERR(rgb->clk_parent);
226 goto remove;
225 }
226
227 err = clk_set_parent(rgb->clk, rgb->clk_parent);
228 if (err < 0) {
229 dev_err(dc->dev, "failed to set parent clock: %d\n", err);
227 }
228
229 err = clk_set_parent(rgb->clk, rgb->clk_parent);
230 if (err < 0) {
231 dev_err(dc->dev, "failed to set parent clock: %d\n", err);
230 return err;
232 goto remove;
231 }
232
233 rgb->pll_d_out0 = clk_get_sys(NULL, "pll_d_out0");
234 if (IS_ERR(rgb->pll_d_out0)) {
235 err = PTR_ERR(rgb->pll_d_out0);
236 dev_err(dc->dev, "failed to get pll_d_out0: %d\n", err);
233 }
234
235 rgb->pll_d_out0 = clk_get_sys(NULL, "pll_d_out0");
236 if (IS_ERR(rgb->pll_d_out0)) {
237 err = PTR_ERR(rgb->pll_d_out0);
238 dev_err(dc->dev, "failed to get pll_d_out0: %d\n", err);
237 return err;
239 goto remove;
238 }
239
240 if (dc->soc->has_pll_d2_out0) {
241 rgb->pll_d2_out0 = clk_get_sys(NULL, "pll_d2_out0");
242 if (IS_ERR(rgb->pll_d2_out0)) {
243 err = PTR_ERR(rgb->pll_d2_out0);
244 dev_err(dc->dev, "failed to get pll_d2_out0: %d\n", err);
240 }
241
242 if (dc->soc->has_pll_d2_out0) {
243 rgb->pll_d2_out0 = clk_get_sys(NULL, "pll_d2_out0");
244 if (IS_ERR(rgb->pll_d2_out0)) {
245 err = PTR_ERR(rgb->pll_d2_out0);
246 dev_err(dc->dev, "failed to get pll_d2_out0: %d\n", err);
245 return err;
247 goto remove;
246 }
247 }
248
249 dc->rgb = &rgb->output;
250
251 return 0;
248 }
249 }
250
251 dc->rgb = &rgb->output;
252
253 return 0;
254
255remove:
256 tegra_output_remove(&rgb->output);
257 return err;
252}
253
254void tegra_dc_rgb_remove(struct tegra_dc *dc)
255{
256 struct tegra_rgb *rgb;
257
258 if (!dc->rgb)
259 return;

--- 95 unchanged lines hidden ---
258}
259
260void tegra_dc_rgb_remove(struct tegra_dc *dc)
261{
262 struct tegra_rgb *rgb;
263
264 if (!dc->rgb)
265 return;

--- 95 unchanged lines hidden ---