Lines Matching refs:dc
17 struct tegra_dc *dc; member
78 static void tegra_dc_write_regs(struct tegra_dc *dc, in tegra_dc_write_regs() argument
85 tegra_dc_writel(dc, table[i].value, table[i].offset); in tegra_dc_write_regs()
96 tegra_dc_write_regs(rgb->dc, rgb_enable, ARRAY_SIZE(rgb_enable)); in tegra_output_rgb_enable()
99 tegra_dc_writel(rgb->dc, value, DC_DISP_DATA_ENABLE_OPTIONS); in tegra_output_rgb_enable()
102 value = tegra_dc_readl(rgb->dc, DC_COM_PIN_OUTPUT_POLARITY(1)); in tegra_output_rgb_enable()
105 tegra_dc_writel(rgb->dc, value, DC_COM_PIN_OUTPUT_POLARITY(1)); in tegra_output_rgb_enable()
110 tegra_dc_writel(rgb->dc, value, DC_DISP_DISP_INTERFACE_CONTROL); in tegra_output_rgb_enable()
114 tegra_dc_writel(rgb->dc, value, DC_DISP_SHIFT_CLOCK_OPTIONS); in tegra_output_rgb_enable()
116 value = tegra_dc_readl(rgb->dc, DC_CMD_DISPLAY_COMMAND); in tegra_output_rgb_enable()
119 tegra_dc_writel(rgb->dc, value, DC_CMD_DISPLAY_COMMAND); in tegra_output_rgb_enable()
121 value = tegra_dc_readl(rgb->dc, DC_CMD_DISPLAY_POWER_CONTROL); in tegra_output_rgb_enable()
124 tegra_dc_writel(rgb->dc, value, DC_CMD_DISPLAY_POWER_CONTROL); in tegra_output_rgb_enable()
126 tegra_dc_writel(rgb->dc, GENERAL_ACT_REQ << 8, DC_CMD_STATE_CONTROL); in tegra_output_rgb_enable()
127 tegra_dc_writel(rgb->dc, GENERAL_ACT_REQ, DC_CMD_STATE_CONTROL); in tegra_output_rgb_enable()
142 value = tegra_dc_readl(rgb->dc, DC_CMD_DISPLAY_POWER_CONTROL); in tegra_output_rgb_disable()
145 tegra_dc_writel(rgb->dc, value, DC_CMD_DISPLAY_POWER_CONTROL); in tegra_output_rgb_disable()
147 value = tegra_dc_readl(rgb->dc, DC_CMD_DISPLAY_COMMAND); in tegra_output_rgb_disable()
149 tegra_dc_writel(rgb->dc, value, DC_CMD_DISPLAY_COMMAND); in tegra_output_rgb_disable()
151 tegra_dc_writel(rgb->dc, GENERAL_ACT_REQ << 8, DC_CMD_STATE_CONTROL); in tegra_output_rgb_disable()
152 tegra_dc_writel(rgb->dc, GENERAL_ACT_REQ, DC_CMD_STATE_CONTROL); in tegra_output_rgb_disable()
154 tegra_dc_write_regs(rgb->dc, rgb_disable, ARRAY_SIZE(rgb_disable)); in tegra_output_rgb_disable()
218 int tegra_dc_rgb_probe(struct tegra_dc *dc) in tegra_dc_rgb_probe() argument
224 np = of_get_child_by_name(dc->dev->of_node, "rgb"); in tegra_dc_rgb_probe()
228 rgb = devm_kzalloc(dc->dev, sizeof(*rgb), GFP_KERNEL); in tegra_dc_rgb_probe()
232 rgb->output.dev = dc->dev; in tegra_dc_rgb_probe()
234 rgb->dc = dc; in tegra_dc_rgb_probe()
240 rgb->clk = devm_clk_get(dc->dev, NULL); in tegra_dc_rgb_probe()
242 dev_err(dc->dev, "failed to get clock\n"); in tegra_dc_rgb_probe()
246 rgb->clk_parent = devm_clk_get(dc->dev, "parent"); in tegra_dc_rgb_probe()
248 dev_err(dc->dev, "failed to get parent clock\n"); in tegra_dc_rgb_probe()
254 dev_err(dc->dev, "failed to set parent clock: %d\n", err); in tegra_dc_rgb_probe()
258 dc->rgb = &rgb->output; in tegra_dc_rgb_probe()
263 int tegra_dc_rgb_remove(struct tegra_dc *dc) in tegra_dc_rgb_remove() argument
267 if (!dc->rgb) in tegra_dc_rgb_remove()
270 err = tegra_output_remove(dc->rgb); in tegra_dc_rgb_remove()
277 int tegra_dc_rgb_init(struct drm_device *drm, struct tegra_dc *dc) in tegra_dc_rgb_init() argument
279 struct tegra_rgb *rgb = to_rgb(dc->rgb); in tegra_dc_rgb_init()
282 if (!dc->rgb) in tegra_dc_rgb_init()
288 err = tegra_output_init(dc->base.dev, &rgb->output); in tegra_dc_rgb_init()
290 dev_err(dc->dev, "output setup failed: %d\n", err); in tegra_dc_rgb_init()
299 rgb->output.encoder.possible_crtcs = drm_crtc_mask(&dc->base); in tegra_dc_rgb_init()
304 int tegra_dc_rgb_exit(struct tegra_dc *dc) in tegra_dc_rgb_exit() argument
306 if (dc->rgb) { in tegra_dc_rgb_exit()
309 err = tegra_output_disable(dc->rgb); in tegra_dc_rgb_exit()
311 dev_err(dc->dev, "output failed to disable: %d\n", err); in tegra_dc_rgb_exit()
315 err = tegra_output_exit(dc->rgb); in tegra_dc_rgb_exit()
317 dev_err(dc->dev, "output cleanup failed: %d\n", err); in tegra_dc_rgb_exit()
321 dc->rgb = NULL; in tegra_dc_rgb_exit()