diff options
author | Mike Isely <isely@pobox.com> | 2009-03-08 17:47:47 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:43:39 -0400 |
commit | 5a3bab8eb02f9413b802540530ea390d8d063e43 (patch) | |
tree | 70f29f62325b7ced90612f30909ddd0c7bc03e49 /drivers/media/video/pvrusb2/pvrusb2-wm8775.c | |
parent | 2eb563b7e726b517ef86213df436f50ec6c1740c (diff) |
V4L/DVB (11204): pvrusb2: Remove old i2c layer; we use v4l2-subdev now
This change removes the old i2c module controlling layer from the
pvrusb2 driver. This is code that first had appeared in the driver
back in December 2005. It's history. Now we use v4l2-subdev. Please
note also that with this change, the driver will no longer be usable
in kernels older that 2.6.22.
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-wm8775.c')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-wm8775.c | 124 |
1 files changed, 0 insertions, 124 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-wm8775.c b/drivers/media/video/pvrusb2/pvrusb2-wm8775.c index 0068566876ec..1670aa4051ce 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-wm8775.c +++ b/drivers/media/video/pvrusb2/pvrusb2-wm8775.c | |||
@@ -27,7 +27,6 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include "pvrusb2-wm8775.h" | 29 | #include "pvrusb2-wm8775.h" |
30 | #include "pvrusb2-i2c-cmd-v4l2.h" | ||
31 | 30 | ||
32 | 31 | ||
33 | #include "pvrusb2-hdw-internal.h" | 32 | #include "pvrusb2-hdw-internal.h" |
@@ -37,129 +36,6 @@ | |||
37 | #include <linux/errno.h> | 36 | #include <linux/errno.h> |
38 | #include <linux/slab.h> | 37 | #include <linux/slab.h> |
39 | 38 | ||
40 | |||
41 | |||
42 | struct pvr2_v4l_wm8775 { | ||
43 | struct pvr2_i2c_handler handler; | ||
44 | struct pvr2_i2c_client *client; | ||
45 | struct pvr2_hdw *hdw; | ||
46 | unsigned long stale_mask; | ||
47 | }; | ||
48 | |||
49 | |||
50 | static void set_input(struct pvr2_v4l_wm8775 *ctxt) | ||
51 | { | ||
52 | struct v4l2_routing route; | ||
53 | struct pvr2_hdw *hdw = ctxt->hdw; | ||
54 | |||
55 | memset(&route,0,sizeof(route)); | ||
56 | |||
57 | switch(hdw->input_val) { | ||
58 | case PVR2_CVAL_INPUT_RADIO: | ||
59 | route.input = 1; | ||
60 | break; | ||
61 | default: | ||
62 | /* All other cases just use the second input */ | ||
63 | route.input = 2; | ||
64 | break; | ||
65 | } | ||
66 | pvr2_trace(PVR2_TRACE_CHIPS,"i2c wm8775 set_input(val=%d route=0x%x)", | ||
67 | hdw->input_val,route.input); | ||
68 | |||
69 | pvr2_i2c_client_cmd(ctxt->client,VIDIOC_INT_S_AUDIO_ROUTING,&route); | ||
70 | } | ||
71 | |||
72 | static int check_input(struct pvr2_v4l_wm8775 *ctxt) | ||
73 | { | ||
74 | struct pvr2_hdw *hdw = ctxt->hdw; | ||
75 | return hdw->input_dirty != 0; | ||
76 | } | ||
77 | |||
78 | |||
79 | struct pvr2_v4l_wm8775_ops { | ||
80 | void (*update)(struct pvr2_v4l_wm8775 *); | ||
81 | int (*check)(struct pvr2_v4l_wm8775 *); | ||
82 | }; | ||
83 | |||
84 | |||
85 | static const struct pvr2_v4l_wm8775_ops wm8775_ops[] = { | ||
86 | { .update = set_input, .check = check_input}, | ||
87 | }; | ||
88 | |||
89 | |||
90 | static unsigned int wm8775_describe(struct pvr2_v4l_wm8775 *ctxt, | ||
91 | char *buf,unsigned int cnt) | ||
92 | { | ||
93 | return scnprintf(buf,cnt,"handler: pvrusb2-wm8775"); | ||
94 | } | ||
95 | |||
96 | |||
97 | static void wm8775_detach(struct pvr2_v4l_wm8775 *ctxt) | ||
98 | { | ||
99 | ctxt->client->handler = NULL; | ||
100 | kfree(ctxt); | ||
101 | } | ||
102 | |||
103 | |||
104 | static int wm8775_check(struct pvr2_v4l_wm8775 *ctxt) | ||
105 | { | ||
106 | unsigned long msk; | ||
107 | unsigned int idx; | ||
108 | |||
109 | for (idx = 0; idx < ARRAY_SIZE(wm8775_ops); idx++) { | ||
110 | msk = 1 << idx; | ||
111 | if (ctxt->stale_mask & msk) continue; | ||
112 | if (wm8775_ops[idx].check(ctxt)) { | ||
113 | ctxt->stale_mask |= msk; | ||
114 | } | ||
115 | } | ||
116 | return ctxt->stale_mask != 0; | ||
117 | } | ||
118 | |||
119 | |||
120 | static void wm8775_update(struct pvr2_v4l_wm8775 *ctxt) | ||
121 | { | ||
122 | unsigned long msk; | ||
123 | unsigned int idx; | ||
124 | |||
125 | for (idx = 0; idx < ARRAY_SIZE(wm8775_ops); idx++) { | ||
126 | msk = 1 << idx; | ||
127 | if (!(ctxt->stale_mask & msk)) continue; | ||
128 | ctxt->stale_mask &= ~msk; | ||
129 | wm8775_ops[idx].update(ctxt); | ||
130 | } | ||
131 | } | ||
132 | |||
133 | |||
134 | static const struct pvr2_i2c_handler_functions hfuncs = { | ||
135 | .detach = (void (*)(void *))wm8775_detach, | ||
136 | .check = (int (*)(void *))wm8775_check, | ||
137 | .update = (void (*)(void *))wm8775_update, | ||
138 | .describe = (unsigned int (*)(void *,char *,unsigned int))wm8775_describe, | ||
139 | }; | ||
140 | |||
141 | |||
142 | int pvr2_i2c_wm8775_setup(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp) | ||
143 | { | ||
144 | struct pvr2_v4l_wm8775 *ctxt; | ||
145 | |||
146 | if (cp->handler) return 0; | ||
147 | |||
148 | ctxt = kzalloc(sizeof(*ctxt),GFP_KERNEL); | ||
149 | if (!ctxt) return 0; | ||
150 | |||
151 | ctxt->handler.func_data = ctxt; | ||
152 | ctxt->handler.func_table = &hfuncs; | ||
153 | ctxt->client = cp; | ||
154 | ctxt->hdw = hdw; | ||
155 | ctxt->stale_mask = (1 << ARRAY_SIZE(wm8775_ops)) - 1; | ||
156 | cp->handler = &ctxt->handler; | ||
157 | pvr2_trace(PVR2_TRACE_CHIPS,"i2c 0x%x wm8775 V4L2 handler set up", | ||
158 | cp->client->addr); | ||
159 | return !0; | ||
160 | } | ||
161 | |||
162 | |||
163 | void pvr2_wm8775_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) | 39 | void pvr2_wm8775_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) |
164 | { | 40 | { |
165 | if (hdw->input_dirty || hdw->force_dirty) { | 41 | if (hdw->input_dirty || hdw->force_dirty) { |