aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c/tvp514x.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2013-06-23 09:01:35 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-06-28 14:08:43 -0400
commitf0a12d0c9272ae24491b983c4982acdacdac1baf (patch)
treea6035dedbb6ba82e6a7e132c1dff2a2c72daf59c /drivers/media/i2c/tvp514x.c
parent12d866ecd008ad8c9b818836fe84994ac8f80e18 (diff)
[media] tvp514x: Fix init seqeunce
client->driver->id_table will always point to the first entry in the device id table. So all devices will use the same init sequence. Use the id table entry that gets passed to the driver's probe() function to get the right init sequence. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/i2c/tvp514x.c')
-rw-r--r--drivers/media/i2c/tvp514x.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/media/i2c/tvp514x.c b/drivers/media/i2c/tvp514x.c
index 864eb14ae9b1..03289e57a217 100644
--- a/drivers/media/i2c/tvp514x.c
+++ b/drivers/media/i2c/tvp514x.c
@@ -123,6 +123,8 @@ struct tvp514x_decoder {
123 /* mc related members */ 123 /* mc related members */
124 struct media_pad pad; 124 struct media_pad pad;
125 struct v4l2_mbus_framefmt format; 125 struct v4l2_mbus_framefmt format;
126
127 struct tvp514x_reg *int_seq;
126}; 128};
127 129
128/* TVP514x default register values */ 130/* TVP514x default register values */
@@ -864,7 +866,6 @@ tvp514x_s_parm(struct v4l2_subdev *sd, struct v4l2_streamparm *a)
864static int tvp514x_s_stream(struct v4l2_subdev *sd, int enable) 866static int tvp514x_s_stream(struct v4l2_subdev *sd, int enable)
865{ 867{
866 int err = 0; 868 int err = 0;
867 struct i2c_client *client = v4l2_get_subdevdata(sd);
868 struct tvp514x_decoder *decoder = to_decoder(sd); 869 struct tvp514x_decoder *decoder = to_decoder(sd);
869 870
870 if (decoder->streaming == enable) 871 if (decoder->streaming == enable)
@@ -884,11 +885,8 @@ static int tvp514x_s_stream(struct v4l2_subdev *sd, int enable)
884 } 885 }
885 case 1: 886 case 1:
886 { 887 {
887 struct tvp514x_reg *int_seq = (struct tvp514x_reg *)
888 client->driver->id_table->driver_data;
889
890 /* Power Up Sequence */ 888 /* Power Up Sequence */
891 err = tvp514x_write_regs(sd, int_seq); 889 err = tvp514x_write_regs(sd, decoder->int_seq);
892 if (err) { 890 if (err) {
893 v4l2_err(sd, "Unable to turn on decoder\n"); 891 v4l2_err(sd, "Unable to turn on decoder\n");
894 return err; 892 return err;
@@ -1128,6 +1126,8 @@ tvp514x_probe(struct i2c_client *client, const struct i2c_device_id *id)
1128 memcpy(decoder->tvp514x_regs, tvp514x_reg_list_default, 1126 memcpy(decoder->tvp514x_regs, tvp514x_reg_list_default,
1129 sizeof(tvp514x_reg_list_default)); 1127 sizeof(tvp514x_reg_list_default));
1130 1128
1129 decoder->int_seq = (struct tvp514x_reg *)id->driver_data;
1130
1131 /* Copy board specific information here */ 1131 /* Copy board specific information here */
1132 decoder->pdata = pdata; 1132 decoder->pdata = pdata;
1133 1133