Lines Matching refs:rgrp
33 u32 rcar_du_group_read(struct rcar_du_group *rgrp, u32 reg) in rcar_du_group_read() argument
35 return rcar_du_read(rgrp->dev, rgrp->mmio_offset + reg); in rcar_du_group_read()
38 void rcar_du_group_write(struct rcar_du_group *rgrp, u32 reg, u32 data) in rcar_du_group_write() argument
40 rcar_du_write(rgrp->dev, rgrp->mmio_offset + reg, data); in rcar_du_group_write()
43 static void rcar_du_group_setup_pins(struct rcar_du_group *rgrp) in rcar_du_group_setup_pins() argument
47 if (rgrp->channels_mask & BIT(0)) in rcar_du_group_setup_pins()
50 if (rgrp->channels_mask & BIT(1)) in rcar_du_group_setup_pins()
53 rcar_du_group_write(rgrp, DEFR6, defr6); in rcar_du_group_setup_pins()
56 static void rcar_du_group_setup_defr8(struct rcar_du_group *rgrp) in rcar_du_group_setup_defr8() argument
58 struct rcar_du_device *rcdu = rgrp->dev; in rcar_du_group_setup_defr8()
69 if (rgrp->index == 0) { in rcar_du_group_setup_defr8()
71 if (rgrp->dev->vspd1_sink == 2) in rcar_du_group_setup_defr8()
80 if (rgrp->index == rcdu->dpad0_source / 2) in rcar_du_group_setup_defr8()
84 rcar_du_group_write(rgrp, DEFR8, defr8); in rcar_du_group_setup_defr8()
87 static void rcar_du_group_setup_didsr(struct rcar_du_group *rgrp) in rcar_du_group_setup_didsr() argument
89 struct rcar_du_device *rcdu = rgrp->dev; in rcar_du_group_setup_didsr()
103 if (rcdu->info->gen < 3 && rgrp->index == 0) { in rcar_du_group_setup_didsr()
110 } else if (rcdu->info->gen == 3 && rgrp->num_crtcs > 1) { in rcar_du_group_setup_didsr()
115 rcrtc = &rcdu->crtcs[rgrp->index * 2]; in rcar_du_group_setup_didsr()
116 num_crtcs = rgrp->num_crtcs; in rcar_du_group_setup_didsr()
132 rcar_du_group_write(rgrp, DIDSR, didsr); in rcar_du_group_setup_didsr()
135 static void rcar_du_group_setup(struct rcar_du_group *rgrp) in rcar_du_group_setup() argument
137 struct rcar_du_device *rcdu = rgrp->dev; in rcar_du_group_setup()
141 rcar_du_group_write(rgrp, DEFR, DEFR_CODE | DEFR_DEFE); in rcar_du_group_setup()
143 rcar_du_group_write(rgrp, DEFR2, DEFR2_CODE | DEFR2_DEFE2G); in rcar_du_group_setup()
144 rcar_du_group_write(rgrp, DEFR3, DEFR3_CODE | DEFR3_DEFE3); in rcar_du_group_setup()
145 rcar_du_group_write(rgrp, DEFR4, DEFR4_CODE); in rcar_du_group_setup()
147 rcar_du_group_write(rgrp, DEFR5, DEFR5_CODE | DEFR5_DEFE5); in rcar_du_group_setup()
149 rcar_du_group_setup_pins(rgrp); in rcar_du_group_setup()
156 defr7 |= (rgrp->cmms_mask & BIT(1) ? DEFR7_CMME1 : 0) | in rcar_du_group_setup()
157 (rgrp->cmms_mask & BIT(0) ? DEFR7_CMME0 : 0); in rcar_du_group_setup()
158 rcar_du_group_write(rgrp, DEFR7, defr7); in rcar_du_group_setup()
161 rcar_du_group_setup_defr8(rgrp); in rcar_du_group_setup()
162 rcar_du_group_setup_didsr(rgrp); in rcar_du_group_setup()
166 rcar_du_group_write(rgrp, DEFR10, DEFR10_CODE | DEFR10_DEFE10); in rcar_du_group_setup()
172 rcar_du_group_write(rgrp, DORCR, DORCR_PG1D_DS1 | DORCR_DPRS); in rcar_du_group_setup()
175 mutex_lock(&rgrp->lock); in rcar_du_group_setup()
176 rcar_du_group_write(rgrp, DPTSR, (rgrp->dptsr_planes << 16) | in rcar_du_group_setup()
177 rgrp->dptsr_planes); in rcar_du_group_setup()
178 mutex_unlock(&rgrp->lock); in rcar_du_group_setup()
191 int rcar_du_group_get(struct rcar_du_group *rgrp) in rcar_du_group_get() argument
193 if (rgrp->use_count) in rcar_du_group_get()
196 rcar_du_group_setup(rgrp); in rcar_du_group_get()
199 rgrp->use_count++; in rcar_du_group_get()
208 void rcar_du_group_put(struct rcar_du_group *rgrp) in rcar_du_group_put() argument
210 --rgrp->use_count; in rcar_du_group_put()
213 static void __rcar_du_group_start_stop(struct rcar_du_group *rgrp, bool start) in __rcar_du_group_start_stop() argument
215 struct rcar_du_device *rcdu = rgrp->dev; in __rcar_du_group_start_stop()
225 if (rcdu->info->channels_mask & BIT(rgrp->index * 2)) { in __rcar_du_group_start_stop()
226 struct rcar_du_crtc *rcrtc = &rgrp->dev->crtcs[rgrp->index * 2]; in __rcar_du_group_start_stop()
231 rcar_du_group_write(rgrp, DSYSR, in __rcar_du_group_start_stop()
236 void rcar_du_group_start_stop(struct rcar_du_group *rgrp, bool start) in rcar_du_group_start_stop() argument
251 if (rgrp->used_crtcs++ != 0) in rcar_du_group_start_stop()
252 __rcar_du_group_start_stop(rgrp, false); in rcar_du_group_start_stop()
253 __rcar_du_group_start_stop(rgrp, true); in rcar_du_group_start_stop()
255 if (--rgrp->used_crtcs == 0) in rcar_du_group_start_stop()
256 __rcar_du_group_start_stop(rgrp, false); in rcar_du_group_start_stop()
260 void rcar_du_group_restart(struct rcar_du_group *rgrp) in rcar_du_group_restart() argument
262 rgrp->need_restart = false; in rcar_du_group_restart()
264 __rcar_du_group_start_stop(rgrp, false); in rcar_du_group_restart()
265 __rcar_du_group_start_stop(rgrp, true); in rcar_du_group_restart()
270 struct rcar_du_group *rgrp; in rcar_du_set_dpad0_vsp1_routing() local
286 rgrp = &rcdu->groups[index]; in rcar_du_set_dpad0_vsp1_routing()
293 rcar_du_group_setup_defr8(rgrp); in rcar_du_set_dpad0_vsp1_routing()
300 static void rcar_du_group_set_dpad_levels(struct rcar_du_group *rgrp) in rcar_du_group_set_dpad_levels() argument
310 struct rcar_du_device *rcdu = rgrp->dev; in rcar_du_group_set_dpad_levels()
327 for (i = 0; i < rgrp->num_crtcs; ++i) { in rcar_du_group_set_dpad_levels()
331 rcrtc = &rcdu->crtcs[rgrp->index * 2 + i]; in rcar_du_group_set_dpad_levels()
338 rcar_du_group_write(rgrp, DOFLR, doflr); in rcar_du_group_set_dpad_levels()
341 int rcar_du_group_set_routing(struct rcar_du_group *rgrp) in rcar_du_group_set_routing() argument
343 struct rcar_du_device *rcdu = rgrp->dev; in rcar_du_group_set_routing()
344 u32 dorcr = rcar_du_group_read(rgrp, DORCR); in rcar_du_group_set_routing()
353 if (rcdu->dpad1_source == rgrp->index * 2) in rcar_du_group_set_routing()
358 rcar_du_group_write(rgrp, DORCR, dorcr); in rcar_du_group_set_routing()
360 rcar_du_group_set_dpad_levels(rgrp); in rcar_du_group_set_routing()
362 return rcar_du_set_dpad0_vsp1_routing(rgrp->dev); in rcar_du_group_set_routing()