diff options
author | Hartmut Hackmann <hartmut.hackmann@t-online.de> | 2007-04-27 11:31:17 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-04-27 14:43:40 -0400 |
commit | cfeb88398f004a0e85ee011fd89a01f5d3bf3c81 (patch) | |
tree | a2df3639bc592b16cdf9a48f8fc39a465f9f9a07 /drivers/media/video/saa7134/saa7134-cards.c | |
parent | b8bc76d88fa7a1e4cd679fac3adfc5afeb2b3427 (diff) |
V4L/DVB (5323): Updated support for tuner callbacks
This change supplies a more generic version of the tuner callback.
The tuner struct now has a function pointer
int (*tuner_callback) (void *dev, int command, int arg)
additionally to a int config parameter.
both can be set through the TUNER_SET_TYPE_ADDR client call.
Note that the meaning of the parameters depend on the tuner type.
Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-cards.c')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-cards.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c index f44e7c7e18a5..87a8a68efc5c 100644 --- a/drivers/media/video/saa7134/saa7134-cards.c +++ b/drivers/media/video/saa7134/saa7134-cards.c | |||
@@ -4185,6 +4185,9 @@ int saa7134_board_init2(struct saa7134_dev *dev) | |||
4185 | { | 4185 | { |
4186 | unsigned char buf; | 4186 | unsigned char buf; |
4187 | int board; | 4187 | int board; |
4188 | struct tuner_setup tun_setup; | ||
4189 | tun_setup.config = 0; | ||
4190 | tun_setup.tuner_callback = saa7134_tuner_callback; | ||
4188 | 4191 | ||
4189 | switch (dev->board) { | 4192 | switch (dev->board) { |
4190 | case SAA7134_BOARD_BMK_MPEX_NOTUNER: | 4193 | case SAA7134_BOARD_BMK_MPEX_NOTUNER: |
@@ -4201,20 +4204,15 @@ int saa7134_board_init2(struct saa7134_dev *dev) | |||
4201 | dev->tuner_type = saa7134_boards[dev->board].tuner_type; | 4204 | dev->tuner_type = saa7134_boards[dev->board].tuner_type; |
4202 | 4205 | ||
4203 | if (TUNER_ABSENT != dev->tuner_type) { | 4206 | if (TUNER_ABSENT != dev->tuner_type) { |
4204 | struct tuner_setup tun_setup; | ||
4205 | |||
4206 | tun_setup.mode_mask = T_RADIO | T_ANALOG_TV | T_DIGITAL_TV; | 4207 | tun_setup.mode_mask = T_RADIO | T_ANALOG_TV | T_DIGITAL_TV; |
4207 | tun_setup.type = dev->tuner_type; | 4208 | tun_setup.type = dev->tuner_type; |
4208 | tun_setup.addr = ADDR_UNSET; | 4209 | tun_setup.addr = ADDR_UNSET; |
4209 | tun_setup.config = 0; | ||
4210 | tun_setup.gpio_func = NULL; | ||
4211 | 4210 | ||
4212 | saa7134_i2c_call_clients (dev, TUNER_SET_TYPE_ADDR, &tun_setup); | 4211 | saa7134_i2c_call_clients (dev, TUNER_SET_TYPE_ADDR, &tun_setup); |
4213 | } | 4212 | } |
4214 | break; | 4213 | break; |
4215 | case SAA7134_BOARD_MD7134: | 4214 | case SAA7134_BOARD_MD7134: |
4216 | { | 4215 | { |
4217 | struct tuner_setup tun_setup; | ||
4218 | u8 subaddr; | 4216 | u8 subaddr; |
4219 | u8 data[3]; | 4217 | u8 data[3]; |
4220 | int ret, tuner_t; | 4218 | int ret, tuner_t; |
@@ -4275,8 +4273,6 @@ int saa7134_board_init2(struct saa7134_dev *dev) | |||
4275 | tun_setup.mode_mask = T_RADIO | T_ANALOG_TV | T_DIGITAL_TV; | 4273 | tun_setup.mode_mask = T_RADIO | T_ANALOG_TV | T_DIGITAL_TV; |
4276 | tun_setup.type = dev->tuner_type; | 4274 | tun_setup.type = dev->tuner_type; |
4277 | tun_setup.addr = ADDR_UNSET; | 4275 | tun_setup.addr = ADDR_UNSET; |
4278 | tun_setup.config = 0; | ||
4279 | tun_setup.gpio_func = NULL; | ||
4280 | 4276 | ||
4281 | saa7134_i2c_call_clients (dev, TUNER_SET_TYPE_ADDR,&tun_setup); | 4277 | saa7134_i2c_call_clients (dev, TUNER_SET_TYPE_ADDR,&tun_setup); |
4282 | } | 4278 | } |
@@ -4288,7 +4284,6 @@ int saa7134_board_init2(struct saa7134_dev *dev) | |||
4288 | * the channel decoder. We have to make it transparent to find it | 4284 | * the channel decoder. We have to make it transparent to find it |
4289 | */ | 4285 | */ |
4290 | { | 4286 | { |
4291 | struct tuner_setup tun_setup; | ||
4292 | u8 data[] = { 0x07, 0x02}; | 4287 | u8 data[] = { 0x07, 0x02}; |
4293 | struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)}; | 4288 | struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)}; |
4294 | i2c_transfer(&dev->i2c_adap, &msg, 1); | 4289 | i2c_transfer(&dev->i2c_adap, &msg, 1); |
@@ -4296,8 +4291,6 @@ int saa7134_board_init2(struct saa7134_dev *dev) | |||
4296 | tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV; | 4291 | tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV; |
4297 | tun_setup.type = dev->tuner_type; | 4292 | tun_setup.type = dev->tuner_type; |
4298 | tun_setup.addr = dev->tuner_addr; | 4293 | tun_setup.addr = dev->tuner_addr; |
4299 | tun_setup.config = 0; | ||
4300 | tun_setup.gpio_func = NULL; | ||
4301 | 4294 | ||
4302 | saa7134_i2c_call_clients (dev, TUNER_SET_TYPE_ADDR,&tun_setup); | 4295 | saa7134_i2c_call_clients (dev, TUNER_SET_TYPE_ADDR,&tun_setup); |
4303 | } | 4296 | } |
@@ -4306,7 +4299,6 @@ int saa7134_board_init2(struct saa7134_dev *dev) | |||
4306 | case SAA7134_BOARD_PHILIPS_TIGER_S: | 4299 | case SAA7134_BOARD_PHILIPS_TIGER_S: |
4307 | { | 4300 | { |
4308 | u8 data[] = { 0x3c, 0x33, 0x60}; | 4301 | u8 data[] = { 0x3c, 0x33, 0x60}; |
4309 | struct tuner_setup tun_setup; | ||
4310 | struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)}; | 4302 | struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)}; |
4311 | if(dev->autodetected && (dev->eedata[0x49] == 0x50)) { | 4303 | if(dev->autodetected && (dev->eedata[0x49] == 0x50)) { |
4312 | dev->board = SAA7134_BOARD_PHILIPS_TIGER_S; | 4304 | dev->board = SAA7134_BOARD_PHILIPS_TIGER_S; |
@@ -4318,7 +4310,6 @@ int saa7134_board_init2(struct saa7134_dev *dev) | |||
4318 | tun_setup.type = TUNER_PHILIPS_TDA8290; | 4310 | tun_setup.type = TUNER_PHILIPS_TDA8290; |
4319 | tun_setup.addr = 0x4b; | 4311 | tun_setup.addr = 0x4b; |
4320 | tun_setup.config = 2; | 4312 | tun_setup.config = 2; |
4321 | tun_setup.gpio_func = (tuner_gpio_func_t) saa7134_set_gpio; | ||
4322 | 4313 | ||
4323 | saa7134_i2c_call_clients (dev, TUNER_SET_TYPE_ADDR,&tun_setup); | 4314 | saa7134_i2c_call_clients (dev, TUNER_SET_TYPE_ADDR,&tun_setup); |
4324 | data[2] = 0x68; | 4315 | data[2] = 0x68; |