Lines Matching refs:dev

27 int hdpvr_config_call(struct hdpvr_device *dev, uint value, u8 valbuf)  in hdpvr_config_call()  argument
32 mutex_lock(&dev->usbc_mutex); in hdpvr_config_call()
33 dev->usbc_buf[0] = valbuf; in hdpvr_config_call()
34 ret = usb_control_msg(dev->udev, in hdpvr_config_call()
35 usb_sndctrlpipe(dev->udev, 0), in hdpvr_config_call()
38 dev->usbc_buf, 1, 10000); in hdpvr_config_call()
40 mutex_unlock(&dev->usbc_mutex); in hdpvr_config_call()
41 v4l2_dbg(MSG_INFO, hdpvr_debug, &dev->v4l2_dev, in hdpvr_config_call()
48 int get_video_info(struct hdpvr_device *dev, struct hdpvr_video_info *vidinf) in get_video_info() argument
53 mutex_lock(&dev->usbc_mutex); in get_video_info()
54 ret = usb_control_msg(dev->udev, in get_video_info()
55 usb_rcvctrlpipe(dev->udev, 0), in get_video_info()
58 dev->usbc_buf, 5, in get_video_info()
63 v4l2_dbg(MSG_INFO, hdpvr_debug, &dev->v4l2_dev, in get_video_info()
65 dev->usbc_buf); in get_video_info()
67 mutex_unlock(&dev->usbc_mutex); in get_video_info()
72 vidinf->width = dev->usbc_buf[1] << 8 | dev->usbc_buf[0]; in get_video_info()
73 vidinf->height = dev->usbc_buf[3] << 8 | dev->usbc_buf[2]; in get_video_info()
74 vidinf->fps = dev->usbc_buf[4]; in get_video_info()
80 int get_input_lines_info(struct hdpvr_device *dev) in get_input_lines_info() argument
84 mutex_lock(&dev->usbc_mutex); in get_input_lines_info()
85 ret = usb_control_msg(dev->udev, in get_input_lines_info()
86 usb_rcvctrlpipe(dev->udev, 0), in get_input_lines_info()
89 dev->usbc_buf, 3, in get_input_lines_info()
94 v4l2_dbg(MSG_INFO, hdpvr_debug, &dev->v4l2_dev, in get_input_lines_info()
96 dev->usbc_buf); in get_input_lines_info()
100 lines = dev->usbc_buf[1] << 8 | dev->usbc_buf[0]; in get_input_lines_info()
101 mutex_unlock(&dev->usbc_mutex); in get_input_lines_info()
106 int hdpvr_set_bitrate(struct hdpvr_device *dev) in hdpvr_set_bitrate() argument
110 mutex_lock(&dev->usbc_mutex); in hdpvr_set_bitrate()
111 memset(dev->usbc_buf, 0, 4); in hdpvr_set_bitrate()
112 dev->usbc_buf[0] = dev->options.bitrate; in hdpvr_set_bitrate()
113 dev->usbc_buf[2] = dev->options.peak_bitrate; in hdpvr_set_bitrate()
115 ret = usb_control_msg(dev->udev, in hdpvr_set_bitrate()
116 usb_sndctrlpipe(dev->udev, 0), in hdpvr_set_bitrate()
118 CTRL_DEFAULT_INDEX, dev->usbc_buf, 4, 1000); in hdpvr_set_bitrate()
119 mutex_unlock(&dev->usbc_mutex); in hdpvr_set_bitrate()
124 int hdpvr_set_audio(struct hdpvr_device *dev, u8 input, in hdpvr_set_audio() argument
129 if (dev->flags & HDPVR_FLAG_AC3_CAP) { in hdpvr_set_audio()
130 mutex_lock(&dev->usbc_mutex); in hdpvr_set_audio()
131 memset(dev->usbc_buf, 0, 2); in hdpvr_set_audio()
132 dev->usbc_buf[0] = input; in hdpvr_set_audio()
134 dev->usbc_buf[1] = 0; in hdpvr_set_audio()
136 dev->usbc_buf[1] = 1; in hdpvr_set_audio()
138 mutex_unlock(&dev->usbc_mutex); in hdpvr_set_audio()
139 v4l2_err(&dev->v4l2_dev, "invalid audio codec %d\n", in hdpvr_set_audio()
145 ret = usb_control_msg(dev->udev, in hdpvr_set_audio()
146 usb_sndctrlpipe(dev->udev, 0), in hdpvr_set_audio()
148 CTRL_DEFAULT_INDEX, dev->usbc_buf, 2, in hdpvr_set_audio()
150 mutex_unlock(&dev->usbc_mutex); in hdpvr_set_audio()
154 ret = hdpvr_config_call(dev, CTRL_AUDIO_INPUT_VALUE, input); in hdpvr_set_audio()
159 int hdpvr_set_options(struct hdpvr_device *dev) in hdpvr_set_options() argument
161 hdpvr_config_call(dev, CTRL_VIDEO_STD_TYPE, dev->options.video_std); in hdpvr_set_options()
163 hdpvr_config_call(dev, CTRL_VIDEO_INPUT_VALUE, in hdpvr_set_options()
164 dev->options.video_input+1); in hdpvr_set_options()
166 hdpvr_set_audio(dev, dev->options.audio_input+1, in hdpvr_set_options()
167 dev->options.audio_codec); in hdpvr_set_options()
169 hdpvr_set_bitrate(dev); in hdpvr_set_options()
170 hdpvr_config_call(dev, CTRL_BITRATE_MODE_VALUE, in hdpvr_set_options()
171 dev->options.bitrate_mode); in hdpvr_set_options()
172 hdpvr_config_call(dev, CTRL_GOP_MODE_VALUE, dev->options.gop_mode); in hdpvr_set_options()
174 hdpvr_config_call(dev, CTRL_BRIGHTNESS, dev->options.brightness); in hdpvr_set_options()
175 hdpvr_config_call(dev, CTRL_CONTRAST, dev->options.contrast); in hdpvr_set_options()
176 hdpvr_config_call(dev, CTRL_HUE, dev->options.hue); in hdpvr_set_options()
177 hdpvr_config_call(dev, CTRL_SATURATION, dev->options.saturation); in hdpvr_set_options()
178 hdpvr_config_call(dev, CTRL_SHARPNESS, dev->options.sharpness); in hdpvr_set_options()