Lines Matching +full:1 +full:- +full:sd
1 // SPDX-License-Identifier: GPL-2.0-only
17 #include <linux/platform_data/i2c-davinci.h>
24 #include <media/v4l2-device.h>
28 #define MODULE_NAME "davinci-vpbe-venc"
50 MODULE_PARM_DESC(debug, "Debug level 0-2");
53 struct v4l2_subdev sd; member
65 static inline struct venc_state *to_state(struct v4l2_subdev *sd) in to_state() argument
67 return container_of(sd, struct venc_state, sd); in to_state()
70 static inline u32 venc_read(struct v4l2_subdev *sd, u32 offset) in venc_read() argument
72 struct venc_state *venc = to_state(sd); in venc_read()
74 return readl(venc->venc_base + offset); in venc_read()
77 static inline u32 venc_write(struct v4l2_subdev *sd, u32 offset, u32 val) in venc_write() argument
79 struct venc_state *venc = to_state(sd); in venc_write()
81 writel(val, (venc->venc_base + offset)); in venc_write()
86 static inline u32 venc_modify(struct v4l2_subdev *sd, u32 offset, in venc_modify() argument
89 u32 new_val = (venc_read(sd, offset) & ~mask) | (val & mask); in venc_modify()
91 venc_write(sd, offset, new_val); in venc_modify()
96 static inline u32 vdaccfg_write(struct v4l2_subdev *sd, u32 val) in vdaccfg_write() argument
98 struct venc_state *venc = to_state(sd); in vdaccfg_write()
100 writel(val, venc->vdaccfg_reg); in vdaccfg_write()
102 val = readl(venc->vdaccfg_reg); in vdaccfg_write()
111 static int venc_set_dac(struct v4l2_subdev *sd, u32 out_index) in venc_set_dac() argument
115 v4l2_dbg(debug, 1, sd, "Setting output to Composite\n"); in venc_set_dac()
116 venc_write(sd, VENC_DACSEL, 0); in venc_set_dac()
118 case 1: in venc_set_dac()
119 v4l2_dbg(debug, 1, sd, "Setting output to Component\n"); in venc_set_dac()
120 venc_write(sd, VENC_DACSEL, VDAC_COMPONENT); in venc_set_dac()
123 v4l2_dbg(debug, 1, sd, "Setting output to S-video\n"); in venc_set_dac()
124 venc_write(sd, VENC_DACSEL, VDAC_S_VIDEO); in venc_set_dac()
127 return -EINVAL; in venc_set_dac()
133 static void venc_enabledigitaloutput(struct v4l2_subdev *sd, int benable) in venc_enabledigitaloutput() argument
135 struct venc_state *venc = to_state(sd); in venc_enabledigitaloutput()
137 v4l2_dbg(debug, 2, sd, "venc_enabledigitaloutput\n"); in venc_enabledigitaloutput()
140 venc_write(sd, VENC_VMOD, 0); in venc_enabledigitaloutput()
141 venc_write(sd, VENC_CVBS, 0); in venc_enabledigitaloutput()
142 venc_write(sd, VENC_LCDOUT, 0); in venc_enabledigitaloutput()
143 venc_write(sd, VENC_HSPLS, 0); in venc_enabledigitaloutput()
144 venc_write(sd, VENC_HSTART, 0); in venc_enabledigitaloutput()
145 venc_write(sd, VENC_HVALID, 0); in venc_enabledigitaloutput()
146 venc_write(sd, VENC_HINT, 0); in venc_enabledigitaloutput()
147 venc_write(sd, VENC_VSPLS, 0); in venc_enabledigitaloutput()
148 venc_write(sd, VENC_VSTART, 0); in venc_enabledigitaloutput()
149 venc_write(sd, VENC_VVALID, 0); in venc_enabledigitaloutput()
150 venc_write(sd, VENC_VINT, 0); in venc_enabledigitaloutput()
151 venc_write(sd, VENC_YCCCTL, 0); in venc_enabledigitaloutput()
152 venc_write(sd, VENC_DACSEL, 0); in venc_enabledigitaloutput()
155 venc_write(sd, VENC_VMOD, 0); in venc_enabledigitaloutput()
157 venc_write(sd, VENC_VIDCTL, 0x141); in venc_enabledigitaloutput()
160 venc_write(sd, VENC_SYNCCTL, 0); in venc_enabledigitaloutput()
163 venc_write(sd, VENC_DCLKCTL, 0); in venc_enabledigitaloutput()
164 venc_write(sd, VENC_DRGBX1, 0x0000057C); in venc_enabledigitaloutput()
167 venc_write(sd, VENC_LCDOUT, 0); in venc_enabledigitaloutput()
168 if (venc->venc_type != VPBE_VERSION_3) in venc_enabledigitaloutput()
169 venc_write(sd, VENC_CMPNT, 0x100); in venc_enabledigitaloutput()
170 venc_write(sd, VENC_HSPLS, 0); in venc_enabledigitaloutput()
171 venc_write(sd, VENC_HINT, 0); in venc_enabledigitaloutput()
172 venc_write(sd, VENC_HSTART, 0); in venc_enabledigitaloutput()
173 venc_write(sd, VENC_HVALID, 0); in venc_enabledigitaloutput()
175 venc_write(sd, VENC_VSPLS, 0); in venc_enabledigitaloutput()
176 venc_write(sd, VENC_VINT, 0); in venc_enabledigitaloutput()
177 venc_write(sd, VENC_VSTART, 0); in venc_enabledigitaloutput()
178 venc_write(sd, VENC_VVALID, 0); in venc_enabledigitaloutput()
180 venc_write(sd, VENC_HSDLY, 0); in venc_enabledigitaloutput()
181 venc_write(sd, VENC_VSDLY, 0); in venc_enabledigitaloutput()
183 venc_write(sd, VENC_YCCCTL, 0); in venc_enabledigitaloutput()
184 venc_write(sd, VENC_VSTARTA, 0); in venc_enabledigitaloutput()
187 venc_write(sd, VENC_OSDCLK0, 1); in venc_enabledigitaloutput()
188 venc_write(sd, VENC_OSDCLK1, 2); in venc_enabledigitaloutput()
202 vpss_enable_clock(VPSS_VENC_CLOCK_SEL, 1); in venc_enable_vpss_clock()
203 vpss_enable_clock(VPSS_VPBE_CLOCK, 1); in venc_enable_vpss_clock()
216 static int venc_set_ntsc(struct v4l2_subdev *sd) in venc_set_ntsc() argument
218 struct venc_state *venc = to_state(sd); in venc_set_ntsc()
219 struct venc_platform_data *pdata = venc->pdata; in venc_set_ntsc()
221 v4l2_dbg(debug, 2, sd, "venc_set_ntsc\n"); in venc_set_ntsc()
223 /* Setup clock at VPSS & VENC for SD */ in venc_set_ntsc()
224 vpss_enable_clock(VPSS_VENC_CLOCK_SEL, 1); in venc_set_ntsc()
225 if (pdata->setup_clock(VPBE_ENC_STD, V4L2_STD_525_60) < 0) in venc_set_ntsc()
226 return -EINVAL; in venc_set_ntsc()
228 venc_enable_vpss_clock(venc->venc_type, VPBE_ENC_STD, V4L2_STD_525_60); in venc_set_ntsc()
229 venc_enabledigitaloutput(sd, 0); in venc_set_ntsc()
231 if (venc->venc_type == VPBE_VERSION_3) { in venc_set_ntsc()
232 venc_write(sd, VENC_CLKCTL, 0x01); in venc_set_ntsc()
233 venc_write(sd, VENC_VIDCTL, 0); in venc_set_ntsc()
234 vdaccfg_write(sd, VDAC_CONFIG_SD_V3); in venc_set_ntsc()
235 } else if (venc->venc_type == VPBE_VERSION_2) { in venc_set_ntsc()
236 venc_write(sd, VENC_CLKCTL, 0x01); in venc_set_ntsc()
237 venc_write(sd, VENC_VIDCTL, 0); in venc_set_ntsc()
238 vdaccfg_write(sd, VDAC_CONFIG_SD_V2); in venc_set_ntsc()
240 /* to set VENC CLK DIV to 1 - final clock is 54 MHz */ in venc_set_ntsc()
241 venc_modify(sd, VENC_VIDCTL, 0, 1 << 1); in venc_set_ntsc()
243 venc_write(sd, VENC_YCCCTL, 0x1); in venc_set_ntsc()
244 venc_modify(sd, VENC_VDPRO, 0, VENC_VDPRO_DAFRQ); in venc_set_ntsc()
245 venc_modify(sd, VENC_VDPRO, 0, VENC_VDPRO_DAUPS); in venc_set_ntsc()
248 venc_write(sd, VENC_VMOD, 0); in venc_set_ntsc()
249 venc_modify(sd, VENC_VMOD, (1 << VENC_VMOD_VIE_SHIFT), in venc_set_ntsc()
251 venc_modify(sd, VENC_VMOD, (0 << VENC_VMOD_VMD), VENC_VMOD_VMD); in venc_set_ntsc()
252 venc_modify(sd, VENC_VMOD, (0 << VENC_VMOD_TVTYP_SHIFT), in venc_set_ntsc()
254 venc_write(sd, VENC_DACTST, 0x0); in venc_set_ntsc()
255 venc_modify(sd, VENC_VMOD, VENC_VMOD_VENC, VENC_VMOD_VENC); in venc_set_ntsc()
263 static int venc_set_pal(struct v4l2_subdev *sd) in venc_set_pal() argument
265 struct venc_state *venc = to_state(sd); in venc_set_pal()
267 v4l2_dbg(debug, 2, sd, "venc_set_pal\n"); in venc_set_pal()
269 /* Setup clock at VPSS & VENC for SD */ in venc_set_pal()
270 vpss_enable_clock(VPSS_VENC_CLOCK_SEL, 1); in venc_set_pal()
271 if (venc->pdata->setup_clock(VPBE_ENC_STD, V4L2_STD_625_50) < 0) in venc_set_pal()
272 return -EINVAL; in venc_set_pal()
274 venc_enable_vpss_clock(venc->venc_type, VPBE_ENC_STD, V4L2_STD_625_50); in venc_set_pal()
275 venc_enabledigitaloutput(sd, 0); in venc_set_pal()
277 if (venc->venc_type == VPBE_VERSION_3) { in venc_set_pal()
278 venc_write(sd, VENC_CLKCTL, 0x1); in venc_set_pal()
279 venc_write(sd, VENC_VIDCTL, 0); in venc_set_pal()
280 vdaccfg_write(sd, VDAC_CONFIG_SD_V3); in venc_set_pal()
281 } else if (venc->venc_type == VPBE_VERSION_2) { in venc_set_pal()
282 venc_write(sd, VENC_CLKCTL, 0x1); in venc_set_pal()
283 venc_write(sd, VENC_VIDCTL, 0); in venc_set_pal()
284 vdaccfg_write(sd, VDAC_CONFIG_SD_V2); in venc_set_pal()
286 /* to set VENC CLK DIV to 1 - final clock is 54 MHz */ in venc_set_pal()
287 venc_modify(sd, VENC_VIDCTL, 0, 1 << 1); in venc_set_pal()
289 venc_write(sd, VENC_YCCCTL, 0x1); in venc_set_pal()
292 venc_modify(sd, VENC_SYNCCTL, 1 << VENC_SYNCCTL_OVD_SHIFT, in venc_set_pal()
294 venc_write(sd, VENC_VMOD, 0); in venc_set_pal()
295 venc_modify(sd, VENC_VMOD, in venc_set_pal()
296 (1 << VENC_VMOD_VIE_SHIFT), in venc_set_pal()
298 venc_modify(sd, VENC_VMOD, in venc_set_pal()
300 venc_modify(sd, VENC_VMOD, in venc_set_pal()
301 (1 << VENC_VMOD_TVTYP_SHIFT), in venc_set_pal()
303 venc_write(sd, VENC_DACTST, 0x0); in venc_set_pal()
304 venc_modify(sd, VENC_VMOD, VENC_VMOD_VENC, VENC_VMOD_VENC); in venc_set_pal()
315 static int venc_set_480p59_94(struct v4l2_subdev *sd) in venc_set_480p59_94() argument
317 struct venc_state *venc = to_state(sd); in venc_set_480p59_94()
318 struct venc_platform_data *pdata = venc->pdata; in venc_set_480p59_94()
320 v4l2_dbg(debug, 2, sd, "venc_set_480p59_94\n"); in venc_set_480p59_94()
321 if (venc->venc_type != VPBE_VERSION_1 && in venc_set_480p59_94()
322 venc->venc_type != VPBE_VERSION_2) in venc_set_480p59_94()
323 return -EINVAL; in venc_set_480p59_94()
325 /* Setup clock at VPSS & VENC for SD */ in venc_set_480p59_94()
326 if (pdata->setup_clock(VPBE_ENC_DV_TIMINGS, 27000000) < 0) in venc_set_480p59_94()
327 return -EINVAL; in venc_set_480p59_94()
329 venc_enable_vpss_clock(venc->venc_type, VPBE_ENC_DV_TIMINGS, 27000000); in venc_set_480p59_94()
330 venc_enabledigitaloutput(sd, 0); in venc_set_480p59_94()
332 if (venc->venc_type == VPBE_VERSION_2) in venc_set_480p59_94()
333 vdaccfg_write(sd, VDAC_CONFIG_HD_V2); in venc_set_480p59_94()
334 venc_write(sd, VENC_OSDCLK0, 0); in venc_set_480p59_94()
335 venc_write(sd, VENC_OSDCLK1, 1); in venc_set_480p59_94()
337 if (venc->venc_type == VPBE_VERSION_1) { in venc_set_480p59_94()
338 venc_modify(sd, VENC_VDPRO, VENC_VDPRO_DAFRQ, in venc_set_480p59_94()
340 venc_modify(sd, VENC_VDPRO, VENC_VDPRO_DAUPS, in venc_set_480p59_94()
344 venc_write(sd, VENC_VMOD, 0); in venc_set_480p59_94()
345 venc_modify(sd, VENC_VMOD, (1 << VENC_VMOD_VIE_SHIFT), in venc_set_480p59_94()
347 venc_modify(sd, VENC_VMOD, VENC_VMOD_HDMD, VENC_VMOD_HDMD); in venc_set_480p59_94()
348 venc_modify(sd, VENC_VMOD, (HDTV_525P << VENC_VMOD_TVTYP_SHIFT), in venc_set_480p59_94()
350 venc_modify(sd, VENC_VMOD, VENC_VMOD_VDMD_YCBCR8 << in venc_set_480p59_94()
353 venc_modify(sd, VENC_VMOD, VENC_VMOD_VENC, VENC_VMOD_VENC); in venc_set_480p59_94()
363 static int venc_set_576p50(struct v4l2_subdev *sd) in venc_set_576p50() argument
365 struct venc_state *venc = to_state(sd); in venc_set_576p50()
366 struct venc_platform_data *pdata = venc->pdata; in venc_set_576p50()
368 v4l2_dbg(debug, 2, sd, "venc_set_576p50\n"); in venc_set_576p50()
370 if (venc->venc_type != VPBE_VERSION_1 && in venc_set_576p50()
371 venc->venc_type != VPBE_VERSION_2) in venc_set_576p50()
372 return -EINVAL; in venc_set_576p50()
373 /* Setup clock at VPSS & VENC for SD */ in venc_set_576p50()
374 if (pdata->setup_clock(VPBE_ENC_DV_TIMINGS, 27000000) < 0) in venc_set_576p50()
375 return -EINVAL; in venc_set_576p50()
377 venc_enable_vpss_clock(venc->venc_type, VPBE_ENC_DV_TIMINGS, 27000000); in venc_set_576p50()
378 venc_enabledigitaloutput(sd, 0); in venc_set_576p50()
380 if (venc->venc_type == VPBE_VERSION_2) in venc_set_576p50()
381 vdaccfg_write(sd, VDAC_CONFIG_HD_V2); in venc_set_576p50()
383 venc_write(sd, VENC_OSDCLK0, 0); in venc_set_576p50()
384 venc_write(sd, VENC_OSDCLK1, 1); in venc_set_576p50()
386 if (venc->venc_type == VPBE_VERSION_1) { in venc_set_576p50()
387 venc_modify(sd, VENC_VDPRO, VENC_VDPRO_DAFRQ, in venc_set_576p50()
389 venc_modify(sd, VENC_VDPRO, VENC_VDPRO_DAUPS, in venc_set_576p50()
393 venc_write(sd, VENC_VMOD, 0); in venc_set_576p50()
394 venc_modify(sd, VENC_VMOD, (1 << VENC_VMOD_VIE_SHIFT), in venc_set_576p50()
396 venc_modify(sd, VENC_VMOD, VENC_VMOD_HDMD, VENC_VMOD_HDMD); in venc_set_576p50()
397 venc_modify(sd, VENC_VMOD, (HDTV_625P << VENC_VMOD_TVTYP_SHIFT), in venc_set_576p50()
400 venc_modify(sd, VENC_VMOD, VENC_VMOD_VDMD_YCBCR8 << in venc_set_576p50()
402 venc_modify(sd, VENC_VMOD, VENC_VMOD_VENC, VENC_VMOD_VENC); in venc_set_576p50()
408 * venc_set_720p60_internal - Setup 720p60 in venc for dm365 only
410 static int venc_set_720p60_internal(struct v4l2_subdev *sd) in venc_set_720p60_internal() argument
412 struct venc_state *venc = to_state(sd); in venc_set_720p60_internal()
413 struct venc_platform_data *pdata = venc->pdata; in venc_set_720p60_internal()
415 if (pdata->setup_clock(VPBE_ENC_DV_TIMINGS, 74250000) < 0) in venc_set_720p60_internal()
416 return -EINVAL; in venc_set_720p60_internal()
418 venc_enable_vpss_clock(venc->venc_type, VPBE_ENC_DV_TIMINGS, 74250000); in venc_set_720p60_internal()
419 venc_enabledigitaloutput(sd, 0); in venc_set_720p60_internal()
421 venc_write(sd, VENC_OSDCLK0, 0); in venc_set_720p60_internal()
422 venc_write(sd, VENC_OSDCLK1, 1); in venc_set_720p60_internal()
424 venc_write(sd, VENC_VMOD, 0); in venc_set_720p60_internal()
426 venc_modify(sd, VENC_VMOD, (1 << VENC_VMOD_VIE_SHIFT), in venc_set_720p60_internal()
428 venc_modify(sd, VENC_VMOD, VENC_VMOD_HDMD, VENC_VMOD_HDMD); in venc_set_720p60_internal()
429 venc_modify(sd, VENC_VMOD, (HDTV_720P << VENC_VMOD_TVTYP_SHIFT), in venc_set_720p60_internal()
431 venc_modify(sd, VENC_VMOD, VENC_VMOD_VENC, VENC_VMOD_VENC); in venc_set_720p60_internal()
432 venc_write(sd, VENC_XHINTVL, 0); in venc_set_720p60_internal()
437 * venc_set_1080i30_internal - Setup 1080i30 in venc for dm365 only
439 static int venc_set_1080i30_internal(struct v4l2_subdev *sd) in venc_set_1080i30_internal() argument
441 struct venc_state *venc = to_state(sd); in venc_set_1080i30_internal()
442 struct venc_platform_data *pdata = venc->pdata; in venc_set_1080i30_internal()
444 if (pdata->setup_clock(VPBE_ENC_DV_TIMINGS, 74250000) < 0) in venc_set_1080i30_internal()
445 return -EINVAL; in venc_set_1080i30_internal()
447 venc_enable_vpss_clock(venc->venc_type, VPBE_ENC_DV_TIMINGS, 74250000); in venc_set_1080i30_internal()
448 venc_enabledigitaloutput(sd, 0); in venc_set_1080i30_internal()
450 venc_write(sd, VENC_OSDCLK0, 0); in venc_set_1080i30_internal()
451 venc_write(sd, VENC_OSDCLK1, 1); in venc_set_1080i30_internal()
454 venc_write(sd, VENC_VMOD, 0); in venc_set_1080i30_internal()
456 venc_modify(sd, VENC_VMOD, (1 << VENC_VMOD_VIE_SHIFT), in venc_set_1080i30_internal()
458 venc_modify(sd, VENC_VMOD, VENC_VMOD_HDMD, VENC_VMOD_HDMD); in venc_set_1080i30_internal()
459 venc_modify(sd, VENC_VMOD, (HDTV_1080I << VENC_VMOD_TVTYP_SHIFT), in venc_set_1080i30_internal()
461 venc_modify(sd, VENC_VMOD, VENC_VMOD_VENC, VENC_VMOD_VENC); in venc_set_1080i30_internal()
462 venc_write(sd, VENC_XHINTVL, 0); in venc_set_1080i30_internal()
466 static int venc_s_std_output(struct v4l2_subdev *sd, v4l2_std_id norm) in venc_s_std_output() argument
468 v4l2_dbg(debug, 1, sd, "venc_s_std_output\n"); in venc_s_std_output()
471 return venc_set_ntsc(sd); in venc_s_std_output()
473 return venc_set_pal(sd); in venc_s_std_output()
475 return -EINVAL; in venc_s_std_output()
478 static int venc_s_dv_timings(struct v4l2_subdev *sd, in venc_s_dv_timings() argument
481 struct venc_state *venc = to_state(sd); in venc_s_dv_timings()
482 u32 height = dv_timings->bt.height; in venc_s_dv_timings()
485 v4l2_dbg(debug, 1, sd, "venc_s_dv_timings\n"); in venc_s_dv_timings()
488 return venc_set_576p50(sd); in venc_s_dv_timings()
490 return venc_set_480p59_94(sd); in venc_s_dv_timings()
492 (venc->venc_type == VPBE_VERSION_2)) { in venc_s_dv_timings()
494 ret = venc_set_720p60_internal(sd); in venc_s_dv_timings()
496 vdaccfg_write(sd, VDAC_CONFIG_HD_V2); in venc_s_dv_timings()
499 (venc->venc_type == VPBE_VERSION_2)) { in venc_s_dv_timings()
501 ret = venc_set_1080i30_internal(sd); in venc_s_dv_timings()
503 vdaccfg_write(sd, VDAC_CONFIG_HD_V2); in venc_s_dv_timings()
506 return -EINVAL; in venc_s_dv_timings()
509 static int venc_s_routing(struct v4l2_subdev *sd, u32 input, u32 output, in venc_s_routing() argument
512 struct venc_state *venc = to_state(sd); in venc_s_routing()
515 v4l2_dbg(debug, 1, sd, "venc_s_routing\n"); in venc_s_routing()
517 ret = venc_set_dac(sd, output); in venc_s_routing()
519 venc->output = output; in venc_s_routing()
524 static long venc_ioctl(struct v4l2_subdev *sd, in venc_ioctl() argument
532 val = venc_read(sd, VENC_VSTAT); in venc_ioctl()
537 v4l2_err(sd, "Wrong IOCTL cmd\n"); in venc_ioctl()
559 static int venc_initialize(struct v4l2_subdev *sd) in venc_initialize() argument
561 struct venc_state *venc = to_state(sd); in venc_initialize()
565 venc->output = 0; in venc_initialize()
566 venc->std = V4L2_STD_525_60; in venc_initialize()
568 ret = venc_s_routing(sd, 0, venc->output, 0); in venc_initialize()
570 v4l2_err(sd, "Error setting output during init\n"); in venc_initialize()
571 return -EINVAL; in venc_initialize()
574 ret = venc_s_std_output(sd, venc->std); in venc_initialize()
576 v4l2_err(sd, "Error setting std during init\n"); in venc_initialize()
577 return -EINVAL; in venc_initialize()
588 if (strstr(pdev->name, "vpbe-venc") != NULL) in venc_device_get()
604 v4l2_subdev_init(&venc->sd, &venc_ops); in venc_sub_dev_init()
606 strscpy(venc->sd.name, venc_name, sizeof(venc->sd.name)); in venc_sub_dev_init()
607 if (v4l2_device_register_subdev(v4l2_dev, &venc->sd) < 0) { in venc_sub_dev_init()
612 if (venc_initialize(&venc->sd)) { in venc_sub_dev_init()
618 return &venc->sd; in venc_sub_dev_init()
628 if (!pdev->dev.platform_data) { in venc_probe()
629 dev_err(&pdev->dev, "No platform data for VENC sub device"); in venc_probe()
630 return -EINVAL; in venc_probe()
635 return -EINVAL; in venc_probe()
637 venc = devm_kzalloc(&pdev->dev, sizeof(struct venc_state), GFP_KERNEL); in venc_probe()
639 return -ENOMEM; in venc_probe()
641 venc->venc_type = pdev_id->driver_data; in venc_probe()
642 venc->pdev = &pdev->dev; in venc_probe()
643 venc->pdata = pdev->dev.platform_data; in venc_probe()
647 venc->venc_base = devm_ioremap_resource(&pdev->dev, res); in venc_probe()
648 if (IS_ERR(venc->venc_base)) in venc_probe()
649 return PTR_ERR(venc->venc_base); in venc_probe()
651 if (venc->venc_type != VPBE_VERSION_1) { in venc_probe()
652 res = platform_get_resource(pdev, IORESOURCE_MEM, 1); in venc_probe()
654 venc->vdaccfg_reg = devm_ioremap_resource(&pdev->dev, res); in venc_probe()
655 if (IS_ERR(venc->vdaccfg_reg)) in venc_probe()
656 return PTR_ERR(venc->vdaccfg_reg); in venc_probe()
658 spin_lock_init(&venc->lock); in venc_probe()
660 dev_notice(venc->pdev, "VENC sub device probe success\n"); in venc_probe()