diff options
| -rw-r--r-- | drivers/media/video/Kconfig | 15 | ||||
| -rw-r--r-- | drivers/media/video/Makefile | 1 | ||||
| -rw-r--r-- | drivers/media/video/dpc7146.c | 408 |
3 files changed, 0 insertions, 424 deletions
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig index 37123ff20fc..2fa7418c16d 100644 --- a/drivers/media/video/Kconfig +++ b/drivers/media/video/Kconfig | |||
| @@ -709,21 +709,6 @@ config VIDEO_MXB | |||
| 709 | To compile this driver as a module, choose M here: the | 709 | To compile this driver as a module, choose M here: the |
| 710 | module will be called mxb. | 710 | module will be called mxb. |
| 711 | 711 | ||
| 712 | config VIDEO_DPC | ||
| 713 | tristate "Philips-Semiconductors 'dpc7146 demonstration board'" | ||
| 714 | depends on PCI && VIDEO_V4L1 && I2C | ||
| 715 | select VIDEO_SAA7146_VV | ||
| 716 | select VIDEO_SAA7111 if VIDEO_HELPER_CHIPS_AUTO | ||
| 717 | ---help--- | ||
| 718 | This is a video4linux driver for the 'dpc7146 demonstration | ||
| 719 | board' by Philips-Semiconductors. It's the reference design | ||
| 720 | for SAA7146 bases boards, so if you have some unsupported | ||
| 721 | saa7146 based, analog video card, chances are good that it | ||
| 722 | will work with this skeleton driver. | ||
| 723 | |||
| 724 | To compile this driver as a module, choose M here: the | ||
| 725 | module will be called dpc7146. | ||
| 726 | |||
| 727 | config VIDEO_HEXIUM_ORION | 712 | config VIDEO_HEXIUM_ORION |
| 728 | tristate "Hexium HV-PCI6 and Orion frame grabber" | 713 | tristate "Hexium HV-PCI6 and Orion frame grabber" |
| 729 | depends on PCI && VIDEO_V4L2 && I2C | 714 | depends on PCI && VIDEO_V4L2 && I2C |
diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile index d234db7c4e0..012bc116957 100644 --- a/drivers/media/video/Makefile +++ b/drivers/media/video/Makefile | |||
| @@ -84,7 +84,6 @@ obj-$(CONFIG_VIDEO_CPIA2) += cpia2/ | |||
| 84 | obj-$(CONFIG_VIDEO_MXB) += mxb.o | 84 | obj-$(CONFIG_VIDEO_MXB) += mxb.o |
| 85 | obj-$(CONFIG_VIDEO_HEXIUM_ORION) += hexium_orion.o | 85 | obj-$(CONFIG_VIDEO_HEXIUM_ORION) += hexium_orion.o |
| 86 | obj-$(CONFIG_VIDEO_HEXIUM_GEMINI) += hexium_gemini.o | 86 | obj-$(CONFIG_VIDEO_HEXIUM_GEMINI) += hexium_gemini.o |
| 87 | obj-$(CONFIG_VIDEO_DPC) += dpc7146.o | ||
| 88 | obj-$(CONFIG_TUNER_3036) += tuner-3036.o | 87 | obj-$(CONFIG_TUNER_3036) += tuner-3036.o |
| 89 | 88 | ||
| 90 | obj-$(CONFIG_VIDEOBUF_GEN) += videobuf-core.o | 89 | obj-$(CONFIG_VIDEOBUF_GEN) += videobuf-core.o |
diff --git a/drivers/media/video/dpc7146.c b/drivers/media/video/dpc7146.c deleted file mode 100644 index 88d6df71d05..00000000000 --- a/drivers/media/video/dpc7146.c +++ /dev/null | |||
| @@ -1,408 +0,0 @@ | |||
| 1 | /* | ||
| 2 | dpc7146.c - v4l2 driver for the dpc7146 demonstration board | ||
| 3 | |||
| 4 | Copyright (C) 2000-2003 Michael Hunold <michael@mihu.de> | ||
| 5 | |||
| 6 | This program is free software; you can redistribute it and/or modify | ||
| 7 | it under the terms of the GNU General Public License as published by | ||
| 8 | the Free Software Foundation; either version 2 of the License, or | ||
| 9 | (at your option) any later version. | ||
| 10 | |||
| 11 | This program is distributed in the hope that it will be useful, | ||
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | GNU General Public License for more details. | ||
| 15 | |||
| 16 | You should have received a copy of the GNU General Public License | ||
| 17 | along with this program; if not, write to the Free Software | ||
| 18 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 19 | */ | ||
| 20 | |||
| 21 | #define DEBUG_VARIABLE debug | ||
| 22 | |||
| 23 | #include <media/saa7146_vv.h> | ||
| 24 | #include <linux/video_decoder.h> /* for saa7111a */ | ||
| 25 | |||
| 26 | #define I2C_SAA7111A 0x24 | ||
| 27 | |||
| 28 | /* All unused bytes are reserverd. */ | ||
| 29 | #define SAA711X_CHIP_VERSION 0x00 | ||
| 30 | #define SAA711X_ANALOG_INPUT_CONTROL_1 0x02 | ||
| 31 | #define SAA711X_ANALOG_INPUT_CONTROL_2 0x03 | ||
| 32 | #define SAA711X_ANALOG_INPUT_CONTROL_3 0x04 | ||
| 33 | #define SAA711X_ANALOG_INPUT_CONTROL_4 0x05 | ||
| 34 | #define SAA711X_HORIZONTAL_SYNC_START 0x06 | ||
| 35 | #define SAA711X_HORIZONTAL_SYNC_STOP 0x07 | ||
| 36 | #define SAA711X_SYNC_CONTROL 0x08 | ||
| 37 | #define SAA711X_LUMINANCE_CONTROL 0x09 | ||
| 38 | #define SAA711X_LUMINANCE_BRIGHTNESS 0x0A | ||
| 39 | #define SAA711X_LUMINANCE_CONTRAST 0x0B | ||
| 40 | #define SAA711X_CHROMA_SATURATION 0x0C | ||
| 41 | #define SAA711X_CHROMA_HUE_CONTROL 0x0D | ||
| 42 | #define SAA711X_CHROMA_CONTROL 0x0E | ||
| 43 | #define SAA711X_FORMAT_DELAY_CONTROL 0x10 | ||
| 44 | #define SAA711X_OUTPUT_CONTROL_1 0x11 | ||
| 45 | #define SAA711X_OUTPUT_CONTROL_2 0x12 | ||
| 46 | #define SAA711X_OUTPUT_CONTROL_3 0x13 | ||
| 47 | #define SAA711X_V_GATE_1_START 0x15 | ||
| 48 | #define SAA711X_V_GATE_1_STOP 0x16 | ||
| 49 | #define SAA711X_V_GATE_1_MSB 0x17 | ||
| 50 | #define SAA711X_TEXT_SLICER_STATUS 0x1A | ||
| 51 | #define SAA711X_DECODED_BYTES_OF_TS_1 0x1B | ||
| 52 | #define SAA711X_DECODED_BYTES_OF_TS_2 0x1C | ||
| 53 | #define SAA711X_STATUS_BYTE 0x1F | ||
| 54 | |||
| 55 | #define DPC_BOARD_CAN_DO_VBI(dev) (dev->revision != 0) | ||
| 56 | |||
| 57 | static int debug; | ||
| 58 | module_param(debug, int, 0); | ||
| 59 | MODULE_PARM_DESC(debug, "debug verbosity"); | ||
| 60 | |||
| 61 | static int dpc_num; | ||
| 62 | |||
| 63 | #define DPC_INPUTS 2 | ||
| 64 | static struct v4l2_input dpc_inputs[DPC_INPUTS] = { | ||
| 65 | { 0, "Port A", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 }, | ||
| 66 | { 1, "Port B", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 }, | ||
| 67 | }; | ||
| 68 | |||
| 69 | #define DPC_AUDIOS 0 | ||
| 70 | |||
| 71 | static struct saa7146_extension_ioctls ioctls[] = { | ||
| 72 | { VIDIOC_G_INPUT, SAA7146_EXCLUSIVE }, | ||
| 73 | { VIDIOC_S_INPUT, SAA7146_EXCLUSIVE }, | ||
| 74 | { VIDIOC_ENUMINPUT, SAA7146_EXCLUSIVE }, | ||
| 75 | { VIDIOC_S_STD, SAA7146_AFTER }, | ||
| 76 | { 0, 0 } | ||
| 77 | }; | ||
| 78 | |||
| 79 | struct dpc | ||
| 80 | { | ||
| 81 | struct video_device *video_dev; | ||
| 82 | struct video_device *vbi_dev; | ||
| 83 | |||
| 84 | struct i2c_adapter i2c_adapter; | ||
| 85 | struct i2c_client *saa7111a; | ||
| 86 | |||
| 87 | int cur_input; /* current input */ | ||
| 88 | }; | ||
| 89 | |||
| 90 | static int dpc_check_clients(struct device *dev, void *data) | ||
| 91 | { | ||
| 92 | struct dpc* dpc = data; | ||
| 93 | struct i2c_client *client = i2c_verify_client(dev); | ||
| 94 | |||
| 95 | if( !client ) | ||
| 96 | return 0; | ||
| 97 | |||
| 98 | if( I2C_SAA7111A == client->addr ) | ||
| 99 | dpc->saa7111a = client; | ||
| 100 | |||
| 101 | return 0; | ||
| 102 | } | ||
| 103 | |||
| 104 | /* fixme: add vbi stuff here */ | ||
| 105 | static int dpc_probe(struct saa7146_dev* dev) | ||
| 106 | { | ||
| 107 | struct dpc* dpc = NULL; | ||
| 108 | |||
| 109 | dpc = kzalloc(sizeof(struct dpc), GFP_KERNEL); | ||
| 110 | if( NULL == dpc ) { | ||
| 111 | printk("dpc_v4l2.o: dpc_probe: not enough kernel memory.\n"); | ||
| 112 | return -ENOMEM; | ||
| 113 | } | ||
| 114 | |||
| 115 | /* FIXME: enable i2c-port pins, video-port-pins | ||
| 116 | video port pins should be enabled here ?! */ | ||
| 117 | saa7146_write(dev, MC1, (MASK_08 | MASK_24 | MASK_10 | MASK_26)); | ||
| 118 | |||
| 119 | dpc->i2c_adapter = (struct i2c_adapter) { | ||
| 120 | .class = I2C_CLASS_TV_ANALOG, | ||
| 121 | .name = "dpc7146", | ||
| 122 | }; | ||
| 123 | saa7146_i2c_adapter_prepare(dev, &dpc->i2c_adapter, SAA7146_I2C_BUS_BIT_RATE_480); | ||
| 124 | if(i2c_add_adapter(&dpc->i2c_adapter) < 0) { | ||
| 125 | DEB_S(("cannot register i2c-device. skipping.\n")); | ||
| 126 | kfree(dpc); | ||
| 127 | return -EFAULT; | ||
| 128 | } | ||
| 129 | |||
| 130 | /* loop through all i2c-devices on the bus and look who is there */ | ||
| 131 | device_for_each_child(&dpc->i2c_adapter.dev, dpc, dpc_check_clients); | ||
| 132 | |||
| 133 | /* check if all devices are present */ | ||
| 134 | if (!dpc->saa7111a) { | ||
| 135 | DEB_D(("dpc_v4l2.o: dpc_attach failed for this device.\n")); | ||
| 136 | i2c_del_adapter(&dpc->i2c_adapter); | ||
| 137 | kfree(dpc); | ||
| 138 | return -ENODEV; | ||
| 139 | } | ||
| 140 | |||
| 141 | /* all devices are present, probe was successful */ | ||
| 142 | DEB_D(("dpc_v4l2.o: dpc_probe succeeded for this device.\n")); | ||
| 143 | |||
| 144 | /* we store the pointer in our private data field */ | ||
| 145 | dev->ext_priv = dpc; | ||
| 146 | |||
| 147 | return 0; | ||
| 148 | } | ||
| 149 | |||
| 150 | /* bring hardware to a sane state. this has to be done, just in case someone | ||
| 151 | wants to capture from this device before it has been properly initialized. | ||
| 152 | the capture engine would badly fail, because no valid signal arrives on the | ||
| 153 | saa7146, thus leading to timeouts and stuff. */ | ||
| 154 | static int dpc_init_done(struct saa7146_dev* dev) | ||
| 155 | { | ||
| 156 | struct dpc* dpc = (struct dpc*)dev->ext_priv; | ||
| 157 | |||
| 158 | DEB_D(("dpc_v4l2.o: dpc_init_done called.\n")); | ||
| 159 | |||
| 160 | /* initialize the helper ics to useful values */ | ||
| 161 | i2c_smbus_write_byte_data(dpc->saa7111a, 0x00, 0x11); | ||
| 162 | |||
| 163 | i2c_smbus_write_byte_data(dpc->saa7111a, 0x02, 0xc0); | ||
| 164 | i2c_smbus_write_byte_data(dpc->saa7111a, 0x03, 0x30); | ||
| 165 | i2c_smbus_write_byte_data(dpc->saa7111a, 0x04, 0x00); | ||
| 166 | i2c_smbus_write_byte_data(dpc->saa7111a, 0x05, 0x00); | ||
| 167 | i2c_smbus_write_byte_data(dpc->saa7111a, 0x06, 0xde); | ||
| 168 | i2c_smbus_write_byte_data(dpc->saa7111a, 0x07, 0xad); | ||
