diff options
author | Philipp Wiesner <p.wiesner@phytec.de> | 2010-08-03 06:57:39 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-08 22:43:03 -0400 |
commit | c8cf078ebd9f9b5ec3a113c8262062799fd9948a (patch) | |
tree | 678c71f303848158ec6c76a5d1b7a7d299df342d /drivers/media/video | |
parent | d86097e19cef2f13a29fc37db0dad17b99b6d5f8 (diff) |
V4L/DVB: mt9m111: Added indication that MT9M131 is supported by this driver
Added this info to Kconfig and mt9m111.c, some comment cleanup,
replaced 'mt9m11x'-statements by clarifications or driver name.
Driver is fully compatible to mt9m131 which has only additional functions
compared to mt9m111. Those aren't used anyway at the moment.
Signed-off-by: Philipp Wiesner <p.wiesner@phytec.de>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/Kconfig | 5 | ||||
-rw-r--r-- | drivers/media/video/mt9m111.c | 36 |
2 files changed, 25 insertions, 16 deletions
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig index 9d55fef2be3b..f6e4d0475351 100644 --- a/drivers/media/video/Kconfig +++ b/drivers/media/video/Kconfig | |||
@@ -792,10 +792,11 @@ config SOC_CAMERA_MT9M001 | |||
792 | and colour models. | 792 | and colour models. |
793 | 793 | ||
794 | config SOC_CAMERA_MT9M111 | 794 | config SOC_CAMERA_MT9M111 |
795 | tristate "mt9m111 and mt9m112 support" | 795 | tristate "mt9m111, mt9m112 and mt9m131 support" |
796 | depends on SOC_CAMERA && I2C | 796 | depends on SOC_CAMERA && I2C |
797 | help | 797 | help |
798 | This driver supports MT9M111 and MT9M112 cameras from Micron | 798 | This driver supports MT9M111, MT9M112 and MT9M131 cameras from |
799 | Micron/Aptina | ||
799 | 800 | ||
800 | config SOC_CAMERA_MT9T031 | 801 | config SOC_CAMERA_MT9T031 |
801 | tristate "mt9t031 support" | 802 | tristate "mt9t031 support" |
diff --git a/drivers/media/video/mt9m111.c b/drivers/media/video/mt9m111.c index 31cc3d04bcc4..9f92d6353231 100644 --- a/drivers/media/video/mt9m111.c +++ b/drivers/media/video/mt9m111.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Driver for MT9M111/MT9M112 CMOS Image Sensor from Micron | 2 | * Driver for MT9M111/MT9M112/MT9M131 CMOS Image Sensor from Micron/Aptina |
3 | * | 3 | * |
4 | * Copyright (C) 2008, Robert Jarzmik <robert.jarzmik@free.fr> | 4 | * Copyright (C) 2008, Robert Jarzmik <robert.jarzmik@free.fr> |
5 | * | 5 | * |
@@ -19,11 +19,14 @@ | |||
19 | #include <media/soc_camera.h> | 19 | #include <media/soc_camera.h> |
20 | 20 | ||
21 | /* | 21 | /* |
22 | * mt9m111 and mt9m112 i2c address is 0x5d or 0x48 (depending on SAddr pin) | 22 | * MT9M111, MT9M112 and MT9M131: |
23 | * i2c address is 0x48 or 0x5d (depending on SADDR pin) | ||
23 | * The platform has to define i2c_board_info and call i2c_register_board_info() | 24 | * The platform has to define i2c_board_info and call i2c_register_board_info() |
24 | */ | 25 | */ |
25 | 26 | ||
26 | /* mt9m111: Sensor register addresses */ | 27 | /* |
28 | * Sensor core register addresses (0x000..0x0ff) | ||
29 | */ | ||
27 | #define MT9M111_CHIP_VERSION 0x000 | 30 | #define MT9M111_CHIP_VERSION 0x000 |
28 | #define MT9M111_ROW_START 0x001 | 31 | #define MT9M111_ROW_START 0x001 |
29 | #define MT9M111_COLUMN_START 0x002 | 32 | #define MT9M111_COLUMN_START 0x002 |
@@ -72,8 +75,9 @@ | |||
72 | #define MT9M111_CTXT_CTRL_LED_FLASH_EN (1 << 2) | 75 | #define MT9M111_CTXT_CTRL_LED_FLASH_EN (1 << 2) |
73 | #define MT9M111_CTXT_CTRL_VBLANK_SEL_B (1 << 1) | 76 | #define MT9M111_CTXT_CTRL_VBLANK_SEL_B (1 << 1) |
74 | #define MT9M111_CTXT_CTRL_HBLANK_SEL_B (1 << 0) | 77 | #define MT9M111_CTXT_CTRL_HBLANK_SEL_B (1 << 0) |
78 | |||
75 | /* | 79 | /* |
76 | * mt9m111: Colorpipe register addresses (0x100..0x1ff) | 80 | * Colorpipe register addresses (0x100..0x1ff) |
77 | */ | 81 | */ |
78 | #define MT9M111_OPER_MODE_CTRL 0x106 | 82 | #define MT9M111_OPER_MODE_CTRL 0x106 |
79 | #define MT9M111_OUTPUT_FORMAT_CTRL 0x108 | 83 | #define MT9M111_OUTPUT_FORMAT_CTRL 0x108 |
@@ -109,8 +113,9 @@ | |||
109 | #define MT9M111_OUTFMT_SWAP_YCbCr_C_Y (1 << 1) | 113 | #define MT9M111_OUTFMT_SWAP_YCbCr_C_Y (1 << 1) |
110 | #define MT9M111_OUTFMT_SWAP_RGB_EVEN (1 << 1) | 114 | #define MT9M111_OUTFMT_SWAP_RGB_EVEN (1 << 1) |
111 | #define MT9M111_OUTFMT_SWAP_YCbCr_Cb_Cr (1 << 0) | 115 | #define MT9M111_OUTFMT_SWAP_YCbCr_Cb_Cr (1 << 0) |
116 | |||
112 | /* | 117 | /* |
113 | * mt9m111: Camera control register addresses (0x200..0x2ff not implemented) | 118 | * Camera control register addresses (0x200..0x2ff not implemented) |
114 | */ | 119 | */ |
115 | 120 | ||
116 | #define reg_read(reg) mt9m111_reg_read(client, MT9M111_##reg) | 121 | #define reg_read(reg) mt9m111_reg_read(client, MT9M111_##reg) |
@@ -160,7 +165,8 @@ enum mt9m111_context { | |||
160 | 165 | ||
161 | struct mt9m111 { | 166 | struct mt9m111 { |
162 | struct v4l2_subdev subdev; | 167 | struct v4l2_subdev subdev; |
163 | int model; /* V4L2_IDENT_MT9M11x* codes from v4l2-chip-ident.h */ | 168 | int model; /* V4L2_IDENT_MT9M111 or V4L2_IDENT_MT9M112 code |
169 | * from v4l2-chip-ident.h */ | ||
164 | enum mt9m111_context context; | 170 | enum mt9m111_context context; |
165 | struct v4l2_rect rect; | 171 | struct v4l2_rect rect; |
166 | const struct mt9m111_datafmt *fmt; | 172 | const struct mt9m111_datafmt *fmt; |
@@ -934,7 +940,7 @@ static int mt9m111_init(struct i2c_client *client) | |||
934 | if (!ret) | 940 | if (!ret) |
935 | ret = mt9m111_set_autoexposure(client, mt9m111->autoexposure); | 941 | ret = mt9m111_set_autoexposure(client, mt9m111->autoexposure); |
936 | if (ret) | 942 | if (ret) |
937 | dev_err(&client->dev, "mt9m11x init failed: %d\n", ret); | 943 | dev_err(&client->dev, "mt9m111 init failed: %d\n", ret); |
938 | return ret; | 944 | return ret; |
939 | } | 945 | } |
940 | 946 | ||
@@ -970,21 +976,23 @@ static int mt9m111_video_probe(struct soc_camera_device *icd, | |||
970 | data = reg_read(CHIP_VERSION); | 976 | data = reg_read(CHIP_VERSION); |
971 | 977 | ||
972 | switch (data) { | 978 | switch (data) { |
973 | case 0x143a: /* MT9M111 */ | 979 | case 0x143a: /* MT9M111 or MT9M131 */ |
974 | mt9m111->model = V4L2_IDENT_MT9M111; | 980 | mt9m111->model = V4L2_IDENT_MT9M111; |
981 | dev_info(&client->dev, | ||
982 | "Detected a MT9M111/MT9M131 chip ID %x\n", data); | ||
975 | break; | 983 | break; |
976 | case 0x148c: /* MT9M112 */ | 984 | case 0x148c: /* MT9M112 */ |
977 | mt9m111->model = V4L2_IDENT_MT9M112; | 985 | mt9m111->model = V4L2_IDENT_MT9M112; |
986 | dev_info(&client->dev, "Detected a MT9M112 chip ID %x\n", data); | ||
978 | break; | 987 | break; |
979 | default: | 988 | default: |
980 | ret = -ENODEV; | 989 | ret = -ENODEV; |
981 | dev_err(&client->dev, | 990 | dev_err(&client->dev, |
982 | "No MT9M11x chip detected, register read %x\n", data); | 991 | "No MT9M111/MT9M112/MT9M131 chip detected register read %x\n", |
992 | data); | ||
983 | goto ei2c; | 993 | goto ei2c; |
984 | } | 994 | } |
985 | 995 | ||
986 | dev_info(&client->dev, "Detected a MT9M11x chip ID %x\n", data); | ||
987 | |||
988 | ei2c: | 996 | ei2c: |
989 | return ret; | 997 | return ret; |
990 | } | 998 | } |
@@ -1034,13 +1042,13 @@ static int mt9m111_probe(struct i2c_client *client, | |||
1034 | int ret; | 1042 | int ret; |
1035 | 1043 | ||
1036 | if (!icd) { | 1044 | if (!icd) { |
1037 | dev_err(&client->dev, "MT9M11x: missing soc-camera data!\n"); | 1045 | dev_err(&client->dev, "mt9m111: soc-camera data missing!\n"); |
1038 | return -EINVAL; | 1046 | return -EINVAL; |
1039 | } | 1047 | } |
1040 | 1048 | ||
1041 | icl = to_soc_camera_link(icd); | 1049 | icl = to_soc_camera_link(icd); |
1042 | if (!icl) { | 1050 | if (!icl) { |
1043 | dev_err(&client->dev, "MT9M11x driver needs platform data\n"); | 1051 | dev_err(&client->dev, "mt9m111: driver needs platform data\n"); |
1044 | return -EINVAL; | 1052 | return -EINVAL; |
1045 | } | 1053 | } |
1046 | 1054 | ||
@@ -1114,6 +1122,6 @@ static void __exit mt9m111_mod_exit(void) | |||
1114 | module_init(mt9m111_mod_init); | 1122 | module_init(mt9m111_mod_init); |
1115 | module_exit(mt9m111_mod_exit); | 1123 | module_exit(mt9m111_mod_exit); |
1116 | 1124 | ||
1117 | MODULE_DESCRIPTION("Micron MT9M111/MT9M112 Camera driver"); | 1125 | MODULE_DESCRIPTION("Micron/Aptina MT9M111/MT9M112/MT9M131 Camera driver"); |
1118 | MODULE_AUTHOR("Robert Jarzmik"); | 1126 | MODULE_AUTHOR("Robert Jarzmik"); |
1119 | MODULE_LICENSE("GPL"); | 1127 | MODULE_LICENSE("GPL"); |