| 1 | static int typhoon_ioctl(struct video_device *dev, unsigned int cmd, void *arg) |
| 2 | { |
| 3 | struct typhoon_device *typhoon = dev->priv; |
| 4 | |
| 5 | if (cmd == VIDIOCGTUNER) { |
| 6 | struct video_tuner v; |
| 7 | if (copy_from_user(v, arg, sizeof(v)) != 0) |
| 8 | return -EFAULT; |
| 9 | if (v.tuner) /* Only 1 tuner */ |
| 10 | return -EINVAL; |
| 11 | v.rangelow = 875 * 1600; |
| 12 | v.rangehigh = 1080 * 1600; |
| 13 | v.flags = VIDEO_TUNER_LOW; |
| 14 | v.mode = VIDEO_MODE_AUTO; |
| 15 | v.signal = 0xFFFF; /* We can't get the signal strength */ |
| 16 | strcpy(v.name, "FM"); |
| 17 | if (copy_to_user(arg, v, sizeof(v))) |
| 18 | return -EFAULT; |
| 19 | } |
| 20 | else if (cmd == VIDIOCSTUNER) { |
| 21 | struct video_tuner v; |
| 22 | if (copy_from_user(v, arg, sizeof(v))) |
| 23 | return -EFAULT; |
| 24 | if (v.tuner != 0) |
| 25 | return -EINVAL; |
| 26 | /* Only 1 tuner so no setting needed ! */ |
| 27 | } else return -ENOIOCTLCMD; /* |
| 28 | else if(cmd == VIDIOCSFREQ) { |
| 29 | if (copy_from_user(typhoon->curfreq, arg, sizeof(typhoon->curfreq))) |
| 30 | return -EFAULT; |
| 31 | typhoon_setfreq(typhoon, typhoon->curfreq); |
| 32 | return 0; |
| 33 | }*/ |
| 34 | return 0; |
| 35 | } |