• Home
  • Raw
  • Download

Lines Matching refs:radio

140 static int tea5764_i2c_read(struct tea5764_device *radio)  in tea5764_i2c_read()  argument
143 u16 *p = (u16 *) &radio->regs; in tea5764_i2c_read()
146 { .addr = radio->i2c_client->addr, in tea5764_i2c_read()
148 .len = sizeof(radio->regs), in tea5764_i2c_read()
149 .buf = (void *)&radio->regs in tea5764_i2c_read()
152 if (i2c_transfer(radio->i2c_client->adapter, msgs, 1) != 1) in tea5764_i2c_read()
160 static int tea5764_i2c_write(struct tea5764_device *radio) in tea5764_i2c_write() argument
163 struct tea5764_regs *r = &radio->regs; in tea5764_i2c_write()
166 .addr = radio->i2c_client->addr, in tea5764_i2c_write()
177 if (i2c_transfer(radio->i2c_client->adapter, msgs, 1) != 1) in tea5764_i2c_write()
182 static void tea5764_power_up(struct tea5764_device *radio) in tea5764_power_up() argument
184 struct tea5764_regs *r = &radio->regs; in tea5764_power_up()
195 tea5764_i2c_write(radio); in tea5764_power_up()
199 static void tea5764_power_down(struct tea5764_device *radio) in tea5764_power_down() argument
201 struct tea5764_regs *r = &radio->regs; in tea5764_power_down()
205 tea5764_i2c_write(radio); in tea5764_power_down()
209 static void tea5764_set_freq(struct tea5764_device *radio, int freq) in tea5764_set_freq() argument
211 struct tea5764_regs *r = &radio->regs; in tea5764_set_freq()
220 static int tea5764_get_freq(struct tea5764_device *radio) in tea5764_get_freq() argument
222 struct tea5764_regs *r = &radio->regs; in tea5764_get_freq()
231 static void tea5764_tune(struct tea5764_device *radio, int freq) in tea5764_tune() argument
233 tea5764_set_freq(radio, freq); in tea5764_tune()
234 if (tea5764_i2c_write(radio)) in tea5764_tune()
238 static void tea5764_set_audout_mode(struct tea5764_device *radio, int audmode) in tea5764_set_audout_mode() argument
240 struct tea5764_regs *r = &radio->regs; in tea5764_set_audout_mode()
248 tea5764_i2c_write(radio); in tea5764_set_audout_mode()
251 static int tea5764_get_audout_mode(struct tea5764_device *radio) in tea5764_get_audout_mode() argument
253 struct tea5764_regs *r = &radio->regs; in tea5764_get_audout_mode()
261 static void tea5764_mute(struct tea5764_device *radio, int on) in tea5764_mute() argument
263 struct tea5764_regs *r = &radio->regs; in tea5764_mute()
271 tea5764_i2c_write(radio); in tea5764_mute()
278 struct tea5764_device *radio = video_drvdata(file); in vidioc_querycap() local
279 struct video_device *dev = &radio->vdev; in vidioc_querycap()
291 struct tea5764_device *radio = video_drvdata(file); in vidioc_g_tuner() local
292 struct tea5764_regs *r = &radio->regs; in vidioc_g_tuner()
299 tea5764_i2c_read(radio); in vidioc_g_tuner()
307 v->audmode = tea5764_get_audout_mode(radio); in vidioc_g_tuner()
317 struct tea5764_device *radio = video_drvdata(file); in vidioc_s_tuner() local
322 tea5764_set_audout_mode(radio, v->audmode); in vidioc_s_tuner()
329 struct tea5764_device *radio = video_drvdata(file); in vidioc_s_frequency() local
336 tea5764_power_down(radio); in vidioc_s_frequency()
345 tea5764_power_up(radio); in vidioc_s_frequency()
346 tea5764_tune(radio, (freq * 125) / 2); in vidioc_s_frequency()
353 struct tea5764_device *radio = video_drvdata(file); in vidioc_g_frequency() local
354 struct tea5764_regs *r = &radio->regs; in vidioc_g_frequency()
358 tea5764_i2c_read(radio); in vidioc_g_frequency()
361 f->frequency = (tea5764_get_freq(radio) * 2) / 125; in vidioc_g_frequency()
370 struct tea5764_device *radio = in tea5764_s_ctrl() local
375 tea5764_mute(radio, ctrl->val); in tea5764_s_ctrl()
417 struct tea5764_device *radio; in tea5764_i2c_probe() local
424 radio = kzalloc(sizeof(struct tea5764_device), GFP_KERNEL); in tea5764_i2c_probe()
425 if (!radio) in tea5764_i2c_probe()
428 v4l2_dev = &radio->v4l2_dev; in tea5764_i2c_probe()
435 hdl = &radio->ctrl_handler; in tea5764_i2c_probe()
446 mutex_init(&radio->mutex); in tea5764_i2c_probe()
447 radio->i2c_client = client; in tea5764_i2c_probe()
448 ret = tea5764_i2c_read(radio); in tea5764_i2c_probe()
451 r = &radio->regs; in tea5764_i2c_probe()
460 radio->vdev = tea5764_radio_template; in tea5764_i2c_probe()
462 i2c_set_clientdata(client, radio); in tea5764_i2c_probe()
463 video_set_drvdata(&radio->vdev, radio); in tea5764_i2c_probe()
464 radio->vdev.lock = &radio->mutex; in tea5764_i2c_probe()
465 radio->vdev.v4l2_dev = v4l2_dev; in tea5764_i2c_probe()
466 radio->vdev.device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO; in tea5764_i2c_probe()
469 tea5764_i2c_read(radio); in tea5764_i2c_probe()
470 tea5764_set_audout_mode(radio, V4L2_TUNER_MODE_STEREO); in tea5764_i2c_probe()
471 tea5764_mute(radio, 1); in tea5764_i2c_probe()
472 tea5764_power_down(radio); in tea5764_i2c_probe()
474 ret = video_register_device(&radio->vdev, VFL_TYPE_RADIO, radio_nr); in tea5764_i2c_probe()
486 kfree(radio); in tea5764_i2c_probe()
492 struct tea5764_device *radio = i2c_get_clientdata(client); in tea5764_i2c_remove() local
495 if (radio) { in tea5764_i2c_remove()
496 tea5764_power_down(radio); in tea5764_i2c_remove()
497 video_unregister_device(&radio->vdev); in tea5764_i2c_remove()
498 v4l2_ctrl_handler_free(&radio->ctrl_handler); in tea5764_i2c_remove()
499 v4l2_device_unregister(&radio->v4l2_dev); in tea5764_i2c_remove()
500 kfree(radio); in tea5764_i2c_remove()