diff --git a/drivers/media/i2c/techpoint/techpoint_dev.c b/drivers/media/i2c/techpoint/techpoint_dev.c index 2353247cec77..0dd7d8f658db 100644 --- a/drivers/media/i2c/techpoint/techpoint_dev.c +++ b/drivers/media/i2c/techpoint/techpoint_dev.c @@ -365,6 +365,13 @@ void techpoint_get_vc_hotplug_inf(struct techpoint *techpoint, up(®_sem); } +void techpoint_set_quick_stream(struct techpoint *techpoint, u32 stream) +{ + if (techpoint->chip_id == CHIP_TP2855) { + tp2855_set_quick_stream(techpoint->client, stream); + } +} + int techpoint_start_video_stream(struct techpoint *techpoint) { int ret = 0; diff --git a/drivers/media/i2c/techpoint/techpoint_dev.h b/drivers/media/i2c/techpoint/techpoint_dev.h index fa9aada6d9dd..7d9018fa2c68 100644 --- a/drivers/media/i2c/techpoint/techpoint_dev.h +++ b/drivers/media/i2c/techpoint/techpoint_dev.h @@ -26,6 +26,7 @@ void techpoint_get_vc_fmt_inf(struct techpoint *techpoint, struct rkmodule_vc_fmt_info *inf); void techpoint_get_vc_hotplug_inf(struct techpoint *techpoint, struct rkmodule_vc_hotplug_info *inf); +void techpoint_set_quick_stream(struct techpoint *techpoint, u32 stream); int techpoint_initialize_devices(struct techpoint *techpoint); int techpoint_start_video_stream(struct techpoint *techpoint); diff --git a/drivers/media/i2c/techpoint/techpoint_tp2855.c b/drivers/media/i2c/techpoint/techpoint_tp2855.c index 5723bd0ec658..7586ca21cfdf 100644 --- a/drivers/media/i2c/techpoint/techpoint_tp2855.c +++ b/drivers/media/i2c/techpoint/techpoint_tp2855.c @@ -431,3 +431,16 @@ int tp2855_get_channel_reso(struct i2c_client *client, int ch) return reso; } + +int tp2855_set_quick_stream(struct i2c_client *client, u32 stream) +{ + if (stream) { + techpoint_write_reg(client, 0x40, 0x8); + techpoint_write_reg(client, 0x23, 0x0); + } else { + techpoint_write_reg(client, 0x40, 0x8); + techpoint_write_reg(client, 0x23, 0x2); + } + + return 0; +} diff --git a/drivers/media/i2c/techpoint/techpoint_tp2855.h b/drivers/media/i2c/techpoint/techpoint_tp2855.h index 38963665efab..15af87b26732 100644 --- a/drivers/media/i2c/techpoint/techpoint_tp2855.h +++ b/drivers/media/i2c/techpoint/techpoint_tp2855.h @@ -37,5 +37,6 @@ int tp2855_get_all_input_status(struct i2c_client *client, u8 *detect_status); int tp2855_set_channel_reso(struct i2c_client *client, int ch, enum techpoint_support_reso reso); int tp2855_get_channel_reso(struct i2c_client *client, int ch); +int tp2855_set_quick_stream(struct i2c_client *client, u32 stream); #endif // _TECHPOINT_TP2855_H diff --git a/drivers/media/i2c/techpoint/techpoint_v4l2.c b/drivers/media/i2c/techpoint/techpoint_v4l2.c index 1a97b2777f58..8144640070ec 100644 --- a/drivers/media/i2c/techpoint/techpoint_v4l2.c +++ b/drivers/media/i2c/techpoint/techpoint_v4l2.c @@ -570,6 +570,9 @@ static long techpoint_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) (struct rkmodule_vicap_reset_info *) arg); break; + case RKMODULE_SET_QUICK_STREAM: + techpoint_set_quick_stream(techpoint, *((u32 *)arg)); + break; default: ret = -ENOTTY; break; @@ -590,6 +593,7 @@ static long techpoint_compat_ioctl32(struct v4l2_subdev *sd, struct rkmodule_vc_hotplug_info *vc_hp_inf; struct rkmodule_vicap_reset_info *vicap_rst_inf; int *stream_seq; + u32 stream; long ret = 0; switch (cmd) { @@ -691,6 +695,11 @@ static long techpoint_compat_ioctl32(struct v4l2_subdev *sd, ret = copy_to_user(up, stream_seq, sizeof(*stream_seq)); kfree(stream_seq); break; + case RKMODULE_SET_QUICK_STREAM: + ret = copy_from_user(&stream, up, sizeof(u32)); + if (!ret) + ret = techpoint_ioctl(sd, cmd, &stream); + break; default: ret = -ENOIOCTLCMD; break;