aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/tvaudio.c
diff options
context:
space:
mode:
authorDaniel Glöckner <daniel-gl@gmx.net>2012-06-17 06:53:42 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-06-25 10:01:29 -0400
commit7bcfdf0f703211cdc85ee240e44f8773246902d8 (patch)
treed4bb61cc6e20e096fb2902e3d647656b8b9c4304 /drivers/media/video/tvaudio.c
parent3f7c0a69ab1181a0f5e4ead5d4b270d404c6465c (diff)
[media] tvaudio: rename getmode and setmode
This is basically s/getmode/getrxsubchans/ and s/setmode/setaudmode/ with some whitespace adjustment in affected lines to please the eye. The rename is done to point out their relation to the rxsubchans and audmode fields of struct v4l2_tuner. I also corrected a commented out call to v4l_dbg in one of the lines. Signed-off-by: Daniel Glöckner <daniel-gl@gmx.net> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/tvaudio.c')
-rw-r--r--drivers/media/video/tvaudio.c108
1 files changed, 60 insertions, 48 deletions
diff --git a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c
index 1e61cbf1c85e..321b3153df87 100644
--- a/drivers/media/video/tvaudio.c
+++ b/drivers/media/video/tvaudio.c
@@ -59,8 +59,8 @@ struct CHIPSTATE;
59typedef int (*getvalue)(int); 59typedef int (*getvalue)(int);
60typedef int (*checkit)(struct CHIPSTATE*); 60typedef int (*checkit)(struct CHIPSTATE*);
61typedef int (*initialize)(struct CHIPSTATE*); 61typedef int (*initialize)(struct CHIPSTATE*);
62typedef int (*getmode)(struct CHIPSTATE*); 62typedef int (*getrxsubchans)(struct CHIPSTATE *);
63typedef void (*setmode)(struct CHIPSTATE*, int mode); 63typedef void (*setaudmode)(struct CHIPSTATE*, int mode);
64 64
65/* i2c command */ 65/* i2c command */
66typedef struct AUDIOCMD { 66typedef struct AUDIOCMD {
@@ -96,8 +96,8 @@ struct CHIPDESC {
96 getvalue volfunc,treblefunc,bassfunc; 96 getvalue volfunc,treblefunc,bassfunc;
97 97
98 /* get/set mode */ 98 /* get/set mode */
99 getmode getmode; 99 getrxsubchans getrxsubchans;
100 setmode setmode; 100 setaudmode setaudmode;
101 101
102 /* input switch register + values for v4l inputs */ 102 /* input switch register + values for v4l inputs */
103 int inputreg; 103 int inputreg;
@@ -306,7 +306,7 @@ static int chip_thread(void *data)
306 continue; 306 continue;
307 307
308 /* have a look what's going on */ 308 /* have a look what's going on */
309 mode = desc->getmode(chip); 309 mode = desc->getrxsubchans(chip);
310 if (mode == chip->prevmode) 310 if (mode == chip->prevmode)
311 continue; 311 continue;
312 312
@@ -340,7 +340,7 @@ static int chip_thread(void *data)
340 else if (mode & V4L2_TUNER_SUB_STEREO) 340 else if (mode & V4L2_TUNER_SUB_STEREO)
341 selected = V4L2_TUNER_MODE_STEREO; 341 selected = V4L2_TUNER_MODE_STEREO;
342 } 342 }
343 desc->setmode(chip, selected); 343 desc->setaudmode(chip, selected);
344 344
345 /* schedule next check */ 345 /* schedule next check */
346 mod_timer(&chip->wt, jiffies+msecs_to_jiffies(2000)); 346 mod_timer(&chip->wt, jiffies+msecs_to_jiffies(2000));
@@ -373,7 +373,7 @@ static int chip_thread(void *data)
373#define TDA9840_TEST_INT1SN 0x1 /* Integration time 0.5s when set */ 373#define TDA9840_TEST_INT1SN 0x1 /* Integration time 0.5s when set */
374#define TDA9840_TEST_INTFU 0x02 /* Disables integrator function */ 374#define TDA9840_TEST_INTFU 0x02 /* Disables integrator function */
375 375
376static int tda9840_getmode(struct CHIPSTATE *chip) 376static int tda9840_getrxsubchans(struct CHIPSTATE *chip)
377{ 377{
378 struct v4l2_subdev *sd = &chip->sd; 378 struct v4l2_subdev *sd = &chip->sd;
379 int val, mode; 379 int val, mode;
@@ -385,12 +385,13 @@ static int tda9840_getmode(struct CHIPSTATE *chip)
385 if (val & TDA9840_ST_STEREO) 385 if (val & TDA9840_ST_STEREO)
386 mode = V4L2_TUNER_SUB_STEREO; 386 mode = V4L2_TUNER_SUB_STEREO;
387 387
388 v4l2_dbg(1, debug, sd, "tda9840_getmode(): raw chip read: %d, return: %d\n", 388 v4l2_dbg(1, debug, sd,
389 "tda9840_getrxsubchans(): raw chip read: %d, return: %d\n",
389 val, mode); 390 val, mode);
390 return mode; 391 return mode;
391} 392}
392 393
393static void tda9840_setmode(struct CHIPSTATE *chip, int mode) 394static void tda9840_setaudmode(struct CHIPSTATE *chip, int mode)
394{ 395{
395 int update = 1; 396 int update = 1;
396 int t = chip->shadow.bytes[TDA9840_SW + 1] & ~0x7e; 397 int t = chip->shadow.bytes[TDA9840_SW + 1] & ~0x7e;
@@ -532,7 +533,7 @@ static int tda9855_volume(int val) { return val/0x2e8+0x27; }
532static int tda9855_bass(int val) { return val/0xccc+0x06; } 533static int tda9855_bass(int val) { return val/0xccc+0x06; }
533static int tda9855_treble(int val) { return (val/0x1c71+0x3)<<1; } 534static int tda9855_treble(int val) { return (val/0x1c71+0x3)<<1; }
534 535
535static int tda985x_getmode(struct CHIPSTATE *chip) 536static int tda985x_getrxsubchans(struct CHIPSTATE *chip)
536{ 537{
537 int mode, val; 538 int mode, val;
538 539
@@ -547,7 +548,7 @@ static int tda985x_getmode(struct CHIPSTATE *chip)
547 return mode; 548 return mode;
548} 549}
549 550
550static void tda985x_setmode(struct CHIPSTATE *chip, int mode) 551static void tda985x_setaudmode(struct CHIPSTATE *chip, int mode)
551{ 552{
552 int update = 1; 553 int update = 1;
553 int c6 = chip->shadow.bytes[TDA985x_C6+1] & 0x3f; 554 int c6 = chip->shadow.bytes[TDA985x_C6+1] & 0x3f;
@@ -692,7 +693,7 @@ static void tda985x_setmode(struct CHIPSTATE *chip, int mode)
692#define TDA9873_STEREO 2 /* Stereo sound is identified */ 693#define TDA9873_STEREO 2 /* Stereo sound is identified */
693#define TDA9873_DUAL 4 /* Dual sound is identified */ 694#define TDA9873_DUAL 4 /* Dual sound is identified */
694 695
695static int tda9873_getmode(struct CHIPSTATE *chip) 696static int tda9873_getrxsubchans(struct CHIPSTATE *chip)
696{ 697{
697 struct v4l2_subdev *sd = &chip->sd; 698 struct v4l2_subdev *sd = &chip->sd;
698 int val,mode; 699 int val,mode;
@@ -703,24 +704,29 @@ static int tda9873_getmode(struct CHIPSTATE *chip)
703 mode = V4L2_TUNER_SUB_STEREO; 704 mode = V4L2_TUNER_SUB_STEREO;
704 if (val & TDA9873_DUAL) 705 if (val & TDA9873_DUAL)
705 mode |= V4L2_TUNER_SUB_LANG1 | V4L2_TUNER_SUB_LANG2; 706 mode |= V4L2_TUNER_SUB_LANG1 | V4L2_TUNER_SUB_LANG2;
706 v4l2_dbg(1, debug, sd, "tda9873_getmode(): raw chip read: %d, return: %d\n", 707 v4l2_dbg(1, debug, sd,
708 "tda9873_getrxsubchans(): raw chip read: %d, return: %d\n",
707 val, mode); 709 val, mode);
708 return mode; 710 return mode;
709} 711}
710 712
711static void tda9873_setmode(struct CHIPSTATE *chip, int mode) 713static void tda9873_setaudmode(struct CHIPSTATE *chip, int mode)
712{ 714{
713 struct v4l2_subdev *sd = &chip->sd; 715 struct v4l2_subdev *sd = &chip->sd;
714 int sw_data = chip->shadow.bytes[TDA9873_SW+1] & ~ TDA9873_TR_MASK; 716 int sw_data = chip->shadow.bytes[TDA9873_SW+1] & ~ TDA9873_TR_MASK;
715 /* int adj_data = chip->shadow.bytes[TDA9873_AD+1] ; */ 717 /* int adj_data = chip->shadow.bytes[TDA9873_AD+1] ; */
716 718
717 if ((sw_data & TDA9873_INP_MASK) != TDA9873_INTERNAL) { 719 if ((sw_data & TDA9873_INP_MASK) != TDA9873_INTERNAL) {
718 v4l2_dbg(1, debug, sd, "tda9873_setmode(): external input\n"); 720 v4l2_dbg(1, debug, sd,
721 "tda9873_setaudmode(): external input\n");
719 return; 722 return;
720 } 723 }
721 724
722 v4l2_dbg(1, debug, sd, "tda9873_setmode(): chip->shadow.bytes[%d] = %d\n", TDA9873_SW+1, chip->shadow.bytes[TDA9873_SW+1]); 725 v4l2_dbg(1, debug, sd,
723 v4l2_dbg(1, debug, sd, "tda9873_setmode(): sw_data = %d\n", sw_data); 726 "tda9873_setaudmode(): chip->shadow.bytes[%d] = %d\n",
727 TDA9873_SW+1, chip->shadow.bytes[TDA9873_SW+1]);
728 v4l2_dbg(1, debug, sd, "tda9873_setaudmode(): sw_data = %d\n",
729 sw_data);
724 730
725 switch (mode) { 731 switch (mode) {
726 case V4L2_TUNER_MODE_MONO: 732 case V4L2_TUNER_MODE_MONO:
@@ -743,7 +749,8 @@ static void tda9873_setmode(struct CHIPSTATE *chip, int mode)
743 } 749 }
744 750
745 chip_write(chip, TDA9873_SW, sw_data); 751 chip_write(chip, TDA9873_SW, sw_data);
746 v4l2_dbg(1, debug, sd, "tda9873_setmode(): req. mode %d; chip_write: %d\n", 752 v4l2_dbg(1, debug, sd,
753 "tda9873_setaudmode(): req. mode %d; chip_write: %d\n",
747 mode, sw_data); 754 mode, sw_data);
748} 755}
749 756
@@ -889,7 +896,7 @@ static int tda9874a_setup(struct CHIPSTATE *chip)
889 return 1; 896 return 1;
890} 897}
891 898
892static int tda9874a_getmode(struct CHIPSTATE *chip) 899static int tda9874a_getrxsubchans(struct CHIPSTATE *chip)
893{ 900{
894 struct v4l2_subdev *sd = &chip->sd; 901 struct v4l2_subdev *sd = &chip->sd;
895 int dsr,nsr,mode; 902 int dsr,nsr,mode;
@@ -928,12 +935,13 @@ static int tda9874a_getmode(struct CHIPSTATE *chip)
928 mode |= V4L2_TUNER_SUB_LANG1 | V4L2_TUNER_SUB_LANG2; 935 mode |= V4L2_TUNER_SUB_LANG1 | V4L2_TUNER_SUB_LANG2;
929 } 936 }
930 937
931 v4l2_dbg(1, debug, sd, "tda9874a_getmode(): DSR=0x%X, NSR=0x%X, NECR=0x%X, return: %d.\n", 938 v4l2_dbg(1, debug, sd,
939 "tda9874a_getrxsubchans(): DSR=0x%X, NSR=0x%X, NECR=0x%X, return: %d.\n",
932 dsr, nsr, necr, mode); 940 dsr, nsr, necr, mode);
933 return mode; 941 return mode;
934} 942}
935 943
936static void tda9874a_setmode(struct CHIPSTATE *chip, int mode) 944static void tda9874a_setaudmode(struct CHIPSTATE *chip, int mode)
937{ 945{
938 struct v4l2_subdev *sd = &chip->sd; 946 struct v4l2_subdev *sd = &chip->sd;
939 947
@@ -979,7 +987,8 @@ static void tda9874a_setmode(struct CHIPSTATE *chip, int mode)
979 chip_write(chip, TDA9874A_AOSR, aosr); 987 chip_write(chip, TDA9874A_AOSR, aosr);
980 chip_write(chip, TDA9874A_MDACOSR, mdacosr); 988 chip_write(chip, TDA9874A_MDACOSR, mdacosr);
981 989
982 v4l2_dbg(1, debug, sd, "tda9874a_setmode(): req. mode %d; AOSR=0x%X, MDACOSR=0x%X.\n", 990 v4l2_dbg(1, debug, sd,
991 "tda9874a_setaudmode(): req. mode %d; AOSR=0x%X, MDACOSR=0x%X.\n",
983 mode, aosr, mdacosr); 992 mode, aosr, mdacosr);
984 993
985 } else { /* dic == 0x07 */ 994 } else { /* dic == 0x07 */
@@ -1017,7 +1026,8 @@ static void tda9874a_setmode(struct CHIPSTATE *chip, int mode)
1017 chip_write(chip, TDA9874A_FMMR, fmmr); 1026 chip_write(chip, TDA9874A_FMMR, fmmr);
1018 chip_write(chip, TDA9874A_AOSR, aosr); 1027 chip_write(chip, TDA9874A_AOSR, aosr);
1019 1028
1020 v4l2_dbg(1, debug, sd, "tda9874a_setmode(): req. mode %d; FMMR=0x%X, AOSR=0x%X.\n", 1029 v4l2_dbg(1, debug, sd,
1030 "tda9874a_setaudmode(): req. mode %d; FMMR=0x%X, AOSR=0x%X.\n",
1021 mode, fmmr, aosr); 1031 mode, fmmr, aosr);
1022 } 1032 }
1023} 1033}
@@ -1262,7 +1272,7 @@ static int tea6320_initialize(struct CHIPSTATE * chip)
1262static int tda8425_shift10(int val) { return (val >> 10) | 0xc0; } 1272static int tda8425_shift10(int val) { return (val >> 10) | 0xc0; }
1263static int tda8425_shift12(int val) { return (val >> 12) | 0xf0; } 1273static int tda8425_shift12(int val) { return (val >> 12) | 0xf0; }
1264 1274
1265static void tda8425_setmode(struct CHIPSTATE *chip, int mode) 1275static void tda8425_setaudmode(struct CHIPSTATE *chip, int mode)
1266{ 1276{
1267 int s1 = chip->shadow.bytes[TDA8425_S1+1] & 0xe1; 1277 int s1 = chip->shadow.bytes[TDA8425_S1+1] & 0xe1;
1268 1278
@@ -1341,7 +1351,7 @@ static void tda8425_setmode(struct CHIPSTATE *chip, int mode)
1341 * stereo L L 1351 * stereo L L
1342 * BIL H L 1352 * BIL H L
1343 */ 1353 */
1344static int ta8874z_getmode(struct CHIPSTATE *chip) 1354static int ta8874z_getrxsubchans(struct CHIPSTATE *chip)
1345{ 1355{
1346 int val, mode; 1356 int val, mode;
1347 1357
@@ -1352,7 +1362,9 @@ static int ta8874z_getmode(struct CHIPSTATE *chip)
1352 }else if (!(val & TA8874Z_B0)){ 1362 }else if (!(val & TA8874Z_B0)){
1353 mode = V4L2_TUNER_SUB_STEREO; 1363 mode = V4L2_TUNER_SUB_STEREO;
1354 } 1364 }
1355 /* v4l_dbg(1, debug, chip->c, "ta8874z_getmode(): raw chip read: 0x%02x, return: 0x%02x\n", val, mode); */ 1365 /* v4l2_dbg(1, debug, &chip->sd,
1366 "ta8874z_getrxsubchans(): raw chip read: 0x%02x, return: 0x%02x\n",
1367 val, mode); */
1356 return mode; 1368 return mode;
1357} 1369}
1358 1370
@@ -1362,13 +1374,13 @@ static audiocmd ta8874z_main = {2, { 0, TA8874Z_SEPARATION_DEFAULT}};
1362static audiocmd ta8874z_sub = {2, { TA8874Z_MODE_SUB, TA8874Z_SEPARATION_DEFAULT}}; 1374static audiocmd ta8874z_sub = {2, { TA8874Z_MODE_SUB, TA8874Z_SEPARATION_DEFAULT}};
1363static audiocmd ta8874z_both = {2, { TA8874Z_MODE_MAIN | TA8874Z_MODE_SUB, TA8874Z_SEPARATION_DEFAULT}}; 1375static audiocmd ta8874z_both = {2, { TA8874Z_MODE_MAIN | TA8874Z_MODE_SUB, TA8874Z_SEPARATION_DEFAULT}};
1364 1376
1365static void ta8874z_setmode(struct CHIPSTATE *chip, int mode) 1377static void ta8874z_setaudmode(struct CHIPSTATE *chip, int mode)
1366{ 1378{
1367 struct v4l2_subdev *sd = &chip->sd; 1379 struct v4l2_subdev *sd = &chip->sd;
1368 int update = 1; 1380 int update = 1;
1369 audiocmd *t = NULL; 1381 audiocmd *t = NULL;
1370 1382
1371 v4l2_dbg(1, debug, sd, "ta8874z_setmode(): mode: 0x%02x\n", mode); 1383 v4l2_dbg(1, debug, sd, "ta8874z_setaudmode(): mode: 0x%02x\n", mode);
1372 1384
1373 switch(mode){ 1385 switch(mode){
1374 case V4L2_TUNER_MODE_MONO: 1386 case V4L2_TUNER_MODE_MONO:
@@ -1442,8 +1454,8 @@ static struct CHIPDESC chiplist[] = {
1442 1454
1443 /* callbacks */ 1455 /* callbacks */
1444 .checkit = tda9840_checkit, 1456 .checkit = tda9840_checkit,
1445 .getmode = tda9840_getmode, 1457 .getrxsubchans = tda9840_getrxsubchans,
1446 .setmode = tda9840_setmode, 1458 .setaudmode = tda9840_setaudmode,
1447 1459
1448 .init = { 2, { TDA9840_TEST, TDA9840_TEST_INT1SN 1460 .init = { 2, { TDA9840_TEST, TDA9840_TEST_INT1SN
1449 /* ,TDA9840_SW, TDA9840_MONO */} } 1461 /* ,TDA9840_SW, TDA9840_MONO */} }
@@ -1458,8 +1470,8 @@ static struct CHIPDESC chiplist[] = {
1458 1470
1459 /* callbacks */ 1471 /* callbacks */
1460 .checkit = tda9873_checkit, 1472 .checkit = tda9873_checkit,
1461 .getmode = tda9873_getmode, 1473 .getrxsubchans = tda9873_getrxsubchans,
1462 .setmode = tda9873_setmode, 1474 .setaudmode = tda9873_setaudmode,
1463 1475
1464 .init = { 4, { TDA9873_SW, 0xa4, 0x06, 0x03 } }, 1476 .init = { 4, { TDA9873_SW, 0xa4, 0x06, 0x03 } },
1465 .inputreg = TDA9873_SW, 1477 .inputreg = TDA9873_SW,
@@ -1478,8 +1490,8 @@ static struct CHIPDESC chiplist[] = {
1478 /* callbacks */ 1490 /* callbacks */
1479 .initialize = tda9874a_initialize, 1491 .initialize = tda9874a_initialize,
1480 .checkit = tda9874a_checkit, 1492 .checkit = tda9874a_checkit,
1481 .getmode = tda9874a_getmode, 1493 .getrxsubchans = tda9874a_getrxsubchans,
1482 .setmode = tda9874a_setmode, 1494 .setaudmode = tda9874a_setaudmode,
1483 }, 1495 },
1484 { 1496 {
1485 .name = "tda9875", 1497 .name = "tda9875",
@@ -1508,8 +1520,8 @@ static struct CHIPDESC chiplist[] = {
1508 .addr_hi = I2C_ADDR_TDA985x_H >> 1, 1520 .addr_hi = I2C_ADDR_TDA985x_H >> 1,
1509 .registers = 11, 1521 .registers = 11,
1510 1522
1511 .getmode = tda985x_getmode, 1523 .getrxsubchans = tda985x_getrxsubchans,
1512 .setmode = tda985x_setmode, 1524 .setaudmode = tda985x_setaudmode,
1513 1525
1514 .init = { 8, { TDA9850_C4, 0x08, 0x08, TDA985x_STEREO, 0x07, 0x10, 0x10, 0x03 } } 1526 .init = { 8, { TDA9850_C4, 0x08, 0x08, TDA985x_STEREO, 0x07, 0x10, 0x10, 0x03 } }
1515 }, 1527 },
@@ -1530,8 +1542,8 @@ static struct CHIPDESC chiplist[] = {
1530 .volfunc = tda9855_volume, 1542 .volfunc = tda9855_volume,
1531 .bassfunc = tda9855_bass, 1543 .bassfunc = tda9855_bass,
1532 .treblefunc = tda9855_treble, 1544 .treblefunc = tda9855_treble,
1533 .getmode = tda985x_getmode, 1545 .getrxsubchans = tda985x_getrxsubchans,
1534 .setmode = tda985x_setmode, 1546 .setaudmode = tda985x_setaudmode,
1535 1547
1536 .init = { 12, { 0, 0x6f, 0x6f, 0x0e, 0x07<<1, 0x8<<2, 1548 .init = { 12, { 0, 0x6f, 0x6f, 0x0e, 0x07<<1, 0x8<<2,
1537 TDA9855_MUTE | TDA9855_AVL | TDA9855_LOUD | TDA9855_INT, 1549 TDA9855_MUTE | TDA9855_AVL | TDA9855_LOUD | TDA9855_INT,
@@ -1612,7 +1624,7 @@ static struct CHIPDESC chiplist[] = {
1612 .volfunc = tda8425_shift10, 1624 .volfunc = tda8425_shift10,
1613 .bassfunc = tda8425_shift12, 1625 .bassfunc = tda8425_shift12,
1614 .treblefunc = tda8425_shift12, 1626 .treblefunc = tda8425_shift12,
1615 .setmode = tda8425_setmode, 1627 .setaudmode = tda8425_setaudmode,
1616 1628
1617 .inputreg = TDA8425_S1, 1629 .inputreg = TDA8425_S1,
1618 .inputmap = { TDA8425_S1_CH1, TDA8425_S1_CH1, TDA8425_S1_CH1 }, 1630 .inputmap = { TDA8425_S1_CH1, TDA8425_S1_CH1, TDA8425_S1_CH1 },
@@ -1643,8 +1655,8 @@ static struct CHIPDESC chiplist[] = {
1643 .registers = 2, 1655 .registers = 2,
1644 1656
1645 /* callbacks */ 1657 /* callbacks */
1646 .getmode = ta8874z_getmode, 1658 .getrxsubchans = ta8874z_getrxsubchans,
1647 .setmode = ta8874z_setmode, 1659 .setaudmode = ta8874z_setaudmode,
1648 1660
1649 .init = {2, { TA8874Z_MONO_SET, TA8874Z_SEPARATION_DEFAULT}}, 1661 .init = {2, { TA8874Z_MONO_SET, TA8874Z_SEPARATION_DEFAULT}},
1650 }, 1662 },
@@ -1840,7 +1852,7 @@ static int tvaudio_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
1840 struct CHIPSTATE *chip = to_state(sd); 1852 struct CHIPSTATE *chip = to_state(sd);
1841 struct CHIPDESC *desc = chip->desc; 1853 struct CHIPDESC *desc = chip->desc;
1842 1854
1843 if (!desc->setmode) 1855 if (!desc->setaudmode)
1844 return 0; 1856 return 0;
1845 if (chip->radio) 1857 if (chip->radio)
1846 return 0; 1858 return 0;
@@ -1860,7 +1872,7 @@ static int tvaudio_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
1860 if (chip->thread) 1872 if (chip->thread)
1861 wake_up_process(chip->thread); 1873 wake_up_process(chip->thread);
1862 else 1874 else
1863 desc->setmode(chip, vt->audmode); 1875 desc->setaudmode(chip, vt->audmode);
1864 1876
1865 return 0; 1877 return 0;
1866} 1878}
@@ -1870,13 +1882,13 @@ static int tvaudio_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
1870 struct CHIPSTATE *chip = to_state(sd); 1882 struct CHIPSTATE *chip = to_state(sd);
1871 struct CHIPDESC *desc = chip->desc; 1883 struct CHIPDESC *desc = chip->desc;
1872 1884
1873 if (!desc->getmode) 1885 if (!desc->getrxsubchans)
1874 return 0; 1886 return 0;
1875 if (chip->radio) 1887 if (chip->radio)
1876 return 0; 1888 return 0;
1877 1889
1878 vt->audmode = chip->audmode; 1890 vt->audmode = chip->audmode;
1879 vt->rxsubchans = desc->getmode(chip); 1891 vt->rxsubchans = desc->getrxsubchans(chip);
1880 vt->capability = V4L2_TUNER_CAP_STEREO | 1892 vt->capability = V4L2_TUNER_CAP_STEREO |
1881 V4L2_TUNER_CAP_LANG1 | V4L2_TUNER_CAP_LANG2; 1893 V4L2_TUNER_CAP_LANG1 | V4L2_TUNER_CAP_LANG2;
1882 1894
@@ -1896,7 +1908,7 @@ static int tvaudio_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *fr
1896 struct CHIPSTATE *chip = to_state(sd); 1908 struct CHIPSTATE *chip = to_state(sd);
1897 struct CHIPDESC *desc = chip->desc; 1909 struct CHIPDESC *desc = chip->desc;
1898 1910
1899 /* For chips that provide getmode and setmode, and doesn't 1911 /* For chips that provide getrxsubchans and setaudmode, and doesn't
1900 automatically follows the stereo carrier, a kthread is 1912 automatically follows the stereo carrier, a kthread is
1901 created to set the audio standard. In this case, when then 1913 created to set the audio standard. In this case, when then
1902 the video channel is changed, tvaudio starts on MONO mode. 1914 the video channel is changed, tvaudio starts on MONO mode.
@@ -1905,7 +1917,7 @@ static int tvaudio_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *fr
1905 audio carrier. 1917 audio carrier.
1906 */ 1918 */
1907 if (chip->thread) { 1919 if (chip->thread) {
1908 desc->setmode(chip, V4L2_TUNER_MODE_MONO); 1920 desc->setaudmode(chip, V4L2_TUNER_MODE_MONO);
1909 chip->prevmode = -1; /* reset previous mode */ 1921 chip->prevmode = -1; /* reset previous mode */
1910 mod_timer(&chip->wt, jiffies+msecs_to_jiffies(2000)); 1922 mod_timer(&chip->wt, jiffies+msecs_to_jiffies(2000));
1911 } 1923 }
@@ -2048,7 +2060,7 @@ static int tvaudio_probe(struct i2c_client *client, const struct i2c_device_id *
2048 chip->thread = NULL; 2060 chip->thread = NULL;
2049 init_timer(&chip->wt); 2061 init_timer(&chip->wt);
2050 if (desc->flags & CHIP_NEED_CHECKMODE) { 2062 if (desc->flags & CHIP_NEED_CHECKMODE) {
2051 if (!desc->getmode || !desc->setmode) { 2063 if (!desc->getrxsubchans || !desc->setaudmode) {
2052 /* This shouldn't be happen. Warn user, but keep working 2064 /* This shouldn't be happen. Warn user, but keep working
2053 without kthread 2065 without kthread
2054 */ 2066 */