102 #define IVTV_REG_GPIO_IN 0x9008
103 #define IVTV_REG_GPIO_OUT 0x900c
104 #define IVTV_REG_GPIO_DIR 0x9020
117 curout = (curout & ~0xF) | 1;
138 curout &= ~(1 << itv->
card->xceive_pin);
142 curout |= 1 << itv->
card->xceive_pin;
160 struct ivtv *itv = sd_to_ivtv(sd);
163 mask = itv->
card->gpio_audio_freq.mask;
166 data = itv->
card->gpio_audio_freq.f32000;
169 data = itv->
card->gpio_audio_freq.f44100;
173 data = itv->
card->gpio_audio_freq.f48000;
183 struct ivtv *itv = sd_to_ivtv(sd);
186 mask = itv->
card->gpio_audio_detect.mask;
197 struct ivtv *itv = sd_to_ivtv(sd);
200 mask = itv->
card->gpio_audio_mode.mask;
203 data = itv->
card->gpio_audio_mode.lang1;
206 data = itv->
card->gpio_audio_mode.lang2;
209 data = itv->
card->gpio_audio_mode.mono;
214 data = itv->
card->gpio_audio_mode.stereo;
224 struct ivtv *itv = sd_to_ivtv(sd);
227 mask = itv->
card->gpio_audio_input.mask;
228 data = itv->
card->gpio_audio_input.radio;
234 static int subdev_s_audio_routing(
struct v4l2_subdev *sd,
237 struct ivtv *itv = sd_to_ivtv(sd);
242 mask = itv->
card->gpio_audio_input.mask;
245 data = itv->
card->gpio_audio_input.tuner;
248 data = itv->
card->gpio_audio_input.linein;
252 data = itv->
card->gpio_audio_input.radio;
263 struct ivtv *itv = sd_to_ivtv(sd);
268 mask = itv->
card->gpio_audio_mute.mask;
269 data = ctrl->
val ? itv->
card->gpio_audio_mute.mute : 0;
279 static int subdev_log_status(
struct v4l2_subdev *sd)
281 struct ivtv *itv = sd_to_ivtv(sd);
283 IVTV_INFO(
"GPIO status: DIR=0x%04x OUT=0x%04x IN=0x%04x\n",
290 static int subdev_s_video_routing(
struct v4l2_subdev *sd,
293 struct ivtv *itv = sd_to_ivtv(sd);
298 mask = itv->
card->gpio_video_input.mask;
300 data = itv->
card->gpio_video_input.tuner;
302 data = itv->
card->gpio_video_input.composite;
304 data = itv->
card->gpio_video_input.svideo;
311 .s_ctrl = subdev_s_ctrl,
315 .log_status = subdev_log_status,
326 .s_radio = subdev_s_radio,
327 .g_tuner = subdev_g_tuner,
328 .s_tuner = subdev_s_tuner,
332 .s_clock_freq = subdev_s_clock_freq,
333 .s_routing = subdev_s_audio_routing,
337 .s_routing = subdev_s_video_routing,
341 .core = &subdev_core_ops,
342 .tuner = &subdev_tuner_ops,
343 .audio = &subdev_audio_ops,
344 .video = &subdev_video_ops,
351 if (itv->
card->xceive_pin)
352 pin = 1 << itv->
card->xceive_pin;
354 if ((itv->
card->gpio_init.direction | pin) == 0)