media: i2c: techpoint: tp2855 add quick stream opt

Change-Id: Ibb6dd23505b2db4afe240ff9a0e8c2e6254c2c11
Signed-off-by: Vicent Chi <vicent.chi@rock-chips.com>
This commit is contained in:
Vicent Chi
2021-04-23 10:59:28 +08:00
committed by Tao Huang
parent 597c44c6be
commit 42e4c8f39a
5 changed files with 31 additions and 0 deletions

View File

@@ -365,6 +365,13 @@ void techpoint_get_vc_hotplug_inf(struct techpoint *techpoint,
up(&reg_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;

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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;