• Home
  • Raw
  • Download

Lines Matching full:rgb

94 	struct tegra_rgb *rgb = to_rgb(output);  in tegra_rgb_encoder_disable()  local
96 tegra_dc_write_regs(rgb->dc, rgb_disable, ARRAY_SIZE(rgb_disable)); in tegra_rgb_encoder_disable()
97 tegra_dc_commit(rgb->dc); in tegra_rgb_encoder_disable()
103 struct tegra_rgb *rgb = to_rgb(output); in tegra_rgb_encoder_enable() local
106 tegra_dc_write_regs(rgb->dc, rgb_enable, ARRAY_SIZE(rgb_enable)); in tegra_rgb_encoder_enable()
109 tegra_dc_writel(rgb->dc, value, DC_DISP_DATA_ENABLE_OPTIONS); in tegra_rgb_encoder_enable()
112 value = tegra_dc_readl(rgb->dc, DC_COM_PIN_OUTPUT_POLARITY(1)); in tegra_rgb_encoder_enable()
115 tegra_dc_writel(rgb->dc, value, DC_COM_PIN_OUTPUT_POLARITY(1)); in tegra_rgb_encoder_enable()
120 tegra_dc_writel(rgb->dc, value, DC_DISP_DISP_INTERFACE_CONTROL); in tegra_rgb_encoder_enable()
122 tegra_dc_commit(rgb->dc); in tegra_rgb_encoder_enable()
125 static bool tegra_rgb_pll_rate_change_allowed(struct tegra_rgb *rgb) in tegra_rgb_pll_rate_change_allowed() argument
127 if (!rgb->pll_d2_out0) in tegra_rgb_pll_rate_change_allowed()
130 if (!clk_is_match(rgb->clk_parent, rgb->pll_d_out0) && in tegra_rgb_pll_rate_change_allowed()
131 !clk_is_match(rgb->clk_parent, rgb->pll_d2_out0)) in tegra_rgb_pll_rate_change_allowed()
145 struct tegra_rgb *rgb = to_rgb(output); in tegra_rgb_encoder_atomic_check() local
165 if (tegra_rgb_pll_rate_change_allowed(rgb)) { in tegra_rgb_encoder_atomic_check()
173 div = ((clk_get_rate(rgb->clk) * 2) / pclk) - 2; in tegra_rgb_encoder_atomic_check()
177 err = tegra_dc_state_setup_clock(dc, crtc_state, rgb->clk_parent, in tegra_rgb_encoder_atomic_check()
201 struct tegra_rgb *rgb; in tegra_dc_rgb_probe() local
204 np = of_get_child_by_name(dc->dev->of_node, "rgb"); in tegra_dc_rgb_probe()
215 rgb = devm_kzalloc(dc->dev, sizeof(*rgb), GFP_KERNEL); in tegra_dc_rgb_probe()
216 if (!rgb) in tegra_dc_rgb_probe()
219 rgb->output.dev = dc->dev; in tegra_dc_rgb_probe()
220 rgb->output.of_node = np; in tegra_dc_rgb_probe()
221 rgb->dc = dc; in tegra_dc_rgb_probe()
223 err = tegra_output_probe(&rgb->output); in tegra_dc_rgb_probe()
227 rgb->clk = devm_clk_get(dc->dev, NULL); in tegra_dc_rgb_probe()
228 if (IS_ERR(rgb->clk)) { in tegra_dc_rgb_probe()
230 err = PTR_ERR(rgb->clk); in tegra_dc_rgb_probe()
234 rgb->clk_parent = devm_clk_get(dc->dev, "parent"); in tegra_dc_rgb_probe()
235 if (IS_ERR(rgb->clk_parent)) { in tegra_dc_rgb_probe()
237 err = PTR_ERR(rgb->clk_parent); in tegra_dc_rgb_probe()
241 err = clk_set_parent(rgb->clk, rgb->clk_parent); in tegra_dc_rgb_probe()
247 rgb->pll_d_out0 = clk_get_sys(NULL, "pll_d_out0"); in tegra_dc_rgb_probe()
248 if (IS_ERR(rgb->pll_d_out0)) { in tegra_dc_rgb_probe()
249 err = PTR_ERR(rgb->pll_d_out0); in tegra_dc_rgb_probe()
255 rgb->pll_d2_out0 = clk_get_sys(NULL, "pll_d2_out0"); in tegra_dc_rgb_probe()
256 if (IS_ERR(rgb->pll_d2_out0)) { in tegra_dc_rgb_probe()
257 err = PTR_ERR(rgb->pll_d2_out0); in tegra_dc_rgb_probe()
263 dc->rgb = &rgb->output; in tegra_dc_rgb_probe()
268 clk_put(rgb->pll_d_out0); in tegra_dc_rgb_probe()
270 tegra_output_remove(&rgb->output); in tegra_dc_rgb_probe()
276 struct tegra_rgb *rgb; in tegra_dc_rgb_remove() local
278 if (!dc->rgb) in tegra_dc_rgb_remove()
281 rgb = to_rgb(dc->rgb); in tegra_dc_rgb_remove()
282 clk_put(rgb->pll_d2_out0); in tegra_dc_rgb_remove()
283 clk_put(rgb->pll_d_out0); in tegra_dc_rgb_remove()
285 tegra_output_remove(dc->rgb); in tegra_dc_rgb_remove()
286 dc->rgb = NULL; in tegra_dc_rgb_remove()
291 struct tegra_output *output = dc->rgb; in tegra_dc_rgb_init()
295 if (!dc->rgb) in tegra_dc_rgb_init()
359 * Other outputs can be attached to either display controller. The RGB in tegra_dc_rgb_init()
370 if (dc->rgb) in tegra_dc_rgb_exit()
371 tegra_output_exit(dc->rgb); in tegra_dc_rgb_exit()