public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/6] Davinci VPFE Capture: Take i2c adapter id through platform data
@ 2009-10-13 15:08 hvaibhav
  2009-10-13 15:30 ` Sergei Shtylyov
  0 siblings, 1 reply; 3+ messages in thread
From: hvaibhav @ 2009-10-13 15:08 UTC (permalink / raw)
  To: linux-media; +Cc: davinci-linux-open-source, Vaibhav Hiremath

From: Vaibhav Hiremath <hvaibhav@ti.com>

The I2C adapter ID is actually depends on Board and may vary, Davinci
uses id=1, but in case of AM3517 id=3.

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
---
 drivers/media/video/davinci/vpfe_capture.c |    3 +--
 include/media/davinci/vpfe_capture.h       |    2 ++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/davinci/vpfe_capture.c b/drivers/media/video/davinci/vpfe_capture.c
index dc32de0..c3c37e7 100644
--- a/drivers/media/video/davinci/vpfe_capture.c
+++ b/drivers/media/video/davinci/vpfe_capture.c
@@ -2228,8 +2228,7 @@ static __init int vpfe_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, vpfe_dev);
 	/* set driver private data */
 	video_set_drvdata(vpfe_dev->video_dev, vpfe_dev);
-	i2c_adap = i2c_get_adapter(1);
-	vpfe_cfg = pdev->dev.platform_data;
+	i2c_adap = i2c_get_adapter(vpfe_cfg->i2c_adapter_id);
 	num_subdevs = vpfe_cfg->num_subdevs;
 	vpfe_dev->sd = kmalloc(sizeof(struct v4l2_subdev *) * num_subdevs,
 				GFP_KERNEL);
diff --git a/include/media/davinci/vpfe_capture.h b/include/media/davinci/vpfe_capture.h
index e8272d1..f610104 100644
--- a/include/media/davinci/vpfe_capture.h
+++ b/include/media/davinci/vpfe_capture.h
@@ -94,6 +94,8 @@ struct vpfe_subdev_info {
 struct vpfe_config {
 	/* Number of sub devices connected to vpfe */
 	int num_subdevs;
+	/*I2c Bus adapter no*/
+	int i2c_adapter_id;
 	/* information about each subdev */
 	struct vpfe_subdev_info *sub_devs;
 	/* evm card info */
-- 
1.6.2.4


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

* Re: [PATCH 2/6] Davinci VPFE Capture: Take i2c adapter id through platform data
  2009-10-13 15:08 [PATCH 2/6] Davinci VPFE Capture: Take i2c adapter id through platform data hvaibhav
@ 2009-10-13 15:30 ` Sergei Shtylyov
  2009-10-13 17:49   ` Hiremath, Vaibhav
  0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylyov @ 2009-10-13 15:30 UTC (permalink / raw)
  To: hvaibhav; +Cc: linux-media, davinci-linux-open-source

Hello.

hvaibhav@ti.com wrote:

> From: Vaibhav Hiremath <hvaibhav@ti.com>

> The I2C adapter ID is actually depends on Board and may vary, Davinci
> uses id=1, but in case of AM3517 id=3.

> Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>

[...]

> diff --git a/include/media/davinci/vpfe_capture.h b/include/media/davinci/vpfe_capture.h
> index e8272d1..f610104 100644
> --- a/include/media/davinci/vpfe_capture.h
> +++ b/include/media/davinci/vpfe_capture.h
> @@ -94,6 +94,8 @@ struct vpfe_subdev_info {
>  struct vpfe_config {
>  	/* Number of sub devices connected to vpfe */
>  	int num_subdevs;
> +	/*I2c Bus adapter no*/

    Put spaces after /* and before */, please. Also, it's "I2C", not "I2c"...

WBR, Sergei

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

* RE: [PATCH 2/6] Davinci VPFE Capture: Take i2c adapter id through platform data
  2009-10-13 15:30 ` Sergei Shtylyov
@ 2009-10-13 17:49   ` Hiremath, Vaibhav
  0 siblings, 0 replies; 3+ messages in thread
From: Hiremath, Vaibhav @ 2009-10-13 17:49 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: linux-media@vger.kernel.org,
	davinci-linux-open-source@linux.davincidsp.com


> -----Original Message-----
> From: Sergei Shtylyov [mailto:sshtylyov@ru.mvista.com]
> Sent: Tuesday, October 13, 2009 9:00 PM
> To: Hiremath, Vaibhav
> Cc: linux-media@vger.kernel.org; davinci-linux-open-
> source@linux.davincidsp.com
> Subject: Re: [PATCH 2/6] Davinci VPFE Capture: Take i2c adapter id
> through platform data
> 
> Hello.
> 
> hvaibhav@ti.com wrote:
> 
> > From: Vaibhav Hiremath <hvaibhav@ti.com>
> 
> > The I2C adapter ID is actually depends on Board and may vary,
> Davinci
> > uses id=1, but in case of AM3517 id=3.
> 
> > Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
> 
> [...]
> 
> > diff --git a/include/media/davinci/vpfe_capture.h
> b/include/media/davinci/vpfe_capture.h
> > index e8272d1..f610104 100644
> > --- a/include/media/davinci/vpfe_capture.h
> > +++ b/include/media/davinci/vpfe_capture.h
> > @@ -94,6 +94,8 @@ struct vpfe_subdev_info {
> >  struct vpfe_config {
> >  	/* Number of sub devices connected to vpfe */
> >  	int num_subdevs;
> > +	/*I2c Bus adapter no*/
> 
>     Put spaces after /* and before */, please. Also, it's "I2C", not
> "I2c"...
[Hiremath, Vaibhav] Thanks Sergei for catching this typo mistake.

I will update and post it again.

Thanks,
Vaibhav

> 
> WBR, Sergei


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

end of thread, other threads:[~2009-10-13 17:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-13 15:08 [PATCH 2/6] Davinci VPFE Capture: Take i2c adapter id through platform data hvaibhav
2009-10-13 15:30 ` Sergei Shtylyov
2009-10-13 17:49   ` Hiremath, Vaibhav

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox