diff options
Diffstat (limited to 'drivers/media/video/mt9t001.c')
-rw-r--r-- | drivers/media/video/mt9t001.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/media/video/mt9t001.c b/drivers/media/video/mt9t001.c index 49ca3cbfc6f1..6d343adf891d 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) | |||
691 | return ret; | 691 | return ret; |
692 | 692 | ||
693 | /* Configure the pixel clock polarity */ | 693 | /* Configure the pixel clock polarity */ |
694 | if (pdata && pdata->clk_pol) { | 694 | if (pdata->clk_pol) { |
695 | ret = mt9t001_write(client, MT9T001_PIXEL_CLOCK, | 695 | ret = mt9t001_write(client, MT9T001_PIXEL_CLOCK, |
696 | MT9T001_PIXEL_CLOCK_INVERT); | 696 | MT9T001_PIXEL_CLOCK_INVERT); |
697 | if (ret < 0) | 697 | if (ret < 0) |
@@ -715,10 +715,16 @@ static int mt9t001_video_probe(struct i2c_client *client) | |||
715 | static int mt9t001_probe(struct i2c_client *client, | 715 | static int mt9t001_probe(struct i2c_client *client, |
716 | const struct i2c_device_id *did) | 716 | const struct i2c_device_id *did) |
717 | { | 717 | { |
718 | struct mt9t001_platform_data *pdata = client->dev.platform_data; | ||
718 | struct mt9t001 *mt9t001; | 719 | struct mt9t001 *mt9t001; |
719 | unsigned int i; | 720 | unsigned int i; |
720 | int ret; | 721 | int ret; |
721 | 722 | ||
723 | if (pdata == NULL) { | ||
724 | dev_err(&client->dev, "No platform data\n"); | ||
725 | return -EINVAL; | ||
726 | } | ||
727 | |||
722 | if (!i2c_check_functionality(client->adapter, | 728 | if (!i2c_check_functionality(client->adapter, |
723 | I2C_FUNC_SMBUS_WORD_DATA)) { | 729 | I2C_FUNC_SMBUS_WORD_DATA)) { |
724 | dev_warn(&client->adapter->dev, | 730 | dev_warn(&client->adapter->dev, |
@@ -735,7 +741,7 @@ static int mt9t001_probe(struct i2c_client *client, | |||
735 | return -ENOMEM; | 741 | return -ENOMEM; |
736 | 742 | ||
737 | v4l2_ctrl_handler_init(&mt9t001->ctrls, ARRAY_SIZE(mt9t001_ctrls) + | 743 | v4l2_ctrl_handler_init(&mt9t001->ctrls, ARRAY_SIZE(mt9t001_ctrls) + |
738 | ARRAY_SIZE(mt9t001_gains) + 2); | 744 | ARRAY_SIZE(mt9t001_gains) + 3); |
739 | 745 | ||
740 | v4l2_ctrl_new_std(&mt9t001->ctrls, &mt9t001_ctrl_ops, | 746 | v4l2_ctrl_new_std(&mt9t001->ctrls, &mt9t001_ctrl_ops, |
741 | V4L2_CID_EXPOSURE, MT9T001_SHUTTER_WIDTH_MIN, | 747 | V4L2_CID_EXPOSURE, MT9T001_SHUTTER_WIDTH_MIN, |
@@ -743,6 +749,9 @@ static int mt9t001_probe(struct i2c_client *client, | |||
743 | MT9T001_SHUTTER_WIDTH_DEF); | 749 | MT9T001_SHUTTER_WIDTH_DEF); |
744 | v4l2_ctrl_new_std(&mt9t001->ctrls, &mt9t001_ctrl_ops, | 750 | v4l2_ctrl_new_std(&mt9t001->ctrls, &mt9t001_ctrl_ops, |
745 | V4L2_CID_BLACK_LEVEL, 1, 1, 1, 1); | 751 | V4L2_CID_BLACK_LEVEL, 1, 1, 1, 1); |
752 | v4l2_ctrl_new_std(&mt9t001->ctrls, &mt9t001_ctrl_ops, | ||
753 | V4L2_CID_PIXEL_RATE, pdata->ext_clk, pdata->ext_clk, | ||
754 | 1, pdata->ext_clk); | ||
746 | 755 | ||
747 | for (i = 0; i < ARRAY_SIZE(mt9t001_ctrls); ++i) | 756 | for (i = 0; i < ARRAY_SIZE(mt9t001_ctrls); ++i) |
748 | v4l2_ctrl_new_custom(&mt9t001->ctrls, &mt9t001_ctrls[i], NULL); | 757 | v4l2_ctrl_new_custom(&mt9t001->ctrls, &mt9t001_ctrls[i], NULL); |