| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Support for a cx23416 mpeg encoder via cx2388x host port. |
|---|
| 3 | 4 | * "blackbird" reference design. |
|---|
| .. | .. |
|---|
| 9 | 10 | * - video_ioctl2 conversion |
|---|
| 10 | 11 | * |
|---|
| 11 | 12 | * Includes parts from the ivtv driver <http://sourceforge.net/projects/ivtv/> |
|---|
| 12 | | - * |
|---|
| 13 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 14 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 15 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 16 | | - * (at your option) any later version. |
|---|
| 17 | | - * |
|---|
| 18 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 19 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 20 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 21 | | - * GNU General Public License for more details. |
|---|
| 22 | 13 | */ |
|---|
| 23 | 14 | |
|---|
| 24 | 15 | #include "cx88.h" |
|---|
| .. | .. |
|---|
| 37 | 28 | |
|---|
| 38 | 29 | MODULE_DESCRIPTION("driver for cx2388x/cx23416 based mpeg encoder cards"); |
|---|
| 39 | 30 | MODULE_AUTHOR("Jelle Foks <jelle@foks.us>, Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); |
|---|
| 40 | | -MODULE_LICENSE("GPL"); |
|---|
| 31 | +MODULE_LICENSE("GPL v2"); |
|---|
| 41 | 32 | MODULE_VERSION(CX88_VERSION); |
|---|
| 42 | 33 | |
|---|
| 43 | 34 | static unsigned int debug; |
|---|
| .. | .. |
|---|
| 803 | 794 | struct cx8802_dev *dev = video_drvdata(file); |
|---|
| 804 | 795 | struct cx88_core *core = dev->core; |
|---|
| 805 | 796 | |
|---|
| 806 | | - strcpy(cap->driver, "cx88_blackbird"); |
|---|
| 797 | + strscpy(cap->driver, "cx88_blackbird", sizeof(cap->driver)); |
|---|
| 807 | 798 | sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci)); |
|---|
| 808 | 799 | return cx88_querycap(file, core, cap); |
|---|
| 809 | 800 | } |
|---|
| .. | .. |
|---|
| 814 | 805 | if (f->index != 0) |
|---|
| 815 | 806 | return -EINVAL; |
|---|
| 816 | 807 | |
|---|
| 817 | | - strlcpy(f->description, "MPEG", sizeof(f->description)); |
|---|
| 818 | 808 | f->pixelformat = V4L2_PIX_FMT_MPEG; |
|---|
| 819 | | - f->flags = V4L2_FMT_FLAG_COMPRESSED; |
|---|
| 820 | 809 | return 0; |
|---|
| 821 | 810 | } |
|---|
| 822 | 811 | |
|---|
| .. | .. |
|---|
| 995 | 984 | if (t->index != 0) |
|---|
| 996 | 985 | return -EINVAL; |
|---|
| 997 | 986 | |
|---|
| 998 | | - strcpy(t->name, "Television"); |
|---|
| 987 | + strscpy(t->name, "Television", sizeof(t->name)); |
|---|
| 999 | 988 | t->capability = V4L2_TUNER_CAP_NORM; |
|---|
| 1000 | 989 | t->rangehigh = 0xffffffffUL; |
|---|
| 1001 | 990 | call_all(core, tuner, g_tuner, t); |
|---|
| .. | .. |
|---|
| 1145 | 1134 | dev->mpeg_dev.ctrl_handler = &dev->cxhdl.hdl; |
|---|
| 1146 | 1135 | video_set_drvdata(&dev->mpeg_dev, dev); |
|---|
| 1147 | 1136 | dev->mpeg_dev.queue = &dev->vb2_mpegq; |
|---|
| 1148 | | - err = video_register_device(&dev->mpeg_dev, VFL_TYPE_GRABBER, -1); |
|---|
| 1137 | + dev->mpeg_dev.device_caps = V4L2_CAP_READWRITE | V4L2_CAP_STREAMING | |
|---|
| 1138 | + V4L2_CAP_VIDEO_CAPTURE; |
|---|
| 1139 | + if (dev->core->board.tuner_type != UNSET) |
|---|
| 1140 | + dev->mpeg_dev.device_caps |= V4L2_CAP_TUNER; |
|---|
| 1141 | + err = video_register_device(&dev->mpeg_dev, VFL_TYPE_VIDEO, -1); |
|---|
| 1149 | 1142 | if (err < 0) { |
|---|
| 1150 | 1143 | pr_info("can't register mpeg device\n"); |
|---|
| 1151 | 1144 | return err; |
|---|
| .. | .. |
|---|
| 1183 | 1176 | err = cx2341x_handler_init(&dev->cxhdl, 36); |
|---|
| 1184 | 1177 | if (err) |
|---|
| 1185 | 1178 | goto fail_core; |
|---|
| 1186 | | - v4l2_ctrl_add_handler(&dev->cxhdl.hdl, &core->video_hdl, NULL); |
|---|
| 1179 | + v4l2_ctrl_add_handler(&dev->cxhdl.hdl, &core->video_hdl, NULL, false); |
|---|
| 1187 | 1180 | |
|---|
| 1188 | 1181 | /* blackbird stuff */ |
|---|
| 1189 | 1182 | pr_info("cx23416 based mpeg encoder (blackbird reference design)\n"); |
|---|