Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320001
b: refs/heads/master
c: 5472d3f
h: refs/heads/master
i:
  319999: 0a16c7c
v: v3
  • Loading branch information
Laurent Pinchart authored and Mauro Carvalho Chehab committed May 24, 2012
1 parent 6279306 commit 8d2c441
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8d690c4a4e88297451edd027d37291676bc5b9c4
refs/heads/master: 5472d3f17845c4398c6a510b46855820920c2181
13 changes: 11 additions & 2 deletions trunk/drivers/media/video/mt9m032.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand Down

0 comments on commit 8d2c441

Please sign in to comment.