V4L/DVB: videotext: remove this obsolete API

Remove the vtx (aka videotext aka teletext) API from the v4l2 core.
This API was scheduled for removal in kernel 2.6.35.

The vtx device nodes have been superseded by vbi device nodes
for many years. No applications exist that use the vtx support.
Of the two i2c drivers that actually support this API the saa5249
has been impossible to use for a year now and no known hardware
that supports this device exists. The saa5246a is theoretically
supported by the old mxb boards, but it never actually worked.

In summary: there is no hardware that can use this API and there
are no applications actually implementing this API.

The vtx support still reserves minors 192-223 and we would really
like to reuse those for upcoming new functionality. In the unlikely
event that new hardware appears that wants to use the functionality
provided by the vtx API, then that functionality should be build
around the sliced VBI API instead.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c
index cb77197..d4a3532 100644
--- a/drivers/media/video/v4l2-dev.c
+++ b/drivers/media/video/v4l2-dev.c
@@ -81,7 +81,7 @@
 	/* Any types not assigned to fixed minor ranges must be mapped to
 	   one single bitmap for the purposes of finding a free node number
 	   since all those unassigned types use the same minor range. */
-	int idx = (vfl_type > VFL_TYPE_VTX) ? VFL_TYPE_MAX - 1 : vfl_type;
+	int idx = (vfl_type > VFL_TYPE_RADIO) ? VFL_TYPE_MAX - 1 : vfl_type;
 
 	return devnode_nums[idx];
 }
@@ -377,8 +377,6 @@
  *
  *	%VFL_TYPE_GRABBER - A frame grabber
  *
- *	%VFL_TYPE_VTX - A teletext device
- *
  *	%VFL_TYPE_VBI - Vertical blank data (undecoded)
  *
  *	%VFL_TYPE_RADIO - A radio card
@@ -411,9 +409,6 @@
 	case VFL_TYPE_GRABBER:
 		name_base = "video";
 		break;
-	case VFL_TYPE_VTX:
-		name_base = "vtx";
-		break;
 	case VFL_TYPE_VBI:
 		name_base = "vbi";
 		break;
@@ -451,10 +446,6 @@
 		minor_offset = 64;
 		minor_cnt = 64;
 		break;
-	case VFL_TYPE_VTX:
-		minor_offset = 192;
-		minor_cnt = 32;
-		break;
 	case VFL_TYPE_VBI:
 		minor_offset = 224;
 		minor_cnt = 32;
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 4e8ea8c..38a9f50 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -371,7 +371,6 @@
 header-y += vhost.h
 header-y += videodev.h
 header-y += videodev2.h
-header-y += videotext.h
 header-y += virtio_9p.h
 header-y += virtio_balloon.h
 header-y += virtio_blk.h
diff --git a/include/linux/videotext.h b/include/linux/videotext.h
deleted file mode 100644
index 3e68c8d..0000000
--- a/include/linux/videotext.h
+++ /dev/null
@@ -1,125 +0,0 @@
-#ifndef _VTX_H
-#define _VTX_H
-
-/*
- * Teletext (=Videotext) hardware decoders using interface /dev/vtx
- * Do not confuse with drivers using /dev/vbi which decode videotext by software
- *
- * Videotext IOCTLs changed in order to use _IO() macros defined in <linux/ioctl.h>,
- * unused tuner IOCTLs cleaned up by
- * Michael Geng <linux@MichaelGeng.de>
- *
- * Copyright (c) 1994-97 Martin Buck  <martin-2.buck@student.uni-ulm.de>
- * Read COPYING for more information
- *
- */
-
-
-/*
- *	Videotext ioctls
- */
-#define VTXIOCGETINFO	_IOR  (0x81,  1, vtx_info_t)
-#define VTXIOCCLRPAGE	_IOW  (0x81,  2, vtx_pagereq_t)
-#define VTXIOCCLRFOUND	_IOW  (0x81,  3, vtx_pagereq_t)
-#define VTXIOCPAGEREQ	_IOW  (0x81,  4, vtx_pagereq_t)
-#define VTXIOCGETSTAT	_IOW  (0x81,  5, vtx_pagereq_t)
-#define VTXIOCGETPAGE	_IOW  (0x81,  6, vtx_pagereq_t)
-#define VTXIOCSTOPDAU	_IOW  (0x81,  7, vtx_pagereq_t)
-#define VTXIOCPUTPAGE	_IO   (0x81,  8)
-#define VTXIOCSETDISP	_IO   (0x81,  9)
-#define VTXIOCPUTSTAT	_IO   (0x81, 10)
-#define VTXIOCCLRCACHE	_IO   (0x81, 11)
-#define VTXIOCSETVIRT	_IOW  (0x81, 12, long)
-
-/* for compatibility, will go away some day */
-#define VTXIOCGETINFO_OLD  0x7101  /* get version of driver & capabilities of vtx-chipset */
-#define VTXIOCCLRPAGE_OLD  0x7102  /* clear page-buffer */
-#define VTXIOCCLRFOUND_OLD 0x7103  /* clear bits indicating that page was found */
-#define VTXIOCPAGEREQ_OLD  0x7104  /* search for page */
-#define VTXIOCGETSTAT_OLD  0x7105  /* get status of page-buffer */
-#define VTXIOCGETPAGE_OLD  0x7106  /* get contents of page-buffer */
-#define VTXIOCSTOPDAU_OLD  0x7107  /* stop data acquisition unit */
-#define VTXIOCPUTPAGE_OLD  0x7108  /* display page on TV-screen */
-#define VTXIOCSETDISP_OLD  0x7109  /* set TV-mode */
-#define VTXIOCPUTSTAT_OLD  0x710a  /* set status of TV-output-buffer */
-#define VTXIOCCLRCACHE_OLD 0x710b  /* clear cache on VTX-interface (if avail.) */
-#define VTXIOCSETVIRT_OLD  0x710c  /* turn on virtual mode (this disables TV-display) */
-
-/*
- *	Definitions for VTXIOCGETINFO
- */
-
-#define SAA5243 0
-#define SAA5246 1
-#define SAA5249 2
-#define SAA5248 3
-#define XSTV5346 4
-
-typedef struct {
-	int version_major, version_minor;	/* version of driver; if version_major changes, driver */
-						/* is not backward compatible!!! CHECK THIS!!! */
-	int numpages;				/* number of page-buffers of vtx-chipset */
-	int cct_type;				/* type of vtx-chipset (SAA5243, SAA5246, SAA5248 or
-						 * SAA5249) */
-}
-vtx_info_t;
-
-
-/*
- *	Definitions for VTXIOC{CLRPAGE,CLRFOUND,PAGEREQ,GETSTAT,GETPAGE,STOPDAU,PUTPAGE,SETDISP}
- */
-
-#define MIN_UNIT   (1<<0)
-#define MIN_TEN    (1<<1)
-#define HR_UNIT    (1<<2)
-#define HR_TEN     (1<<3)
-#define PG_UNIT    (1<<4)
-#define PG_TEN     (1<<5)
-#define PG_HUND    (1<<6)
-#define PGMASK_MAX (1<<7)
-#define PGMASK_PAGE (PG_HUND | PG_TEN | PG_UNIT)
-#define PGMASK_HOUR (HR_TEN | HR_UNIT)
-#define PGMASK_MINUTE (MIN_TEN | MIN_UNIT)
-
-typedef struct
-{
-	int page;	/* number of requested page (hexadecimal) */
-	int hour;	/* requested hour (hexadecimal) */
-	int minute;	/* requested minute (hexadecimal) */
-	int pagemask;	/* mask defining which values of the above are set */
-	int pgbuf;	/* buffer where page will be stored */
-	int start;	/* start of requested part of page */
-	int end;	/* end of requested part of page */
-	void __user *buffer;	/* pointer to beginning of destination buffer */
-}
-vtx_pagereq_t;
-
-
-/*
- *	Definitions for VTXIOC{GETSTAT,PUTSTAT}
- */
-
-#define VTX_PAGESIZE (40 * 24)
-#define VTX_VIRTUALSIZE (40 * 49)
-
-typedef struct
-{
-	int pagenum;			/* number of page (hexadecimal) */
-	int hour;			/* hour (hexadecimal) */
-	int minute;			/* minute (hexadecimal) */
-	int charset;			/* national charset */
-	unsigned delete : 1;		/* delete page (C4) */
-	unsigned headline : 1;		/* insert headline (C5) */
-	unsigned subtitle : 1;		/* insert subtitle (C6) */
-	unsigned supp_header : 1;	/* suppress header (C7) */
-	unsigned update : 1;		/* update page (C8) */
-	unsigned inter_seq : 1;		/* interrupted sequence (C9) */
-	unsigned dis_disp : 1;		/* disable/suppress display (C10) */
-	unsigned serial : 1;		/* serial mode (C11) */
-	unsigned notfound : 1;		/* /FOUND */
-	unsigned pblf : 1;		/* PBLF */
-	unsigned hamming : 1;		/* hamming-error occurred */
-}
-vtx_pageinfo_t;
-
-#endif /* _VTX_H */
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index 1efcacb..8ad4f9f 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -21,8 +21,7 @@
 #define VFL_TYPE_GRABBER	0
 #define VFL_TYPE_VBI		1
 #define VFL_TYPE_RADIO		2
-#define VFL_TYPE_VTX		3
-#define VFL_TYPE_MAX		4
+#define VFL_TYPE_MAX		3
 
 struct v4l2_ioctl_callbacks;
 struct video_device;