* [PATCH 0/3] V4L2_CID_PIXEL_RATE support in sensor drivers
@ 2012-05-09 12:55 Laurent Pinchart
2012-05-09 12:55 ` [PATCH 1/3] mt9t001: Implement V4L2_CID_PIXEL_RATE control Laurent Pinchart
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Laurent Pinchart @ 2012-05-09 12:55 UTC (permalink / raw)
To: linux-media; +Cc: sakari.ailus
Hi everybody,
This patch implements support for the V4L2_CID_PIXEL_RATE control in the
mt9t001, mt9p031 and mt9m032 sensor drivers.
Recent changes to the OMAP3 ISP driver (see the media-for-3.5 branch in the
http://git.linuxtv.org/sailus/media_tree.git repository) made support for that
control mandatory for sensor drivers that are to be used with the OMAP3 ISP.
Sakari, would you like to take these patches in your tree and push them for
v3.5 ? V4L2_CID_PIXEL_RATE support for the mt9v032 driver is also still
missing, the patch you've sent to the list two months ago needs to be rebased.
Will you do that or should I do it ? I'm also wondering whether that patch
shouldn't mark the V4L2_CID_PIXEL_RATE control as volatile, calling
v4l2_s_ext_ctrls() from inside the driver looks quite hackish to me. The
alternative would be to create a 64-bit version of v4l2_ctrl_s_ctrl().
Laurent Pinchart (3):
mt9t001: Implement V4L2_CID_PIXEL_RATE control
mt9p031: Implement V4L2_CID_PIXEL_RATE control
mt9m032: Implement V4L2_CID_PIXEL_RATE control
drivers/media/video/mt9m032.c | 13 +++++++++++--
drivers/media/video/mt9p031.c | 5 ++++-
drivers/media/video/mt9t001.c | 13 +++++++++++--
include/media/mt9t001.h | 1 +
4 files changed, 27 insertions(+), 5 deletions(-)
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/3] mt9t001: Implement V4L2_CID_PIXEL_RATE control
2012-05-09 12:55 [PATCH 0/3] V4L2_CID_PIXEL_RATE support in sensor drivers Laurent Pinchart
@ 2012-05-09 12:55 ` Laurent Pinchart
2012-05-09 12:55 ` [PATCH 2/3] mt9p031: " Laurent Pinchart
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Laurent Pinchart @ 2012-05-09 12:55 UTC (permalink / raw)
To: linux-media; +Cc: sakari.ailus
The pixel rate control is required by the OMAP3 ISP driver and should be
implemented by all media controller-compatible sensor drivers.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
drivers/media/video/mt9t001.c | 13 +++++++++++--
include/media/mt9t001.h | 1 +
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/media/video/mt9t001.c b/drivers/media/video/mt9t001.c
index 49ca3cb..6d343ad 100644
--- a/drivers/media/video/mt9t001.c
+++ b/drivers/media/video/mt9t001.c
@@ -691,7 +691,7 @@ static int mt9t001_video_probe(struct i2c_client *client)
return ret;
/* Configure the pixel clock polarity */
- if (pdata && pdata->clk_pol) {
+ if (pdata->clk_pol) {
ret = mt9t001_write(client, MT9T001_PIXEL_CLOCK,
MT9T001_PIXEL_CLOCK_INVERT);
if (ret < 0)
@@ -715,10 +715,16 @@ static int mt9t001_video_probe(struct i2c_client *client)
static int mt9t001_probe(struct i2c_client *client,
const struct i2c_device_id *did)
{
+ struct mt9t001_platform_data *pdata = client->dev.platform_data;
struct mt9t001 *mt9t001;
unsigned int i;
int ret;
+ if (pdata == NULL) {
+ dev_err(&client->dev, "No platform data\n");
+ return -EINVAL;
+ }
+
if (!i2c_check_functionality(client->adapter,
I2C_FUNC_SMBUS_WORD_DATA)) {
dev_warn(&client->adapter->dev,
@@ -735,7 +741,7 @@ static int mt9t001_probe(struct i2c_client *client,
return -ENOMEM;
v4l2_ctrl_handler_init(&mt9t001->ctrls, ARRAY_SIZE(mt9t001_ctrls) +
- ARRAY_SIZE(mt9t001_gains) + 2);
+ ARRAY_SIZE(mt9t001_gains) + 3);
v4l2_ctrl_new_std(&mt9t001->ctrls, &mt9t001_ctrl_ops,
V4L2_CID_EXPOSURE, MT9T001_SHUTTER_WIDTH_MIN,
@@ -743,6 +749,9 @@ static int mt9t001_probe(struct i2c_client *client,
MT9T001_SHUTTER_WIDTH_DEF);
v4l2_ctrl_new_std(&mt9t001->ctrls, &mt9t001_ctrl_ops,
V4L2_CID_BLACK_LEVEL, 1, 1, 1, 1);
+ v4l2_ctrl_new_std(&mt9t001->ctrls, &mt9t001_ctrl_ops,
+ V4L2_CID_PIXEL_RATE, pdata->ext_clk, pdata->ext_clk,
+ 1, pdata->ext_clk);
for (i = 0; i < ARRAY_SIZE(mt9t001_ctrls); ++i)
v4l2_ctrl_new_custom(&mt9t001->ctrls, &mt9t001_ctrls[i], NULL);
diff --git a/include/media/mt9t001.h b/include/media/mt9t001.h
index e839a78..03fd63e 100644
--- a/include/media/mt9t001.h
+++ b/include/media/mt9t001.h
@@ -3,6 +3,7 @@
struct mt9t001_platform_data {
unsigned int clk_pol:1;
+ unsigned int ext_clk;
};
#endif
--
1.7.3.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] mt9p031: Implement V4L2_CID_PIXEL_RATE control
2012-05-09 12:55 [PATCH 0/3] V4L2_CID_PIXEL_RATE support in sensor drivers Laurent Pinchart
2012-05-09 12:55 ` [PATCH 1/3] mt9t001: Implement V4L2_CID_PIXEL_RATE control Laurent Pinchart
@ 2012-05-09 12:55 ` Laurent Pinchart
2012-05-09 12:55 ` [PATCH 3/3] mt9m032: " Laurent Pinchart
2012-05-13 21:53 ` [PATCH 0/3] V4L2_CID_PIXEL_RATE support in sensor drivers Sakari Ailus
3 siblings, 0 replies; 6+ messages in thread
From: Laurent Pinchart @ 2012-05-09 12:55 UTC (permalink / raw)
To: linux-media; +Cc: sakari.ailus
The pixel rate control is required by the OMAP3 ISP driver and should be
implemented by all media controller-compatible sensor drivers.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
drivers/media/video/mt9p031.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/drivers/media/video/mt9p031.c b/drivers/media/video/mt9p031.c
index d0b8e36..e790100 100644
--- a/drivers/media/video/mt9p031.c
+++ b/drivers/media/video/mt9p031.c
@@ -968,7 +968,7 @@ static int mt9p031_probe(struct i2c_client *client,
mt9p031->vdd_core = devm_regulator_get(&client->dev, "cam_core");
mt9p031->vdd_io = devm_regulator_get(&client->dev, "cam_io");
- v4l2_ctrl_handler_init(&mt9p031->ctrls, ARRAY_SIZE(mt9p031_ctrls) + 4);
+ v4l2_ctrl_handler_init(&mt9p031->ctrls, ARRAY_SIZE(mt9p031_ctrls) + 5);
v4l2_ctrl_new_std(&mt9p031->ctrls, &mt9p031_ctrl_ops,
V4L2_CID_EXPOSURE, MT9P031_SHUTTER_WIDTH_MIN,
@@ -981,6 +981,9 @@ static int mt9p031_probe(struct i2c_client *client,
V4L2_CID_HFLIP, 0, 1, 1, 0);
v4l2_ctrl_new_std(&mt9p031->ctrls, &mt9p031_ctrl_ops,
V4L2_CID_VFLIP, 0, 1, 1, 0);
+ v4l2_ctrl_new_std(&mt9p031->ctrls, &mt9p031_ctrl_ops,
+ V4L2_CID_PIXEL_RATE, pdata->target_freq,
+ pdata->target_freq, 1, pdata->target_freq);
for (i = 0; i < ARRAY_SIZE(mt9p031_ctrls); ++i)
v4l2_ctrl_new_custom(&mt9p031->ctrls, &mt9p031_ctrls[i], NULL);
--
1.7.3.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] mt9m032: Implement V4L2_CID_PIXEL_RATE control
2012-05-09 12:55 [PATCH 0/3] V4L2_CID_PIXEL_RATE support in sensor drivers Laurent Pinchart
2012-05-09 12:55 ` [PATCH 1/3] mt9t001: Implement V4L2_CID_PIXEL_RATE control Laurent Pinchart
2012-05-09 12:55 ` [PATCH 2/3] mt9p031: " Laurent Pinchart
@ 2012-05-09 12:55 ` Laurent Pinchart
2012-05-13 21:53 ` [PATCH 0/3] V4L2_CID_PIXEL_RATE support in sensor drivers Sakari Ailus
3 siblings, 0 replies; 6+ messages in thread
From: Laurent Pinchart @ 2012-05-09 12:55 UTC (permalink / raw)
To: linux-media; +Cc: sakari.ailus
The pixel rate control is required by the OMAP3 ISP driver and should be
implemented by all media controller-compatible sensor drivers.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
drivers/media/video/mt9m032.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/media/video/mt9m032.c b/drivers/media/video/mt9m032.c
index 3c1e626..445359c 100644
--- a/drivers/media/video/mt9m032.c
+++ b/drivers/media/video/mt9m032.c
@@ -688,11 +688,17 @@ static const struct v4l2_subdev_ops mt9m032_ops = {
static int mt9m032_probe(struct i2c_client *client,
const struct i2c_device_id *devid)
{
+ struct mt9m032_platform_data *pdata = client->dev.platform_data;
struct i2c_adapter *adapter = client->adapter;
struct mt9m032 *sensor;
int chip_version;
int ret;
+ if (pdata == NULL) {
+ dev_err(&client->dev, "No platform data\n");
+ return -EINVAL;
+ }
+
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WORD_DATA)) {
dev_warn(&client->dev,
"I2C-Adapter doesn't support I2C_FUNC_SMBUS_WORD\n");
@@ -708,7 +714,7 @@ static int mt9m032_probe(struct i2c_client *client,
mutex_init(&sensor->lock);
- sensor->pdata = client->dev.platform_data;
+ sensor->pdata = pdata;
v4l2_i2c_subdev_init(&sensor->subdev, client, &mt9m032_ops);
sensor->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
@@ -738,7 +744,7 @@ static int mt9m032_probe(struct i2c_client *client,
sensor->format.field = V4L2_FIELD_NONE;
sensor->format.colorspace = V4L2_COLORSPACE_SRGB;
- v4l2_ctrl_handler_init(&sensor->ctrls, 4);
+ v4l2_ctrl_handler_init(&sensor->ctrls, 5);
v4l2_ctrl_new_std(&sensor->ctrls, &mt9m032_ctrl_ops,
V4L2_CID_GAIN, 0, 127, 1, 64);
@@ -754,6 +760,9 @@ static int mt9m032_probe(struct i2c_client *client,
V4L2_CID_EXPOSURE, MT9M032_SHUTTER_WIDTH_MIN,
MT9M032_SHUTTER_WIDTH_MAX, 1,
MT9M032_SHUTTER_WIDTH_DEF);
+ v4l2_ctrl_new_std(&sensor->ctrls, &mt9m032_ctrl_ops,
+ V4L2_CID_PIXEL_RATE, pdata->pix_clock,
+ pdata->pix_clock, 1, pdata->pix_clock);
if (sensor->ctrls.error) {
ret = sensor->ctrls.error;
--
1.7.3.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 0/3] V4L2_CID_PIXEL_RATE support in sensor drivers
2012-05-09 12:55 [PATCH 0/3] V4L2_CID_PIXEL_RATE support in sensor drivers Laurent Pinchart
` (2 preceding siblings ...)
2012-05-09 12:55 ` [PATCH 3/3] mt9m032: " Laurent Pinchart
@ 2012-05-13 21:53 ` Sakari Ailus
2012-05-14 7:30 ` Laurent Pinchart
3 siblings, 1 reply; 6+ messages in thread
From: Sakari Ailus @ 2012-05-13 21:53 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: linux-media
Hi Laurent,
Thanks for the patches!
On Wed, May 09, 2012 at 02:55:56PM +0200, Laurent Pinchart wrote:
> Hi everybody,
>
> This patch implements support for the V4L2_CID_PIXEL_RATE control in the
> mt9t001, mt9p031 and mt9m032 sensor drivers.
>
> Recent changes to the OMAP3 ISP driver (see the media-for-3.5 branch in the
> http://git.linuxtv.org/sailus/media_tree.git repository) made support for that
> control mandatory for sensor drivers that are to be used with the OMAP3 ISP.
>
> Sakari, would you like to take these patches in your tree and push them for
> v3.5 ? V4L2_CID_PIXEL_RATE support for the mt9v032 driver is also still
> missing, the patch you've sent to the list two months ago needs to be rebased.
> Will you do that or should I do it ? I'm also wondering whether that patch
> shouldn't mark the V4L2_CID_PIXEL_RATE control as volatile, calling
> v4l2_s_ext_ctrls() from inside the driver looks quite hackish to me. The
> alternative would be to create a 64-bit version of v4l2_ctrl_s_ctrl().
>
> Laurent Pinchart (3):
> mt9t001: Implement V4L2_CID_PIXEL_RATE control
> mt9p031: Implement V4L2_CID_PIXEL_RATE control
> mt9m032: Implement V4L2_CID_PIXEL_RATE control
>
> drivers/media/video/mt9m032.c | 13 +++++++++++--
> drivers/media/video/mt9p031.c | 5 ++++-
> drivers/media/video/mt9t001.c | 13 +++++++++++--
> include/media/mt9t001.h | 1 +
> 4 files changed, 27 insertions(+), 5 deletions(-)
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
--
Sakari Ailus
e-mail: sakari.ailus@iki.fi jabber/XMPP/Gmail: sailus@retiisi.org.uk
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/3] V4L2_CID_PIXEL_RATE support in sensor drivers
2012-05-13 21:53 ` [PATCH 0/3] V4L2_CID_PIXEL_RATE support in sensor drivers Sakari Ailus
@ 2012-05-14 7:30 ` Laurent Pinchart
0 siblings, 0 replies; 6+ messages in thread
From: Laurent Pinchart @ 2012-05-14 7:30 UTC (permalink / raw)
To: Sakari Ailus; +Cc: linux-media
Hi Sakari,
On Monday 14 May 2012 00:53:36 Sakari Ailus wrote:
> On Wed, May 09, 2012 at 02:55:56PM +0200, Laurent Pinchart wrote:
> > Hi everybody,
> >
> > This patch implements support for the V4L2_CID_PIXEL_RATE control in the
> > mt9t001, mt9p031 and mt9m032 sensor drivers.
> >
> > Recent changes to the OMAP3 ISP driver (see the media-for-3.5 branch in
> > the http://git.linuxtv.org/sailus/media_tree.git repository) made support
> > for that control mandatory for sensor drivers that are to be used with the
> > OMAP3 ISP.
> >
> > Sakari, would you like to take these patches in your tree and push them
> > for v3.5 ? V4L2_CID_PIXEL_RATE support for the mt9v032 driver is also
> > still missing, the patch you've sent to the list two months ago needs to
> > be rebased. Will you do that or should I do it ? I'm also wondering
> > whether that patch shouldn't mark the V4L2_CID_PIXEL_RATE control as
> > volatile, calling v4l2_s_ext_ctrls() from inside the driver looks quite
> > hackish to> me. The alternative would be to create a 64-bit version of
> > v4l2_ctrl_s_ctrl().
> >
> > Laurent Pinchart (3):
> > mt9t001: Implement V4L2_CID_PIXEL_RATE control
> > mt9p031: Implement V4L2_CID_PIXEL_RATE control
> > mt9m032: Implement V4L2_CID_PIXEL_RATE control
> >
> > drivers/media/video/mt9m032.c | 13 +++++++++++--
> > drivers/media/video/mt9p031.c | 5 ++++-
> > drivers/media/video/mt9t001.c | 13 +++++++++++--
> > include/media/mt9t001.h | 1 +
> > 4 files changed, 27 insertions(+), 5 deletions(-)
>
> Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Thank you. Ad the patches depend on the V4L2_CID_PIXEL_RATE control, could you
please take them in your tree and push them for v3.5 ?
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-05-14 7:30 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-09 12:55 [PATCH 0/3] V4L2_CID_PIXEL_RATE support in sensor drivers Laurent Pinchart
2012-05-09 12:55 ` [PATCH 1/3] mt9t001: Implement V4L2_CID_PIXEL_RATE control Laurent Pinchart
2012-05-09 12:55 ` [PATCH 2/3] mt9p031: " Laurent Pinchart
2012-05-09 12:55 ` [PATCH 3/3] mt9m032: " Laurent Pinchart
2012-05-13 21:53 ` [PATCH 0/3] V4L2_CID_PIXEL_RATE support in sensor drivers Sakari Ailus
2012-05-14 7:30 ` Laurent Pinchart
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).