linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [media] tvp514x: Fix init seqeunce
@ 2013-06-15 14:34 Lars-Peter Clausen
  2013-06-16 10:11 ` Prabhakar Lad
  0 siblings, 1 reply; 4+ messages in thread
From: Lars-Peter Clausen @ 2013-06-15 14:34 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Prabhakar Lad, Manjunath Hadli, linux-media, Lars-Peter Clausen

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>
---
 drivers/media/i2c/tvp514x.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/media/i2c/tvp514x.c b/drivers/media/i2c/tvp514x.c
index 7438e01..8640d68 100644
--- a/drivers/media/i2c/tvp514x.c
+++ b/drivers/media/i2c/tvp514x.c
@@ -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;
 
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] [media] tvp514x: Fix init seqeunce
  2013-06-15 14:34 [PATCH] [media] tvp514x: Fix init seqeunce Lars-Peter Clausen
@ 2013-06-16 10:11 ` Prabhakar Lad
  2013-06-21 12:27   ` Prabhakar Lad
  0 siblings, 1 reply; 4+ messages in thread
From: Prabhakar Lad @ 2013-06-16 10:11 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: Mauro Carvalho Chehab, Prabhakar Lad, linux-media

Hi Lars-Peter,

Thanks for the patch.

On Sat, Jun 15, 2013 at 8:04 PM, Lars-Peter Clausen <lars@metafoo.de> wrote:
> 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.
>
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,

Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>

Regards,
--Prabhakar Lad

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [media] tvp514x: Fix init seqeunce
  2013-06-16 10:11 ` Prabhakar Lad
@ 2013-06-21 12:27   ` Prabhakar Lad
  2013-06-21 17:14     ` Lars-Peter Clausen
  0 siblings, 1 reply; 4+ messages in thread
From: Prabhakar Lad @ 2013-06-21 12:27 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: Mauro Carvalho Chehab, Prabhakar Lad, linux-media

Hi Lars-Peter,

On Sun, Jun 16, 2013 at 3:41 PM, Prabhakar Lad
<prabhakar.csengg@gmail.com> wrote:
> Hi Lars-Peter,
>
> Thanks for the patch.
>
> On Sat, Jun 15, 2013 at 8:04 PM, Lars-Peter Clausen <lars@metafoo.de> wrote:
>> 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.
>>
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [media] tvp514x: Fix init seqeunce
  2013-06-21 12:27   ` Prabhakar Lad
@ 2013-06-21 17:14     ` Lars-Peter Clausen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars-Peter Clausen @ 2013-06-21 17:14 UTC (permalink / raw)
  To: Prabhakar Lad; +Cc: Mauro Carvalho Chehab, Prabhakar Lad, linux-media

On 06/21/2013 02:27 PM, Prabhakar Lad wrote:
> Hi Lars-Peter,
> 
> On Sun, Jun 16, 2013 at 3:41 PM, Prabhakar Lad
> <prabhakar.csengg@gmail.com> wrote:
>> Hi Lars-Peter,
>>
>> Thanks for the patch.
>>
>> On Sat, Jun 15, 2013 at 8:04 PM, Lars-Peter Clausen <lars@metafoo.de> wrote:
>>> 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.
>>>
>> 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

I'll send a v2 soon.

- Lars

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-06-21 17:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-15 14:34 [PATCH] [media] tvp514x: Fix init seqeunce Lars-Peter Clausen
2013-06-16 10:11 ` Prabhakar Lad
2013-06-21 12:27   ` Prabhakar Lad
2013-06-21 17:14     ` Lars-Peter Clausen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).