Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] tuner: add Sony BTF tuners

This adds support for three Sony BTF tuners:
TUNER_SONY_BTF_PG472Z: PAL+SECAM
TUNER_SONY_BTF_PK467Z: NTSC-M-JP
TUNER_SONY_BTF_PB463Z: NTSC-M
These come from the go7007 staging driver where they were implemented in
the wis-sony-tuner i2c driver.
Adding support for these tuners to tuner-types.c is the first step towards
removing the wis-sony-tuner driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by

Hans Verkuil and committed by
Mauro Carvalho Chehab
e4d2a616 ffb97493

+78 -6
+3
Documentation/video4linux/CARDLIST.tuner
··· 86 86 tuner=86 - Tena TNF5337 MFD 87 87 tuner=87 - Xceive 4000 tuner 88 88 tuner=88 - Xceive 5000C tuner 89 + tuner=89 - Sony PAL+SECAM (BTF-PG472Z) 90 + tuner=90 - Sony NTSC-M-JP (BTF-PK467Z) 91 + tuner=91 - Sony NTSC-M (BTF-PB463Z)
+69
drivers/media/tuners/tuner-types.c
··· 1381 1381 }, 1382 1382 }; 1383 1383 1384 + /* --------- Sony BTF-PG472Z PAL/SECAM ------- */ 1385 + 1386 + static struct tuner_range tuner_sony_btf_pg472z_ranges[] = { 1387 + { 16 * 144.25 /*MHz*/, 0xc6, 0x01, }, 1388 + { 16 * 427.25 /*MHz*/, 0xc6, 0x02, }, 1389 + { 16 * 999.99 , 0xc6, 0x04, }, 1390 + }; 1391 + 1392 + static struct tuner_params tuner_sony_btf_pg472z_params[] = { 1393 + { 1394 + .type = TUNER_PARAM_TYPE_PAL, 1395 + .ranges = tuner_sony_btf_pg472z_ranges, 1396 + .count = ARRAY_SIZE(tuner_sony_btf_pg472z_ranges), 1397 + .has_tda9887 = 1, 1398 + .port1_active = 1, 1399 + .port2_invert_for_secam_lc = 1, 1400 + }, 1401 + }; 1402 + 1403 + /* 90-99 */ 1404 + /* --------- Sony BTF-PG467Z NTSC-M-JP ------- */ 1405 + 1406 + static struct tuner_range tuner_sony_btf_pg467z_ranges[] = { 1407 + { 16 * 220.25 /*MHz*/, 0xc6, 0x01, }, 1408 + { 16 * 467.25 /*MHz*/, 0xc6, 0x02, }, 1409 + { 16 * 999.99 , 0xc6, 0x04, }, 1410 + }; 1411 + 1412 + static struct tuner_params tuner_sony_btf_pg467z_params[] = { 1413 + { 1414 + .type = TUNER_PARAM_TYPE_NTSC, 1415 + .ranges = tuner_sony_btf_pg467z_ranges, 1416 + .count = ARRAY_SIZE(tuner_sony_btf_pg467z_ranges), 1417 + }, 1418 + }; 1419 + 1420 + /* --------- Sony BTF-PG463Z NTSC-M ------- */ 1421 + 1422 + static struct tuner_range tuner_sony_btf_pg463z_ranges[] = { 1423 + { 16 * 130.25 /*MHz*/, 0xc6, 0x01, }, 1424 + { 16 * 364.25 /*MHz*/, 0xc6, 0x02, }, 1425 + { 16 * 999.99 , 0xc6, 0x04, }, 1426 + }; 1427 + 1428 + static struct tuner_params tuner_sony_btf_pg463z_params[] = { 1429 + { 1430 + .type = TUNER_PARAM_TYPE_NTSC, 1431 + .ranges = tuner_sony_btf_pg463z_ranges, 1432 + .count = ARRAY_SIZE(tuner_sony_btf_pg463z_ranges), 1433 + }, 1434 + }; 1435 + 1384 1436 /* --------------------------------------------------------------------- */ 1385 1437 1386 1438 struct tunertype tuners[] = { ··· 1923 1871 [TUNER_XC5000C] = { /* Xceive 5000C */ 1924 1872 .name = "Xceive 5000C tuner", 1925 1873 /* see xc5000.c for details */ 1874 + }, 1875 + [TUNER_SONY_BTF_PG472Z] = { 1876 + .name = "Sony BTF-PG472Z PAL/SECAM", 1877 + .params = tuner_sony_btf_pg472z_params, 1878 + .count = ARRAY_SIZE(tuner_sony_btf_pg472z_params), 1879 + }, 1880 + 1881 + /* 90-99 */ 1882 + [TUNER_SONY_BTF_PK467Z] = { 1883 + .name = "Sony BTF-PK467Z NTSC-M-JP", 1884 + .params = tuner_sony_btf_pg467z_params, 1885 + .count = ARRAY_SIZE(tuner_sony_btf_pg467z_params), 1886 + }, 1887 + [TUNER_SONY_BTF_PB463Z] = { 1888 + .name = "Sony BTF-PB463Z NTSC-M", 1889 + .params = tuner_sony_btf_pg463z_params, 1890 + .count = ARRAY_SIZE(tuner_sony_btf_pg463z_params), 1926 1891 }, 1927 1892 }; 1928 1893 EXPORT_SYMBOL(tuners);
+1
drivers/staging/media/go7007/go7007-usb.c
··· 27 27 #include <linux/i2c.h> 28 28 #include <asm/byteorder.h> 29 29 #include <media/tvaudio.h> 30 + #include <media/tuner.h> 30 31 31 32 #include "go7007-priv.h" 32 33 #include "wis-i2c.h"
+1
drivers/staging/media/go7007/go7007-v4l2.c
··· 1238 1238 if (!go->i2c_adapter_online) 1239 1239 return -EIO; 1240 1240 1241 + strlcpy(t->name, "Tuner", sizeof(t->name)); 1241 1242 return call_all(&go->v4l2_dev, tuner, g_tuner, t); 1242 1243 } 1243 1244
-6
drivers/staging/media/go7007/wis-i2c.h
··· 34 34 35 35 #define DECODER_SET_RESOLUTION _IOW('d', 200, struct video_decoder_resolution) 36 36 #define DECODER_SET_CHANNEL _IOW('d', 201, int) 37 - 38 - /* Sony tuner types */ 39 - 40 - #define TUNER_SONY_BTF_PG472Z 200 41 - #define TUNER_SONY_BTF_PK467Z 201 42 - #define TUNER_SONY_BTF_PB463Z 202
+4
include/media/tuner.h
··· 138 138 #define TUNER_XC4000 87 /* Xceive Silicon Tuner */ 139 139 #define TUNER_XC5000C 88 /* Xceive Silicon Tuner */ 140 140 141 + #define TUNER_SONY_BTF_PG472Z 89 /* PAL+SECAM */ 142 + #define TUNER_SONY_BTF_PK467Z 90 /* NTSC_JP */ 143 + #define TUNER_SONY_BTF_PB463Z 91 /* NTSC */ 144 + 141 145 /* tv card specific */ 142 146 #define TDA9887_PRESENT (1<<0) 143 147 #define TDA9887_PORT1_INACTIVE (1<<1)