diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2014-06-03 05:35:54 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-07-21 23:52:03 -0400 |
commit | d8dde6c8dd3916f532b5fd3b1fc377e01ea41e01 (patch) | |
tree | d997e9d4608bd5339c1a4144a244cae07225b635 /drivers/media/i2c/mt9v032.c | |
parent | d131e54b686049f90a34f195a7d276083ef68aa0 (diff) |
[media] mt9v032: add support for mt9v022 and mt9v024
as are mt9v024 and mt9v034. With minimal changes it is possible
to support mt9v02[24] with the same driver.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/i2c/mt9v032.c')
-rw-r--r-- | drivers/media/i2c/mt9v032.c | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/drivers/media/i2c/mt9v032.c b/drivers/media/i2c/mt9v032.c index edbe80ce2132..86c383385847 100644 --- a/drivers/media/i2c/mt9v032.c +++ b/drivers/media/i2c/mt9v032.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Driver for MT9V032 CMOS Image Sensor from Micron | 2 | * Driver for MT9V022, MT9V024, MT9V032, and MT9V034 CMOS Image Sensors |
3 | * | 3 | * |
4 | * Copyright (C) 2010, Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 4 | * Copyright (C) 2010, Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
5 | * | 5 | * |
@@ -134,8 +134,12 @@ | |||
134 | #define MT9V032_THERMAL_INFO 0xc1 | 134 | #define MT9V032_THERMAL_INFO 0xc1 |
135 | 135 | ||
136 | enum mt9v032_model { | 136 | enum mt9v032_model { |
137 | MT9V032_MODEL_V032_COLOR, | 137 | MT9V032_MODEL_V022_COLOR, /* MT9V022IX7ATC */ |
138 | MT9V032_MODEL_V032_MONO, | 138 | MT9V032_MODEL_V022_MONO, /* MT9V022IX7ATM */ |
139 | MT9V032_MODEL_V024_COLOR, /* MT9V024IA7XTC */ | ||
140 | MT9V032_MODEL_V024_MONO, /* MT9V024IA7XTM */ | ||
141 | MT9V032_MODEL_V032_COLOR, /* MT9V032C12STM */ | ||
142 | MT9V032_MODEL_V032_MONO, /* MT9V032C12STC */ | ||
139 | MT9V032_MODEL_V034_COLOR, | 143 | MT9V032_MODEL_V034_COLOR, |
140 | MT9V032_MODEL_V034_MONO, | 144 | MT9V032_MODEL_V034_MONO, |
141 | }; | 145 | }; |
@@ -161,14 +165,14 @@ struct mt9v032_model_info { | |||
161 | }; | 165 | }; |
162 | 166 | ||
163 | static const struct mt9v032_model_version mt9v032_versions[] = { | 167 | static const struct mt9v032_model_version mt9v032_versions[] = { |
164 | { MT9V032_CHIP_ID_REV1, "MT9V032 rev1/2" }, | 168 | { MT9V032_CHIP_ID_REV1, "MT9V022/MT9V032 rev1/2" }, |
165 | { MT9V032_CHIP_ID_REV3, "MT9V032 rev3" }, | 169 | { MT9V032_CHIP_ID_REV3, "MT9V022/MT9V032 rev3" }, |
166 | { MT9V034_CHIP_ID_REV1, "MT9V034 rev1" }, | 170 | { MT9V034_CHIP_ID_REV1, "MT9V024/MT9V034 rev1" }, |
167 | }; | 171 | }; |
168 | 172 | ||
169 | static const struct mt9v032_model_data mt9v032_model_data[] = { | 173 | static const struct mt9v032_model_data mt9v032_model_data[] = { |
170 | { | 174 | { |
171 | /* MT9V032 revisions 1/2/3 */ | 175 | /* MT9V022, MT9V032 revisions 1/2/3 */ |
172 | .min_row_time = 660, | 176 | .min_row_time = 660, |
173 | .min_hblank = MT9V032_HORIZONTAL_BLANKING_MIN, | 177 | .min_hblank = MT9V032_HORIZONTAL_BLANKING_MIN, |
174 | .min_vblank = MT9V032_VERTICAL_BLANKING_MIN, | 178 | .min_vblank = MT9V032_VERTICAL_BLANKING_MIN, |
@@ -177,7 +181,7 @@ static const struct mt9v032_model_data mt9v032_model_data[] = { | |||
177 | .max_shutter = MT9V032_TOTAL_SHUTTER_WIDTH_MAX, | 181 | .max_shutter = MT9V032_TOTAL_SHUTTER_WIDTH_MAX, |
178 | .pclk_reg = MT9V032_PIXEL_CLOCK, | 182 | .pclk_reg = MT9V032_PIXEL_CLOCK, |
179 | }, { | 183 | }, { |
180 | /* MT9V034 */ | 184 | /* MT9V024, MT9V034 */ |
181 | .min_row_time = 690, | 185 | .min_row_time = 690, |
182 | .min_hblank = MT9V034_HORIZONTAL_BLANKING_MIN, | 186 | .min_hblank = MT9V034_HORIZONTAL_BLANKING_MIN, |
183 | .min_vblank = MT9V034_VERTICAL_BLANKING_MIN, | 187 | .min_vblank = MT9V034_VERTICAL_BLANKING_MIN, |
@@ -189,6 +193,22 @@ static const struct mt9v032_model_data mt9v032_model_data[] = { | |||
189 | }; | 193 | }; |
190 | 194 | ||
191 | static const struct mt9v032_model_info mt9v032_models[] = { | 195 | static const struct mt9v032_model_info mt9v032_models[] = { |
196 | [MT9V032_MODEL_V022_COLOR] = { | ||
197 | .data = &mt9v032_model_data[0], | ||
198 | .color = true, | ||
199 | }, | ||
200 | [MT9V032_MODEL_V022_MONO] = { | ||
201 | .data = &mt9v032_model_data[0], | ||
202 | .color = false, | ||
203 | }, | ||
204 | [MT9V032_MODEL_V024_COLOR] = { | ||
205 | .data = &mt9v032_model_data[1], | ||
206 | .color = true, | ||
207 | }, | ||
208 | [MT9V032_MODEL_V024_MONO] = { | ||
209 | .data = &mt9v032_model_data[1], | ||
210 | .color = false, | ||
211 | }, | ||
192 | [MT9V032_MODEL_V032_COLOR] = { | 212 | [MT9V032_MODEL_V032_COLOR] = { |
193 | .data = &mt9v032_model_data[0], | 213 | .data = &mt9v032_model_data[0], |
194 | .color = true, | 214 | .color = true, |
@@ -1010,6 +1030,10 @@ static int mt9v032_remove(struct i2c_client *client) | |||
1010 | } | 1030 | } |
1011 | 1031 | ||
1012 | static const struct i2c_device_id mt9v032_id[] = { | 1032 | static const struct i2c_device_id mt9v032_id[] = { |
1033 | { "mt9v022", (kernel_ulong_t)&mt9v032_models[MT9V032_MODEL_V022_COLOR] }, | ||
1034 | { "mt9v022m", (kernel_ulong_t)&mt9v032_models[MT9V032_MODEL_V022_MONO] }, | ||
1035 | { "mt9v024", (kernel_ulong_t)&mt9v032_models[MT9V032_MODEL_V024_COLOR] }, | ||
1036 | { "mt9v024m", (kernel_ulong_t)&mt9v032_models[MT9V032_MODEL_V024_MONO] }, | ||
1013 | { "mt9v032", (kernel_ulong_t)&mt9v032_models[MT9V032_MODEL_V032_COLOR] }, | 1037 | { "mt9v032", (kernel_ulong_t)&mt9v032_models[MT9V032_MODEL_V032_COLOR] }, |
1014 | { "mt9v032m", (kernel_ulong_t)&mt9v032_models[MT9V032_MODEL_V032_MONO] }, | 1038 | { "mt9v032m", (kernel_ulong_t)&mt9v032_models[MT9V032_MODEL_V032_MONO] }, |
1015 | { "mt9v034", (kernel_ulong_t)&mt9v032_models[MT9V032_MODEL_V034_COLOR] }, | 1039 | { "mt9v034", (kernel_ulong_t)&mt9v032_models[MT9V032_MODEL_V034_COLOR] }, |