diff options
author | Daniel Drake <dsd@laptop.org> | 2012-04-30 17:06:27 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-14 15:35:22 -0400 |
commit | a39fbb1d747aa88e410d0a25af92cd9e179ba0f4 (patch) | |
tree | 3620b1ed438fa98715dfcaf119c0c62307d28e9b /drivers/media/video/via-camera.c | |
parent | 3477e2ab0e52fe55999130eee833af9a29e2789a (diff) |
[media] via-camera: specify XO-1.5 camera clock speed
For the ov7670 camera to return images at the requested frame rate,
it needs to make calculations based on the clock speed, which is
a completely external factor (depends on the wiring of the system).
On the XO-1.5, which is the only known via-camera user, the camera
is clocked at 90MHz.
Pass this information to the ov7670 driver, to fix an issue where
a framerate of 3x the requested amount was being provided.
Signed-off-by: Daniel Drake <dsd@laptop.org>
Acked-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/via-camera.c')
-rw-r--r-- | drivers/media/video/via-camera.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/media/video/via-camera.c b/drivers/media/video/via-camera.c index 20f7237b8242..308e150a39bc 100644 --- a/drivers/media/video/via-camera.c +++ b/drivers/media/video/via-camera.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <media/v4l2-device.h> | 18 | #include <media/v4l2-device.h> |
19 | #include <media/v4l2-ioctl.h> | 19 | #include <media/v4l2-ioctl.h> |
20 | #include <media/v4l2-chip-ident.h> | 20 | #include <media/v4l2-chip-ident.h> |
21 | #include <media/ov7670.h> | ||
21 | #include <media/videobuf-dma-sg.h> | 22 | #include <media/videobuf-dma-sg.h> |
22 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
23 | #include <linux/dma-mapping.h> | 24 | #include <linux/dma-mapping.h> |
@@ -1347,11 +1348,21 @@ static __devinit bool viacam_serial_is_enabled(void) | |||
1347 | return false; | 1348 | return false; |
1348 | } | 1349 | } |
1349 | 1350 | ||
1351 | static struct ov7670_config sensor_cfg = { | ||
1352 | /* The XO-1.5 (only known user) clocks the camera at 90MHz. */ | ||
1353 | .clock_speed = 90, | ||
1354 | }; | ||
1355 | |||
1350 | static __devinit int viacam_probe(struct platform_device *pdev) | 1356 | static __devinit int viacam_probe(struct platform_device *pdev) |
1351 | { | 1357 | { |
1352 | int ret; | 1358 | int ret; |
1353 | struct i2c_adapter *sensor_adapter; | 1359 | struct i2c_adapter *sensor_adapter; |
1354 | struct viafb_dev *viadev = pdev->dev.platform_data; | 1360 | struct viafb_dev *viadev = pdev->dev.platform_data; |
1361 | struct i2c_board_info ov7670_info = { | ||
1362 | .type = "ov7670", | ||
1363 | .addr = 0x42 >> 1, | ||
1364 | .platform_data = &sensor_cfg, | ||
1365 | }; | ||
1355 | 1366 | ||
1356 | /* | 1367 | /* |
1357 | * Note that there are actually two capture channels on | 1368 | * Note that there are actually two capture channels on |
@@ -1433,8 +1444,8 @@ static __devinit int viacam_probe(struct platform_device *pdev) | |||
1433 | * is OLPC-specific. 0x42 assumption is ov7670-specific. | 1444 | * is OLPC-specific. 0x42 assumption is ov7670-specific. |
1434 | */ | 1445 | */ |
1435 | sensor_adapter = viafb_find_i2c_adapter(VIA_PORT_31); | 1446 | sensor_adapter = viafb_find_i2c_adapter(VIA_PORT_31); |
1436 | cam->sensor = v4l2_i2c_new_subdev(&cam->v4l2_dev, sensor_adapter, | 1447 | cam->sensor = v4l2_i2c_new_subdev_board(&cam->v4l2_dev, sensor_adapter, |
1437 | "ov7670", 0x42 >> 1, NULL); | 1448 | &ov7670_info, NULL); |
1438 | if (cam->sensor == NULL) { | 1449 | if (cam->sensor == NULL) { |
1439 | dev_err(&pdev->dev, "Unable to find the sensor!\n"); | 1450 | dev_err(&pdev->dev, "Unable to find the sensor!\n"); |
1440 | ret = -ENODEV; | 1451 | ret = -ENODEV; |