V4L/DVB (5149): Convert radio-maxiradio to use video_ioctl2
[powerpc.git] / drivers / media / video / saa7134 / saa7134-video.c
index 557530a..f2cb630 100644 (file)
@@ -1820,15 +1820,18 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
                                        break;
                if (i == TVNORMS)
                        return -EINVAL;
-               if (*id & V4L2_STD_SECAM) {
-                       if (secam[0] == 'L' || secam[0] == 'l')
+               if ((*id & V4L2_STD_SECAM) && (secam[0] != '-')) {
+                       if (secam[0] == 'L' || secam[0] == 'l') {
                                if (secam[1] == 'C' || secam[1] == 'c')
                                        fixup = V4L2_STD_SECAM_LC;
                                else
                                        fixup = V4L2_STD_SECAM_L;
-                       else
+                       } else {
                                if (secam[0] == 'D' || secam[0] == 'd')
                                        fixup = V4L2_STD_SECAM_DK;
+                               else
+                                       fixup = V4L2_STD_SECAM;
+                       }
                        for (i = 0; i < TVNORMS; i++)
                                if (fixup == tvnorms[i].id)
                                        break;
@@ -2245,7 +2248,11 @@ static int radio_do_ioctl(struct inode *inode, struct file *file,
                t->type = V4L2_TUNER_RADIO;
 
                saa7134_i2c_call_clients(dev, VIDIOC_G_TUNER, t);
-
+               if (dev->input->amux == TV) {
+                       t->signal = 0xf800 - ((saa_readb(0x581) & 0x1f) << 11);
+                       t->rxsubchans = (saa_readb(0x529) & 0x08) ?
+                                       V4L2_TUNER_SUB_STEREO : V4L2_TUNER_SUB_MONO;
+               }
                return 0;
        }
        case VIDIOC_S_TUNER:
@@ -2329,7 +2336,7 @@ static int radio_ioctl(struct inode *inode, struct file *file,
        return video_usercopy(inode, file, cmd, arg, radio_do_ioctl);
 }
 
-static struct file_operations video_fops =
+static const struct file_operations video_fops =
 {
        .owner    = THIS_MODULE,
        .open     = video_open,
@@ -2342,7 +2349,7 @@ static struct file_operations video_fops =
        .llseek   = no_llseek,
 };
 
-static struct file_operations radio_fops =
+static const struct file_operations radio_fops =
 {
        .owner    = THIS_MODULE,
        .open     = video_open,