diff options
author | Mauro Carvalho Chehab <mchehab@brturbo.com.br> | 2005-06-24 01:02:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-24 03:05:31 -0400 |
commit | 391cd727eac2e10be7685efd739a3ea9de87393c (patch) | |
tree | 564ac5faefc87d6a8806d56a82d22a0404da0fdc /drivers/media/video/tuner-simple.c | |
parent | 55f51efdb696ff6e9d2056377d05268a97f3d4e4 (diff) |
[PATCH] tuner-core.c improvments and Ymec Tvision TVF8533MF support
tuner-core.c, tuner.h:
- tuner-core changed to support multiple I2C devices used on some
adapters;
- Kconfig now has an option (CONFIG_TUNER_MULTI_I2C) to enable this new
behavor;
- By default, even enabling CONFIG_TUNER_MULTI_I2C, tuner-core emulates
the old behavor, using first I2C device for both FM and TV;
- There is a new i2c command (TUNER_SET_ADDR) to allow tuner clients to
select I2C address for FM or TV tuner;
- Tuner I2C dettach now generates a warning on syslog if failed.
tuner-simple.c:
- TVision TVF-8531MF and TVF-5533 MF tuner included. It uses, by
default, I2C on 0xC2 address for TV and on 0xC0 for Radio. Both TV and
FM Radio mode are working.
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/video/tuner-simple.c')
-rw-r--r-- | drivers/media/video/tuner-simple.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/drivers/media/video/tuner-simple.c b/drivers/media/video/tuner-simple.c index 48c6ceff1dc2..f7305c8d53de 100644 --- a/drivers/media/video/tuner-simple.c +++ b/drivers/media/video/tuner-simple.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: tuner-simple.c,v 1.10 2005/03/08 08:38:00 kraxel Exp $ | 2 | * $Id: tuner-simple.c,v 1.14 2005/05/30 02:02:47 mchehab Exp $ |
3 | * | 3 | * |
4 | * i2c tv tuner chip device driver | 4 | * i2c tv tuner chip device driver |
5 | * controls all those simple 4-control-bytes style tuners. | 5 | * controls all those simple 4-control-bytes style tuners. |
@@ -212,6 +212,11 @@ static struct tunertype tuners[] = { | |||
212 | { "Philips FQ1236A MK4", Philips, NTSC, | 212 | { "Philips FQ1236A MK4", Philips, NTSC, |
213 | 16*160.00,16*442.00,0x01,0x02,0x04,0x8e,732 }, | 213 | 16*160.00,16*442.00,0x01,0x02,0x04,0x8e,732 }, |
214 | 214 | ||
215 | /* Should work for TVF8531MF, TVF8831MF, TVF8731MF */ | ||
216 | { "Ymec TVision TVF-8531MF", Philips, NTSC, | ||
217 | 16*160.00,16*454.00,0xa0,0x90,0x30,0x8e,732}, | ||
218 | { "Ymec TVision TVF-5533MF", Philips, NTSC, | ||
219 | 16*160.00,16*454.00,0x01,0x02,0x04,0x8e,732}, | ||
215 | }; | 220 | }; |
216 | unsigned const int tuner_count = ARRAY_SIZE(tuners); | 221 | unsigned const int tuner_count = ARRAY_SIZE(tuners); |
217 | 222 | ||
@@ -424,6 +429,13 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq) | |||
424 | buffer[2] = tun->config; | 429 | buffer[2] = tun->config; |
425 | 430 | ||
426 | switch (t->type) { | 431 | switch (t->type) { |
432 | case TUNER_YMEC_TVF_5533MF: | ||
433 | |||
434 | /*These values are empirically determinated */ | ||
435 | div = (freq*122)/16 - 20; | ||
436 | buffer[2] = 0x88; /* could be also 0x80 */ | ||
437 | buffer[3] = 0x19; /* could be also 0x10, 0x18, 0x99 */ | ||
438 | break; | ||
427 | case TUNER_PHILIPS_FM1216ME_MK3: | 439 | case TUNER_PHILIPS_FM1216ME_MK3: |
428 | case TUNER_PHILIPS_FM1236_MK3: | 440 | case TUNER_PHILIPS_FM1236_MK3: |
429 | buffer[3] = 0x19; | 441 | buffer[3] = 0x19; |
@@ -458,6 +470,20 @@ int default_tuner_init(struct i2c_client *c) | |||
458 | t->type, tuners[t->type].name); | 470 | t->type, tuners[t->type].name); |
459 | strlcpy(c->name, tuners[t->type].name, sizeof(c->name)); | 471 | strlcpy(c->name, tuners[t->type].name, sizeof(c->name)); |
460 | 472 | ||
473 | switch (t->type) { | ||
474 | case TUNER_YMEC_TVF_5533MF: | ||
475 | { | ||
476 | struct tuner_addr tun_addr = { V4L2_TUNER_ANALOG_TV, 0xc2>>1 }; | ||
477 | |||
478 | if (c->driver->command) { | ||
479 | c->driver->command(c, TUNER_SET_ADDR, &tun_addr); | ||
480 | } else { | ||
481 | tuner_warn("Couldn't set TV tuner I2C address to 0x%02x\n",tun_addr.addr<<1); | ||
482 | } | ||
483 | break; | ||
484 | } | ||
485 | } | ||
486 | |||
461 | t->tv_freq = default_set_tv_freq; | 487 | t->tv_freq = default_set_tv_freq; |
462 | t->radio_freq = default_set_radio_freq; | 488 | t->radio_freq = default_set_radio_freq; |
463 | t->has_signal = tuner_signal; | 489 | t->has_signal = tuner_signal; |