Add new V4L device type VFL_TYPE_SDR for Software Defined Radio. It is registered as /dev/swradio0 (/dev/sdr0 was already reserved).
Unified · Split
| @@ -758,6 +758,8 @@ static void determine_valid_ioctls(struct video_device *vdev) · 757 unmodified lines | ||
| 758 | 758 | * %VFL_TYPE_RADIO - A radio card |
| 759 | 759 | * |
| 760 | 760 | * %VFL_TYPE_SUBDEV - A subdevice |
| 761 | + * | |
| 762 | + * %VFL_TYPE_SDR - Software Defined Radio | |
| 761 | 763 | */ |
| 762 | 764 | int __video_register_device(struct video_device *vdev, int type, int nr, |
| 763 | 765 | int warn_if_nr_in_use, struct module *owner) |
| @@ -797,6 +799,10 @@ int __video_register_device(struct video_device *vdev, int type, int nr, · 33 unmodified lines | ||
| 797 | 799 | case VFL_TYPE_SUBDEV: |
| 798 | 800 | name_base = "v4l-subdev"; |
| 799 | 801 | break; |
| 802 | + case VFL_TYPE_SDR: | |
| 803 | + /* Use device name 'swradio' because 'sdr' was already taken. */ | |
| 804 | + name_base = "swradio"; | |
| 805 | + break; | |
| 800 | 806 | default: |
| 801 | 807 | printk(KERN_ERR "%s called with unknown type: %d\n", |
| 802 | 808 | __func__, type); |
| @@ -24,7 +24,8 @@ · 23 unmodified lines | ||
| 24 | 24 | #define VFL_TYPE_VBI 1 |
| 25 | 25 | #define VFL_TYPE_RADIO 2 |
| 26 | 26 | #define VFL_TYPE_SUBDEV 3 |
| 27 | −#define VFL_TYPE_MAX 4 | |
| 27 | +#define VFL_TYPE_SDR 4 | |
| 28 | +#define VFL_TYPE_MAX 5 | |
| 28 | 29 | |
| 29 | 30 | /* Is this a receiver, transmitter or mem-to-mem? */ |
| 30 | 31 | /* Ignored for VFL_TYPE_SUBDEV. */ |