aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7134
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-17 00:15:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-17 00:15:42 -0400
commit0dd5198672dd2bbeb933862e1fc82162e0b636be (patch)
treec9efed20d90603c4d1626c21bd7aab1e7fc74a58 /drivers/media/video/saa7134
parentc868d550115b9ccc0027c67265b9520790f05601 (diff)
parent11c635a25b9f3a5d87409ce46cf2e05c500251ec (diff)
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (425 commits) V4L/DVB (11870): gspca - main: VIDIOC_ENUM_FRAMESIZES ioctl added. V4L/DVB (12004): poll method lose race condition V4L/DVB (11894): flexcop-pci: dmesg visible names broken V4L/DVB (11892): Siano: smsendian - declare function as extern V4L/DVB (11891): Siano: smscore - bind the GPIO SMS protocol V4L/DVB (11890): Siano: smscore - remove redundant code V4L/DVB (11889): Siano: smsdvb - add DVB v3 events V4L/DVB (11888): Siano: smsusb - remove redundant ifdef V4L/DVB (11887): Siano: smscards - add board (target) events V4L/DVB (11886): Siano: smscore - fix some new GPIO definitions names V4L/DVB (11885): Siano: Add new GPIO management interface V4L/DVB (11884): Siano: smssdio - revert to stand alone module V4L/DVB (11883): Siano: cards - add two additional (USB) devices V4L/DVB (11824): Siano: smsusb - change exit func debug msg V4L/DVB (11823): Siano: smsusb - fix typo in module description V4L/DVB (11822): Siano: smscore - bug fix at get_device_mode V4L/DVB (11821): Siano: smscore - fix isdb-t firmware name V4L/DVB (11820): Siano: smscore - fix byte ordering bug V4L/DVB (11819): Siano: smscore - fix get_common_buffer bug V4L/DVB (11818): Siano: smscards - assign gpio to HPG targets ...
Diffstat (limited to 'drivers/media/video/saa7134')
-rw-r--r--drivers/media/video/saa7134/Kconfig1
-rw-r--r--drivers/media/video/saa7134/Makefile3
-rw-r--r--drivers/media/video/saa7134/saa7134-cards.c450
-rw-r--r--drivers/media/video/saa7134/saa7134-core.c18
-rw-r--r--drivers/media/video/saa7134/saa7134-dvb.c26
-rw-r--r--drivers/media/video/saa7134/saa7134-empress.c14
-rw-r--r--drivers/media/video/saa7134/saa7134-i2c.c33
-rw-r--r--drivers/media/video/saa7134/saa7134-input.c118
-rw-r--r--drivers/media/video/saa7134/saa7134-ts.c122
-rw-r--r--drivers/media/video/saa7134/saa7134-video.c10
-rw-r--r--drivers/media/video/saa7134/saa7134.h29
11 files changed, 660 insertions, 164 deletions
diff --git a/drivers/media/video/saa7134/Kconfig b/drivers/media/video/saa7134/Kconfig
index 0ba68987bfce..5bcce092e804 100644
--- a/drivers/media/video/saa7134/Kconfig
+++ b/drivers/media/video/saa7134/Kconfig
@@ -44,6 +44,7 @@ config VIDEO_SAA7134_DVB
44 select DVB_LNBP21 if !DVB_FE_CUSTOMISE 44 select DVB_LNBP21 if !DVB_FE_CUSTOMISE
45 select DVB_ZL10353 if !DVB_FE_CUSTOMISE 45 select DVB_ZL10353 if !DVB_FE_CUSTOMISE
46 select DVB_LGDT3305 if !DVB_FE_CUSTOMISE 46 select DVB_LGDT3305 if !DVB_FE_CUSTOMISE
47 select DVB_TDA10048 if !DVB_FE_CUSTOMISE
47 select MEDIA_TUNER_TDA18271 if !MEDIA_TUNER_CUSTOMISE 48 select MEDIA_TUNER_TDA18271 if !MEDIA_TUNER_CUSTOMISE
48 select MEDIA_TUNER_TDA8290 if !MEDIA_TUNER_CUSTOMISE 49 select MEDIA_TUNER_TDA8290 if !MEDIA_TUNER_CUSTOMISE
49 ---help--- 50 ---help---
diff --git a/drivers/media/video/saa7134/Makefile b/drivers/media/video/saa7134/Makefile
index 3dbaa19a6d00..604158a8c235 100644
--- a/drivers/media/video/saa7134/Makefile
+++ b/drivers/media/video/saa7134/Makefile
@@ -3,8 +3,7 @@ saa7134-objs := saa7134-cards.o saa7134-core.o saa7134-i2c.o \
3 saa7134-ts.o saa7134-tvaudio.o saa7134-vbi.o \ 3 saa7134-ts.o saa7134-tvaudio.o saa7134-vbi.o \
4 saa7134-video.o saa7134-input.o 4 saa7134-video.o saa7134-input.o
5 5
6obj-$(CONFIG_VIDEO_SAA7134) += saa7134.o saa7134-empress.o \ 6obj-$(CONFIG_VIDEO_SAA7134) += saa6752hs.o saa7134.o saa7134-empress.o
7 saa6752hs.o
8 7
9obj-$(CONFIG_VIDEO_SAA7134_ALSA) += saa7134-alsa.o 8obj-$(CONFIG_VIDEO_SAA7134_ALSA) += saa7134-alsa.o
10 9
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
index fdb19449d269..06861b782b95 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -1669,6 +1669,39 @@ struct saa7134_board saa7134_boards[] = {
1669 .amux = LINE1, 1669 .amux = LINE1,
1670 }, 1670 },
1671 }, 1671 },
1672 [SAA7134_BOARD_AVERMEDIA_CARDBUS_501] = {
1673 /* Oldrich Jedlicka <oldium.pro@seznam.cz> */
1674 .name = "AVerMedia Cardbus TV/Radio (E501R)",
1675 .audio_clock = 0x187de7,
1676 .tuner_type = TUNER_ALPS_TSBE5_PAL,
1677 .radio_type = TUNER_TEA5767,
1678 .tuner_addr = 0x61,
1679 .radio_addr = 0x60,
1680 .tda9887_conf = TDA9887_PRESENT,
1681 .gpiomask = 0x08000000,
1682 .inputs = { {
1683 .name = name_tv,
1684 .vmux = 1,
1685 .amux = TV,
1686 .tv = 1,
1687 .gpio = 0x08000000,
1688 }, {
1689 .name = name_comp1,
1690 .vmux = 3,
1691 .amux = LINE1,
1692 .gpio = 0x08000000,
1693 }, {
1694 .name = name_svideo,
1695 .vmux = 8,
1696 .amux = LINE1,
1697 .gpio = 0x08000000,
1698 } },
1699 .radio = {
1700 .name = name_radio,
1701 .amux = LINE2,
1702 .gpio = 0x00000000,
1703 },
1704 },
1672 [SAA7134_BOARD_CINERGY400_CARDBUS] = { 1705 [SAA7134_BOARD_CINERGY400_CARDBUS] = {
1673 .name = "Terratec Cinergy 400 mobile", 1706 .name = "Terratec Cinergy 400 mobile",
1674 .audio_clock = 0x187de7, 1707 .audio_clock = 0x187de7,
@@ -3331,13 +3364,15 @@ struct saa7134_board saa7134_boards[] = {
3331 }, 3364 },
3332 }, 3365 },
3333 [SAA7134_BOARD_HAUPPAUGE_HVR1110R3] = { 3366 [SAA7134_BOARD_HAUPPAUGE_HVR1110R3] = {
3334 .name = "Hauppauge WinTV-HVR1110r3", 3367 .name = "Hauppauge WinTV-HVR1110r3 DVB-T/Hybrid",
3335 .audio_clock = 0x00187de7, 3368 .audio_clock = 0x00187de7,
3336 .tuner_type = TUNER_PHILIPS_TDA8290, 3369 .tuner_type = TUNER_PHILIPS_TDA8290,
3337 .radio_type = UNSET, 3370 .radio_type = UNSET,
3338 .tuner_addr = ADDR_UNSET, 3371 .tuner_addr = ADDR_UNSET,
3339 .radio_addr = ADDR_UNSET, 3372 .radio_addr = ADDR_UNSET,
3340 .tuner_config = 3, 3373 .tuner_config = 3,
3374 .mpeg = SAA7134_MPEG_DVB,
3375 .ts_type = SAA7134_MPEG_TS_SERIAL,
3341 .gpiomask = 0x0800100, /* GPIO 21 is an INPUT */ 3376 .gpiomask = 0x0800100, /* GPIO 21 is an INPUT */
3342 .inputs = {{ 3377 .inputs = {{
3343 .name = name_tv, 3378 .name = name_tv,
@@ -4006,7 +4041,7 @@ struct saa7134_board saa7134_boards[] = {
4006 [SAA7134_BOARD_BEHOLD_505FM] = { 4041 [SAA7134_BOARD_BEHOLD_505FM] = {
4007 /* Beholder Intl. Ltd. 2008 */ 4042 /* Beholder Intl. Ltd. 2008 */
4008 /*Dmitry Belimov <d.belimov@gmail.com> */ 4043 /*Dmitry Belimov <d.belimov@gmail.com> */
4009 .name = "Beholder BeholdTV 505 FM/RDS", 4044 .name = "Beholder BeholdTV 505 FM",
4010 .audio_clock = 0x00200000, 4045 .audio_clock = 0x00200000,
4011 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, 4046 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
4012 .radio_type = UNSET, 4047 .radio_type = UNSET,
@@ -4019,6 +4054,40 @@ struct saa7134_board saa7134_boards[] = {
4019 .vmux = 3, 4054 .vmux = 3,
4020 .amux = LINE2, 4055 .amux = LINE2,
4021 .tv = 1, 4056 .tv = 1,
4057 }, {
4058 .name = name_comp1,
4059 .vmux = 1,
4060 .amux = LINE1,
4061 }, {
4062 .name = name_svideo,
4063 .vmux = 8,
4064 .amux = LINE1,
4065 } },
4066 .mute = {
4067 .name = name_mute,
4068 .amux = LINE1,
4069 },
4070 .radio = {
4071 .name = name_radio,
4072 .amux = LINE2,
4073 },
4074 },
4075 [SAA7134_BOARD_BEHOLD_505RDS] = {
4076 /* Beholder Intl. Ltd. 2008 */
4077 /*Dmitry Belimov <d.belimov@gmail.com> */
4078 .name = "Beholder BeholdTV 505 RDS",
4079 .audio_clock = 0x00200000,
4080 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, /* FIXME to MK5 */
4081 .radio_type = UNSET,
4082 .tuner_addr = ADDR_UNSET,
4083 .radio_addr = ADDR_UNSET,
4084 .tda9887_conf = TDA9887_PRESENT,
4085 .gpiomask = 0x00008000,
4086 .inputs = {{
4087 .name = name_tv,
4088 .vmux = 3,
4089 .amux = LINE2,
4090 .tv = 1,
4022 },{ 4091 },{
4023 .name = name_comp1, 4092 .name = name_comp1,
4024 .vmux = 1, 4093 .vmux = 1,
@@ -4040,7 +4109,7 @@ struct saa7134_board saa7134_boards[] = {
4040 [SAA7134_BOARD_BEHOLD_507_9FM] = { 4109 [SAA7134_BOARD_BEHOLD_507_9FM] = {
4041 /* Beholder Intl. Ltd. 2008 */ 4110 /* Beholder Intl. Ltd. 2008 */
4042 /*Dmitry Belimov <d.belimov@gmail.com> */ 4111 /*Dmitry Belimov <d.belimov@gmail.com> */
4043 .name = "Beholder BeholdTV 507 FM/RDS / BeholdTV 509 FM", 4112 .name = "Beholder BeholdTV 507 FM / BeholdTV 509 FM",
4044 .audio_clock = 0x00187de7, 4113 .audio_clock = 0x00187de7,
4045 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, 4114 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
4046 .radio_type = UNSET, 4115 .radio_type = UNSET,
@@ -4067,6 +4136,66 @@ struct saa7134_board saa7134_boards[] = {
4067 .amux = LINE2, 4136 .amux = LINE2,
4068 }, 4137 },
4069 }, 4138 },
4139 [SAA7134_BOARD_BEHOLD_507RDS_MK5] = {
4140 /* Beholder Intl. Ltd. 2008 */
4141 /*Dmitry Belimov <d.belimov@gmail.com> */
4142 .name = "Beholder BeholdTV 507 RDS",
4143 .audio_clock = 0x00187de7,
4144 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, /* FIXME to MK5 */
4145 .radio_type = UNSET,
4146 .tuner_addr = ADDR_UNSET,
4147 .radio_addr = ADDR_UNSET,
4148 .tda9887_conf = TDA9887_PRESENT,
4149 .gpiomask = 0x00008000,
4150 .inputs = {{
4151 .name = name_tv,
4152 .vmux = 3,
4153 .amux = TV,
4154 .tv = 1,
4155 }, {
4156 .name = name_comp1,
4157 .vmux = 1,
4158 .amux = LINE1,
4159 }, {
4160 .name = name_svideo,
4161 .vmux = 8,
4162 .amux = LINE1,
4163 } },
4164 .radio = {
4165 .name = name_radio,
4166 .amux = LINE2,
4167 },
4168 },
4169 [SAA7134_BOARD_BEHOLD_507RDS_MK3] = {
4170 /* Beholder Intl. Ltd. 2008 */
4171 /*Dmitry Belimov <d.belimov@gmail.com> */
4172 .name = "Beholder BeholdTV 507 RDS",
4173 .audio_clock = 0x00187de7,
4174 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
4175 .radio_type = UNSET,
4176 .tuner_addr = ADDR_UNSET,
4177 .radio_addr = ADDR_UNSET,
4178 .tda9887_conf = TDA9887_PRESENT,
4179 .gpiomask = 0x00008000,
4180 .inputs = {{
4181 .name = name_tv,
4182 .vmux = 3,
4183 .amux = TV,
4184 .tv = 1,
4185 }, {
4186 .name = name_comp1,
4187 .vmux = 1,
4188 .amux = LINE1,
4189 }, {
4190 .name = name_svideo,
4191 .vmux = 8,
4192 .amux = LINE1,
4193 } },
4194 .radio = {
4195 .name = name_radio,
4196 .amux = LINE2,
4197 },
4198 },
4070 [SAA7134_BOARD_BEHOLD_COLUMBUS_TVFM] = { 4199 [SAA7134_BOARD_BEHOLD_COLUMBUS_TVFM] = {
4071 /* Beholder Intl. Ltd. 2008 */ 4200 /* Beholder Intl. Ltd. 2008 */
4072 /*Dmitry Belimov <d.belimov@gmail.com> */ 4201 /*Dmitry Belimov <d.belimov@gmail.com> */
@@ -4101,9 +4230,121 @@ struct saa7134_board saa7134_boards[] = {
4101 .gpio = 0x000A8000, 4230 .gpio = 0x000A8000,
4102 }, 4231 },
4103 }, 4232 },
4104 [SAA7134_BOARD_BEHOLD_607_9FM] = { 4233 [SAA7134_BOARD_BEHOLD_607FM_MK3] = {
4234 /* Andrey Melnikoff <temnota@kmv.ru> */
4235 .name = "Beholder BeholdTV 607 FM",
4236 .audio_clock = 0x00187de7,
4237 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
4238 .radio_type = UNSET,
4239 .tuner_addr = ADDR_UNSET,
4240 .radio_addr = ADDR_UNSET,
4241 .tda9887_conf = TDA9887_PRESENT,
4242 .inputs = {{
4243 .name = name_tv,
4244 .vmux = 3,
4245 .amux = TV,
4246 .tv = 1,
4247 }, {
4248 .name = name_comp1,
4249 .vmux = 1,
4250 .amux = LINE1,
4251 }, {
4252 .name = name_svideo,
4253 .vmux = 8,
4254 .amux = LINE1,
4255 } },
4256 .radio = {
4257 .name = name_radio,
4258 .amux = LINE2,
4259 },
4260 },
4261 [SAA7134_BOARD_BEHOLD_609FM_MK3] = {
4262 /* Andrey Melnikoff <temnota@kmv.ru> */
4263 .name = "Beholder BeholdTV 609 FM",
4264 .audio_clock = 0x00187de7,
4265 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
4266 .radio_type = UNSET,
4267 .tuner_addr = ADDR_UNSET,
4268 .radio_addr = ADDR_UNSET,
4269 .tda9887_conf = TDA9887_PRESENT,
4270 .inputs = {{
4271 .name = name_tv,
4272 .vmux = 3,
4273 .amux = TV,
4274 .tv = 1,
4275 }, {
4276 .name = name_comp1,
4277 .vmux = 1,
4278 .amux = LINE1,
4279 }, {
4280 .name = name_svideo,
4281 .vmux = 8,
4282 .amux = LINE1,
4283 } },
4284 .radio = {
4285 .name = name_radio,
4286 .amux = LINE2,
4287 },
4288 },
4289 [SAA7134_BOARD_BEHOLD_607FM_MK5] = {
4290 /* Andrey Melnikoff <temnota@kmv.ru> */
4291 .name = "Beholder BeholdTV 607 FM",
4292 .audio_clock = 0x00187de7,
4293 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, /* FIXME to MK5 */
4294 .radio_type = UNSET,
4295 .tuner_addr = ADDR_UNSET,
4296 .radio_addr = ADDR_UNSET,
4297 .tda9887_conf = TDA9887_PRESENT,
4298 .inputs = {{
4299 .name = name_tv,
4300 .vmux = 3,
4301 .amux = TV,
4302 .tv = 1,
4303 }, {
4304 .name = name_comp1,
4305 .vmux = 1,
4306 .amux = LINE1,
4307 }, {
4308 .name = name_svideo,
4309 .vmux = 8,
4310 .amux = LINE1,
4311 } },
4312 .radio = {
4313 .name = name_radio,
4314 .amux = LINE2,
4315 },
4316 },
4317 [SAA7134_BOARD_BEHOLD_609FM_MK5] = {
4105 /* Andrey Melnikoff <temnota@kmv.ru> */ 4318 /* Andrey Melnikoff <temnota@kmv.ru> */
4106 .name = "Beholder BeholdTV 607 / BeholdTV 609", 4319 .name = "Beholder BeholdTV 609 FM",
4320 .audio_clock = 0x00187de7,
4321 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, /* FIXME to MK5 */
4322 .radio_type = UNSET,
4323 .tuner_addr = ADDR_UNSET,
4324 .radio_addr = ADDR_UNSET,
4325 .tda9887_conf = TDA9887_PRESENT,
4326 .inputs = {{
4327 .name = name_tv,
4328 .vmux = 3,
4329 .amux = TV,
4330 .tv = 1,
4331 }, {
4332 .name = name_comp1,
4333 .vmux = 1,
4334 .amux = LINE1,
4335 }, {
4336 .name = name_svideo,
4337 .vmux = 8,
4338 .amux = LINE1,
4339 } },
4340 .radio = {
4341 .name = name_radio,
4342 .amux = LINE2,
4343 },
4344 },
4345 [SAA7134_BOARD_BEHOLD_607RDS_MK3] = {
4346 /* Andrey Melnikoff <temnota@kmv.ru> */
4347 .name = "Beholder BeholdTV 607 RDS",
4107 .audio_clock = 0x00187de7, 4348 .audio_clock = 0x00187de7,
4108 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, 4349 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
4109 .radio_type = UNSET, 4350 .radio_type = UNSET,
@@ -4115,6 +4356,90 @@ struct saa7134_board saa7134_boards[] = {
4115 .vmux = 3, 4356 .vmux = 3,
4116 .amux = TV, 4357 .amux = TV,
4117 .tv = 1, 4358 .tv = 1,
4359 }, {
4360 .name = name_comp1,
4361 .vmux = 1,
4362 .amux = LINE1,
4363 }, {
4364 .name = name_svideo,
4365 .vmux = 8,
4366 .amux = LINE1,
4367 } },
4368 .radio = {
4369 .name = name_radio,
4370 .amux = LINE2,
4371 },
4372 },
4373 [SAA7134_BOARD_BEHOLD_609RDS_MK3] = {
4374 /* Andrey Melnikoff <temnota@kmv.ru> */
4375 .name = "Beholder BeholdTV 609 RDS",
4376 .audio_clock = 0x00187de7,
4377 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
4378 .radio_type = UNSET,
4379 .tuner_addr = ADDR_UNSET,
4380 .radio_addr = ADDR_UNSET,
4381 .tda9887_conf = TDA9887_PRESENT,
4382 .inputs = {{
4383 .name = name_tv,
4384 .vmux = 3,
4385 .amux = TV,
4386 .tv = 1,
4387 }, {
4388 .name = name_comp1,
4389 .vmux = 1,
4390 .amux = LINE1,
4391 }, {
4392 .name = name_svideo,
4393 .vmux = 8,
4394 .amux = LINE1,
4395 } },
4396 .radio = {
4397 .name = name_radio,
4398 .amux = LINE2,
4399 },
4400 },
4401 [SAA7134_BOARD_BEHOLD_607RDS_MK5] = {
4402 /* Andrey Melnikoff <temnota@kmv.ru> */
4403 .name = "Beholder BeholdTV 607 RDS",
4404 .audio_clock = 0x00187de7,
4405 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, /* FIXME to MK5 */
4406 .radio_type = UNSET,
4407 .tuner_addr = ADDR_UNSET,
4408 .radio_addr = ADDR_UNSET,
4409 .tda9887_conf = TDA9887_PRESENT,
4410 .inputs = {{
4411 .name = name_tv,
4412 .vmux = 3,
4413 .amux = TV,
4414 .tv = 1,
4415 }, {
4416 .name = name_comp1,
4417 .vmux = 1,
4418 .amux = LINE1,
4419 }, {
4420 .name = name_svideo,
4421 .vmux = 8,
4422 .amux = LINE1,
4423 } },
4424 .radio = {
4425 .name = name_radio,
4426 .amux = LINE2,
4427 },
4428 },
4429 [SAA7134_BOARD_BEHOLD_609RDS_MK5] = {
4430 /* Andrey Melnikoff <temnota@kmv.ru> */
4431 .name = "Beholder BeholdTV 609 RDS",
4432 .audio_clock = 0x00187de7,
4433 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, /* FIXME to MK5 */
4434 .radio_type = UNSET,
4435 .tuner_addr = ADDR_UNSET,
4436 .radio_addr = ADDR_UNSET,
4437 .tda9887_conf = TDA9887_PRESENT,
4438 .inputs = {{
4439 .name = name_tv,
4440 .vmux = 3,
4441 .amux = TV,
4442 .tv = 1,
4118 },{ 4443 },{
4119 .name = name_comp1, 4444 .name = name_comp1,
4120 .vmux = 1, 4445 .vmux = 1,
@@ -4133,6 +4458,7 @@ struct saa7134_board saa7134_boards[] = {
4133 /* Igor Kuznetsov <igk@igk.ru> */ 4458 /* Igor Kuznetsov <igk@igk.ru> */
4134 /* Andrey Melnikoff <temnota@kmv.ru> */ 4459 /* Andrey Melnikoff <temnota@kmv.ru> */
4135 /* Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com> */ 4460 /* Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com> */
4461 /* Alexey Osipov <lion-simba@pridelands.ru> */
4136 .name = "Beholder BeholdTV M6", 4462 .name = "Beholder BeholdTV M6",
4137 .audio_clock = 0x00187de7, 4463 .audio_clock = 0x00187de7,
4138 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, 4464 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
@@ -4207,10 +4533,10 @@ struct saa7134_board saa7134_boards[] = {
4207 /* Igor Kuznetsov <igk@igk.ru> */ 4533 /* Igor Kuznetsov <igk@igk.ru> */
4208 /* Andrey Melnikoff <temnota@kmv.ru> */ 4534 /* Andrey Melnikoff <temnota@kmv.ru> */
4209 /* Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com> */ 4535 /* Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com> */
4536 /* Alexey Osipov <lion-simba@pridelands.ru> */
4210 .name = "Beholder BeholdTV M6 Extra", 4537 .name = "Beholder BeholdTV M6 Extra",
4211 .audio_clock = 0x00187de7, 4538 .audio_clock = 0x00187de7,
4212 /* FIXME: Must be PHILIPS_FM1216ME_MK5*/ 4539 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, /* FIXME to MK5 */
4213 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
4214 .radio_type = UNSET, 4540 .radio_type = UNSET,
4215 .tuner_addr = ADDR_UNSET, 4541 .tuner_addr = ADDR_UNSET,
4216 .radio_addr = ADDR_UNSET, 4542 .radio_addr = ADDR_UNSET,
@@ -4465,7 +4791,6 @@ struct saa7134_board saa7134_boards[] = {
4465 .radio_type = UNSET, 4791 .radio_type = UNSET,
4466 .tuner_addr = ADDR_UNSET, 4792 .tuner_addr = ADDR_UNSET,
4467 .radio_addr = ADDR_UNSET, 4793 .radio_addr = ADDR_UNSET,
4468 .mpeg = SAA7134_MPEG_DVB,
4469 .inputs = {{ 4794 .inputs = {{
4470 .name = name_tv, 4795 .name = name_tv,
4471 .vmux = 3, 4796 .vmux = 3,
@@ -4753,6 +5078,44 @@ struct saa7134_board saa7134_boards[] = {
4753 .gpio = 0x01, 5078 .gpio = 0x01,
4754 }, 5079 },
4755 }, 5080 },
5081 [SAA7134_BOARD_AVERMEDIA_STUDIO_507UA] = {
5082 /* Andy Shevchenko <andy@smile.org.ua> */
5083 .name = "Avermedia AVerTV Studio 507UA",
5084 .audio_clock = 0x00187de7,
5085 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, /* Should be MK5 */
5086 .radio_type = UNSET,
5087 .tuner_addr = ADDR_UNSET,
5088 .radio_addr = ADDR_UNSET,
5089 .tda9887_conf = TDA9887_PRESENT,
5090 .gpiomask = 0x03,
5091 .inputs = { {
5092 .name = name_tv,
5093 .vmux = 1,
5094 .amux = TV,
5095 .tv = 1,
5096 .gpio = 0x00,
5097 }, {
5098 .name = name_comp1,
5099 .vmux = 3,
5100 .amux = LINE1,
5101 .gpio = 0x00,
5102 }, {
5103 .name = name_svideo,
5104 .vmux = 8,
5105 .amux = LINE1,
5106 .gpio = 0x00,
5107 } },
5108 .radio = {
5109 .name = name_radio,
5110 .amux = LINE2,
5111 .gpio = 0x01,
5112 },
5113 .mute = {
5114 .name = name_mute,
5115 .amux = LINE1,
5116 .gpio = 0x00,
5117 },
5118 },
4756}; 5119};
4757 5120
4758const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards); 5121const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards);
@@ -5027,6 +5390,13 @@ struct pci_device_id saa7134_pci_tbl[] = {
5027 .subdevice = 0xd6ee, 5390 .subdevice = 0xd6ee,
5028 .driver_data = SAA7134_BOARD_AVERMEDIA_CARDBUS, 5391 .driver_data = SAA7134_BOARD_AVERMEDIA_CARDBUS,
5029 },{ 5392 },{
5393 /* AVerMedia CardBus */
5394 .vendor = PCI_VENDOR_ID_PHILIPS,
5395 .device = PCI_DEVICE_ID_PHILIPS_SAA7134,
5396 .subvendor = 0x1461, /* Avermedia Technologies Inc */
5397 .subdevice = 0xb7e9,
5398 .driver_data = SAA7134_BOARD_AVERMEDIA_CARDBUS_501,
5399 }, {
5030 /* TransGear 3000TV */ 5400 /* TransGear 3000TV */
5031 .vendor = PCI_VENDOR_ID_PHILIPS, 5401 .vendor = PCI_VENDOR_ID_PHILIPS,
5032 .device = PCI_DEVICE_ID_PHILIPS_SAA7130, 5402 .device = PCI_DEVICE_ID_PHILIPS_SAA7130,
@@ -5441,6 +5811,12 @@ struct pci_device_id saa7134_pci_tbl[] = {
5441 .driver_data = SAA7134_BOARD_AVERMEDIA_STUDIO_507, 5811 .driver_data = SAA7134_BOARD_AVERMEDIA_STUDIO_507,
5442 },{ 5812 },{
5443 .vendor = PCI_VENDOR_ID_PHILIPS, 5813 .vendor = PCI_VENDOR_ID_PHILIPS,
5814 .device = PCI_DEVICE_ID_PHILIPS_SAA7134,
5815 .subvendor = 0x1461, /* Avermedia Technologies Inc */
5816 .subdevice = 0xa11b,
5817 .driver_data = SAA7134_BOARD_AVERMEDIA_STUDIO_507UA,
5818 }, {
5819 .vendor = PCI_VENDOR_ID_PHILIPS,
5444 .device = PCI_DEVICE_ID_PHILIPS_SAA7133, 5820 .device = PCI_DEVICE_ID_PHILIPS_SAA7133,
5445 .subvendor = 0x1043, 5821 .subvendor = 0x1043,
5446 .subdevice = 0x4876, 5822 .subdevice = 0x4876,
@@ -5647,14 +6023,8 @@ struct pci_device_id saa7134_pci_tbl[] = {
5647 .vendor = PCI_VENDOR_ID_PHILIPS, 6023 .vendor = PCI_VENDOR_ID_PHILIPS,
5648 .device = PCI_DEVICE_ID_PHILIPS_SAA7130, 6024 .device = PCI_DEVICE_ID_PHILIPS_SAA7130,
5649 .subvendor = 0x0000, 6025 .subvendor = 0x0000,
5650 .subdevice = 0x5051,
5651 .driver_data = SAA7134_BOARD_BEHOLD_505FM,
5652 },{
5653 .vendor = PCI_VENDOR_ID_PHILIPS,
5654 .device = PCI_DEVICE_ID_PHILIPS_SAA7130,
5655 .subvendor = 0x0000,
5656 .subdevice = 0x505B, 6026 .subdevice = 0x505B,
5657 .driver_data = SAA7134_BOARD_BEHOLD_505FM, 6027 .driver_data = SAA7134_BOARD_BEHOLD_505RDS,
5658 },{ 6028 },{
5659 .vendor = PCI_VENDOR_ID_PHILIPS, 6029 .vendor = PCI_VENDOR_ID_PHILIPS,
5660 .device = PCI_DEVICE_ID_PHILIPS_SAA7130, 6030 .device = PCI_DEVICE_ID_PHILIPS_SAA7130,
@@ -5666,13 +6036,13 @@ struct pci_device_id saa7134_pci_tbl[] = {
5666 .device = PCI_DEVICE_ID_PHILIPS_SAA7133, 6036 .device = PCI_DEVICE_ID_PHILIPS_SAA7133,
5667 .subvendor = 0x0000, 6037 .subvendor = 0x0000,
5668 .subdevice = 0x5071, 6038 .subdevice = 0x5071,
5669 .driver_data = SAA7134_BOARD_BEHOLD_507_9FM, 6039 .driver_data = SAA7134_BOARD_BEHOLD_507RDS_MK3,
5670 },{ 6040 },{
5671 .vendor = PCI_VENDOR_ID_PHILIPS, 6041 .vendor = PCI_VENDOR_ID_PHILIPS,
5672 .device = PCI_DEVICE_ID_PHILIPS_SAA7133, 6042 .device = PCI_DEVICE_ID_PHILIPS_SAA7133,
5673 .subvendor = 0x0000, 6043 .subvendor = 0x0000,
5674 .subdevice = 0x507B, 6044 .subdevice = 0x507B,
5675 .driver_data = SAA7134_BOARD_BEHOLD_507_9FM, 6045 .driver_data = SAA7134_BOARD_BEHOLD_507RDS_MK5,
5676 },{ 6046 },{
5677 .vendor = PCI_VENDOR_ID_PHILIPS, 6047 .vendor = PCI_VENDOR_ID_PHILIPS,
5678 .device = PCI_DEVICE_ID_PHILIPS_SAA7134, 6048 .device = PCI_DEVICE_ID_PHILIPS_SAA7134,
@@ -5696,49 +6066,49 @@ struct pci_device_id saa7134_pci_tbl[] = {
5696 .device = PCI_DEVICE_ID_PHILIPS_SAA7134, 6066 .device = PCI_DEVICE_ID_PHILIPS_SAA7134,
5697 .subvendor = 0x5ace, 6067 .subvendor = 0x5ace,
5698 .subdevice = 0x6070, 6068 .subdevice = 0x6070,
5699 .driver_data = SAA7134_BOARD_BEHOLD_607_9FM, 6069 .driver_data = SAA7134_BOARD_BEHOLD_607FM_MK3,
5700 },{ 6070 },{
5701 .vendor = PCI_VENDOR_ID_PHILIPS, 6071 .vendor = PCI_VENDOR_ID_PHILIPS,
5702 .device = PCI_DEVICE_ID_PHILIPS_SAA7134, 6072 .device = PCI_DEVICE_ID_PHILIPS_SAA7134,
5703 .subvendor = 0x5ace, 6073 .subvendor = 0x5ace,
5704 .subdevice = 0x6071, 6074 .subdevice = 0x6071,
5705 .driver_data = SAA7134_BOARD_BEHOLD_607_9FM, 6075 .driver_data = SAA7134_BOARD_BEHOLD_607FM_MK5,
5706 },{ 6076 },{
5707 .vendor = PCI_VENDOR_ID_PHILIPS, 6077 .vendor = PCI_VENDOR_ID_PHILIPS,
5708 .device = PCI_DEVICE_ID_PHILIPS_SAA7134, 6078 .device = PCI_DEVICE_ID_PHILIPS_SAA7134,
5709 .subvendor = 0x5ace, 6079 .subvendor = 0x5ace,
5710 .subdevice = 0x6072, 6080 .subdevice = 0x6072,
5711 .driver_data = SAA7134_BOARD_BEHOLD_607_9FM, 6081 .driver_data = SAA7134_BOARD_BEHOLD_607RDS_MK3,
5712 },{ 6082 },{
5713 .vendor = PCI_VENDOR_ID_PHILIPS, 6083 .vendor = PCI_VENDOR_ID_PHILIPS,
5714 .device = PCI_DEVICE_ID_PHILIPS_SAA7134, 6084 .device = PCI_DEVICE_ID_PHILIPS_SAA7134,
5715 .subvendor = 0x5ace, 6085 .subvendor = 0x5ace,
5716 .subdevice = 0x6073, 6086 .subdevice = 0x6073,
5717 .driver_data = SAA7134_BOARD_BEHOLD_607_9FM, 6087 .driver_data = SAA7134_BOARD_BEHOLD_607RDS_MK5,
5718 },{ 6088 },{
5719 .vendor = PCI_VENDOR_ID_PHILIPS, 6089 .vendor = PCI_VENDOR_ID_PHILIPS,
5720 .device = PCI_DEVICE_ID_PHILIPS_SAA7133, 6090 .device = PCI_DEVICE_ID_PHILIPS_SAA7133,
5721 .subvendor = 0x5ace, 6091 .subvendor = 0x5ace,
5722 .subdevice = 0x6090, 6092 .subdevice = 0x6090,
5723 .driver_data = SAA7134_BOARD_BEHOLD_607_9FM, 6093 .driver_data = SAA7134_BOARD_BEHOLD_609FM_MK3,
5724 },{ 6094 },{
5725 .vendor = PCI_VENDOR_ID_PHILIPS, 6095 .vendor = PCI_VENDOR_ID_PHILIPS,
5726 .device = PCI_DEVICE_ID_PHILIPS_SAA7133, 6096 .device = PCI_DEVICE_ID_PHILIPS_SAA7133,
5727 .subvendor = 0x5ace, 6097 .subvendor = 0x5ace,
5728 .subdevice = 0x6091, 6098 .subdevice = 0x6091,
5729 .driver_data = SAA7134_BOARD_BEHOLD_607_9FM, 6099 .driver_data = SAA7134_BOARD_BEHOLD_609FM_MK5,
5730 },{ 6100 },{
5731 .vendor = PCI_VENDOR_ID_PHILIPS, 6101 .vendor = PCI_VENDOR_ID_PHILIPS,
5732 .device = PCI_DEVICE_ID_PHILIPS_SAA7133, 6102 .device = PCI_DEVICE_ID_PHILIPS_SAA7133,
5733 .subvendor = 0x5ace, 6103 .subvendor = 0x5ace,
5734 .subdevice = 0x6092, 6104 .subdevice = 0x6092,
5735 .driver_data = SAA7134_BOARD_BEHOLD_607_9FM, 6105 .driver_data = SAA7134_BOARD_BEHOLD_609RDS_MK3,
5736 },{ 6106 },{
5737 .vendor = PCI_VENDOR_ID_PHILIPS, 6107 .vendor = PCI_VENDOR_ID_PHILIPS,
5738 .device = PCI_DEVICE_ID_PHILIPS_SAA7133, 6108 .device = PCI_DEVICE_ID_PHILIPS_SAA7133,
5739 .subvendor = 0x5ace, 6109 .subvendor = 0x5ace,
5740 .subdevice = 0x6093, 6110 .subdevice = 0x6093,
5741 .driver_data = SAA7134_BOARD_BEHOLD_607_9FM, 6111 .driver_data = SAA7134_BOARD_BEHOLD_609RDS_MK5,
5742 },{ 6112 },{
5743 .vendor = PCI_VENDOR_ID_PHILIPS, 6113 .vendor = PCI_VENDOR_ID_PHILIPS,
5744 .device = PCI_DEVICE_ID_PHILIPS_SAA7133, 6114 .device = PCI_DEVICE_ID_PHILIPS_SAA7133,
@@ -5832,6 +6202,12 @@ struct pci_device_id saa7134_pci_tbl[] = {
5832 }, { 6202 }, {
5833 .vendor = PCI_VENDOR_ID_PHILIPS, 6203 .vendor = PCI_VENDOR_ID_PHILIPS,
5834 .device = PCI_DEVICE_ID_PHILIPS_SAA7133, 6204 .device = PCI_DEVICE_ID_PHILIPS_SAA7133,
6205 .subvendor = 0x1461, /* Avermedia Technologies Inc */
6206 .subdevice = 0xf736,
6207 .driver_data = SAA7134_BOARD_AVERMEDIA_M103,
6208 }, {
6209 .vendor = PCI_VENDOR_ID_PHILIPS,
6210 .device = PCI_DEVICE_ID_PHILIPS_SAA7133,
5835 .subvendor = 0x1043, 6211 .subvendor = 0x1043,
5836 .subdevice = 0x4878, /* REV:1.02G */ 6212 .subdevice = 0x4878, /* REV:1.02G */
5837 .driver_data = SAA7134_BOARD_ASUSTeK_TIGER_3IN1, 6213 .driver_data = SAA7134_BOARD_ASUSTeK_TIGER_3IN1,
@@ -6114,7 +6490,6 @@ int saa7134_board_init1(struct saa7134_dev *dev)
6114 case SAA7134_BOARD_VIDEOMATE_DVBT_300: 6490 case SAA7134_BOARD_VIDEOMATE_DVBT_300:
6115 case SAA7134_BOARD_VIDEOMATE_DVBT_200: 6491 case SAA7134_BOARD_VIDEOMATE_DVBT_200:
6116 case SAA7134_BOARD_VIDEOMATE_DVBT_200A: 6492 case SAA7134_BOARD_VIDEOMATE_DVBT_200A:
6117 case SAA7134_BOARD_VIDEOMATE_T750:
6118 case SAA7134_BOARD_MANLI_MTV001: 6493 case SAA7134_BOARD_MANLI_MTV001:
6119 case SAA7134_BOARD_MANLI_MTV002: 6494 case SAA7134_BOARD_MANLI_MTV002:
6120 case SAA7134_BOARD_BEHOLD_409FM: 6495 case SAA7134_BOARD_BEHOLD_409FM:
@@ -6142,7 +6517,10 @@ int saa7134_board_init1(struct saa7134_dev *dev)
6142 case SAA7134_BOARD_BEHOLD_407FM: 6517 case SAA7134_BOARD_BEHOLD_407FM:
6143 case SAA7134_BOARD_BEHOLD_409: 6518 case SAA7134_BOARD_BEHOLD_409:
6144 case SAA7134_BOARD_BEHOLD_505FM: 6519 case SAA7134_BOARD_BEHOLD_505FM:
6520 case SAA7134_BOARD_BEHOLD_505RDS:
6145 case SAA7134_BOARD_BEHOLD_507_9FM: 6521 case SAA7134_BOARD_BEHOLD_507_9FM:
6522 case SAA7134_BOARD_BEHOLD_507RDS_MK3:
6523 case SAA7134_BOARD_BEHOLD_507RDS_MK5:
6146 case SAA7134_BOARD_GENIUS_TVGO_A11MCE: 6524 case SAA7134_BOARD_GENIUS_TVGO_A11MCE:
6147 case SAA7134_BOARD_REAL_ANGEL_220: 6525 case SAA7134_BOARD_REAL_ANGEL_220:
6148 case SAA7134_BOARD_KWORLD_PLUS_TV_ANALOG: 6526 case SAA7134_BOARD_KWORLD_PLUS_TV_ANALOG:
@@ -6196,6 +6574,16 @@ int saa7134_board_init1(struct saa7134_dev *dev)
6196 saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0xffffffff, 0xffffffff); 6574 saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0xffffffff, 0xffffffff);
6197 msleep(10); 6575 msleep(10);
6198 break; 6576 break;
6577 case SAA7134_BOARD_AVERMEDIA_CARDBUS_501:
6578 /* power-down tuner chip */
6579 saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x08400000, 0x08400000);
6580 saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x08400000, 0);
6581 msleep(10);
6582 saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x08400000, 0x08400000);
6583 saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x08400000, 0x08400000);
6584 msleep(10);
6585 dev->has_remote = SAA7134_REMOTE_I2C;
6586 break;
6199 case SAA7134_BOARD_AVERMEDIA_CARDBUS_506: 6587 case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
6200 saa7134_set_gpio(dev, 23, 0); 6588 saa7134_set_gpio(dev, 23, 0);
6201 msleep(10); 6589 msleep(10);
@@ -6253,7 +6641,14 @@ int saa7134_board_init1(struct saa7134_dev *dev)
6253 case SAA7134_BOARD_UPMOST_PURPLE_TV: 6641 case SAA7134_BOARD_UPMOST_PURPLE_TV:
6254 case SAA7134_BOARD_MSI_TVATANYWHERE_PLUS: 6642 case SAA7134_BOARD_MSI_TVATANYWHERE_PLUS:
6255 case SAA7134_BOARD_HAUPPAUGE_HVR1110: 6643 case SAA7134_BOARD_HAUPPAUGE_HVR1110:
6256 case SAA7134_BOARD_BEHOLD_607_9FM: 6644 case SAA7134_BOARD_BEHOLD_607FM_MK3:
6645 case SAA7134_BOARD_BEHOLD_607FM_MK5:
6646 case SAA7134_BOARD_BEHOLD_609FM_MK3:
6647 case SAA7134_BOARD_BEHOLD_609FM_MK5:
6648 case SAA7134_BOARD_BEHOLD_607RDS_MK3:
6649 case SAA7134_BOARD_BEHOLD_607RDS_MK5:
6650 case SAA7134_BOARD_BEHOLD_609RDS_MK3:
6651 case SAA7134_BOARD_BEHOLD_609RDS_MK5:
6257 case SAA7134_BOARD_BEHOLD_M6: 6652 case SAA7134_BOARD_BEHOLD_M6:
6258 case SAA7134_BOARD_BEHOLD_M63: 6653 case SAA7134_BOARD_BEHOLD_M63:
6259 case SAA7134_BOARD_BEHOLD_M6_EXTRA: 6654 case SAA7134_BOARD_BEHOLD_M6_EXTRA:
@@ -6635,6 +7030,7 @@ int saa7134_board_init2(struct saa7134_dev *dev)
6635 7030
6636 switch (dev->board) { 7031 switch (dev->board) {
6637 case SAA7134_BOARD_BEHOLD_COLUMBUS_TVFM: 7032 case SAA7134_BOARD_BEHOLD_COLUMBUS_TVFM:
7033 case SAA7134_BOARD_AVERMEDIA_CARDBUS_501:
6638 { 7034 {
6639 struct v4l2_priv_tun_config tea5767_cfg; 7035 struct v4l2_priv_tun_config tea5767_cfg;
6640 struct tea5767_ctrl ctl; 7036 struct tea5767_ctrl ctl;
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
index 2def6fec814b..94a023a14bbc 100644
--- a/drivers/media/video/saa7134/saa7134-core.c
+++ b/drivers/media/video/saa7134/saa7134-core.c
@@ -331,6 +331,10 @@ void saa7134_buffer_next(struct saa7134_dev *dev,
331 dprintk("buffer_next %p\n",NULL); 331 dprintk("buffer_next %p\n",NULL);
332 saa7134_set_dmabits(dev); 332 saa7134_set_dmabits(dev);
333 del_timer(&q->timeout); 333 del_timer(&q->timeout);
334
335 if (card_has_mpeg(dev))
336 if (dev->ts_started)
337 saa7134_ts_stop(dev);
334 } 338 }
335} 339}
336 340
@@ -416,6 +420,19 @@ int saa7134_set_dmabits(struct saa7134_dev *dev)
416 ctrl |= SAA7134_MAIN_CTRL_TE5; 420 ctrl |= SAA7134_MAIN_CTRL_TE5;
417 irq |= SAA7134_IRQ1_INTE_RA2_1 | 421 irq |= SAA7134_IRQ1_INTE_RA2_1 |
418 SAA7134_IRQ1_INTE_RA2_0; 422 SAA7134_IRQ1_INTE_RA2_0;
423
424 /* dma: setup channel 5 (= TS) */
425
426 saa_writeb(SAA7134_TS_DMA0, (dev->ts.nr_packets - 1) & 0xff);
427 saa_writeb(SAA7134_TS_DMA1,
428 ((dev->ts.nr_packets - 1) >> 8) & 0xff);
429 /* TSNOPIT=0, TSCOLAP=0 */
430 saa_writeb(SAA7134_TS_DMA2,
431 (((dev->ts.nr_packets - 1) >> 16) & 0x3f) | 0x00);
432 saa_writel(SAA7134_RS_PITCH(5), TS_PACKET_SIZE);
433 saa_writel(SAA7134_RS_CONTROL(5), SAA7134_RS_CONTROL_BURST_16 |
434 SAA7134_RS_CONTROL_ME |
435 (dev->ts.pt_ts.dma >> 12));
419 } 436 }
420 437
421 /* set task conditions + field handling */ 438 /* set task conditions + field handling */
@@ -775,7 +792,6 @@ static struct video_device *vdev_init(struct saa7134_dev *dev,
775 if (NULL == vfd) 792 if (NULL == vfd)
776 return NULL; 793 return NULL;
777 *vfd = *template; 794 *vfd = *template;
778 vfd->minor = -1;
779 vfd->v4l2_dev = &dev->v4l2_dev; 795 vfd->v4l2_dev = &dev->v4l2_dev;
780 vfd->release = video_device_release; 796 vfd->release = video_device_release;
781 vfd->debug = video_debug; 797 vfd->debug = video_debug;
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c
index 4eff1ca8593c..31930f26ffc7 100644
--- a/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/drivers/media/video/saa7134/saa7134-dvb.c
@@ -48,6 +48,7 @@
48#include "isl6405.h" 48#include "isl6405.h"
49#include "lnbp21.h" 49#include "lnbp21.h"
50#include "tuner-simple.h" 50#include "tuner-simple.h"
51#include "tda10048.h"
51#include "tda18271.h" 52#include "tda18271.h"
52#include "lgdt3305.h" 53#include "lgdt3305.h"
53#include "tda8290.h" 54#include "tda8290.h"
@@ -978,6 +979,18 @@ static struct lgdt3305_config hcw_lgdt3305_config = {
978 .vsb_if_khz = 3250, 979 .vsb_if_khz = 3250,
979}; 980};
980 981
982static struct tda10048_config hcw_tda10048_config = {
983 .demod_address = 0x10 >> 1,
984 .output_mode = TDA10048_SERIAL_OUTPUT,
985 .fwbulkwritelen = TDA10048_BULKWRITE_200,
986 .inversion = TDA10048_INVERSION_ON,
987 .dtv6_if_freq_khz = TDA10048_IF_3300,
988 .dtv7_if_freq_khz = TDA10048_IF_3500,
989 .dtv8_if_freq_khz = TDA10048_IF_4000,
990 .clk_freq_khz = TDA10048_CLK_16000,
991 .disable_gate_access = 1,
992};
993
981static struct tda18271_std_map hauppauge_tda18271_std_map = { 994static struct tda18271_std_map hauppauge_tda18271_std_map = {
982 .atsc_6 = { .if_freq = 3250, .agc_mode = 3, .std = 4, 995 .atsc_6 = { .if_freq = 3250, .agc_mode = 3, .std = 4,
983 .if_lvl = 1, .rfagc_top = 0x58, }, 996 .if_lvl = 1, .rfagc_top = 0x58, },
@@ -1106,6 +1119,19 @@ static int dvb_init(struct saa7134_dev *dev)
1106 &tda827x_cfg_2) < 0) 1119 &tda827x_cfg_2) < 0)
1107 goto dettach_frontend; 1120 goto dettach_frontend;
1108 break; 1121 break;
1122 case SAA7134_BOARD_HAUPPAUGE_HVR1110R3:
1123 fe0->dvb.frontend = dvb_attach(tda10048_attach,
1124 &hcw_tda10048_config,
1125 &dev->i2c_adap);
1126 if (fe0->dvb.frontend != NULL) {
1127 dvb_attach(tda829x_attach, fe0->dvb.frontend,
1128 &dev->i2c_adap, 0x4b,
1129 &tda829x_no_probe);
1130 dvb_attach(tda18271_attach, fe0->dvb.frontend,
1131 0x60, &dev->i2c_adap,
1132 &hcw_tda18271_config);
1133 }
1134 break;
1109 case SAA7134_BOARD_PHILIPS_TIGER: 1135 case SAA7134_BOARD_PHILIPS_TIGER:
1110 if (configure_tda827x_fe(dev, &philips_tiger_config, 1136 if (configure_tda827x_fe(dev, &philips_tiger_config,
1111 &tda827x_cfg_0) < 0) 1137 &tda827x_cfg_0) < 0)
diff --git a/drivers/media/video/saa7134/saa7134-empress.c b/drivers/media/video/saa7134/saa7134-empress.c
index 9db3472667e5..add1757f8930 100644
--- a/drivers/media/video/saa7134/saa7134-empress.c
+++ b/drivers/media/video/saa7134/saa7134-empress.c
@@ -255,6 +255,16 @@ static int empress_s_fmt_vid_cap(struct file *file, void *priv,
255 return 0; 255 return 0;
256} 256}
257 257
258static int empress_try_fmt_vid_cap(struct file *file, void *priv,
259 struct v4l2_format *f)
260{
261 struct saa7134_dev *dev = file->private_data;
262
263 f->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG;
264 f->fmt.pix.sizeimage = TS_PACKET_SIZE * dev->ts.nr_packets;
265
266 return 0;
267}
258 268
259static int empress_reqbufs(struct file *file, void *priv, 269static int empress_reqbufs(struct file *file, void *priv,
260 struct v4l2_requestbuffers *p) 270 struct v4l2_requestbuffers *p)
@@ -450,6 +460,7 @@ static const struct v4l2_file_operations ts_fops =
450static const struct v4l2_ioctl_ops ts_ioctl_ops = { 460static const struct v4l2_ioctl_ops ts_ioctl_ops = {
451 .vidioc_querycap = empress_querycap, 461 .vidioc_querycap = empress_querycap,
452 .vidioc_enum_fmt_vid_cap = empress_enum_fmt_vid_cap, 462 .vidioc_enum_fmt_vid_cap = empress_enum_fmt_vid_cap,
463 .vidioc_try_fmt_vid_cap = empress_try_fmt_vid_cap,
453 .vidioc_s_fmt_vid_cap = empress_s_fmt_vid_cap, 464 .vidioc_s_fmt_vid_cap = empress_s_fmt_vid_cap,
454 .vidioc_g_fmt_vid_cap = empress_g_fmt_vid_cap, 465 .vidioc_g_fmt_vid_cap = empress_g_fmt_vid_cap,
455 .vidioc_reqbufs = empress_reqbufs, 466 .vidioc_reqbufs = empress_reqbufs,
@@ -491,11 +502,8 @@ static void empress_signal_update(struct work_struct *work)
491 502
492 if (dev->nosignal) { 503 if (dev->nosignal) {
493 dprintk("no video signal\n"); 504 dprintk("no video signal\n");
494 ts_reset_encoder(dev);
495 } else { 505 } else {
496 dprintk("video signal acquired\n"); 506 dprintk("video signal acquired\n");
497 if (atomic_read(&dev->empress_users))
498 ts_init_encoder(dev);
499 } 507 }
500} 508}
501 509
diff --git a/drivers/media/video/saa7134/saa7134-i2c.c b/drivers/media/video/saa7134/saa7134-i2c.c
index f3e285aa2fb4..8096dace5f6c 100644
--- a/drivers/media/video/saa7134/saa7134-i2c.c
+++ b/drivers/media/video/saa7134/saa7134-i2c.c
@@ -259,7 +259,7 @@ static int saa7134_i2c_xfer(struct i2c_adapter *i2c_adap,
259 /* workaround for a saa7134 i2c bug 259 /* workaround for a saa7134 i2c bug
260 * needed to talk to the mt352 demux 260 * needed to talk to the mt352 demux
261 * thanks to pinnacle for the hint */ 261 * thanks to pinnacle for the hint */
262 int quirk = 0xfd; 262 int quirk = 0xfe;
263 d1printk(" [%02x quirk]",quirk); 263 d1printk(" [%02x quirk]",quirk);
264 i2c_send_byte(dev,START,quirk); 264 i2c_send_byte(dev,START,quirk);
265 i2c_recv_byte(dev); 265 i2c_recv_byte(dev);
@@ -321,33 +321,6 @@ static u32 functionality(struct i2c_adapter *adap)
321 return I2C_FUNC_SMBUS_EMUL; 321 return I2C_FUNC_SMBUS_EMUL;
322} 322}
323 323
324static int attach_inform(struct i2c_client *client)
325{
326 struct saa7134_dev *dev = client->adapter->algo_data;
327
328 d1printk( "%s i2c attach [addr=0x%x,client=%s]\n",
329 client->driver->driver.name, client->addr, client->name);
330
331 /* Am I an i2c remote control? */
332
333 switch (client->addr) {
334 case 0x7a:
335 case 0x47:
336 case 0x71:
337 case 0x2d:
338 case 0x30:
339 {
340 struct IR_i2c *ir = i2c_get_clientdata(client);
341 d1printk("%s i2c IR detected (%s).\n",
342 client->driver->driver.name, ir->phys);
343 saa7134_set_i2c_ir(dev,ir);
344 break;
345 }
346 }
347
348 return 0;
349}
350
351static struct i2c_algorithm saa7134_algo = { 324static struct i2c_algorithm saa7134_algo = {
352 .master_xfer = saa7134_i2c_xfer, 325 .master_xfer = saa7134_i2c_xfer,
353 .functionality = functionality, 326 .functionality = functionality,
@@ -358,7 +331,6 @@ static struct i2c_adapter saa7134_adap_template = {
358 .name = "saa7134", 331 .name = "saa7134",
359 .id = I2C_HW_SAA7134, 332 .id = I2C_HW_SAA7134,
360 .algo = &saa7134_algo, 333 .algo = &saa7134_algo,
361 .client_register = attach_inform,
362}; 334};
363 335
364static struct i2c_client saa7134_client_template = { 336static struct i2c_client saa7134_client_template = {
@@ -433,6 +405,9 @@ int saa7134_i2c_register(struct saa7134_dev *dev)
433 saa7134_i2c_eeprom(dev,dev->eedata,sizeof(dev->eedata)); 405 saa7134_i2c_eeprom(dev,dev->eedata,sizeof(dev->eedata));
434 if (i2c_scan) 406 if (i2c_scan)
435 do_i2c_scan(dev->name,&dev->i2c_client); 407 do_i2c_scan(dev->name,&dev->i2c_client);
408
409 /* Instantiate the IR receiver device, if present */
410 saa7134_probe_i2c_ir(dev);
436 return 0; 411 return 0;
437} 412}
438 413
diff --git a/drivers/media/video/saa7134/saa7134-input.c b/drivers/media/video/saa7134/saa7134-input.c
index 8a106d36e723..6e219c2db841 100644
--- a/drivers/media/video/saa7134/saa7134-input.c
+++ b/drivers/media/video/saa7134/saa7134-input.c
@@ -60,7 +60,7 @@ MODULE_PARM_DESC(disable_other_ir, "disable full codes of "
60#define dprintk(fmt, arg...) if (ir_debug) \ 60#define dprintk(fmt, arg...) if (ir_debug) \
61 printk(KERN_DEBUG "%s/ir: " fmt, dev->name , ## arg) 61 printk(KERN_DEBUG "%s/ir: " fmt, dev->name , ## arg)
62#define i2cdprintk(fmt, arg...) if (ir_debug) \ 62#define i2cdprintk(fmt, arg...) if (ir_debug) \
63 printk(KERN_DEBUG "%s/ir: " fmt, ir->c.name , ## arg) 63 printk(KERN_DEBUG "%s/ir: " fmt, ir->name , ## arg)
64 64
65/* Helper functions for RC5 and NEC decoding at GPIO16 or GPIO18 */ 65/* Helper functions for RC5 and NEC decoding at GPIO16 or GPIO18 */
66static int saa7134_rc5_irq(struct saa7134_dev *dev); 66static int saa7134_rc5_irq(struct saa7134_dev *dev);
@@ -134,10 +134,10 @@ static int get_key_msi_tvanywhere_plus(struct IR_i2c *ir, u32 *ir_key,
134 int gpio; 134 int gpio;
135 135
136 /* <dev> is needed to access GPIO. Used by the saa_readl macro. */ 136 /* <dev> is needed to access GPIO. Used by the saa_readl macro. */
137 struct saa7134_dev *dev = ir->c.adapter->algo_data; 137 struct saa7134_dev *dev = ir->c->adapter->algo_data;
138 if (dev == NULL) { 138 if (dev == NULL) {
139 dprintk("get_key_msi_tvanywhere_plus: " 139 dprintk("get_key_msi_tvanywhere_plus: "
140 "gir->c.adapter->algo_data is NULL!\n"); 140 "gir->c->adapter->algo_data is NULL!\n");
141 return -EIO; 141 return -EIO;
142 } 142 }
143 143
@@ -156,7 +156,7 @@ static int get_key_msi_tvanywhere_plus(struct IR_i2c *ir, u32 *ir_key,
156 156
157 /* GPIO says there is a button press. Get it. */ 157 /* GPIO says there is a button press. Get it. */
158 158
159 if (1 != i2c_master_recv(&ir->c, &b, 1)) { 159 if (1 != i2c_master_recv(ir->c, &b, 1)) {
160 i2cdprintk("read error\n"); 160 i2cdprintk("read error\n");
161 return -EIO; 161 return -EIO;
162 } 162 }
@@ -179,7 +179,7 @@ static int get_key_purpletv(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
179 unsigned char b; 179 unsigned char b;
180 180
181 /* poll IR chip */ 181 /* poll IR chip */
182 if (1 != i2c_master_recv(&ir->c,&b,1)) { 182 if (1 != i2c_master_recv(ir->c, &b, 1)) {
183 i2cdprintk("read error\n"); 183 i2cdprintk("read error\n");
184 return -EIO; 184 return -EIO;
185 } 185 }
@@ -202,7 +202,7 @@ static int get_key_hvr1110(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
202 unsigned char buf[5], cod4, code3, code4; 202 unsigned char buf[5], cod4, code3, code4;
203 203
204 /* poll IR chip */ 204 /* poll IR chip */
205 if (5 != i2c_master_recv(&ir->c,buf,5)) 205 if (5 != i2c_master_recv(ir->c, buf, 5))
206 return -EIO; 206 return -EIO;
207 207
208 cod4 = buf[4]; 208 cod4 = buf[4];
@@ -224,7 +224,7 @@ static int get_key_beholdm6xx(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
224 unsigned char data[12]; 224 unsigned char data[12];
225 u32 gpio; 225 u32 gpio;
226 226
227 struct saa7134_dev *dev = ir->c.adapter->algo_data; 227 struct saa7134_dev *dev = ir->c->adapter->algo_data;
228 228
229 /* rising SAA7134_GPIO_GPRESCAN reads the status */ 229 /* rising SAA7134_GPIO_GPRESCAN reads the status */
230 saa_clearb(SAA7134_GPIO_GPMODE3, SAA7134_GPIO_GPRESCAN); 230 saa_clearb(SAA7134_GPIO_GPMODE3, SAA7134_GPIO_GPRESCAN);
@@ -235,9 +235,9 @@ static int get_key_beholdm6xx(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
235 if (0x400000 & ~gpio) 235 if (0x400000 & ~gpio)
236 return 0; /* No button press */ 236 return 0; /* No button press */
237 237
238 ir->c.addr = 0x5a >> 1; 238 ir->c->addr = 0x5a >> 1;
239 239
240 if (12 != i2c_master_recv(&ir->c, data, 12)) { 240 if (12 != i2c_master_recv(ir->c, data, 12)) {
241 i2cdprintk("read error\n"); 241 i2cdprintk("read error\n");
242 return -EIO; 242 return -EIO;
243 } 243 }
@@ -267,7 +267,7 @@ static int get_key_pinnacle(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw,
267 unsigned int start = 0,parity = 0,code = 0; 267 unsigned int start = 0,parity = 0,code = 0;
268 268
269 /* poll IR chip */ 269 /* poll IR chip */
270 if (4 != i2c_master_recv(&ir->c, b, 4)) { 270 if (4 != i2c_master_recv(ir->c, b, 4)) {
271 i2cdprintk("read error\n"); 271 i2cdprintk("read error\n");
272 return -EIO; 272 return -EIO;
273 } 273 }
@@ -447,6 +447,7 @@ int saa7134_input_init1(struct saa7134_dev *dev)
447 case SAA7134_BOARD_AVERMEDIA_STUDIO_305: 447 case SAA7134_BOARD_AVERMEDIA_STUDIO_305:
448 case SAA7134_BOARD_AVERMEDIA_STUDIO_307: 448 case SAA7134_BOARD_AVERMEDIA_STUDIO_307:
449 case SAA7134_BOARD_AVERMEDIA_STUDIO_507: 449 case SAA7134_BOARD_AVERMEDIA_STUDIO_507:
450 case SAA7134_BOARD_AVERMEDIA_STUDIO_507UA:
450 case SAA7134_BOARD_AVERMEDIA_GO_007_FM: 451 case SAA7134_BOARD_AVERMEDIA_GO_007_FM:
451 case SAA7134_BOARD_AVERMEDIA_M102: 452 case SAA7134_BOARD_AVERMEDIA_M102:
452 case SAA7134_BOARD_AVERMEDIA_GO_007_FM_PLUS: 453 case SAA7134_BOARD_AVERMEDIA_GO_007_FM_PLUS:
@@ -506,7 +507,10 @@ int saa7134_input_init1(struct saa7134_dev *dev)
506 case SAA7134_BOARD_BEHOLD_407FM: 507 case SAA7134_BOARD_BEHOLD_407FM:
507 case SAA7134_BOARD_BEHOLD_409: 508 case SAA7134_BOARD_BEHOLD_409:
508 case SAA7134_BOARD_BEHOLD_505FM: 509 case SAA7134_BOARD_BEHOLD_505FM:
510 case SAA7134_BOARD_BEHOLD_505RDS:
509 case SAA7134_BOARD_BEHOLD_507_9FM: 511 case SAA7134_BOARD_BEHOLD_507_9FM:
512 case SAA7134_BOARD_BEHOLD_507RDS_MK3:
513 case SAA7134_BOARD_BEHOLD_507RDS_MK5:
510 ir_codes = ir_codes_manli; 514 ir_codes = ir_codes_manli;
511 mask_keycode = 0x003f00; 515 mask_keycode = 0x003f00;
512 mask_keyup = 0x004000; 516 mask_keyup = 0x004000;
@@ -678,55 +682,101 @@ void saa7134_input_fini(struct saa7134_dev *dev)
678 dev->remote = NULL; 682 dev->remote = NULL;
679} 683}
680 684
681void saa7134_set_i2c_ir(struct saa7134_dev *dev, struct IR_i2c *ir) 685void saa7134_probe_i2c_ir(struct saa7134_dev *dev)
682{ 686{
687 struct i2c_board_info info;
688 struct IR_i2c_init_data init_data;
689 const unsigned short addr_list[] = {
690 0x7a, 0x47, 0x71, 0x2d,
691 I2C_CLIENT_END
692 };
693
694 struct i2c_msg msg_msi = {
695 .addr = 0x50,
696 .flags = I2C_M_RD,
697 .len = 0,
698 .buf = NULL,
699 };
700
701 int rc;
702
683 if (disable_ir) { 703 if (disable_ir) {
684 dprintk("Found supported i2c remote, but IR has been disabled\n"); 704 dprintk("IR has been disabled, not probing for i2c remote\n");
685 ir->get_key=NULL;
686 return; 705 return;
687 } 706 }
688 707
708 memset(&info, 0, sizeof(struct i2c_board_info));
709 memset(&init_data, 0, sizeof(struct IR_i2c_init_data));
710 strlcpy(info.type, "ir_video", I2C_NAME_SIZE);
711
689 switch (dev->board) { 712 switch (dev->board) {
690 case SAA7134_BOARD_PINNACLE_PCTV_110i: 713 case SAA7134_BOARD_PINNACLE_PCTV_110i:
691 case SAA7134_BOARD_PINNACLE_PCTV_310i: 714 case SAA7134_BOARD_PINNACLE_PCTV_310i:
692 snprintf(ir->c.name, sizeof(ir->c.name), "Pinnacle PCTV"); 715 init_data.name = "Pinnacle PCTV";
693 if (pinnacle_remote == 0) { 716 if (pinnacle_remote == 0) {
694 ir->get_key = get_key_pinnacle_color; 717 init_data.get_key = get_key_pinnacle_color;
695 ir->ir_codes = ir_codes_pinnacle_color; 718 init_data.ir_codes = ir_codes_pinnacle_color;
696 } else { 719 } else {
697 ir->get_key = get_key_pinnacle_grey; 720 init_data.get_key = get_key_pinnacle_grey;
698 ir->ir_codes = ir_codes_pinnacle_grey; 721 init_data.ir_codes = ir_codes_pinnacle_grey;
699 } 722 }
700 break; 723 break;
701 case SAA7134_BOARD_UPMOST_PURPLE_TV: 724 case SAA7134_BOARD_UPMOST_PURPLE_TV:
702 snprintf(ir->c.name, sizeof(ir->c.name), "Purple TV"); 725 init_data.name = "Purple TV";
703 ir->get_key = get_key_purpletv; 726 init_data.get_key = get_key_purpletv;
704 ir->ir_codes = ir_codes_purpletv; 727 init_data.ir_codes = ir_codes_purpletv;
705 break; 728 break;
706 case SAA7134_BOARD_MSI_TVATANYWHERE_PLUS: 729 case SAA7134_BOARD_MSI_TVATANYWHERE_PLUS:
707 snprintf(ir->c.name, sizeof(ir->c.name), "MSI TV@nywhere Plus"); 730 init_data.name = "MSI TV@nywhere Plus";
708 ir->get_key = get_key_msi_tvanywhere_plus; 731 init_data.get_key = get_key_msi_tvanywhere_plus;
709 ir->ir_codes = ir_codes_msi_tvanywhere_plus; 732 init_data.ir_codes = ir_codes_msi_tvanywhere_plus;
733 info.addr = 0x30;
734 /* MSI TV@nywhere Plus controller doesn't seem to
735 respond to probes unless we read something from
736 an existing device. Weird...
737 REVISIT: might no longer be needed */
738 rc = i2c_transfer(&dev->i2c_adap, &msg_msi, 1);
739 dprintk(KERN_DEBUG "probe 0x%02x @ %s: %s\n",
740 msg_msi.addr, dev->i2c_adap.name,
741 (1 == rc) ? "yes" : "no");
710 break; 742 break;
711 case SAA7134_BOARD_HAUPPAUGE_HVR1110: 743 case SAA7134_BOARD_HAUPPAUGE_HVR1110:
712 snprintf(ir->c.name, sizeof(ir->c.name), "HVR 1110"); 744 init_data.name = "HVR 1110";
713 ir->get_key = get_key_hvr1110; 745 init_data.get_key = get_key_hvr1110;
714 ir->ir_codes = ir_codes_hauppauge_new; 746 init_data.ir_codes = ir_codes_hauppauge_new;
715 break; 747 break;
716 case SAA7134_BOARD_BEHOLD_607_9FM: 748 case SAA7134_BOARD_BEHOLD_607FM_MK3:
749 case SAA7134_BOARD_BEHOLD_607FM_MK5:
750 case SAA7134_BOARD_BEHOLD_609FM_MK3:
751 case SAA7134_BOARD_BEHOLD_609FM_MK5:
752 case SAA7134_BOARD_BEHOLD_607RDS_MK3:
753 case SAA7134_BOARD_BEHOLD_607RDS_MK5:
754 case SAA7134_BOARD_BEHOLD_609RDS_MK3:
755 case SAA7134_BOARD_BEHOLD_609RDS_MK5:
717 case SAA7134_BOARD_BEHOLD_M6: 756 case SAA7134_BOARD_BEHOLD_M6:
718 case SAA7134_BOARD_BEHOLD_M63: 757 case SAA7134_BOARD_BEHOLD_M63:
719 case SAA7134_BOARD_BEHOLD_M6_EXTRA: 758 case SAA7134_BOARD_BEHOLD_M6_EXTRA:
720 case SAA7134_BOARD_BEHOLD_H6: 759 case SAA7134_BOARD_BEHOLD_H6:
721 snprintf(ir->c.name, sizeof(ir->c.name), "BeholdTV"); 760 init_data.name = "BeholdTV";
722 ir->get_key = get_key_beholdm6xx; 761 init_data.get_key = get_key_beholdm6xx;
723 ir->ir_codes = ir_codes_behold; 762 init_data.ir_codes = ir_codes_behold;
724 break; 763 break;
725 default: 764 case SAA7134_BOARD_AVERMEDIA_CARDBUS_501:
726 dprintk("Shouldn't get here: Unknown board %x for I2C IR?\n",dev->board); 765 case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
766 info.addr = 0x40;
727 break; 767 break;
728 } 768 }
729 769
770 if (init_data.name)
771 info.platform_data = &init_data;
772 /* No need to probe if address is known */
773 if (info.addr) {
774 i2c_new_device(&dev->i2c_adap, &info);
775 return;
776 }
777
778 /* Address not known, fallback to probing */
779 i2c_new_probed_device(&dev->i2c_adap, &info, addr_list);
730} 780}
731 781
732static int saa7134_rc5_irq(struct saa7134_dev *dev) 782static int saa7134_rc5_irq(struct saa7134_dev *dev)
diff --git a/drivers/media/video/saa7134/saa7134-ts.c b/drivers/media/video/saa7134/saa7134-ts.c
index cc8b923afbc0..3fa652279ac0 100644
--- a/drivers/media/video/saa7134/saa7134-ts.c
+++ b/drivers/media/video/saa7134/saa7134-ts.c
@@ -65,35 +65,10 @@ static int buffer_activate(struct saa7134_dev *dev,
65 /* start DMA */ 65 /* start DMA */
66 saa7134_set_dmabits(dev); 66 saa7134_set_dmabits(dev);
67 67
68 mod_timer(&dev->ts_q.timeout, jiffies+BUFFER_TIMEOUT); 68 mod_timer(&dev->ts_q.timeout, jiffies+TS_BUFFER_TIMEOUT);
69
70 if (dev->ts_state == SAA7134_TS_BUFF_DONE) {
71 /* Clear TS cache */
72 dev->buff_cnt = 0;
73 saa_writeb(SAA7134_TS_SERIAL1, 0x00);
74 saa_writeb(SAA7134_TS_SERIAL1, 0x03);
75 saa_writeb(SAA7134_TS_SERIAL1, 0x00);
76 saa_writeb(SAA7134_TS_SERIAL1, 0x01);
77
78 /* TS clock non-inverted */
79 saa_writeb(SAA7134_TS_SERIAL1, 0x00);
80
81 /* Start TS stream */
82 switch (saa7134_boards[dev->board].ts_type) {
83 case SAA7134_MPEG_TS_PARALLEL:
84 saa_writeb(SAA7134_TS_SERIAL0, 0x40);
85 saa_writeb(SAA7134_TS_PARALLEL, 0xec);
86 break;
87 case SAA7134_MPEG_TS_SERIAL:
88 saa_writeb(SAA7134_TS_SERIAL0, 0xd8);
89 saa_writeb(SAA7134_TS_PARALLEL, 0x6c);
90 saa_writeb(SAA7134_TS_PARALLEL_SERIAL, 0xbc);
91 saa_writeb(SAA7134_TS_SERIAL1, 0x02);
92 break;
93 }
94 69
95 dev->ts_state = SAA7134_TS_STARTED; 70 if (!dev->ts_started)
96 } 71 saa7134_ts_start(dev);
97 72
98 return 0; 73 return 0;
99} 74}
@@ -104,7 +79,6 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,
104 struct saa7134_dev *dev = q->priv_data; 79 struct saa7134_dev *dev = q->priv_data;
105 struct saa7134_buf *buf = container_of(vb,struct saa7134_buf,vb); 80 struct saa7134_buf *buf = container_of(vb,struct saa7134_buf,vb);
106 unsigned int lines, llength, size; 81 unsigned int lines, llength, size;
107 u32 control;
108 int err; 82 int err;
109 83
110 dprintk("buffer_prepare [%p,%s]\n",buf,v4l2_field_names[field]); 84 dprintk("buffer_prepare [%p,%s]\n",buf,v4l2_field_names[field]);
@@ -121,8 +95,11 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,
121 } 95 }
122 96
123 if (VIDEOBUF_NEEDS_INIT == buf->vb.state) { 97 if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
98
124 struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb); 99 struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb);
125 100
101 dprintk("buffer_prepare: needs_init\n");
102
126 buf->vb.width = llength; 103 buf->vb.width = llength;
127 buf->vb.height = lines; 104 buf->vb.height = lines;
128 buf->vb.size = size; 105 buf->vb.size = size;
@@ -139,23 +116,6 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,
139 goto oops; 116 goto oops;
140 } 117 }
141 118
142 dev->buff_cnt++;
143
144 if (dev->buff_cnt == dev->ts.nr_bufs) {
145 dev->ts_state = SAA7134_TS_BUFF_DONE;
146 /* dma: setup channel 5 (= TS) */
147 control = SAA7134_RS_CONTROL_BURST_16 |
148 SAA7134_RS_CONTROL_ME |
149 (buf->pt->dma >> 12);
150
151 saa_writeb(SAA7134_TS_DMA0, (lines - 1) & 0xff);
152 saa_writeb(SAA7134_TS_DMA1, ((lines - 1) >> 8) & 0xff);
153 /* TSNOPIT=0, TSCOLAP=0 */
154 saa_writeb(SAA7134_TS_DMA2, (((lines - 1) >> 16) & 0x3f) | 0x00);
155 saa_writel(SAA7134_RS_PITCH(5), TS_PACKET_SIZE);
156 saa_writel(SAA7134_RS_CONTROL(5), control);
157 }
158
159 buf->vb.state = VIDEOBUF_PREPARED; 119 buf->vb.state = VIDEOBUF_PREPARED;
160 buf->activate = buffer_activate; 120 buf->activate = buffer_activate;
161 buf->vb.field = field; 121 buf->vb.field = field;
@@ -175,8 +135,7 @@ buffer_setup(struct videobuf_queue *q, unsigned int *count, unsigned int *size)
175 if (0 == *count) 135 if (0 == *count)
176 *count = dev->ts.nr_bufs; 136 *count = dev->ts.nr_bufs;
177 *count = saa7134_buffer_count(*size,*count); 137 *count = saa7134_buffer_count(*size,*count);
178 dev->buff_cnt = 0; 138
179 dev->ts_state = SAA7134_TS_STOPPED;
180 return 0; 139 return 0;
181} 140}
182 141
@@ -193,11 +152,9 @@ static void buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb)
193 struct saa7134_buf *buf = container_of(vb,struct saa7134_buf,vb); 152 struct saa7134_buf *buf = container_of(vb,struct saa7134_buf,vb);
194 struct saa7134_dev *dev = q->priv_data; 153 struct saa7134_dev *dev = q->priv_data;
195 154
196 if (dev->ts_state == SAA7134_TS_STARTED) { 155 if (dev->ts_started)
197 /* Stop TS transport */ 156 saa7134_ts_stop(dev);
198 saa_writeb(SAA7134_TS_PARALLEL, 0x6c); 157
199 dev->ts_state = SAA7134_TS_STOPPED;
200 }
201 saa7134_dma_free(q,buf); 158 saa7134_dma_free(q,buf);
202} 159}
203 160
@@ -214,7 +171,7 @@ EXPORT_SYMBOL_GPL(saa7134_ts_qops);
214 171
215static unsigned int tsbufs = 8; 172static unsigned int tsbufs = 8;
216module_param(tsbufs, int, 0444); 173module_param(tsbufs, int, 0444);
217MODULE_PARM_DESC(tsbufs,"number of ts buffers, range 2-32"); 174MODULE_PARM_DESC(tsbufs, "number of ts buffers for read/write IO, range 2-32");
218 175
219static unsigned int ts_nr_packets = 64; 176static unsigned int ts_nr_packets = 64;
220module_param(ts_nr_packets, int, 0444); 177module_param(ts_nr_packets, int, 0444);
@@ -256,6 +213,7 @@ int saa7134_ts_init1(struct saa7134_dev *dev)
256 dev->ts_q.timeout.data = (unsigned long)(&dev->ts_q); 213 dev->ts_q.timeout.data = (unsigned long)(&dev->ts_q);
257 dev->ts_q.dev = dev; 214 dev->ts_q.dev = dev;
258 dev->ts_q.need_two = 1; 215 dev->ts_q.need_two = 1;
216 dev->ts_started = 0;
259 saa7134_pgtable_alloc(dev->pci,&dev->ts.pt_ts); 217 saa7134_pgtable_alloc(dev->pci,&dev->ts.pt_ts);
260 218
261 /* init TS hw */ 219 /* init TS hw */
@@ -264,13 +222,67 @@ int saa7134_ts_init1(struct saa7134_dev *dev)
264 return 0; 222 return 0;
265} 223}
266 224
225/* Function for stop TS */
226int saa7134_ts_stop(struct saa7134_dev *dev)
227{
228 dprintk("TS stop\n");
229
230 BUG_ON(!dev->ts_started);
231
232 /* Stop TS stream */
233 switch (saa7134_boards[dev->board].ts_type) {
234 case SAA7134_MPEG_TS_PARALLEL:
235 saa_writeb(SAA7134_TS_PARALLEL, 0x6c);
236 dev->ts_started = 0;
237 break;
238 case SAA7134_MPEG_TS_SERIAL:
239 saa_writeb(SAA7134_TS_SERIAL0, 0x40);
240 dev->ts_started = 0;
241 break;
242 }
243 return 0;
244}
245
246/* Function for start TS */
247int saa7134_ts_start(struct saa7134_dev *dev)
248{
249 dprintk("TS start\n");
250
251 BUG_ON(dev->ts_started);
252
253 saa_writeb(SAA7134_TS_SERIAL1, 0x00);
254 saa_writeb(SAA7134_TS_SERIAL1, 0x03);
255 saa_writeb(SAA7134_TS_SERIAL1, 0x00);
256 saa_writeb(SAA7134_TS_SERIAL1, 0x01);
257
258 /* TS clock non-inverted */
259 saa_writeb(SAA7134_TS_SERIAL1, 0x00);
260
261 /* Start TS stream */
262 switch (saa7134_boards[dev->board].ts_type) {
263 case SAA7134_MPEG_TS_PARALLEL:
264 saa_writeb(SAA7134_TS_SERIAL0, 0x40);
265 saa_writeb(SAA7134_TS_PARALLEL, 0xec);
266 break;
267 case SAA7134_MPEG_TS_SERIAL:
268 saa_writeb(SAA7134_TS_SERIAL0, 0xd8);
269 saa_writeb(SAA7134_TS_PARALLEL, 0x6c);
270 saa_writeb(SAA7134_TS_PARALLEL_SERIAL, 0xbc);
271 saa_writeb(SAA7134_TS_SERIAL1, 0x02);
272 break;
273 }
274
275 dev->ts_started = 1;
276
277 return 0;
278}
279
267int saa7134_ts_fini(struct saa7134_dev *dev) 280int saa7134_ts_fini(struct saa7134_dev *dev)
268{ 281{
269 saa7134_pgtable_free(dev->pci,&dev->ts.pt_ts); 282 saa7134_pgtable_free(dev->pci,&dev->ts.pt_ts);
270 return 0; 283 return 0;
271} 284}
272 285
273
274void saa7134_irq_ts_done(struct saa7134_dev *dev, unsigned long status) 286void saa7134_irq_ts_done(struct saa7134_dev *dev, unsigned long status)
275{ 287{
276 enum v4l2_field field; 288 enum v4l2_field field;
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c
index 493cad941460..e305c1674cee 100644
--- a/drivers/media/video/saa7134/saa7134-video.c
+++ b/drivers/media/video/saa7134/saa7134-video.c
@@ -1057,6 +1057,7 @@ static int buffer_prepare(struct videobuf_queue *q,
1057 buf->vb.field = field; 1057 buf->vb.field = field;
1058 buf->fmt = fh->fmt; 1058 buf->fmt = fh->fmt;
1059 buf->pt = &fh->pt_cap; 1059 buf->pt = &fh->pt_cap;
1060 dev->video_q.curr = NULL;
1060 1061
1061 err = videobuf_iolock(q,&buf->vb,&dev->ovbuf); 1062 err = videobuf_iolock(q,&buf->vb,&dev->ovbuf);
1062 if (err) 1063 if (err)
@@ -1423,11 +1424,13 @@ video_poll(struct file *file, struct poll_table_struct *wait)
1423{ 1424{
1424 struct saa7134_fh *fh = file->private_data; 1425 struct saa7134_fh *fh = file->private_data;
1425 struct videobuf_buffer *buf = NULL; 1426 struct videobuf_buffer *buf = NULL;
1427 unsigned int rc = 0;
1426 1428
1427 if (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type) 1429 if (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type)
1428 return videobuf_poll_stream(file, &fh->vbi, wait); 1430 return videobuf_poll_stream(file, &fh->vbi, wait);
1429 1431
1430 if (res_check(fh,RESOURCE_VIDEO)) { 1432 if (res_check(fh,RESOURCE_VIDEO)) {
1433 mutex_lock(&fh->cap.vb_lock);
1431 if (!list_empty(&fh->cap.stream)) 1434 if (!list_empty(&fh->cap.stream))
1432 buf = list_entry(fh->cap.stream.next, struct videobuf_buffer, stream); 1435 buf = list_entry(fh->cap.stream.next, struct videobuf_buffer, stream);
1433 } else { 1436 } else {
@@ -1446,13 +1449,14 @@ video_poll(struct file *file, struct poll_table_struct *wait)
1446 } 1449 }
1447 1450
1448 if (!buf) 1451 if (!buf)
1449 return POLLERR; 1452 goto err;
1450 1453
1451 poll_wait(file, &buf->done, wait); 1454 poll_wait(file, &buf->done, wait);
1452 if (buf->state == VIDEOBUF_DONE || 1455 if (buf->state == VIDEOBUF_DONE ||
1453 buf->state == VIDEOBUF_ERROR) 1456 buf->state == VIDEOBUF_ERROR)
1454 return POLLIN|POLLRDNORM; 1457 rc = POLLIN|POLLRDNORM;
1455 return 0; 1458 mutex_unlock(&fh->cap.vb_lock);
1459 return rc;
1456 1460
1457err: 1461err:
1458 mutex_unlock(&fh->cap.vb_lock); 1462 mutex_unlock(&fh->cap.vb_lock);
diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h
index 0cbaf90d4874..82268848f26a 100644
--- a/drivers/media/video/saa7134/saa7134.h
+++ b/drivers/media/video/saa7134/saa7134.h
@@ -252,7 +252,7 @@ struct saa7134_format {
252#define SAA7134_BOARD_BEHOLD_505FM 126 252#define SAA7134_BOARD_BEHOLD_505FM 126
253#define SAA7134_BOARD_BEHOLD_507_9FM 127 253#define SAA7134_BOARD_BEHOLD_507_9FM 127
254#define SAA7134_BOARD_BEHOLD_COLUMBUS_TVFM 128 254#define SAA7134_BOARD_BEHOLD_COLUMBUS_TVFM 128
255#define SAA7134_BOARD_BEHOLD_607_9FM 129 255#define SAA7134_BOARD_BEHOLD_607FM_MK3 129
256#define SAA7134_BOARD_BEHOLD_M6 130 256#define SAA7134_BOARD_BEHOLD_M6 130
257#define SAA7134_BOARD_TWINHAN_DTV_DVB_3056 131 257#define SAA7134_BOARD_TWINHAN_DTV_DVB_3056 131
258#define SAA7134_BOARD_GENIUS_TVGO_A11MCE 132 258#define SAA7134_BOARD_GENIUS_TVGO_A11MCE 132
@@ -280,6 +280,18 @@ struct saa7134_format {
280#define SAA7134_BOARD_AVERMEDIA_GO_007_FM_PLUS 154 280#define SAA7134_BOARD_AVERMEDIA_GO_007_FM_PLUS 154
281#define SAA7134_BOARD_HAUPPAUGE_HVR1120 155 281#define SAA7134_BOARD_HAUPPAUGE_HVR1120 155
282#define SAA7134_BOARD_HAUPPAUGE_HVR1110R3 156 282#define SAA7134_BOARD_HAUPPAUGE_HVR1110R3 156
283#define SAA7134_BOARD_AVERMEDIA_STUDIO_507UA 157
284#define SAA7134_BOARD_AVERMEDIA_CARDBUS_501 158
285#define SAA7134_BOARD_BEHOLD_505RDS 159
286#define SAA7134_BOARD_BEHOLD_507RDS_MK3 160
287#define SAA7134_BOARD_BEHOLD_507RDS_MK5 161
288#define SAA7134_BOARD_BEHOLD_607FM_MK5 162
289#define SAA7134_BOARD_BEHOLD_609FM_MK3 163
290#define SAA7134_BOARD_BEHOLD_609FM_MK5 164
291#define SAA7134_BOARD_BEHOLD_607RDS_MK3 165
292#define SAA7134_BOARD_BEHOLD_607RDS_MK5 166
293#define SAA7134_BOARD_BEHOLD_609RDS_MK3 167
294#define SAA7134_BOARD_BEHOLD_609RDS_MK5 168
283 295
284#define SAA7134_MAXBOARDS 32 296#define SAA7134_MAXBOARDS 32
285#define SAA7134_INPUT_MAX 8 297#define SAA7134_INPUT_MAX 8
@@ -364,6 +376,7 @@ struct saa7134_board {
364#define INTERLACE_OFF 2 376#define INTERLACE_OFF 2
365 377
366#define BUFFER_TIMEOUT msecs_to_jiffies(500) /* 0.5 seconds */ 378#define BUFFER_TIMEOUT msecs_to_jiffies(500) /* 0.5 seconds */
379#define TS_BUFFER_TIMEOUT msecs_to_jiffies(1000) /* 1 second */
367 380
368struct saa7134_dev; 381struct saa7134_dev;
369struct saa7134_dma; 382struct saa7134_dma;
@@ -480,12 +493,6 @@ struct saa7134_mpeg_ops {
480 void (*signal_change)(struct saa7134_dev *dev); 493 void (*signal_change)(struct saa7134_dev *dev);
481}; 494};
482 495
483enum saa7134_ts_status {
484 SAA7134_TS_STOPPED,
485 SAA7134_TS_BUFF_DONE,
486 SAA7134_TS_STARTED,
487};
488
489/* global device status */ 496/* global device status */
490struct saa7134_dev { 497struct saa7134_dev {
491 struct list_head devlist; 498 struct list_head devlist;
@@ -580,8 +587,7 @@ struct saa7134_dev {
580 /* SAA7134_MPEG_* */ 587 /* SAA7134_MPEG_* */
581 struct saa7134_ts ts; 588 struct saa7134_ts ts;
582 struct saa7134_dmaqueue ts_q; 589 struct saa7134_dmaqueue ts_q;
583 enum saa7134_ts_status ts_state; 590 int ts_started;
584 unsigned int buff_cnt;
585 struct saa7134_mpeg_ops *mops; 591 struct saa7134_mpeg_ops *mops;
586 592
587 /* SAA7134_MPEG_EMPRESS only */ 593 /* SAA7134_MPEG_EMPRESS only */
@@ -739,6 +745,9 @@ void saa7134_ts_unregister(struct saa7134_mpeg_ops *ops);
739 745
740int saa7134_ts_init_hw(struct saa7134_dev *dev); 746int saa7134_ts_init_hw(struct saa7134_dev *dev);
741 747
748int saa7134_ts_start(struct saa7134_dev *dev);
749int saa7134_ts_stop(struct saa7134_dev *dev);
750
742/* ----------------------------------------------------------- */ 751/* ----------------------------------------------------------- */
743/* saa7134-vbi.c */ 752/* saa7134-vbi.c */
744 753
@@ -786,7 +795,7 @@ void saa7134_irq_oss_done(struct saa7134_dev *dev, unsigned long status);
786int saa7134_input_init1(struct saa7134_dev *dev); 795int saa7134_input_init1(struct saa7134_dev *dev);
787void saa7134_input_fini(struct saa7134_dev *dev); 796void saa7134_input_fini(struct saa7134_dev *dev);
788void saa7134_input_irq(struct saa7134_dev *dev); 797void saa7134_input_irq(struct saa7134_dev *dev);
789void saa7134_set_i2c_ir(struct saa7134_dev *dev, struct IR_i2c *ir); 798void saa7134_probe_i2c_ir(struct saa7134_dev *dev);
790void saa7134_ir_start(struct saa7134_dev *dev, struct card_ir *ir); 799void saa7134_ir_start(struct saa7134_dev *dev, struct card_ir *ir);
791void saa7134_ir_stop(struct saa7134_dev *dev); 800void saa7134_ir_stop(struct saa7134_dev *dev);
792 801