diff options
author | Mike Isely <isely@pobox.com> | 2009-03-06 22:39:34 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:43:35 -0400 |
commit | 5f6dae802c0f6a943c2c873c203642d1d3c2fc3f (patch) | |
tree | 40941ce08c2ef230262b215a78a6a725a8ece0d9 /drivers/media | |
parent | edb9dcb885c6288813b62c20e6b578492845f9ad (diff) |
V4L/DVB (11176): pvrusb2: Tie in wm8775 sub-device handling
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-devattr.h | 1 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw.c | 4 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-wm8775.c | 26 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-wm8775.h | 3 |
4 files changed, 33 insertions, 1 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-devattr.h b/drivers/media/video/pvrusb2/pvrusb2-devattr.h index abf3e37fab2b..1339a32a2a1b 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-devattr.h +++ b/drivers/media/video/pvrusb2/pvrusb2-devattr.h | |||
@@ -39,6 +39,7 @@ | |||
39 | #define PVR2_CLIENT_ID_SAA7115 3 | 39 | #define PVR2_CLIENT_ID_SAA7115 3 |
40 | #define PVR2_CLIENT_ID_TUNER 4 | 40 | #define PVR2_CLIENT_ID_TUNER 4 |
41 | #define PVR2_CLIENT_ID_CS53132A 5 | 41 | #define PVR2_CLIENT_ID_CS53132A 5 |
42 | #define PVR2_CLIENT_ID_WM8775 6 | ||
42 | 43 | ||
43 | struct pvr2_device_client_desc { | 44 | struct pvr2_device_client_desc { |
44 | /* One ovr PVR2_CLIENT_ID_xxxx */ | 45 | /* One ovr PVR2_CLIENT_ID_xxxx */ |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 36285ca48808..3a93860310ed 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include "pvrusb2-encoder.h" | 36 | #include "pvrusb2-encoder.h" |
37 | #include "pvrusb2-debug.h" | 37 | #include "pvrusb2-debug.h" |
38 | #include "pvrusb2-fx2-cmd.h" | 38 | #include "pvrusb2-fx2-cmd.h" |
39 | #include "pvrusb2-wm8775.h" | ||
39 | 40 | ||
40 | #define TV_MIN_FREQ 55250000L | 41 | #define TV_MIN_FREQ 55250000L |
41 | #define TV_MAX_FREQ 850000000L | 42 | #define TV_MAX_FREQ 850000000L |
@@ -109,7 +110,7 @@ typedef void (*pvr2_subdev_update_func)(struct pvr2_hdw *, | |||
109 | struct v4l2_subdev *); | 110 | struct v4l2_subdev *); |
110 | 111 | ||
111 | static const pvr2_subdev_update_func pvr2_module_update_functions[] = { | 112 | static const pvr2_subdev_update_func pvr2_module_update_functions[] = { |
112 | /* ????? */ | 113 | [PVR2_CLIENT_ID_WM8775] = pvr2_wm8775_update, |
113 | }; | 114 | }; |
114 | 115 | ||
115 | static const char *module_names[] = { | 116 | static const char *module_names[] = { |
@@ -118,6 +119,7 @@ static const char *module_names[] = { | |||
118 | [PVR2_CLIENT_ID_SAA7115] = "saa7115", | 119 | [PVR2_CLIENT_ID_SAA7115] = "saa7115", |
119 | [PVR2_CLIENT_ID_TUNER] = "tuner", | 120 | [PVR2_CLIENT_ID_TUNER] = "tuner", |
120 | [PVR2_CLIENT_ID_CS53132A] = "cs53132a", | 121 | [PVR2_CLIENT_ID_CS53132A] = "cs53132a", |
122 | [PVR2_CLIENT_ID_WM8775] = "wm8775", | ||
121 | }; | 123 | }; |
122 | 124 | ||
123 | 125 | ||
diff --git a/drivers/media/video/pvrusb2/pvrusb2-wm8775.c b/drivers/media/video/pvrusb2/pvrusb2-wm8775.c index f6fcf0ac6118..40b221fe8027 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-wm8775.c +++ b/drivers/media/video/pvrusb2/pvrusb2-wm8775.c | |||
@@ -37,6 +37,8 @@ | |||
37 | #include <linux/errno.h> | 37 | #include <linux/errno.h> |
38 | #include <linux/slab.h> | 38 | #include <linux/slab.h> |
39 | 39 | ||
40 | |||
41 | |||
40 | struct pvr2_v4l_wm8775 { | 42 | struct pvr2_v4l_wm8775 { |
41 | struct pvr2_i2c_handler handler; | 43 | struct pvr2_i2c_handler handler; |
42 | struct pvr2_i2c_client *client; | 44 | struct pvr2_i2c_client *client; |
@@ -158,6 +160,30 @@ int pvr2_i2c_wm8775_setup(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp) | |||
158 | } | 160 | } |
159 | 161 | ||
160 | 162 | ||
163 | void pvr2_wm8775_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) | ||
164 | { | ||
165 | if (hdw->input_dirty) { | ||
166 | struct v4l2_routing route; | ||
167 | |||
168 | memset(&route, 0, sizeof(route)); | ||
169 | |||
170 | switch (hdw->input_val) { | ||
171 | case PVR2_CVAL_INPUT_RADIO: | ||
172 | route.input = 1; | ||
173 | break; | ||
174 | default: | ||
175 | /* All other cases just use the second input */ | ||
176 | route.input = 2; | ||
177 | break; | ||
178 | } | ||
179 | pvr2_trace(PVR2_TRACE_CHIPS, "subdev wm8775" | ||
180 | " set_input(val=%d route=0x%x)", | ||
181 | hdw->input_val, route.input); | ||
182 | |||
183 | sd->ops->audio->s_routing(sd, &route); | ||
184 | } | ||
185 | } | ||
186 | |||
161 | 187 | ||
162 | 188 | ||
163 | /* | 189 | /* |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-wm8775.h b/drivers/media/video/pvrusb2/pvrusb2-wm8775.h index 5b2cb6183576..d2d4e7eb1107 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-wm8775.h +++ b/drivers/media/video/pvrusb2/pvrusb2-wm8775.h | |||
@@ -37,6 +37,9 @@ | |||
37 | #include "pvrusb2-i2c-track.h" | 37 | #include "pvrusb2-i2c-track.h" |
38 | 38 | ||
39 | int pvr2_i2c_wm8775_setup(struct pvr2_hdw *,struct pvr2_i2c_client *); | 39 | int pvr2_i2c_wm8775_setup(struct pvr2_hdw *,struct pvr2_i2c_client *); |
40 | #include "pvrusb2-hdw-internal.h" | ||
41 | |||
42 | void pvr2_wm8775_update(struct pvr2_hdw *, struct v4l2_subdev *sd); | ||
40 | 43 | ||
41 | 44 | ||
42 | #endif /* __PVRUSB2_WM8775_H */ | 45 | #endif /* __PVRUSB2_WM8775_H */ |