diff options
-rw-r--r-- | arch/arm/mach-pxa/pcm990-baseboard.c | 6 | ||||
-rw-r--r-- | drivers/media/i2c/soc_camera/mt9v022.c | 8 | ||||
-rw-r--r-- | include/media/mt9v022.h | 16 |
3 files changed, 27 insertions, 3 deletions
diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c index 113c57a03565..fb7f1d1627dc 100644 --- a/arch/arm/mach-pxa/pcm990-baseboard.c +++ b/arch/arm/mach-pxa/pcm990-baseboard.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/i2c/pxa-i2c.h> | 26 | #include <linux/i2c/pxa-i2c.h> |
27 | #include <linux/pwm_backlight.h> | 27 | #include <linux/pwm_backlight.h> |
28 | 28 | ||
29 | #include <media/mt9v022.h> | ||
29 | #include <media/soc_camera.h> | 30 | #include <media/soc_camera.h> |
30 | 31 | ||
31 | #include <linux/platform_data/camera-pxa.h> | 32 | #include <linux/platform_data/camera-pxa.h> |
@@ -468,6 +469,10 @@ static struct i2c_board_info __initdata pcm990_i2c_devices[] = { | |||
468 | }, | 469 | }, |
469 | }; | 470 | }; |
470 | 471 | ||
472 | static struct mt9v022_platform_data mt9v022_pdata = { | ||
473 | .y_skip_top = 1, | ||
474 | }; | ||
475 | |||
471 | static struct i2c_board_info pcm990_camera_i2c[] = { | 476 | static struct i2c_board_info pcm990_camera_i2c[] = { |
472 | { | 477 | { |
473 | I2C_BOARD_INFO("mt9v022", 0x48), | 478 | I2C_BOARD_INFO("mt9v022", 0x48), |
@@ -480,6 +485,7 @@ static struct soc_camera_link iclink[] = { | |||
480 | { | 485 | { |
481 | .bus_id = 0, /* Must match with the camera ID */ | 486 | .bus_id = 0, /* Must match with the camera ID */ |
482 | .board_info = &pcm990_camera_i2c[0], | 487 | .board_info = &pcm990_camera_i2c[0], |
488 | .priv = &mt9v022_pdata, | ||
483 | .i2c_adapter_id = 0, | 489 | .i2c_adapter_id = 0, |
484 | .query_bus_param = pcm990_camera_query_bus_param, | 490 | .query_bus_param = pcm990_camera_query_bus_param, |
485 | .set_bus_param = pcm990_camera_set_bus_param, | 491 | .set_bus_param = pcm990_camera_set_bus_param, |
diff --git a/drivers/media/i2c/soc_camera/mt9v022.c b/drivers/media/i2c/soc_camera/mt9v022.c index 5bc5a9286fd5..84d204f82cb2 100644 --- a/drivers/media/i2c/soc_camera/mt9v022.c +++ b/drivers/media/i2c/soc_camera/mt9v022.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/log2.h> | 15 | #include <linux/log2.h> |
16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
17 | 17 | ||
18 | #include <media/mt9v022.h> | ||
18 | #include <media/soc_camera.h> | 19 | #include <media/soc_camera.h> |
19 | #include <media/soc_mediabus.h> | 20 | #include <media/soc_mediabus.h> |
20 | #include <media/v4l2-subdev.h> | 21 | #include <media/v4l2-subdev.h> |
@@ -869,6 +870,7 @@ static int mt9v022_probe(struct i2c_client *client, | |||
869 | struct mt9v022 *mt9v022; | 870 | struct mt9v022 *mt9v022; |
870 | struct soc_camera_link *icl = soc_camera_i2c_to_link(client); | 871 | struct soc_camera_link *icl = soc_camera_i2c_to_link(client); |
871 | struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); | 872 | struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); |
873 | struct mt9v022_platform_data *pdata = icl->priv; | ||
872 | int ret; | 874 | int ret; |
873 | 875 | ||
874 | if (!icl) { | 876 | if (!icl) { |
@@ -932,10 +934,10 @@ static int mt9v022_probe(struct i2c_client *client, | |||
932 | mt9v022->chip_control = MT9V022_CHIP_CONTROL_DEFAULT; | 934 | mt9v022->chip_control = MT9V022_CHIP_CONTROL_DEFAULT; |
933 | 935 | ||
934 | /* | 936 | /* |
935 | * MT9V022 _really_ corrupts the first read out line. | 937 | * On some platforms the first read out line is corrupted. |
936 | * TODO: verify on i.MX31 | 938 | * Workaround it by skipping if indicated by platform data. |
937 | */ | 939 | */ |
938 | mt9v022->y_skip_top = 1; | 940 | mt9v022->y_skip_top = pdata ? pdata->y_skip_top : 0; |
939 | mt9v022->rect.left = MT9V022_COLUMN_SKIP; | 941 | mt9v022->rect.left = MT9V022_COLUMN_SKIP; |
940 | mt9v022->rect.top = MT9V022_ROW_SKIP; | 942 | mt9v022->rect.top = MT9V022_ROW_SKIP; |
941 | mt9v022->rect.width = MT9V022_MAX_WIDTH; | 943 | mt9v022->rect.width = MT9V022_MAX_WIDTH; |
diff --git a/include/media/mt9v022.h b/include/media/mt9v022.h new file mode 100644 index 000000000000..40561801321a --- /dev/null +++ b/include/media/mt9v022.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * mt9v022 sensor | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #ifndef __MT9V022_H__ | ||
10 | #define __MT9V022_H__ | ||
11 | |||
12 | struct mt9v022_platform_data { | ||
13 | unsigned short y_skip_top; /* Lines to skip at the top */ | ||
14 | }; | ||
15 | |||
16 | #endif | ||