]> Pileus Git - ~andy/linux/blobdiff - drivers/media/radio/si470x/radio-si470x.h
[media] radio-si470x: Add support for the new band APIs
[~andy/linux] / drivers / media / radio / si470x / radio-si470x.h
index f300a55ed85ccee217f3a8ff37565e0fcc5a7d6f..2f089b4252dfe2f9f10956acb267392a38373caa 100644 (file)
@@ -36,6 +36,9 @@
 #include <linux/mutex.h>
 #include <media/v4l2-common.h>
 #include <media/v4l2-ioctl.h>
+#include <media/v4l2-ctrls.h>
+#include <media/v4l2-event.h>
+#include <media/v4l2-device.h>
 #include <asm/unaligned.h>
 
 
@@ -84,7 +87,7 @@
 
 #define SYSCONFIG2             5       /* System Configuration 2 */
 #define SYSCONFIG2_SEEKTH      0xff00  /* bits 15..08: RSSI Seek Threshold */
-#define SYSCONFIG2_BAND                0x0080  /* bits 07..06: Band Select */
+#define SYSCONFIG2_BAND                0x00c0  /* bits 07..06: Band Select */
 #define SYSCONFIG2_SPACE       0x0030  /* bits 05..04: Channel Spacing */
 #define SYSCONFIG2_VOLUME      0x000f  /* bits 03..00: Volume */
 
  * si470x_device - private data
  */
 struct si470x_device {
-       struct video_device *videodev;
-
-       /* driver management */
-       unsigned int users;
+       struct v4l2_device v4l2_dev;
+       struct video_device videodev;
+       struct v4l2_ctrl_handler hdl;
+       int band;
 
        /* Silabs internal registers (0..15) */
        unsigned short registers[RADIO_REGISTER_NUM];
@@ -158,7 +161,7 @@ struct si470x_device {
        unsigned int wr_index;
 
        struct completion completion;
-       bool stci_enabled;              /* Seek/Tune Complete Interrupt */
+       bool status_rssi_auto_update;   /* Does RSSI get updated automatic? */
 
 #if defined(CONFIG_USB_SI470X) || defined(CONFIG_USB_SI470X_MODULE)
        /* reference to USB and video device */
@@ -174,9 +177,6 @@ struct si470x_device {
        /* scratch page */
        unsigned char software_version;
        unsigned char hardware_version;
-
-       /* driver management */
-       unsigned char disconnected;
 #endif
 
 #if defined(CONFIG_I2C_SI470X) || defined(CONFIG_I2C_SI470X_MODULE)
@@ -190,7 +190,7 @@ struct si470x_device {
  * Firmware Versions
  **************************************************************************/
 
-#define RADIO_FW_VERSION       15
+#define RADIO_FW_VERSION       12
 
 
 
@@ -213,6 +213,7 @@ struct si470x_device {
  * Common Functions
  **************************************************************************/
 extern struct video_device si470x_viddev_template;
+extern const struct v4l2_ctrl_ops si470x_ctrl_ops;
 int si470x_get_register(struct si470x_device *radio, int regnr);
 int si470x_set_register(struct si470x_device *radio, int regnr);
 int si470x_disconnect_check(struct si470x_device *radio);