diff options
Diffstat (limited to 'drivers/media/video/msp3400-driver.c')
-rw-r--r-- | drivers/media/video/msp3400-driver.c | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/drivers/media/video/msp3400-driver.c b/drivers/media/video/msp3400-driver.c index 0e412131da7c..b1763ac93ab3 100644 --- a/drivers/media/video/msp3400-driver.c +++ b/drivers/media/video/msp3400-driver.c | |||
@@ -56,7 +56,6 @@ | |||
56 | #include <linux/videodev2.h> | 56 | #include <linux/videodev2.h> |
57 | #include <media/v4l2-device.h> | 57 | #include <media/v4l2-device.h> |
58 | #include <media/v4l2-ioctl.h> | 58 | #include <media/v4l2-ioctl.h> |
59 | #include <media/v4l2-i2c-drv.h> | ||
60 | #include <media/msp3400.h> | 59 | #include <media/msp3400.h> |
61 | #include <media/tvaudio.h> | 60 | #include <media/tvaudio.h> |
62 | #include "msp3400-driver.h" | 61 | #include "msp3400-driver.h" |
@@ -382,7 +381,12 @@ static int msp_s_ctrl(struct v4l2_ctrl *ctrl) | |||
382 | 381 | ||
383 | void msp_update_volume(struct msp_state *state) | 382 | void msp_update_volume(struct msp_state *state) |
384 | { | 383 | { |
385 | v4l2_ctrl_s_ctrl(state->volume, v4l2_ctrl_g_ctrl(state->volume)); | 384 | /* Force an update of the volume/mute cluster */ |
385 | v4l2_ctrl_lock(state->volume); | ||
386 | state->volume->val = state->volume->cur.val; | ||
387 | state->muted->val = state->muted->cur.val; | ||
388 | msp_s_ctrl(state->volume); | ||
389 | v4l2_ctrl_unlock(state->volume); | ||
386 | } | 390 | } |
387 | 391 | ||
388 | /* --- v4l2 ioctls --- */ | 392 | /* --- v4l2 ioctls --- */ |
@@ -843,15 +847,31 @@ static const struct i2c_device_id msp_id[] = { | |||
843 | }; | 847 | }; |
844 | MODULE_DEVICE_TABLE(i2c, msp_id); | 848 | MODULE_DEVICE_TABLE(i2c, msp_id); |
845 | 849 | ||
846 | static struct v4l2_i2c_driver_data v4l2_i2c_data = { | 850 | static struct i2c_driver msp_driver = { |
847 | .name = "msp3400", | 851 | .driver = { |
848 | .probe = msp_probe, | 852 | .owner = THIS_MODULE, |
849 | .remove = msp_remove, | 853 | .name = "msp3400", |
850 | .suspend = msp_suspend, | 854 | }, |
851 | .resume = msp_resume, | 855 | .probe = msp_probe, |
852 | .id_table = msp_id, | 856 | .remove = msp_remove, |
857 | .suspend = msp_suspend, | ||
858 | .resume = msp_resume, | ||
859 | .id_table = msp_id, | ||
853 | }; | 860 | }; |
854 | 861 | ||
862 | static __init int init_msp(void) | ||
863 | { | ||
864 | return i2c_add_driver(&msp_driver); | ||
865 | } | ||
866 | |||
867 | static __exit void exit_msp(void) | ||
868 | { | ||
869 | i2c_del_driver(&msp_driver); | ||
870 | } | ||
871 | |||
872 | module_init(init_msp); | ||
873 | module_exit(exit_msp); | ||
874 | |||
855 | /* | 875 | /* |
856 | * Overrides for Emacs so that we follow Linus's tabbing style. | 876 | * Overrides for Emacs so that we follow Linus's tabbing style. |
857 | * --------------------------------------------------------------------------- | 877 | * --------------------------------------------------------------------------- |