diff options
| author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2022-08-10 13:54:45 +0200 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-08-29 15:33:45 +0200 |
| commit | 2a0c28063de23646bb56152095ce73ea2284dc26 (patch) | |
| tree | ca8413e91edcee5ab063195d916e7e524b90d6c3 /drivers/staging | |
| parent | 90f6b6affd51a29df41686be3bde30b97ec94fd2 (diff) | |
| download | linux-2a0c28063de23646bb56152095ce73ea2284dc26.tar.gz linux-2a0c28063de23646bb56152095ce73ea2284dc26.tar.bz2 linux-2a0c28063de23646bb56152095ce73ea2284dc26.zip | |
media: zoran: move to mainline
The zoran driver can be moved back to mainline after it has been
converted by Corentin Labbe to vb2.
Note that the zoran driver no longer supports video output, but
video capture is working fine now.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/staging')
20 files changed, 0 insertions, 7214 deletions
diff --git a/drivers/staging/media/Kconfig b/drivers/staging/media/Kconfig index 421ce9dbf44c..ce379cae01b9 100644 --- a/drivers/staging/media/Kconfig +++ b/drivers/staging/media/Kconfig @@ -44,6 +44,4 @@ source "drivers/staging/media/sunxi/Kconfig" source "drivers/staging/media/tegra-video/Kconfig" -source "drivers/staging/media/zoran/Kconfig" - endif diff --git a/drivers/staging/media/Makefile b/drivers/staging/media/Makefile index 950e96f10aad..7ece57ca0403 100644 --- a/drivers/staging/media/Makefile +++ b/drivers/staging/media/Makefile @@ -10,5 +10,4 @@ obj-$(CONFIG_VIDEO_SUNXI) += sunxi/ obj-$(CONFIG_VIDEO_TEGRA) += tegra-video/ obj-$(CONFIG_VIDEO_HANTRO) += hantro/ obj-$(CONFIG_VIDEO_IPU3_IMGU) += ipu3/ -obj-$(CONFIG_VIDEO_ZORAN) += zoran/ obj-$(CONFIG_DVB_AV7110) += av7110/ diff --git a/drivers/staging/media/zoran/Kconfig b/drivers/staging/media/zoran/Kconfig deleted file mode 100644 index 3fb3e27e04a8..000000000000 --- a/drivers/staging/media/zoran/Kconfig +++ /dev/null @@ -1,74 +0,0 @@ -config VIDEO_ZORAN - tristate "Zoran ZR36057/36067 Video For Linux (Deprecated)" - depends on PCI && I2C_ALGOBIT && VIDEO_DEV - depends on !ALPHA - depends on DEBUG_FS - select VIDEOBUF2_DMA_CONTIG - select VIDEO_ADV7170 if VIDEO_ZORAN_LML33R10 - select VIDEO_ADV7175 if VIDEO_ZORAN_DC10 || VIDEO_ZORAN_DC30 - select VIDEO_BT819 if VIDEO_ZORAN_LML33 - select VIDEO_BT856 if VIDEO_ZORAN_LML33 || VIDEO_ZORAN_AVS6EYES - select VIDEO_BT866 if VIDEO_ZORAN_AVS6EYES - select VIDEO_KS0127 if VIDEO_ZORAN_AVS6EYES - select VIDEO_SAA711X if VIDEO_ZORAN_BUZ || VIDEO_ZORAN_LML33R10 - select VIDEO_SAA7110 if VIDEO_ZORAN_DC10 - select VIDEO_SAA7185 if VIDEO_ZORAN_BUZ - select VIDEO_VPX3220 if VIDEO_ZORAN_DC30 - help - Say Y for support for MJPEG capture cards based on the Zoran - 36057/36067 PCI controller chipset. This includes the Iomega - Buz, Pinnacle DC10+ and the Linux Media Labs LML33. There is - a driver homepage at <http://mjpeg.sf.net/driver-zoran/>. For - more information, check <file:Documentation/driver-api/media/drivers/zoran.rst>. - - To compile this driver as a module, choose M here: the - module will be called zr36067. - -config VIDEO_ZORAN_DC30 - bool "Pinnacle/Miro DC30(+) support" - depends on VIDEO_ZORAN - help - Support for the Pinnacle/Miro DC30(+) MJPEG capture/playback - card. This also supports really old DC10 cards based on the - zr36050 MJPEG codec and zr36016 VFE. - -config VIDEO_ZORAN_ZR36060 - bool "Zoran ZR36060" - depends on VIDEO_ZORAN - help - Say Y to support Zoran boards based on 36060 chips. - This includes Iomega Buz, Pinnacle DC10, Linux media Labs 33 - and 33 R10 and AverMedia 6 boards. - -config VIDEO_ZORAN_BUZ - bool "Iomega Buz support" - depends on VIDEO_ZORAN_ZR36060 - help - Support for the Iomega Buz MJPEG capture/playback card. - -config VIDEO_ZORAN_DC10 - bool "Pinnacle/Miro DC10(+) support" - depends on VIDEO_ZORAN_ZR36060 - help - Support for the Pinnacle/Miro DC10(+) MJPEG capture/playback - card. - -config VIDEO_ZORAN_LML33 - bool "Linux Media Labs LML33 support" - depends on VIDEO_ZORAN_ZR36060 - help - Support for the Linux Media Labs LML33 MJPEG capture/playback - card. - -config VIDEO_ZORAN_LML33R10 - bool "Linux Media Labs LML33R10 support" - depends on VIDEO_ZORAN_ZR36060 - help - support for the Linux Media Labs LML33R10 MJPEG capture/playback - card. - -config VIDEO_ZORAN_AVS6EYES - bool "AverMedia 6 Eyes support" - depends on VIDEO_ZORAN_ZR36060 - help - Support for the AverMedia 6 Eyes video surveillance card. diff --git a/drivers/staging/media/zoran/Makefile b/drivers/staging/media/zoran/Makefile deleted file mode 100644 index 9603bac0195c..000000000000 --- a/drivers/staging/media/zoran/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -zr36067-objs := zoran_device.o \ - zoran_driver.o zoran_card.o videocodec.o - -obj-$(CONFIG_VIDEO_ZORAN) += zr36067.o -zr36067-$(CONFIG_VIDEO_ZORAN_DC30) += zr36050.o zr36016.o -zr36067-$(CONFIG_VIDEO_ZORAN_ZR36060) += zr36060.o diff --git a/drivers/staging/media/zoran/TODO b/drivers/staging/media/zoran/TODO deleted file mode 100644 index 6992540d3e53..000000000000 --- a/drivers/staging/media/zoran/TODO +++ /dev/null @@ -1,19 +0,0 @@ - -How to test the zoran driver: -- RAW capture - mplayer tv:///dev/video0 -tv driver=v4l2 - -- MJPEG capture (compression) - mplayer tv:///dev/video0 -tv driver=v4l2:outfmt=mjpeg - TODO: need two test for both Dcim path - -- MJPEG play (decompression) - ffmpeg -i test.avi -vcodec mjpeg -an -f v4l2 /dev/video0 - Note: only recent ffmpeg has the ability of sending non-raw video via v4l2 - - The original way of sending video was via mplayer vo_zr/vo_zr2, but it does not compile - anymore and is a dead end (usage of some old private ffmpeg structures). - -TODO -- fix the v4l compliance "TRY_FMT cannot handle an invalid pixelformat" -- Filter JPEG data to made output work diff --git a/drivers/staging/media/zoran/videocodec.c b/drivers/staging/media/zoran/videocodec.c deleted file mode 100644 index 8efc5e06b0f7..000000000000 --- a/drivers/staging/media/zoran/videocodec.c +++ /dev/null @@ -1,278 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * VIDEO MOTION CODECs internal API for video devices - * - * Interface for MJPEG (and maybe later MPEG/WAVELETS) codec's - * bound to a master device. - * - * (c) 2002 Wolfgang Scherr <scherr@net4you.at> - */ - -#include <linux/kernel.h> -#include <linux/module.h> -#include <linux/init.h> -#include <linux/types.h> -#include <linux/slab.h> - -#include "videocodec.h" - -struct attached_list { - struct videocodec *codec; - struct attached_list *next; -}; - -struct codec_list { - const struct videocodec *codec; - int attached; - struct attached_list *list; - struct codec_list *next; -}; - -static struct codec_list *codeclist_top; - -/* ================================================= */ -/* function prototypes of the master/slave interface */ -/* ================================================= */ - -struct videocodec *videocodec_attach(struct videocodec_master *master) -{ - struct codec_list *h = codeclist_top; - struct zoran *zr; - struct attached_list *a, *ptr; - struct videocodec *codec; - int res; - - if (!master) { - pr_err("%s: no data\n", __func__); - return NULL; - } - - zr = videocodec_master_to_zoran(master); - - zrdev_dbg(zr, "%s: '%s', flags %lx, magic %lx\n", __func__, - master->name, master->flags, master->magic); - - if (!h) { - zrdev_err(zr, "%s: no device available\n", __func__); - return NULL; - } - - while (h) { - // attach only if the slave has at least the flags - // expected by the master - if ((master->flags & h->codec->flags) == master->flags) { - zrdev_dbg(zr, "%s: try '%s'\n", __func__, h->codec->name); - - codec = kmemdup(h->codec, sizeof(struct videocodec), GFP_KERNEL); - if (!codec) - goto out_kfree; - - res = strlen(codec->name); - snprintf(codec->name + res, sizeof(codec->name) - res, "[%d]", h->attached); - codec->master_data = master; - res = codec->setup(codec); - if (res == 0) { - zrdev_dbg(zr, "%s: '%s'\n", __func__, codec->name); - ptr = kzalloc(sizeof(*ptr), GFP_KERNEL); - if (!ptr) - goto out_kfree; - ptr->codec = codec; - - a = h->list; - if (!a) { - h->list = ptr; - zrdev_dbg(zr, "videocodec: first element\n"); - } else { - while (a->next) - a = a->next; // find end - a->next = ptr; - zrdev_dbg(zr, "videocodec: in after '%s'\n", - h->codec->name); - } - - h->attached += 1; - return codec; - } - kfree(codec); - } - h = h->next; - } - - zrdev_err(zr, "%s: no codec found!\n", __func__); - return NULL; - - out_kfree: - kfree(codec); - return NULL; -} - -int videocodec_detach(struct videocodec *codec) -{ - struct codec_list *h = codeclist_top; - struct zoran *zr; - struct attached_list *a, *prev; - int res; - - if (!codec) { - pr_err("%s: no data\n", __func__); - return -EINVAL; - } - - zr = videocodec_to_zoran(codec); - - zrdev_dbg(zr, "%s: '%s', type: %x, flags %lx, magic %lx\n", __func__, - codec->name, codec->type, codec->flags, codec->magic); - - if (!h) { - zrdev_err(zr, "%s: no device left...\n", __func__); - return -ENXIO; - } - - while (h) { - a = h->list; - prev = NULL; - while (a) { - if (codec == a->codec) { - res = a->codec->unset(a->codec); - if (res >= 0) { - zrdev_dbg(zr, "%s: '%s'\n", __func__, - a->codec->name); - a->codec->master_data = NULL; - } else { - zrdev_err(zr, "%s: '%s'\n", __func__, a->codec->name); - a->codec->master_data = NULL; - } - if (!prev) { - h->list = a->next; - zrdev_dbg(zr, "videocodec: delete first\n"); - } else { - prev->next = a->next; - zrdev_dbg(zr, "videocodec: delete middle\n"); - } - kfree(a->codec); - kfree(a); - h->attached -= 1; - return 0; - } - prev = a; - a = a->next; - } - h = h->next; - } - - zrdev_err(zr, "%s: given codec not found!\n", __func__); - return -EINVAL; -} - -int videocodec_register(const struct videocodec *codec) -{ - struct codec_list *ptr, *h = codeclist_top; - struct zoran *zr; - - if (!codec) { - pr_err("%s: no data!\n", __func__); - return -EINVAL; - } - - zr = videocodec_to_zoran((struct videocodec *)codec); - - zrdev_dbg(zr, - "videocodec: register '%s', type: %x, flags %lx, magic %lx\n", - codec->name, codec->type, codec->flags, codec->magic); - - ptr = kzalloc(sizeof(*ptr), GFP_KERNEL); - if (!ptr) - return -ENOMEM; - ptr->codec = codec; - - if (!h) { - codeclist_top = ptr; - zrdev_dbg(zr, "videocodec: hooked in as first element\n"); - } else { - while (h->next) - h = h->next; // find the end - h->next = ptr; - zrdev_dbg(zr, "videocodec: hooked in after '%s'\n", - h->codec->name); - } - - return 0; -} - -int videocodec_unregister(const struct videocodec *codec) -{ - struct codec_list *prev = NULL, *h = codeclist_top; - struct zoran *zr; - - if (!codec) { - pr_err("%s: no data!\n", __func__); - return -EINVAL; - } - - zr = videocodec_to_zoran((struct videocodec *)codec); - - zrdev_dbg(zr, - "videocodec: unregister '%s', type: %x, flags %lx, magic %lx\n", - codec->name, codec->type, codec->flags, codec->magic); - - if (!h) { - zrdev_err(zr, "%s: no device left...\n", __func__); - return -ENXIO; - } - - while (h) { - if (codec == h->codec) { - if (h->attached) { - zrdev_err(zr, "videocodec: '%s' is used\n", - h->codec->name); - return -EBUSY; - } - zrdev_dbg(zr, "videocodec: unregister '%s' is ok.\n", - h->codec->name); - if (!prev) { - codeclist_top = h->next; - zrdev_dbg(zr, - "videocodec: delete first element\n"); - } else { - prev->next = h->next; - zrdev_dbg(zr, - "videocodec: delete middle element\n"); - } - kfree(h); - return 0; - } - prev = h; - h = h->next; - } - - zrdev_err(zr, "%s: given codec not found!\n", __func__); - return -EINVAL; -} - -int videocodec_debugfs_show(struct seq_file *m) -{ - struct codec_list *h = codeclist_top; - struct attached_list *a; - - seq_puts(m, "<S>lave or attached <M>aster name type flags magic "); - seq_puts(m, "(connected as)\n"); - - while (h) { - seq_printf(m, "S %32s %04x %08lx %08lx (TEMPLATE)\n", - h->codec->name, h->codec->type, - h->codec->flags, h->codec->magic); - a = h->list; - while (a) { - seq_printf(m, "M %32s %04x %08lx %08lx (%s)\n", - a->codec->master_data->name, - a->codec->master_data->type, - a->codec->master_data->flags, - a->codec->master_data->magic, - a->codec->name); - a = a->next; - } - h = h->next; - } - - return 0; -} diff --git a/drivers/staging/media/zoran/videocodec.h b/drivers/staging/media/zoran/videocodec.h deleted file mode 100644 index 6b69f69667f9..000000000000 --- a/drivers/staging/media/zoran/videocodec.h +++ /dev/null @@ -1,325 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* - * VIDEO MOTION CODECs internal API for video devices - * - * Interface for MJPEG (and maybe later MPEG/WAVELETS) codec's - * bound to a master device. - * - * (c) 2002 Wolfgang Scherr <scherr@net4you.at> - */ - -/* =================== */ -/* general description */ -/* =================== */ - -/* - * Should ease the (re-)usage of drivers supporting cards with (different) - * video codecs. The codecs register to this module their functionality, - * and the processors (masters) can attach to them if they fit. - * - * The codecs are typically have a "strong" binding to their master - so I - * don't think it makes sense to have a full blown interfacing as with e.g. - * i2c. If you have an other opinion, let's discuss & implement it :-))) - * - * Usage: - * - * The slave has just to setup the videocodec structure and use two functions: - * videocodec_register(codecdata); - * videocodec_unregister(codecdata); - * The best is just calling them at module (de-)initialisation. - * - * The master sets up the structure videocodec_master and calls: - * codecdata=videocodec_attach(master_codecdata); - * videocodec_detach(codecdata); - * - * The slave is called during attach/detach via functions setup previously - * during register. At that time, the master_data pointer is set up - * and the slave can access any io registers of the master device (in the case - * the slave is bound to it). Otherwise it doesn't need this functions and - * therefor they may not be initialized. - * - * The other functions are just for convenience, as they are for sure used by - * most/all of the codecs. The last ones may be omitted, too. - * - * See the structure declaration below for more information and which data has - * to be set up for the master and the slave. - * - * ---------------------------------------------------------------------------- - * The master should have "knowledge" of the slave and vice versa. So the data - * structures sent to/from slave via set_data/get_data set_image/get_image are - * device dependent and vary between MJPEG/MPEG/WAVELET/... devices. (!!!!) - * ---------------------------------------------------------------------------- - */ - -/* ========================================== */ -/* description of the videocodec_io structure */ -/* ========================================== */ - -/* - * ==== master setup ==== - * name -> name of the device structure for reference and debugging - * master_data -> data ref. for the master (e.g. the zr36055,57,67) - * readreg -> ref. to read-fn from register (setup by master, used by slave) - * writereg -> ref. to write-fn to register (setup by master, used by slave) - * this two functions do the lowlevel I/O job - * - * ==== slave functionality setup ==== - * slave_data -> data ref. for the slave (e.g. the zr36050,60) - * check -> fn-ref. checks availability of an device, returns -EIO on failure or - * the type on success - * this makes espcecially sense if a driver module supports more than - * one codec which may be quite similar to access, nevertheless it - * is good for a first functionality check - * - * -- main functions you always need for compression/decompression -- - * - * set_mode -> this fn-ref. resets the entire codec, and sets up the mode - * with the last defined norm/size (or device default if not - * available) - it returns 0 if the mode is possible - * set_size -> this fn-ref. sets the norm and image size for - * compression/decompression (returns 0 on success) - * the norm param is defined in videodev2.h (V4L2_STD_*) - * - * additional setup may be available, too - but the codec should work with - * some default values even without this - * - * set_data -> sets device-specific data (tables, quality etc.) - * get_data -> query device-specific data (tables, quality etc.) - * - * if the device delivers interrupts, they may be setup/handled here - * setup_interrupt -> codec irq setup (not needed for 36050/60) - * handle_interrupt -> codec irq handling (not needed for 36050/60) - - * if the device delivers pictures, they may be handled here - * put_image -> puts image data to the codec (not needed for 36050/60) - * get_image -> gets image data from the codec (not needed for 36050/60) - * the calls include frame numbers and flags (even/odd/...) - * if needed and a flag which allows blocking until its ready - */ - -/* ============== */ -/* user interface */ -/* ============== */ - -/* - * Currently there is only a information display planned, as the layer - * is not visible for the user space at all. - * - * Information is available via procfs. The current entry is "/proc/videocodecs" - * but it makes sense to "hide" it in the /proc/video tree of v4l(2) --TODO--. - * - * A example for such an output is: - * - * <S>lave or attached <M>aster name type flags magic (connected as) - * S zr36050 0002 0000d001 00000000 (TEMPLATE) - * M zr36055[0] 0001 0000c001 00000000 (zr36050[0]) - * M zr36055[1] 0001 0000c001 00000000 (zr36050[1]) - */ - -/* =============================================== */ -/* special defines for the videocodec_io structure */ -/* =============================================== */ - -#ifndef __LINUX_VIDEOCODEC_H -#define __LINUX_VIDEOCODEC_H - -#include <linux/debugfs.h> -#include <linux/videodev2.h> - -#define CODEC_DO_COMPRESSION 0 -#define CODEC_DO_EXPANSION 1 - -/* this are the current codec flags I think they are needed */ -/* -> type value in structure */ -#define CODEC_FLAG_JPEG 0x00000001L // JPEG codec -#define CODEC_FLAG_MPEG 0x00000002L // MPEG1/2/4 codec -#define CODEC_FLAG_DIVX 0x00000004L // DIVX codec -#define CODEC_FLAG_WAVELET 0x00000008L // WAVELET codec - // room for other types - -#define CODEC_FLAG_MAGIC 0x00000800L // magic key must match -#define CODEC_FLAG_HARDWARE 0x00001000L // is a hardware codec -#define CODEC_FLAG_VFE 0x00002000L // has direct video frontend -#define CODEC_FLAG_ENCODER 0x00004000L // compression capability -#define CODEC_FLAG_DECODER 0x00008000L // decompression capability -#define CODEC_FLAG_NEEDIRQ 0x00010000L // needs irq handling -#define CODEC_FLAG_RDWRPIC 0x00020000L // handles picture I/O - -/* a list of modes, some are just examples (is there any HW?) */ -#define CODEC_MODE_BJPG 0x0001 // Baseline JPEG -#define CODEC_MODE_LJPG 0x0002 // Lossless JPEG -#define CODEC_MODE_MPEG1 0x0003 // MPEG 1 -#define CODEC_MODE_MPEG2 0x0004 // MPEG 2 -#define CODEC_MODE_MPEG4 0x0005 // MPEG 4 -#define CODEC_MODE_MSDIVX 0x0006 // MS DivX -#define CODEC_MODE_ODIVX 0x0007 // Open DivX -#define CODEC_MODE_WAVELET 0x0008 // Wavelet - -/* this are the current codec types I want to implement */ -/* -> type value in structure */ -#define CODEC_TYPE_NONE 0 -#define CODEC_TYPE_L64702 1 -#define CODEC_TYPE_ZR36050 2 -#define CODEC_TYPE_ZR36016 3 -#define CODEC_TYPE_ZR36060 4 - -/* the type of data may be enhanced by future implementations (data-fn.'s) */ -/* -> used in command */ -#define CODEC_G_STATUS 0x0000 /* codec status (query only) */ -#define CODEC_S_CODEC_MODE 0x0001 /* codec mode (baseline JPEG, MPEG1,... */ -#define CODEC_G_CODEC_MODE 0x8001 -#define CODEC_S_VFE 0x0002 /* additional video frontend setup */ -#define CODEC_G_VFE 0x8002 -#define CODEC_S_MMAP 0x0003 /* MMAP setup (if available) */ - -#define CODEC_S_JPEG_TDS_BYTE 0x0010 /* target data size in bytes */ -#define CODEC_G_JPEG_TDS_BYTE 0x8010 -#define CODEC_S_JPEG_SCALE 0x0011 /* scaling factor for quant. tables */ -#define CODEC_G_JPEG_SCALE 0x8011 -#define CODEC_S_JPEG_HDT_DATA 0x0018 /* huffman-tables */ -#define CODEC_G_JPEG_HDT_DATA 0x8018 -#define CODEC_S_JPEG_QDT_DATA 0x0019 /* quantizing-tables */ -#define CODEC_G_JPEG_QDT_DATA 0x8019 -#define CODEC_S_JPEG_APP_DATA 0x001A /* APP marker */ -#define CODEC_G_JPEG_APP_DATA 0x801A -#define CODEC_S_JPEG_COM_DATA 0x001B /* COM marker */ -#define CODEC_G_JPEG_COM_DATA 0x801B - -#define CODEC_S_PRIVATE 0x1000 /* "private" commands start here */ -#define CODEC_G_PRIVATE 0x9000 - -#define CODEC_G_FLAG 0x8000 /* this is how 'get' is detected */ - -/* types of transfer, directly user space or a kernel buffer (image-fn.'s) */ -/* -> used in get_image, put_image */ -#define CODEC_TRANSFER_KERNEL 0 /* use "memcopy" */ -#define CODEC_TRANSFER_USER 1 /* use "to/from_user" */ - -/* ========================= */ -/* the structures itself ... */ -/* ========================= */ - -struct vfe_polarity { - unsigned int vsync_pol:1; - unsigned int hsync_pol:1; - unsigned int field_pol:1; - unsigned int blank_pol:1; - unsigned int subimg_pol:1; - unsigned int poe_pol:1; - unsigned int pvalid_pol:1; - unsigned int vclk_pol:1; -}; - -struct vfe_settings { - __u32 x, y; /* Offsets into image */ - __u32 width, height; /* Area to capture */ - __u16 decimation; /* Decimation divider */ - __u16 flags; /* Flags for capture */ - __u16 quality; /* quality of the video */ -}; - -struct tvnorm { - u16 wt, wa, h_start, h_sync_start, ht, ha, v_start; -}; - -struct jpeg_com_marker { - int len; /* number of usable bytes in data */ - char data[60]; -}; - -struct jpeg_app_marker { - int appn; /* number app segment */ - int len; /* number of usable bytes in data */ - char data[60]; -}; - -struct videocodec { - /* -- filled in by slave device during register -- */ - char name[32]; - unsigned long magic; /* may be used for client<->master attaching */ - unsigned long flags; /* functionality flags */ - unsigned int type; /* codec type */ - - /* -- these is filled in later during master device attach -- */ - - struct videocodec_master *master_data; - - /* -- these are filled in by the slave device during register -- */ - - void *data; /* private slave data */ - - /* attach/detach client functions (indirect call) */ - int (*setup)(struct videocodec *codec); - int (*unset)(struct videocodec *codec); - - /* main functions, every client needs them for sure! */ - // set compression or decompression (or freeze, stop, standby, etc) - int (*set_mode)(struct videocodec *codec, int mode); - // setup picture size and norm (for the codec's video frontend) - int (*set_video)(struct videocodec *codec, const struct tvnorm *norm, - struct vfe_settings *cap, struct vfe_polarity *pol); - // other control commands, also mmap setup etc. - int (*control)(struct videocodec *codec, int type, int size, void *data); - - /* additional setup/query/processing (may be NULL pointer) */ - // interrupt setup / handling (for irq's delivered by master) - int (*setup_interrupt)(struct videocodec *codec, long mode); - int (*handle_interrupt)(struct videocodec *codec, int source, long flag); - // picture interface (if any) - long (*put_image)(struct videocodec *codec, int tr_type, int block, - long *fr_num, long *flag, long size, void *buf); - long (*get_image)(struct videocodec *codec, int tr_type, int block, - long *fr_num, long *flag, long size, void *buf); -}; - -struct videocodec_master { - /* -- filled in by master device for registration -- */ - char name[32]; - unsigned long magic; /* may be used for client<->master attaching */ - unsigned long flags; /* functionality flags */ - unsigned int type; /* master type */ - - void *data; /* private master data */ - - __u32 (*readreg)(struct videocodec *codec, __u16 reg); - void (*writereg)(struct videocodec *codec, __u16 reg, __u32 value); -}; - -/* ================================================= */ -/* function prototypes of the master/slave interface */ -/* ================================================= */ - -/* attach and detach commands for the master */ -// * master structure needs to be kmalloc'ed before calling attach -// and free'd after calling detach -// * returns pointer on success, NULL on failure -struct videocodec *videocodec_attach(struct videocodec_master *master); -// * 0 on success, <0 (errno) on failure -int videocodec_detach(struct videocodec *codec); - -/* register and unregister commands for the slaves */ -// * 0 on success, <0 (errno) on failure -int videocodec_register(const struct videocodec *codec); -// * 0 on success, <0 (errno) on failure -int videocodec_unregister(const struct videocodec *codec); - -/* the other calls are directly done via the videocodec structure! */ - -int videocodec_debugfs_show(struct seq_file *m); - -#include "zoran.h" -static inline struct zoran *videocodec_master_to_zoran(struct videocodec_master *master) -{ - struct zoran *zr = master->data; - - return zr; -} - -static inline struct zoran *videocodec_to_zoran(struct videocodec *codec) -{ - struct videocodec_master *master = codec->master_data; - - return videocodec_master_to_zoran(master); -} - -#endif /*ifndef __LINUX_VIDEOCODEC_H */ diff --git a/drivers/staging/media/zoran/zoran.h b/drivers/staging/media/zoran/zoran.h deleted file mode 100644 index 56340553b282..000000000000 --- a/drivers/staging/media/zoran/zoran.h +++ /dev/null @@ -1,328 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* - * zoran - Iomega Buz driver - * - * Copyright (C) 1999 Rainer Johanni <Rainer@Johanni.de> - * - * based on - * - * zoran.0.0.3 Copyright (C) 1998 Dave Perks <dperks@ibm.net> - * - * and - * - * bttv - Bt848 frame grabber driver - * Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de) - * & Marcus Metzler (mocm@thp.uni-koeln.de) - */ - -#ifndef _BUZ_H_ -#define _BUZ_H_ - -#include <linux/debugfs.h> -#include <linux/pci.h> -#include <linux/i2c-algo-bit.h> -#include <media/v4l2-device.h> -#include <media/v4l2-ctrls.h> -#include <media/videobuf2-core.h> -#include <media/videobuf2-v4l2.h> -#include <media/videobuf2-dma-contig.h> - -#define ZR_NORM_PAL 0 -#define ZR_NORM_NTSC 1 -#define ZR_NORM_SECAM 2 - -struct zr_buffer { - /* common v4l buffer stuff -- must be first */ - struct vb2_v4l2_buffer vbuf; - struct list_head queue; -}; - -static inline struct zr_buffer *vb2_to_zr_buffer(struct vb2_buffer *vb) -{ - struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb); - - return container_of(vbuf, struct zr_buffer, vbuf); -} - -#define ZORAN_NAME "ZORAN" /* name of the device */ - -#define ZR_DEVNAME(zr) ((zr)->name) - -#define BUZ_MAX_WIDTH (zr->timing->wa) -#define BUZ_MAX_HEIGHT (zr->timing->ha) -#define BUZ_MIN_WIDTH 32 /* never display less than 32 pixels */ -#define BUZ_MIN_HEIGHT 24 /* never display less than 24 rows */ - -#define BUZ_NUM_STAT_COM 4 -#define BUZ_MASK_STAT_COM 3 - -#define BUZ_MAX_INPUT 16 - -#include "zr36057.h" - -enum card_type { - UNKNOWN = -1, - - /* Pinnacle/Miro */ - DC10_OLD, /* DC30 like */ - DC10_NEW, /* DC10_PLUS like */ - DC10_PLUS, - DC30, - DC30_PLUS, - - /* Linux Media Labs */ - LML33, - LML33R10, - - /* Iomega */ - BUZ, - - /* AverMedia */ - AVS6EYES, - - /* total number of cards */ - NUM_CARDS -}; - -enum zoran_codec_mode { - BUZ_MODE_IDLE, /* nothing going on */ - BUZ_MODE_MOTION_COMPRESS, /* grabbing frames */ - BUZ_MODE_MOTION_DECOMPRESS, /* playing frames */ - BUZ_MODE_STILL_COMPRESS, /* still frame conversion */ - BUZ_MODE_STILL_DECOMPRESS /* still frame conversion */ -}; - -enum zoran_map_mode { - ZORAN_MAP_MODE_NONE, - ZORAN_MAP_MODE_RAW, - ZORAN_MAP_MODE_JPG_REC, - ZORAN_MAP_MODE_JPG_PLAY, -}; - -enum gpio_type { - ZR_GPIO_JPEG_SLEEP = 0, - ZR_GPIO_JPEG_RESET, - ZR_GPIO_JPEG_FRAME, - ZR_GPIO_VID_DIR, - ZR_GPIO_VID_EN, - ZR_GPIO_VID_RESET, - ZR_GPIO_CLK_SEL1, - ZR_GPIO_CLK_SEL2, - ZR_GPIO_MAX, -}; - -enum gpcs_type { - GPCS_JPEG_RESET = 0, - GPCS_JPEG_START, - GPCS_MAX, -}; - -struct zoran_format { - char *name; - __u |
