*** a/ti81xxvin_main.c 2011-11-21 05:50:45.000000000 -0700 --- b/ti81xxvin_main.c 2012-01-30 07:52:51.308815728 -0700 *************** *** 49,54 **** --- 49,56 ---- #include "ti81xxvin_pvt.h" + #define DEBUG + MODULE_DESCRIPTION("TI 81xx Capture driver"); MODULE_LICENSE("GPL"); *************** *** 934,942 **** ti81xxvin_dbg(1, debug, "videobuf streamoff failed\n"); ti81xxvin_vps_delete(inst); ret = v4l2_subdev_call(ti81xxvin_obj.sd[inst->curr_sd_index], video, s_stream, 0); ! if (ret && (ret != -ENOIOCTLCMD)) ti81xxvin_dbg(1, debug, "stream off failed in subdev\n"); return ret; --- 936,945 ---- ti81xxvin_dbg(1, debug, "videobuf streamoff failed\n"); ti81xxvin_vps_delete(inst); + #if 0 ret = v4l2_subdev_call(ti81xxvin_obj.sd[inst->curr_sd_index], video, s_stream, 0); ! #endif if (ret && (ret != -ENOIOCTLCMD)) ti81xxvin_dbg(1, debug, "stream off failed in subdev\n"); return ret; *************** *** 984,989 **** --- 987,994 ---- static int vidioc_querycap(struct file *file, void *priv, struct v4l2_capability *cap) { + printk("vidioc_querycap: entering\n"); + struct ti81xxvin_config *config = ti81xxvin_dev->platform_data; cap->version = TI81XXVIN_VERSION_CODE; *************** *** 992,998 **** strlcpy(cap->driver, "ti81xxvin", sizeof(cap->driver)); strlcpy(cap->bus_info, "TI81xx Platform", sizeof(cap->bus_info)); strlcpy(cap->card, config->card_name, sizeof(cap->card)); ! return 0; } --- 997,1003 ---- strlcpy(cap->driver, "ti81xxvin", sizeof(cap->driver)); strlcpy(cap->bus_info, "TI81xx Platform", sizeof(cap->bus_info)); strlcpy(cap->card, config->card_name, sizeof(cap->card)); ! return 0; } *************** *** 1278,1283 **** --- 1283,1289 ---- return -ERESTARTSYS; /* Call querystd function of decoder device */ + #if 0 ret = v4l2_subdev_call(ti81xxvin_obj.sd[inst->curr_sd_index], video, query_dv_preset, qpreset); if (ret < 0) { *************** *** 1292,1297 **** --- 1299,1318 ---- ret = v4l2_subdev_call(ti81xxvin_obj.sd[inst->curr_sd_index], video, g_mbus_fmt, &mbus_framefmt); /* Get the information about the standard */ + #endif + + printk("The width = 800\n"); + mbus_framefmt.width = 800; + mbus_framefmt.height = 600; + mbus_framefmt.code = V4L2_MBUS_FMT_YUYV8_2X8; + mbus_framefmt.field = V4L2_FIELD_NONE; + mbus_framefmt.field = V4L2_COLORSPACE_REC709; + + qpreset->preset = V4L2_DV_INVALID; + inst->video.cur_dv_preset.preset = V4L2_DV_INVALID; + inst->video.cur_std_id = V4L2_STD_UNKNOWN; + inst->video.cur_dv_preset = *qpreset; + if (ti81xxvin_update_std_info(inst, &mbus_framefmt)) { ret = -EINVAL; ti81xxvin_err("Error getting the standard info\n"); *************** *** 1330,1335 **** --- 1351,1357 ---- return -ERESTARTSYS; /* Call querystd function of decoder device */ + #if 0 ret = v4l2_subdev_call(ti81xxvin_obj.sd[inst->curr_sd_index], video, querystd, norm); if (ret < 0) { *************** *** 1349,1354 **** --- 1371,1377 ---- ti81xxvin_err("Error getting the standard info\n"); goto querystd_exit; } + #endif /* Configure the default format information according to the std * selected */ *************** *** 1391,1396 **** --- 1414,1420 ---- /* Call encoder subdevice function to set the standard */ if (mutex_lock_interruptible(&buf_obj->buf_lock)) return -ERESTARTSYS; + #if 0 /* Call the V4l2 subdev to set the preset */ ret = v4l2_subdev_call(ti81xxvin_obj.sd[inst->curr_sd_index], video, s_dv_preset, dv_preset); *************** *** 1402,1407 **** --- 1426,1443 ---- ret = v4l2_subdev_call(ti81xxvin_obj.sd[inst->curr_sd_index], video, g_mbus_fmt, &mbus_framefmt); + #endif + mbus_framefmt.width = 800; + mbus_framefmt.height = 600; + mbus_framefmt.code = V4L2_MBUS_FMT_YUYV8_2X8; + mbus_framefmt.field = V4L2_FIELD_NONE; + mbus_framefmt.field = V4L2_COLORSPACE_REC709; + + dv_preset->preset = V4L2_DV_INVALID; + inst->video.cur_dv_preset.preset = V4L2_DV_INVALID; + inst->video.cur_std_id = V4L2_STD_UNKNOWN; + inst->video.cur_dv_preset = *dv_preset; + /* Get the information about the standard */ if (ti81xxvin_update_std_info(inst, &mbus_framefmt)) { ret = -EINVAL; *************** *** 1453,1458 **** --- 1489,1495 ---- /* Call encoder subdevice function to set the standard */ if (mutex_lock_interruptible(&buf_obj->buf_lock)) return -ERESTARTSYS; + #if 0 /* Call the V4l2 subdev to set the preset */ ret = v4l2_subdev_call(ti81xxvin_obj.sd[inst->curr_sd_index], core, s_std, *norm); *************** *** 1470,1476 **** ti81xxvin_err("Error getting the standard info\n"); goto s_std_exit; } ! /* Configure the default format information according to the std * selected */ --- 1507,1513 ---- ti81xxvin_err("Error getting the standard info\n"); goto s_std_exit; } ! #endif /* Configure the default format information according to the std * selected */ *************** *** 1537,1547 **** --- 1574,1588 ---- ti81xxvin_dbg(2, debug, "vidioc_enum_dv_presets\n"); if (mutex_lock_interruptible(&buf_obj->buf_lock)) return -ERESTARTSYS; + #if 0 + // XXXX Not in patch? /* Call the V4l2 subdev to set the preset */ ret = v4l2_subdev_call(ti81xxvin_obj.sd[inst->curr_sd_index], video, enum_dv_presets, preset); if (ret) goto enum_dv_presets_exit; + #endif + mutex_unlock(&buf_obj->buf_lock); return 0; *************** *** 1727,1732 **** --- 1768,1774 ---- ret = ti81xxvin_check_format(inst, &buf_obj->fmt.fmt.pix, 0); if (ret) return ret; + #if 0 /* After checking the buffer format. Call the FVID2 Create and * Set format for starting the driver */ *************** *** 1738,1743 **** --- 1780,1786 ---- ti81xxvin_dbg(1, debug, "stream on failed in subdev\n"); return ret; } + #endif ret = ti81xxvin_vps_create(inst); if (ret) { ti81xxvin_err("Vps create failed\n"); *************** *** 1790,1798 **** vps_capture_unregister_isr(ti81xxvin_instance_isr, (void *)inst->instance_id, inst->instance_id); ti81xxvin_vps_create_failed: ret = v4l2_subdev_call(ti81xxvin_obj.sd[inst->curr_sd_index], video, s_stream, 0); ! return ret; } --- 1833,1842 ---- vps_capture_unregister_isr(ti81xxvin_instance_isr, (void *)inst->instance_id, inst->instance_id); ti81xxvin_vps_create_failed: + #if 0 ret = v4l2_subdev_call(ti81xxvin_obj.sd[inst->curr_sd_index], video, s_stream, 0); ! #endif return ret; } *************** *** 2421,2428 **** --- 2466,2479 ---- " v4l2 device\n"); goto probe_subdev_out; } + + + for (i = 0; i < 1; i++) { subdevdata = &config->subdev_info[i]; + + #if 0 + ti81xxvin_obj.sd[i] = v4l2_i2c_new_subdev_board(&ti81xxvin_obj.v4l2_dev, i2c_adap, *************** *** 2433,2438 **** --- 2484,2491 ---- ti81xxvin_err("Error registering v4l2 subdevice\n"); goto probe_subdev_out; } + #endif + if (subdevdata->ti81xxvin_select_decoder) err = subdevdata->ti81xxvin_select_decoder( subdevdata->decoder_id); *************** *** 2523,2529 **** */ static __init int ti81xxvin_init(void) { ! return platform_driver_register(&hdvpss_driver); } /** --- 2578,2585 ---- */ static __init int ti81xxvin_init(void) { ! ! return platform_driver_register(&hdvpss_driver); } /**