2 * drivers/media/radio/si470x/radio-si470x-common.c
4 * Driver for radios with Silicon Labs Si470x FM Radio Receivers
6 * Copyright (c) 2009 Tobias Lorenz <tobias.lorenz@gmx.net>
7 * Copyright (c) 2012 Hans de Goede <hdegoede@redhat.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
23 * 2008-01-12 Tobias Lorenz <tobias.lorenz@gmx.net>
25 * - First working version
26 * 2008-01-13 Tobias Lorenz <tobias.lorenz@gmx.net>
28 * - Improved error handling, every function now returns errno
29 * - Improved multi user access (start/mute/stop)
30 * - Channel doesn't get lost anymore after start/mute/stop
31 * - RDS support added (polling mode via interrupt EP 1)
32 * - marked default module parameters with *value*
33 * - switched from bit structs to bit masks
34 * - header file cleaned and integrated
35 * 2008-01-14 Tobias Lorenz <tobias.lorenz@gmx.net>
37 * - hex values are now lower case
38 * - commented USB ID for ADS/Tech moved on todo list
39 * - blacklisted si470x in hid-quirks.c
40 * - rds buffer handling functions integrated into *_work, *_read
41 * - rds_command in si470x_poll exchanged against simple retval
42 * - check for firmware version 15
43 * - code order and prototypes still remain the same
44 * - spacing and bottom of band codes remain the same
45 * 2008-01-16 Tobias Lorenz <tobias.lorenz@gmx.net>
47 * - code reordered to avoid function prototypes
48 * - switch/case defaults are now more user-friendly
49 * - unified comment style
50 * - applied all checkpatch.pl v1.12 suggestions
51 * except the warning about the too long lines with bit comments
52 * - renamed FMRADIO to RADIO to cut line length (checkpatch.pl)
53 * 2008-01-22 Tobias Lorenz <tobias.lorenz@gmx.net>
55 * - avoid poss. locking when doing copy_to_user which may sleep
56 * - RDS is automatically activated on read now
57 * - code cleaned of unnecessary rds_commands
58 * - USB Vendor/Product ID for ADS/Tech FM Radio Receiver verified
59 * (thanks to Guillaume RAMOUSSE)
60 * 2008-01-27 Tobias Lorenz <tobias.lorenz@gmx.net>
62 * - number of seek_retries changed to tune_timeout
63 * - fixed problem with incomplete tune operations by own buffers
64 * - optimization of variables and printf types
65 * - improved error logging
66 * 2008-01-31 Tobias Lorenz <tobias.lorenz@gmx.net>
67 * Oliver Neukum <oliver@neukum.org>
69 * - fixed coverity checker warnings in *_usb_driver_disconnect
70 * - probe()/open() race by correct ordering in probe()
71 * - DMA coherency rules by separate allocation of all buffers
72 * - use of endianness macros
73 * - abuse of spinlock, replaced by mutex
74 * - racy handling of timer in disconnect,
75 * replaced by delayed_work
76 * - racy interruptible_sleep_on(),
77 * replaced with wait_event_interruptible()
78 * - handle signals in read()
79 * 2008-02-08 Tobias Lorenz <tobias.lorenz@gmx.net>
80 * Oliver Neukum <oliver@neukum.org>
82 * - usb autosuspend support
84 * 2008-05-07 Tobias Lorenz <tobias.lorenz@gmx.net>
86 * - hardware frequency seek support
88 * - more safety checks, let si470x_get_freq return errno
89 * - vidioc behavior corrected according to v4l2 spec
90 * 2008-10-20 Alexey Klimov <klimov.linux@gmail.com>
91 * - add support for KWorld USB FM Radio FM700
92 * - blacklisted KWorld radio in hid-core.c and hid-ids.h
93 * 2008-12-03 Mark Lord <mlord@pobox.com>
94 * - add support for DealExtreme USB Radio
95 * 2009-01-31 Bob Ross <pigiron@gmx.com>
96 * - correction of stereo detection/setting
97 * - correction of signal strength indicator scaling
98 * 2009-01-31 Rick Bronson <rick@efn.org>
99 * Tobias Lorenz <tobias.lorenz@gmx.net>
100 * - add LED status output
101 * - get HW/SW version from scratchpad
102 * 2009-06-16 Edouard Lafargue <edouard@lafargue.name>
104 * - add support for interrupt mode for RDS endpoint,
105 * instead of polling.
106 * Improves RDS reception significantly
110 /* kernel includes */
111 #include "radio-si470x.h"
115 /**************************************************************************
117 **************************************************************************/
120 /* 0: 200 kHz (USA, Australia) */
121 /* 1: 100 kHz (Europe, Japan) */
123 static unsigned short space
= 2;
124 module_param(space
, ushort
, 0444);
125 MODULE_PARM_DESC(space
, "Spacing: 0=200kHz 1=100kHz *2=50kHz*");
129 /* 1: 50 us (Europe, Australia, Japan) */
130 static unsigned short de
= 1;
131 module_param(de
, ushort
, 0444);
132 MODULE_PARM_DESC(de
, "De-emphasis: 0=75us *1=50us*");
135 static unsigned int tune_timeout
= 3000;
136 module_param(tune_timeout
, uint
, 0644);
137 MODULE_PARM_DESC(tune_timeout
, "Tune timeout: *3000*");
140 static unsigned int seek_timeout
= 5000;
141 module_param(seek_timeout
, uint
, 0644);
142 MODULE_PARM_DESC(seek_timeout
, "Seek timeout: *5000*");
144 static const struct v4l2_frequency_band bands
[] = {
146 .type
= V4L2_TUNER_RADIO
,
148 .capability
= V4L2_TUNER_CAP_LOW
| V4L2_TUNER_CAP_STEREO
|
149 V4L2_TUNER_CAP_RDS
| V4L2_TUNER_CAP_RDS_BLOCK_IO
|
150 V4L2_TUNER_CAP_FREQ_BANDS
|
151 V4L2_TUNER_CAP_HWSEEK_BOUNDED
|
152 V4L2_TUNER_CAP_HWSEEK_WRAP
,
153 .rangelow
= 87500 * 16,
154 .rangehigh
= 108000 * 16,
155 .modulation
= V4L2_BAND_MODULATION_FM
,
158 .type
= V4L2_TUNER_RADIO
,
160 .capability
= V4L2_TUNER_CAP_LOW
| V4L2_TUNER_CAP_STEREO
|
161 V4L2_TUNER_CAP_RDS
| V4L2_TUNER_CAP_RDS_BLOCK_IO
|
162 V4L2_TUNER_CAP_FREQ_BANDS
|
163 V4L2_TUNER_CAP_HWSEEK_BOUNDED
|
164 V4L2_TUNER_CAP_HWSEEK_WRAP
,
165 .rangelow
= 76000 * 16,
166 .rangehigh
= 108000 * 16,
167 .modulation
= V4L2_BAND_MODULATION_FM
,
170 .type
= V4L2_TUNER_RADIO
,
172 .capability
= V4L2_TUNER_CAP_LOW
| V4L2_TUNER_CAP_STEREO
|
173 V4L2_TUNER_CAP_RDS
| V4L2_TUNER_CAP_RDS_BLOCK_IO
|
174 V4L2_TUNER_CAP_FREQ_BANDS
|
175 V4L2_TUNER_CAP_HWSEEK_BOUNDED
|
176 V4L2_TUNER_CAP_HWSEEK_WRAP
,
177 .rangelow
= 76000 * 16,
178 .rangehigh
= 90000 * 16,
179 .modulation
= V4L2_BAND_MODULATION_FM
,
183 /**************************************************************************
185 **************************************************************************/
188 * si470x_set_band - set the band
190 static int si470x_set_band(struct si470x_device
*radio
, int band
)
192 if (radio
->band
== band
)
196 radio
->registers
[SYSCONFIG2
] &= ~SYSCONFIG2_BAND
;
197 radio
->registers
[SYSCONFIG2
] |= radio
->band
<< 6;
198 return si470x_set_register(radio
, SYSCONFIG2
);
202 * si470x_set_chan - set the channel
204 static int si470x_set_chan(struct si470x_device
*radio
, unsigned short chan
)
207 unsigned long time_left
;
208 bool timed_out
= false;
211 radio
->registers
[CHANNEL
] &= ~CHANNEL_CHAN
;
212 radio
->registers
[CHANNEL
] |= CHANNEL_TUNE
| chan
;
213 retval
= si470x_set_register(radio
, CHANNEL
);
217 /* wait till tune operation has completed */
218 reinit_completion(&radio
->completion
);
219 time_left
= wait_for_completion_timeout(&radio
->completion
,
220 msecs_to_jiffies(tune_timeout
));
224 if ((radio
->registers
[STATUSRSSI
] & STATUSRSSI_STC
) == 0)
225 dev_warn(&radio
->videodev
.dev
, "tune does not complete\n");
227 dev_warn(&radio
->videodev
.dev
,
228 "tune timed out after %u ms\n", tune_timeout
);
231 radio
->registers
[CHANNEL
] &= ~CHANNEL_TUNE
;
232 retval
= si470x_set_register(radio
, CHANNEL
);
239 * si470x_get_step - get channel spacing
241 static unsigned int si470x_get_step(struct si470x_device
*radio
)
244 switch ((radio
->registers
[SYSCONFIG2
] & SYSCONFIG2_SPACE
) >> 4) {
245 /* 0: 200 kHz (USA, Australia) */
248 /* 1: 100 kHz (Europe, Japan) */
259 * si470x_get_freq - get the frequency
261 static int si470x_get_freq(struct si470x_device
*radio
, unsigned int *freq
)
266 retval
= si470x_get_register(radio
, READCHAN
);
267 chan
= radio
->registers
[READCHAN
] & READCHAN_READCHAN
;
269 /* Frequency (MHz) = Spacing (kHz) x Channel + Bottom of Band (MHz) */
270 *freq
= chan
* si470x_get_step(radio
) + bands
[radio
->band
].rangelow
;
277 * si470x_set_freq - set the frequency
279 int si470x_set_freq(struct si470x_device
*radio
, unsigned int freq
)
283 freq
= clamp(freq
, bands
[radio
->band
].rangelow
,
284 bands
[radio
->band
].rangehigh
);
285 /* Chan = [ Freq (Mhz) - Bottom of Band (MHz) ] / Spacing (kHz) */
286 chan
= (freq
- bands
[radio
->band
].rangelow
) / si470x_get_step(radio
);
288 return si470x_set_chan(radio
, chan
);
293 * si470x_set_seek - set seek
295 static int si470x_set_seek(struct si470x_device
*radio
,
296 const struct v4l2_hw_freq_seek
*seek
)
300 bool timed_out
= false;
301 unsigned long time_left
;
304 if (seek
->rangelow
|| seek
->rangehigh
) {
305 for (band
= 0; band
< ARRAY_SIZE(bands
); band
++) {
306 if (bands
[band
].rangelow
== seek
->rangelow
&&
307 bands
[band
].rangehigh
== seek
->rangehigh
)
310 if (band
== ARRAY_SIZE(bands
))
311 return -EINVAL
; /* No matching band found */
313 band
= 1; /* If nothing is specified seek 76 - 108 Mhz */
315 if (radio
->band
!= band
) {
316 retval
= si470x_get_freq(radio
, &freq
);
319 retval
= si470x_set_band(radio
, band
);
322 retval
= si470x_set_freq(radio
, freq
);
328 radio
->registers
[POWERCFG
] |= POWERCFG_SEEK
;
329 if (seek
->wrap_around
)
330 radio
->registers
[POWERCFG
] &= ~POWERCFG_SKMODE
;
332 radio
->registers
[POWERCFG
] |= POWERCFG_SKMODE
;
333 if (seek
->seek_upward
)
334 radio
->registers
[POWERCFG
] |= POWERCFG_SEEKUP
;
336 radio
->registers
[POWERCFG
] &= ~POWERCFG_SEEKUP
;
337 retval
= si470x_set_register(radio
, POWERCFG
);
341 /* wait till tune operation has completed */
342 reinit_completion(&radio
->completion
);
343 time_left
= wait_for_completion_timeout(&radio
->completion
,
344 msecs_to_jiffies(seek_timeout
));
348 if ((radio
->registers
[STATUSRSSI
] & STATUSRSSI_STC
) == 0)
349 dev_warn(&radio
->videodev
.dev
, "seek does not complete\n");
350 if (radio
->registers
[STATUSRSSI
] & STATUSRSSI_SF
)
351 dev_warn(&radio
->videodev
.dev
,
352 "seek failed / band limit reached\n");
355 radio
->registers
[POWERCFG
] &= ~POWERCFG_SEEK
;
356 retval
= si470x_set_register(radio
, POWERCFG
);
358 /* try again, if timed out */
359 if (retval
== 0 && timed_out
)
366 * si470x_start - switch on radio
368 int si470x_start(struct si470x_device
*radio
)
373 radio
->registers
[POWERCFG
] =
374 POWERCFG_DMUTE
| POWERCFG_ENABLE
| POWERCFG_RDSM
;
375 retval
= si470x_set_register(radio
, POWERCFG
);
380 radio
->registers
[SYSCONFIG1
] =
381 (de
<< 11) & SYSCONFIG1_DE
; /* DE*/
382 retval
= si470x_set_register(radio
, SYSCONFIG1
);
387 radio
->registers
[SYSCONFIG2
] =
388 (0x1f << 8) | /* SEEKTH */
389 ((radio
->band
<< 6) & SYSCONFIG2_BAND
) |/* BAND */
390 ((space
<< 4) & SYSCONFIG2_SPACE
) | /* SPACE */
391 15; /* VOLUME (max) */
392 retval
= si470x_set_register(radio
, SYSCONFIG2
);
396 /* reset last channel */
397 retval
= si470x_set_chan(radio
,
398 radio
->registers
[CHANNEL
] & CHANNEL_CHAN
);
406 * si470x_stop - switch off radio
408 int si470x_stop(struct si470x_device
*radio
)
413 radio
->registers
[SYSCONFIG1
] &= ~SYSCONFIG1_RDS
;
414 retval
= si470x_set_register(radio
, SYSCONFIG1
);
419 radio
->registers
[POWERCFG
] &= ~POWERCFG_DMUTE
;
420 /* POWERCFG_ENABLE has to automatically go low */
421 radio
->registers
[POWERCFG
] |= POWERCFG_ENABLE
| POWERCFG_DISABLE
;
422 retval
= si470x_set_register(radio
, POWERCFG
);
430 * si470x_rds_on - switch on rds reception
432 static int si470x_rds_on(struct si470x_device
*radio
)
437 radio
->registers
[SYSCONFIG1
] |= SYSCONFIG1_RDS
;
438 retval
= si470x_set_register(radio
, SYSCONFIG1
);
440 radio
->registers
[SYSCONFIG1
] &= ~SYSCONFIG1_RDS
;
447 /**************************************************************************
448 * File Operations Interface
449 **************************************************************************/
452 * si470x_fops_read - read RDS data
454 static ssize_t
si470x_fops_read(struct file
*file
, char __user
*buf
,
455 size_t count
, loff_t
*ppos
)
457 struct si470x_device
*radio
= video_drvdata(file
);
459 unsigned int block_count
= 0;
461 /* switch on rds reception */
462 if ((radio
->registers
[SYSCONFIG1
] & SYSCONFIG1_RDS
) == 0)
463 si470x_rds_on(radio
);
465 /* block if no new data available */
466 while (radio
->wr_index
== radio
->rd_index
) {
467 if (file
->f_flags
& O_NONBLOCK
) {
468 retval
= -EWOULDBLOCK
;
471 if (wait_event_interruptible(radio
->read_queue
,
472 radio
->wr_index
!= radio
->rd_index
) < 0) {
478 /* calculate block count from byte count */
481 /* copy RDS block out of internal buffer and to user buffer */
482 while (block_count
< count
) {
483 if (radio
->rd_index
== radio
->wr_index
)
486 /* always transfer rds complete blocks */
487 if (copy_to_user(buf
, &radio
->buffer
[radio
->rd_index
], 3))
488 /* retval = -EFAULT; */
491 /* increment and wrap read pointer */
492 radio
->rd_index
+= 3;
493 if (radio
->rd_index
>= radio
->buf_size
)
496 /* increment counters */
508 * si470x_fops_poll - poll RDS data
510 static __poll_t
si470x_fops_poll(struct file
*file
,
511 struct poll_table_struct
*pts
)
513 struct si470x_device
*radio
= video_drvdata(file
);
514 __poll_t req_events
= poll_requested_events(pts
);
515 __poll_t retval
= v4l2_ctrl_poll(file
, pts
);
517 if (req_events
& (EPOLLIN
| EPOLLRDNORM
)) {
518 /* switch on rds reception */
519 if ((radio
->registers
[SYSCONFIG1
] & SYSCONFIG1_RDS
) == 0)
520 si470x_rds_on(radio
);
522 poll_wait(file
, &radio
->read_queue
, pts
);
524 if (radio
->rd_index
!= radio
->wr_index
)
525 retval
|= EPOLLIN
| EPOLLRDNORM
;
533 * si470x_fops - file operations interface
535 static const struct v4l2_file_operations si470x_fops
= {
536 .owner
= THIS_MODULE
,
537 .read
= si470x_fops_read
,
538 .poll
= si470x_fops_poll
,
539 .unlocked_ioctl
= video_ioctl2
,
540 .open
= si470x_fops_open
,
541 .release
= si470x_fops_release
,
546 /**************************************************************************
547 * Video4Linux Interface
548 **************************************************************************/
551 static int si470x_s_ctrl(struct v4l2_ctrl
*ctrl
)
553 struct si470x_device
*radio
=
554 container_of(ctrl
->handler
, struct si470x_device
, hdl
);
557 case V4L2_CID_AUDIO_VOLUME
:
558 radio
->registers
[SYSCONFIG2
] &= ~SYSCONFIG2_VOLUME
;
559 radio
->registers
[SYSCONFIG2
] |= ctrl
->val
;
560 return si470x_set_register(radio
, SYSCONFIG2
);
561 case V4L2_CID_AUDIO_MUTE
:
563 radio
->registers
[POWERCFG
] &= ~POWERCFG_DMUTE
;
565 radio
->registers
[POWERCFG
] |= POWERCFG_DMUTE
;
566 return si470x_set_register(radio
, POWERCFG
);
574 * si470x_vidioc_g_tuner - get tuner attributes
576 static int si470x_vidioc_g_tuner(struct file
*file
, void *priv
,
577 struct v4l2_tuner
*tuner
)
579 struct si470x_device
*radio
= video_drvdata(file
);
582 if (tuner
->index
!= 0)
585 if (!radio
->status_rssi_auto_update
) {
586 retval
= si470x_get_register(radio
, STATUSRSSI
);
591 /* driver constants */
592 strcpy(tuner
->name
, "FM");
593 tuner
->type
= V4L2_TUNER_RADIO
;
594 tuner
->capability
= V4L2_TUNER_CAP_LOW
| V4L2_TUNER_CAP_STEREO
|
595 V4L2_TUNER_CAP_RDS
| V4L2_TUNER_CAP_RDS_BLOCK_IO
|
596 V4L2_TUNER_CAP_HWSEEK_BOUNDED
|
597 V4L2_TUNER_CAP_HWSEEK_WRAP
;
598 tuner
->rangelow
= 76 * FREQ_MUL
;
599 tuner
->rangehigh
= 108 * FREQ_MUL
;
601 /* stereo indicator == stereo (instead of mono) */
602 if ((radio
->registers
[STATUSRSSI
] & STATUSRSSI_ST
) == 0)
603 tuner
->rxsubchans
= V4L2_TUNER_SUB_MONO
;
605 tuner
->rxsubchans
= V4L2_TUNER_SUB_STEREO
;
606 /* If there is a reliable method of detecting an RDS channel,
607 then this code should check for that before setting this
609 tuner
->rxsubchans
|= V4L2_TUNER_SUB_RDS
;
611 /* mono/stereo selector */
612 if ((radio
->registers
[POWERCFG
] & POWERCFG_MONO
) == 0)
613 tuner
->audmode
= V4L2_TUNER_MODE_STEREO
;
615 tuner
->audmode
= V4L2_TUNER_MODE_MONO
;
617 /* min is worst, max is best; signal:0..0xffff; rssi: 0..0xff */
618 /* measured in units of dbµV in 1 db increments (max at ~75 dbµV) */
619 tuner
->signal
= (radio
->registers
[STATUSRSSI
] & STATUSRSSI_RSSI
);
620 /* the ideal factor is 0xffff/75 = 873,8 */
621 tuner
->signal
= (tuner
->signal
* 873) + (8 * tuner
->signal
/ 10);
622 if (tuner
->signal
> 0xffff)
623 tuner
->signal
= 0xffff;
625 /* automatic frequency control: -1: freq to low, 1 freq to high */
626 /* AFCRL does only indicate that freq. differs, not if too low/high */
627 tuner
->afc
= (radio
->registers
[STATUSRSSI
] & STATUSRSSI_AFCRL
) ? 1 : 0;
634 * si470x_vidioc_s_tuner - set tuner attributes
636 static int si470x_vidioc_s_tuner(struct file
*file
, void *priv
,
637 const struct v4l2_tuner
*tuner
)
639 struct si470x_device
*radio
= video_drvdata(file
);
641 if (tuner
->index
!= 0)
644 /* mono/stereo selector */
645 switch (tuner
->audmode
) {
646 case V4L2_TUNER_MODE_MONO
:
647 radio
->registers
[POWERCFG
] |= POWERCFG_MONO
; /* force mono */
649 case V4L2_TUNER_MODE_STEREO
:
651 radio
->registers
[POWERCFG
] &= ~POWERCFG_MONO
; /* try stereo */
655 return si470x_set_register(radio
, POWERCFG
);
660 * si470x_vidioc_g_frequency - get tuner or modulator radio frequency
662 static int si470x_vidioc_g_frequency(struct file
*file
, void *priv
,
663 struct v4l2_frequency
*freq
)
665 struct si470x_device
*radio
= video_drvdata(file
);
667 if (freq
->tuner
!= 0)
670 freq
->type
= V4L2_TUNER_RADIO
;
671 return si470x_get_freq(radio
, &freq
->frequency
);
676 * si470x_vidioc_s_frequency - set tuner or modulator radio frequency
678 static int si470x_vidioc_s_frequency(struct file
*file
, void *priv
,
679 const struct v4l2_frequency
*freq
)
681 struct si470x_device
*radio
= video_drvdata(file
);
684 if (freq
->tuner
!= 0)
687 if (freq
->frequency
< bands
[radio
->band
].rangelow
||
688 freq
->frequency
> bands
[radio
->band
].rangehigh
) {
689 /* Switch to band 1 which covers everything we support */
690 retval
= si470x_set_band(radio
, 1);
694 return si470x_set_freq(radio
, freq
->frequency
);
699 * si470x_vidioc_s_hw_freq_seek - set hardware frequency seek
701 static int si470x_vidioc_s_hw_freq_seek(struct file
*file
, void *priv
,
702 const struct v4l2_hw_freq_seek
*seek
)
704 struct si470x_device
*radio
= video_drvdata(file
);
706 if (seek
->tuner
!= 0)
709 if (file
->f_flags
& O_NONBLOCK
)
712 return si470x_set_seek(radio
, seek
);
716 * si470x_vidioc_enum_freq_bands - enumerate supported bands
718 static int si470x_vidioc_enum_freq_bands(struct file
*file
, void *priv
,
719 struct v4l2_frequency_band
*band
)
721 if (band
->tuner
!= 0)
723 if (band
->index
>= ARRAY_SIZE(bands
))
725 *band
= bands
[band
->index
];
729 const struct v4l2_ctrl_ops si470x_ctrl_ops
= {
730 .s_ctrl
= si470x_s_ctrl
,
734 * si470x_ioctl_ops - video device ioctl operations
736 static const struct v4l2_ioctl_ops si470x_ioctl_ops
= {
737 .vidioc_querycap
= si470x_vidioc_querycap
,
738 .vidioc_g_tuner
= si470x_vidioc_g_tuner
,
739 .vidioc_s_tuner
= si470x_vidioc_s_tuner
,
740 .vidioc_g_frequency
= si470x_vidioc_g_frequency
,
741 .vidioc_s_frequency
= si470x_vidioc_s_frequency
,
742 .vidioc_s_hw_freq_seek
= si470x_vidioc_s_hw_freq_seek
,
743 .vidioc_enum_freq_bands
= si470x_vidioc_enum_freq_bands
,
744 .vidioc_subscribe_event
= v4l2_ctrl_subscribe_event
,
745 .vidioc_unsubscribe_event
= v4l2_event_unsubscribe
,
750 * si470x_viddev_template - video device interface
752 const struct video_device si470x_viddev_template
= {
753 .fops
= &si470x_fops
,
755 .release
= video_device_release_empty
,
756 .ioctl_ops
= &si470x_ioctl_ops
,