Lines Matching +full:in0 +full:- +full:in1
1 // SPDX-License-Identifier: GPL-2.0-or-later
6 Copyright (C) 2005-2007 Hans Verkuil <hverkuil@xs4all.nl>
10 #include "ivtv-driver.h"
11 #include "ivtv-cards.h"
12 #include "ivtv-gpio.h"
15 #include <media/v4l2-ctrls.h>
21 * OUTPUT IN1 IN0 AM3 AM2 AM1 AM0
25 * IN1 IN0
54 * OUTPUT IN0 AM0 IN1 AM1 AM2 IN2 BR0 BR1
58 * IN0 IN1 IN2
60 * 0 0 0 Line-In
82 * Special thanks to AVerMedia Technologies, Inc. and Jiun-Kuei Jung at
98 if (itv->card->type != IVTV_CARD_PVR_150) in ivtv_reset_ir_gpio()
119 struct ivtv *itv = algo->data; in ivtv_reset_tuner_gpio()
126 curout &= ~(1 << itv->card->xceive_pin); in ivtv_reset_tuner_gpio()
130 curout |= 1 << itv->card->xceive_pin; in ivtv_reset_tuner_gpio()
143 return &container_of(ctrl->handler, struct ivtv, hdl_gpio)->sd_gpio; in to_sd()
151 mask = itv->card->gpio_audio_freq.mask; in subdev_s_clock_freq()
154 data = itv->card->gpio_audio_freq.f32000; in subdev_s_clock_freq()
157 data = itv->card->gpio_audio_freq.f44100; in subdev_s_clock_freq()
161 data = itv->card->gpio_audio_freq.f48000; in subdev_s_clock_freq()
174 mask = itv->card->gpio_audio_detect.mask; in subdev_g_tuner()
176 vt->rxsubchans = V4L2_TUNER_SUB_STEREO | in subdev_g_tuner()
179 vt->rxsubchans = V4L2_TUNER_SUB_MONO; in subdev_g_tuner()
188 mask = itv->card->gpio_audio_mode.mask; in subdev_s_tuner()
189 switch (vt->audmode) { in subdev_s_tuner()
191 data = itv->card->gpio_audio_mode.lang1; in subdev_s_tuner()
194 data = itv->card->gpio_audio_mode.lang2; in subdev_s_tuner()
197 data = itv->card->gpio_audio_mode.mono; in subdev_s_tuner()
202 data = itv->card->gpio_audio_mode.stereo; in subdev_s_tuner()
215 mask = itv->card->gpio_audio_input.mask; in subdev_s_radio()
216 data = itv->card->gpio_audio_input.radio; in subdev_s_radio()
229 return -EINVAL; in subdev_s_audio_routing()
230 mask = itv->card->gpio_audio_input.mask; in subdev_s_audio_routing()
233 data = itv->card->gpio_audio_input.tuner; in subdev_s_audio_routing()
236 data = itv->card->gpio_audio_input.linein; in subdev_s_audio_routing()
240 data = itv->card->gpio_audio_input.radio; in subdev_s_audio_routing()
254 switch (ctrl->id) { in subdev_s_ctrl()
256 mask = itv->card->gpio_audio_mute.mask; in subdev_s_ctrl()
257 data = ctrl->val ? itv->card->gpio_audio_mute.mute : 0; in subdev_s_ctrl()
263 return -EINVAL; in subdev_s_ctrl()
274 v4l2_ctrl_handler_log_status(&itv->hdl_gpio, sd->name); in subdev_log_status()
284 if (input > 2) /* 0:Tuner 1:Composite 2:S-Video */ in subdev_s_video_routing()
285 return -EINVAL; in subdev_s_video_routing()
286 mask = itv->card->gpio_video_input.mask; in subdev_s_video_routing()
288 data = itv->card->gpio_video_input.tuner; in subdev_s_video_routing()
290 data = itv->card->gpio_video_input.composite; in subdev_s_video_routing()
292 data = itv->card->gpio_video_input.svideo; in subdev_s_video_routing()
332 if (itv->card->xceive_pin) in ivtv_gpio_init()
333 pin = 1 << itv->card->xceive_pin; in ivtv_gpio_init()
335 if ((itv->card->gpio_init.direction | pin) == 0) in ivtv_gpio_init()
342 write_reg(itv->card->gpio_init.initial_value | pin, IVTV_REG_GPIO_OUT); in ivtv_gpio_init()
343 write_reg(itv->card->gpio_init.direction | pin, IVTV_REG_GPIO_DIR); in ivtv_gpio_init()
344 v4l2_subdev_init(&itv->sd_gpio, &subdev_ops); in ivtv_gpio_init()
345 snprintf(itv->sd_gpio.name, sizeof(itv->sd_gpio.name), "%s-gpio", itv->v4l2_dev.name); in ivtv_gpio_init()
346 itv->sd_gpio.grp_id = IVTV_HW_GPIO; in ivtv_gpio_init()
347 v4l2_ctrl_handler_init(&itv->hdl_gpio, 1); in ivtv_gpio_init()
348 v4l2_ctrl_new_std(&itv->hdl_gpio, &gpio_ctrl_ops, in ivtv_gpio_init()
350 if (itv->hdl_gpio.error) in ivtv_gpio_init()
351 return itv->hdl_gpio.error; in ivtv_gpio_init()
352 itv->sd_gpio.ctrl_handler = &itv->hdl_gpio; in ivtv_gpio_init()
353 v4l2_ctrl_handler_setup(&itv->hdl_gpio); in ivtv_gpio_init()
354 return v4l2_device_register_subdev(&itv->v4l2_dev, &itv->sd_gpio); in ivtv_gpio_init()