• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/media/radio/

Lines Matching refs:radio

2  * driver/media/radio/radio-tea5764.c
4 * Driver for TEA5764 radio chip for linux 2.6.
8 * Based in radio-tea5761.c Copyright (C) 2005 Nokia Corporation
38 #include <linux/videodev2.h> /* kernel radio structs */
48 #define DRIVER_DESC "A driver for the TEA5764 radio chip for EZX Phones."
149 int tea5764_i2c_read(struct tea5764_device *radio)
152 u16 *p = (u16 *) &radio->regs;
155 { radio->i2c_client->addr, I2C_M_RD, sizeof(radio->regs),
156 (void *)&radio->regs },
158 if (i2c_transfer(radio->i2c_client->adapter, msgs, 1) != 1)
166 int tea5764_i2c_write(struct tea5764_device *radio)
169 struct tea5764_regs *r = &radio->regs;
171 { radio->i2c_client->addr, 0, sizeof(wr), (void *) &wr },
179 if (i2c_transfer(radio->i2c_client->adapter, msgs, 1) != 1)
196 static void tea5764_power_up(struct tea5764_device *radio)
198 struct tea5764_regs *r = &radio->regs;
209 tea5764_i2c_write(radio);
213 static void tea5764_power_down(struct tea5764_device *radio)
215 struct tea5764_regs *r = &radio->regs;
219 tea5764_i2c_write(radio);
223 static void tea5764_set_freq(struct tea5764_device *radio, int freq)
225 struct tea5764_regs *r = &radio->regs;
234 static int tea5764_get_freq(struct tea5764_device *radio)
236 struct tea5764_regs *r = &radio->regs;
245 static void tea5764_tune(struct tea5764_device *radio, int freq)
247 tea5764_set_freq(radio, freq);
248 if (tea5764_i2c_write(radio))
252 static void tea5764_set_audout_mode(struct tea5764_device *radio, int audmode)
254 struct tea5764_regs *r = &radio->regs;
262 tea5764_i2c_write(radio);
265 static int tea5764_get_audout_mode(struct tea5764_device *radio)
267 struct tea5764_regs *r = &radio->regs;
275 static void tea5764_mute(struct tea5764_device *radio, int on)
277 struct tea5764_regs *r = &radio->regs;
285 tea5764_i2c_write(radio);
288 static int tea5764_is_muted(struct tea5764_device *radio)
290 return radio->regs.tnctrl & TEA5764_TNCTRL_MU;
297 struct tea5764_device *radio = video_drvdata(file);
298 struct video_device *dev = radio->videodev;
312 struct tea5764_device *radio = video_drvdata(file);
313 struct tea5764_regs *r = &radio->regs;
321 tea5764_i2c_read(radio);
329 v->audmode = tea5764_get_audout_mode(radio);
339 struct tea5764_device *radio = video_drvdata(file);
344 tea5764_set_audout_mode(radio, v->audmode);
351 struct tea5764_device *radio = video_drvdata(file);
357 tea5764_power_down(radio);
363 tea5764_power_up(radio);
364 tea5764_tune(radio, (f->frequency * 125) / 2);
371 struct tea5764_device *radio = video_drvdata(file);
372 struct tea5764_regs *r = &radio->regs;
376 tea5764_i2c_read(radio);
380 f->frequency = (tea5764_get_freq(radio) * 2) / 125;
404 struct tea5764_device *radio = video_drvdata(file);
408 tea5764_i2c_read(radio);
409 ctrl->value = tea5764_is_muted(radio) ? 1 : 0;
418 struct tea5764_device *radio = video_drvdata(file);
422 tea5764_mute(radio, ctrl->value);
464 struct tea5764_device *radio = video_drvdata(file);
466 mutex_lock(&radio->mutex);
468 if (radio->users) {
469 mutex_unlock(&radio->mutex);
472 radio->users++;
473 mutex_unlock(&radio->mutex);
474 file->private_data = radio;
480 struct tea5764_device *radio = video_drvdata(file);
482 if (!radio)
484 mutex_lock(&radio->mutex);
485 radio->users--;
486 mutex_unlock(&radio->mutex);
525 struct tea5764_device *radio;
530 radio = kmalloc(sizeof(struct tea5764_device), GFP_KERNEL);
531 if (!radio)
534 mutex_init(&radio->mutex);
535 radio->i2c_client = client;
536 ret = tea5764_i2c_read(radio);
539 r = &radio->regs;
548 radio->videodev = video_device_alloc();
549 if (!(radio->videodev)) {
553 memcpy(radio->videodev, &tea5764_radio_template,
556 i2c_set_clientdata(client, radio);
557 video_set_drvdata(radio->videodev, radio);
559 ret = video_register_device(radio->videodev, VFL_TYPE_RADIO, radio_nr);
566 tea5764_i2c_read(radio);
567 tea5764_set_audout_mode(radio, V4L2_TUNER_MODE_STEREO);
568 tea5764_mute(radio, 1);
569 tea5764_power_down(radio);
574 video_device_release(radio->videodev);
576 kfree(radio);
582 struct tea5764_device *radio = i2c_get_clientdata(client);
585 if (radio) {
586 tea5764_power_down(radio);
587 video_unregister_device(radio->videodev);
588 kfree(radio);
595 { "radio-tea5764", 0 },
602 .name = "radio-tea5764",