diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-07-14 03:14:21 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-07-14 03:14:21 -0300 |
commit | a8d41efd6cd091346a1276f0c7d818874b10bc36 (patch) | |
tree | 6ac7edd541fed080e63d93f7f14ef2daa0b10714 | |
parent | bd8a28419f128638347a77d46de11461f0c17fd6 (diff) | |
download | mediapointer-dvb-s2-a8d41efd6cd091346a1276f0c7d818874b10bc36.tar.gz mediapointer-dvb-s2-a8d41efd6cd091346a1276f0c7d818874b10bc36.tar.bz2 |
mt9v011: implement core->s_config to allow adjusting xtal frequency
From: Mauro Carvalho Chehab <mchehab@redhat.com>
Since frames per second is a function of cristal frequency, and this is
device-specific, add a function that allows adjusting it, via
subdev->core->s_config callback.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | linux/drivers/media/video/mt9v011.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/linux/drivers/media/video/mt9v011.c b/linux/drivers/media/video/mt9v011.c index 46b5a3cf5..bf68ea63f 100644 --- a/linux/drivers/media/video/mt9v011.c +++ b/linux/drivers/media/video/mt9v011.c @@ -350,6 +350,22 @@ static int mt9v011_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt) return 0; } +static int mt9v011_s_config(struct v4l2_subdev *sd, int dumb, void *data) +{ + struct mt9v011 *core = to_mt9v011(sd); + unsigned *xtal = data; + + v4l2_dbg(1, debug, sd, "s_config called\n"); + + if (xtal) { + core->xtal = *xtal; + v4l2_dbg(1, debug, sd, "xtal set to %d.%03d MHz\n", + *xtal / 1000000, (*xtal / 1000) % 1000); + } + + return 0; +} + #ifdef CONFIG_VIDEO_ADV_DEBUG static int mt9v011_g_register(struct v4l2_subdev *sd, @@ -398,6 +414,7 @@ static const struct v4l2_subdev_core_ops mt9v011_core_ops = { .g_ctrl = mt9v011_g_ctrl, .s_ctrl = mt9v011_s_ctrl, .reset = mt9v011_reset, + .s_config = mt9v011_s_config, .g_chip_ident = mt9v011_g_chip_ident, #ifdef CONFIG_VIDEO_ADV_DEBUG .g_register = mt9v011_g_register, |