aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88/cx88-video.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@brturbo.com.br>2005-06-24 01:05:03 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-24 03:06:39 -0400
commitb45009b0288a96a3458f4f8e93cb776678d41875 (patch)
treec912e8d3dcc625fe92cdd1bac97bab7539fce4d7 /drivers/media/video/cx88/cx88-video.c
parent2d03e289ea4b13d78ce55f1ea0b0d45b8f1b34c3 (diff)
[PATCH] v4l: CX88 cards update
This patch adds support for various CX88 cards and allows specifying card addresses. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br> Signed-off-by: Michael Krufky <mkrufky@m1k.net> Signed-off-by: cybercide@f2s.com <cybercide@f2s.com> Signed-off-by: Catalin Climov <catalin@climov.com> Signed-off-by: Nickolay V Shmyrev <nshmyrev@yandex.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/video/cx88/cx88-video.c')
-rw-r--r--drivers/media/video/cx88/cx88-video.c59
1 files changed, 47 insertions, 12 deletions
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index d1f5c92f0ce5..e4ca7350df15 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: cx88-video.c,v 1.58 2005/03/07 15:58:05 kraxel Exp $ 2 * $Id: cx88-video.c,v 1.63 2005/06/12 04:19:19 mchehab Exp $
3 * 3 *
4 * device driver for Conexant 2388x based TV cards 4 * device driver for Conexant 2388x based TV cards
5 * video4linux video interface 5 * video4linux video interface
@@ -1187,9 +1187,24 @@ static void init_controls(struct cx8800_dev *dev)
1187 .id = V4L2_CID_AUDIO_VOLUME, 1187 .id = V4L2_CID_AUDIO_VOLUME,
1188 .value = 0x3f, 1188 .value = 0x3f,
1189 }; 1189 };
1190 static struct v4l2_control hue = {
1191 .id = V4L2_CID_HUE,
1192 .value = 0x80,
1193 };
1194 static struct v4l2_control contrast = {
1195 .id = V4L2_CID_CONTRAST,
1196 .value = 0x80,
1197 };
1198 static struct v4l2_control brightness = {
1199 .id = V4L2_CID_BRIGHTNESS,
1200 .value = 0x80,
1201 };
1190 1202
1191 set_control(dev,&mute); 1203 set_control(dev,&mute);
1192 set_control(dev,&volume); 1204 set_control(dev,&volume);
1205 set_control(dev,&hue);
1206 set_control(dev,&contrast);
1207 set_control(dev,&brightness);
1193} 1208}
1194 1209
1195/* ------------------------------------------------------------------ */ 1210/* ------------------------------------------------------------------ */
@@ -1336,6 +1351,9 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
1336 V4L2_CAP_STREAMING | 1351 V4L2_CAP_STREAMING |
1337 V4L2_CAP_VBI_CAPTURE | 1352 V4L2_CAP_VBI_CAPTURE |
1338#if 0 1353#if 0
1354 V4L2_TUNER_CAP_LOW |
1355#endif
1356#if 0
1339 V4L2_CAP_VIDEO_OVERLAY | 1357 V4L2_CAP_VIDEO_OVERLAY |
1340#endif 1358#endif
1341 0; 1359 0;
@@ -1696,7 +1714,11 @@ static int radio_do_ioctl(struct inode *inode, struct file *file,
1696 sizeof(cap->card)); 1714 sizeof(cap->card));
1697 sprintf(cap->bus_info,"PCI:%s", pci_name(dev->pci)); 1715 sprintf(cap->bus_info,"PCI:%s", pci_name(dev->pci));
1698 cap->version = CX88_VERSION_CODE; 1716 cap->version = CX88_VERSION_CODE;
1699 cap->capabilities = V4L2_CAP_TUNER; 1717 cap->capabilities = V4L2_CAP_TUNER
1718#if 0
1719 | V4L2_TUNER_CAP_LOW
1720#endif
1721 ;
1700 return 0; 1722 return 0;
1701 } 1723 }
1702 case VIDIOC_G_TUNER: 1724 case VIDIOC_G_TUNER:
@@ -1992,6 +2014,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
1992{ 2014{
1993 struct cx8800_dev *dev; 2015 struct cx8800_dev *dev;
1994 struct cx88_core *core; 2016 struct cx88_core *core;
2017 struct tuner_addr tun_addr;
1995 int err; 2018 int err;
1996 2019
1997 dev = kmalloc(sizeof(*dev),GFP_KERNEL); 2020 dev = kmalloc(sizeof(*dev),GFP_KERNEL);
@@ -2065,8 +2088,19 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
2065 request_module("tuner"); 2088 request_module("tuner");
2066 if (core->tda9887_conf) 2089 if (core->tda9887_conf)
2067 request_module("tda9887"); 2090 request_module("tda9887");
2068 if (core->tuner_type != UNSET) 2091 if (core->radio_type != UNSET) {
2069 cx88_call_i2c_clients(dev->core,TUNER_SET_TYPE,&core->tuner_type); 2092 tun_addr.v4l2_tuner = V4L2_TUNER_RADIO;
2093 tun_addr.type = core->radio_type;
2094 tun_addr.addr = core->radio_addr;
2095 cx88_call_i2c_clients(dev->core,TUNER_SET_TYPE_ADDR, &tun_addr);
2096 }
2097 if (core->tuner_type != UNSET) {
2098 tun_addr.v4l2_tuner = V4L2_TUNER_ANALOG_TV;
2099 tun_addr.type = core->tuner_type;
2100 tun_addr.addr = core->tuner_addr;
2101 cx88_call_i2c_clients(dev->core,TUNER_SET_TYPE_ADDR, &tun_addr);
2102 }
2103
2070 if (core->tda9887_conf) 2104 if (core->tda9887_conf)
2071 cx88_call_i2c_clients(dev->core,TDA9887_SET_CONFIG,&core->tda9887_conf); 2105 cx88_call_i2c_clients(dev->core,TDA9887_SET_CONFIG,&core->tda9887_conf);
2072 2106
@@ -2162,7 +2196,7 @@ static void __devexit cx8800_finidev(struct pci_dev *pci_dev)
2162 2196
2163static int cx8800_suspend(struct pci_dev *pci_dev, pm_message_t state) 2197static int cx8800_suspend(struct pci_dev *pci_dev, pm_message_t state)
2164{ 2198{
2165 struct cx8800_dev *dev = pci_get_drvdata(pci_dev); 2199 struct cx8800_dev *dev = pci_get_drvdata(pci_dev);
2166 struct cx88_core *core = dev->core; 2200 struct cx88_core *core = dev->core;
2167 2201
2168 /* stop video+vbi capture */ 2202 /* stop video+vbi capture */
@@ -2194,7 +2228,7 @@ static int cx8800_suspend(struct pci_dev *pci_dev, pm_message_t state)
2194 2228
2195static int cx8800_resume(struct pci_dev *pci_dev) 2229static int cx8800_resume(struct pci_dev *pci_dev)
2196{ 2230{
2197 struct cx8800_dev *dev = pci_get_drvdata(pci_dev); 2231 struct cx8800_dev *dev = pci_get_drvdata(pci_dev);
2198 struct cx88_core *core = dev->core; 2232 struct cx88_core *core = dev->core;
2199 2233
2200 if (dev->state.disabled) { 2234 if (dev->state.disabled) {
@@ -2230,8 +2264,8 @@ static struct pci_device_id cx8800_pci_tbl[] = {
2230 { 2264 {
2231 .vendor = 0x14f1, 2265 .vendor = 0x14f1,
2232 .device = 0x8800, 2266 .device = 0x8800,
2233 .subvendor = PCI_ANY_ID, 2267 .subvendor = PCI_ANY_ID,
2234 .subdevice = PCI_ANY_ID, 2268 .subdevice = PCI_ANY_ID,
2235 },{ 2269 },{
2236 /* --- end of list --- */ 2270 /* --- end of list --- */
2237 } 2271 }
@@ -2239,10 +2273,10 @@ static struct pci_device_id cx8800_pci_tbl[] = {
2239MODULE_DEVICE_TABLE(pci, cx8800_pci_tbl); 2273MODULE_DEVICE_TABLE(pci, cx8800_pci_tbl);
2240 2274
2241static struct pci_driver cx8800_pci_driver = { 2275static struct pci_driver cx8800_pci_driver = {
2242 .name = "cx8800", 2276 .name = "cx8800",
2243 .id_table = cx8800_pci_tbl, 2277 .id_table = cx8800_pci_tbl,
2244 .probe = cx8800_initdev, 2278 .probe = cx8800_initdev,
2245 .remove = __devexit_p(cx8800_finidev), 2279 .remove = __devexit_p(cx8800_finidev),
2246 2280
2247 .suspend = cx8800_suspend, 2281 .suspend = cx8800_suspend,
2248 .resume = cx8800_resume, 2282 .resume = cx8800_resume,
@@ -2274,4 +2308,5 @@ module_exit(cx8800_fini);
2274 * Local variables: 2308 * Local variables:
2275 * c-basic-offset: 8 2309 * c-basic-offset: 8
2276 * End: 2310 * End:
2311 * kate: eol "unix"; indent-width 3; remove-trailing-space on; replace-trailing-space-save on; tab-width 8; replace-tabs off; space-indent off; mixed-indent off
2277 */ 2312 */