tvp514x: Fix init seqeunce
PATCH 1/1 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.
--- drivers/media/i2c/tvp514x.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/media/i2c/tvp514x.c +5 -4
@@ -123,6 +123,8 @@ struct tvp514x_decoder {/* mc related members */ struct media_pad pad;struct v4l2_mbus_framefmt format; + +struct tvp514x_reg *int_seq; };/* TVP514x default register values */
@@ -882,11 +884,8 @@ static int tvp514x_s_stream(struct v4l2_subdev *sd, int enable) }case 1 : { -struct tvp514x_reg *int_seq = (struct tvp514x_reg *) - client->driver->id_table->driver_data; -/* Power Up Sequence */ - err =tvp514x_write_regs (sd, int_seq); + err =tvp514x_write_regs (sd, decoder->int_seq);if (err) {v4l2_err (sd,"Unable to turn on decoder\n" );return err;
@@ -1089,6 +1088,8 @@ tvp514x_probe(struct i2c_client *client, const struct i2c_device_id *id)memcpy (decoder->tvp514x_regs, tvp514x_reg_list_default,sizeof (tvp514x_reg_list_default)); + decoder->int_seq = id->driver_data; +/* Copy board specific information here */ decoder->pdata = client->dev.platform_data;
Signature · 1 line
1.8.0
Hi Lars-Peter,
Thanks for the patch.
Quoted 5 lines · Lars-Peter Clausen
client->driver->id_tablewill 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'sprobe()function to get the right init sequence.
The patch looks OK, but it causes following two warnings,
drivers/media/i2c/tvp514x.c: In function 'tvp514x_s_stream':drivers/media/i2c/tvp514x.c:868: warning: unused variable 'client' drivers/media/i2c/tvp514x.c: In function 'tvp514x_probe':drivers/media/i2c/tvp514x.c:1092: warning: assignment makes pointer from integer without a cast
With the above fixed you can add my,
Regards,
--Prabhakar Lad
Hi Lars-Peter,
Quoted 10 lines · Prabhakar Lad
Hi Lars-Peter,
Thanks for the patch.
Quoted 5 lines · Lars-Peter Clausen
client->driver->id_tablewill 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'sprobe()function to get the right init sequence.
Quoted 8 lines
The patch looks OK, but it causes following two warnings,
drivers/media/i2c/tvp514x.c: In function 'tvp514x_s_stream':drivers/media/i2c/tvp514x.c:868: warning: unused variable 'client'drivers/media/i2c/tvp514x.c: In function 'tvp514x_probe':drivers/media/i2c/tvp514x.c:1092: warning: assignment makes pointer from integer without a cast
Do you plan to post a v2 ? or shall I take care of it ?
Regards,
--Prabhakar Lad
Quoted 22 lines · Prabhakar Lad
Hi Lars-Peter,
Quoted 10 lines · Prabhakar Lad
Hi Lars-Peter,
Thanks for the patch.
Quoted 5 lines · Lars-Peter Clausen
client->driver->id_tablewill 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'sprobe()function to get the right init sequence.Quoted 8 lines
The patch looks OK, but it causes following two warnings,
drivers/media/i2c/tvp514x.c: In function 'tvp514x_s_stream':drivers/media/i2c/tvp514x.c:868: warning: unused variable 'client'drivers/media/i2c/tvp514x.c: In function 'tvp514x_probe':drivers/media/i2c/tvp514x.c:1092: warning: assignment makes pointer from integer without a cast
Quoted 4 lines
Do you plan to post a v2 ? or shall I take care of it ?
Regards,
--Prabhakar Lad
I'll send a v2 soon.
- Lars