Lines Matching defs:dev
23 int hdpvr_config_call(struct hdpvr_device *dev, uint value, u8 valbuf)
28 mutex_lock(&dev->usbc_mutex);
29 dev->usbc_buf[0] = valbuf;
30 ret = usb_control_msg(dev->udev,
31 usb_sndctrlpipe(dev->udev, 0),
34 dev->usbc_buf, 1, 10000);
36 mutex_unlock(&dev->usbc_mutex);
37 v4l2_dbg(MSG_INFO, hdpvr_debug, &dev->v4l2_dev,
44 int get_video_info(struct hdpvr_device *dev, struct hdpvr_video_info *vidinf)
49 mutex_lock(&dev->usbc_mutex);
50 ret = usb_control_msg(dev->udev,
51 usb_rcvctrlpipe(dev->udev, 0),
54 dev->usbc_buf, 5,
59 v4l2_dbg(MSG_INFO, hdpvr_debug, &dev->v4l2_dev,
61 dev->usbc_buf);
63 mutex_unlock(&dev->usbc_mutex);
68 vidinf->width = dev->usbc_buf[1] << 8 | dev->usbc_buf[0];
69 vidinf->height = dev->usbc_buf[3] << 8 | dev->usbc_buf[2];
70 vidinf->fps = dev->usbc_buf[4];
76 int get_input_lines_info(struct hdpvr_device *dev)
80 mutex_lock(&dev->usbc_mutex);
81 ret = usb_control_msg(dev->udev,
82 usb_rcvctrlpipe(dev->udev, 0),
85 dev->usbc_buf, 3,
90 v4l2_dbg(MSG_INFO, hdpvr_debug, &dev->v4l2_dev,
92 dev->usbc_buf);
96 lines = dev->usbc_buf[1] << 8 | dev->usbc_buf[0];
97 mutex_unlock(&dev->usbc_mutex);
102 int hdpvr_set_bitrate(struct hdpvr_device *dev)
106 mutex_lock(&dev->usbc_mutex);
107 memset(dev->usbc_buf, 0, 4);
108 dev->usbc_buf[0] = dev->options.bitrate;
109 dev->usbc_buf[2] = dev->options.peak_bitrate;
111 ret = usb_control_msg(dev->udev,
112 usb_sndctrlpipe(dev->udev, 0),
114 CTRL_DEFAULT_INDEX, dev->usbc_buf, 4, 1000);
115 mutex_unlock(&dev->usbc_mutex);
120 int hdpvr_set_audio(struct hdpvr_device *dev, u8 input,
125 if (dev->flags & HDPVR_FLAG_AC3_CAP) {
126 mutex_lock(&dev->usbc_mutex);
127 memset(dev->usbc_buf, 0, 2);
128 dev->usbc_buf[0] = input;
130 dev->usbc_buf[1] = 0;
132 dev->usbc_buf[1] = 1;
134 mutex_unlock(&dev->usbc_mutex);
135 v4l2_err(&dev->v4l2_dev, "invalid audio codec %d\n",
141 ret = usb_control_msg(dev->udev,
142 usb_sndctrlpipe(dev->udev, 0),
144 CTRL_DEFAULT_INDEX, dev->usbc_buf, 2,
146 mutex_unlock(&dev->usbc_mutex);
150 ret = hdpvr_config_call(dev, CTRL_AUDIO_INPUT_VALUE, input);
155 int hdpvr_set_options(struct hdpvr_device *dev)
157 hdpvr_config_call(dev, CTRL_VIDEO_STD_TYPE, dev->options.video_std);
159 hdpvr_config_call(dev, CTRL_VIDEO_INPUT_VALUE,
160 dev->options.video_input+1);
162 hdpvr_set_audio(dev, dev->options.audio_input+1,
163 dev->options.audio_codec);
165 hdpvr_set_bitrate(dev);
166 hdpvr_config_call(dev, CTRL_BITRATE_MODE_VALUE,
167 dev->options.bitrate_mode);
168 hdpvr_config_call(dev, CTRL_GOP_MODE_VALUE, dev->options.gop_mode);
170 hdpvr_config_call(dev, CTRL_BRIGHTNESS, dev->options.brightness);
171 hdpvr_config_call(dev, CTRL_CONTRAST, dev->options.contrast);
172 hdpvr_config_call(dev, CTRL_HUE, dev->options.hue);
173 hdpvr_config_call(dev, CTRL_SATURATION, dev->options.saturation);
174 hdpvr_config_call(dev, CTRL_SHARPNESS, dev->options.sharpness);