aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2009-04-01 03:00:30 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-04-06 20:44:25 -0400
commit940088a16221fa517f5b921266afa8e46f49b784 (patch)
tree41e7635a3cddc38a4a04d4c65a50b96f8f13ada6
parent1792f68b0eb464a9bc84e7d182e2ab4d00541c8c (diff)
V4L/DVB (11376): tvaudio.h: add static inline to retrieve the list of possible i2c addrs.
Rather than duplicating this list everywhere, just put it in tvaudio.h. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/bt8xx/bttv-cards.c15
-rw-r--r--include/media/tvaudio.h19
2 files changed, 21 insertions, 13 deletions
diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c
index 58fb93ee5500..fdb4adff3d28 100644
--- a/drivers/media/video/bt8xx/bttv-cards.c
+++ b/drivers/media/video/bt8xx/bttv-cards.c
@@ -3324,17 +3324,6 @@ void __devinit bttv_init_card1(struct bttv *btv)
3324/* initialization part two -- after registering i2c bus */ 3324/* initialization part two -- after registering i2c bus */
3325void __devinit bttv_init_card2(struct bttv *btv) 3325void __devinit bttv_init_card2(struct bttv *btv)
3326{ 3326{
3327 static const unsigned short tvaudio_addrs[] = {
3328 I2C_ADDR_TDA8425 >> 1,
3329 I2C_ADDR_TEA6300 >> 1,
3330 I2C_ADDR_TEA6420 >> 1,
3331 I2C_ADDR_TDA9840 >> 1,
3332 I2C_ADDR_TDA985x_L >> 1,
3333 I2C_ADDR_TDA985x_H >> 1,
3334 I2C_ADDR_TDA9874 >> 1,
3335 I2C_ADDR_PIC16C54 >> 1,
3336 I2C_CLIENT_END
3337 };
3338 int addr=ADDR_UNSET; 3327 int addr=ADDR_UNSET;
3339 3328
3340 btv->tuner_type = UNSET; 3329 btv->tuner_type = UNSET;
@@ -3621,7 +3610,7 @@ void __devinit bttv_init_card2(struct bttv *btv)
3621 case 3: { 3610 case 3: {
3622 /* The user specified that we should probe for tvaudio */ 3611 /* The user specified that we should probe for tvaudio */
3623 btv->sd_tvaudio = v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev, 3612 btv->sd_tvaudio = v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev,
3624 &btv->c.i2c_adap, "tvaudio", "tvaudio", tvaudio_addrs); 3613 &btv->c.i2c_adap, "tvaudio", "tvaudio", tvaudio_addrs());
3625 if (btv->sd_tvaudio) 3614 if (btv->sd_tvaudio)
3626 return; 3615 return;
3627 goto no_audio; 3616 goto no_audio;
@@ -3667,7 +3656,7 @@ void __devinit bttv_init_card2(struct bttv *btv)
3667 3656
3668 /* Now see if we can find one of the tvaudio devices. */ 3657 /* Now see if we can find one of the tvaudio devices. */
3669 btv->sd_tvaudio = v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev, 3658 btv->sd_tvaudio = v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev,
3670 &btv->c.i2c_adap, "tvaudio", "tvaudio", tvaudio_addrs); 3659 &btv->c.i2c_adap, "tvaudio", "tvaudio", tvaudio_addrs());
3671 if (btv->sd_tvaudio) 3660 if (btv->sd_tvaudio)
3672 return; 3661 return;
3673 3662
diff --git a/include/media/tvaudio.h b/include/media/tvaudio.h
index 6915aafc875a..1ac8184693f8 100644
--- a/include/media/tvaudio.h
+++ b/include/media/tvaudio.h
@@ -21,10 +21,29 @@
21#ifndef _TVAUDIO_H 21#ifndef _TVAUDIO_H
22#define _TVAUDIO_H 22#define _TVAUDIO_H
23 23
24#include <media/i2c-addr.h>
25
24/* The tvaudio module accepts the following inputs: */ 26/* The tvaudio module accepts the following inputs: */
25#define TVAUDIO_INPUT_TUNER 0 27#define TVAUDIO_INPUT_TUNER 0
26#define TVAUDIO_INPUT_RADIO 1 28#define TVAUDIO_INPUT_RADIO 1
27#define TVAUDIO_INPUT_EXTERN 2 29#define TVAUDIO_INPUT_EXTERN 2
28#define TVAUDIO_INPUT_INTERN 3 30#define TVAUDIO_INPUT_INTERN 3
29 31
32static inline const unsigned short *tvaudio_addrs(void)
33{
34 static const unsigned short addrs[] = {
35 I2C_ADDR_TDA8425 >> 1,
36 I2C_ADDR_TEA6300 >> 1,
37 I2C_ADDR_TEA6420 >> 1,
38 I2C_ADDR_TDA9840 >> 1,
39 I2C_ADDR_TDA985x_L >> 1,
40 I2C_ADDR_TDA985x_H >> 1,
41 I2C_ADDR_TDA9874 >> 1,
42 I2C_ADDR_PIC16C54 >> 1,
43 I2C_CLIENT_END
44 };
45
46 return addrs;
47}
48
30#endif 49#endif