From 9bdf24a4fedadb4844c01c633b97f355abfde6d7 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Mon, 21 Oct 2013 23:52:40 +0200 Subject: tea5760uk: add support for TEA5761UK They share most of registers (except test and some extra bits), since our driver is very basic, it is safe to relax the manufacurer & chip id check. Change-Id: If54e8b9e0d852cd9128d5e28ff59bd2c7a55d98d --- firmware/drivers/tuner/tea5760uk.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'firmware/drivers/tuner') diff --git a/firmware/drivers/tuner/tea5760uk.c b/firmware/drivers/tuner/tea5760uk.c index 5e89bad411..e3496a161e 100644 --- a/firmware/drivers/tuner/tea5760uk.c +++ b/firmware/drivers/tuner/tea5760uk.c @@ -35,6 +35,10 @@ #define RSSI_MIN 4 #define RSSI_MAX 46 +#define TEA5760UK 0x5760 +#define TEA5761UK 0x5761 + +static int model = 0; static bool tuner_present = false; static unsigned char write_bytes[7] = { 0x00, /* INTREG LSB */ @@ -170,19 +174,24 @@ void tea5760_init(void) /* read all registers */ fmradio_i2c_read(I2C_ADR, buf, sizeof(buf)); - + /* check device id */ manid = (buf[12] << 8) | buf[13]; chipid = (buf[14] << 8) | buf[15]; if ((manid == 0x202B) && (chipid == 0x5760)) + model = TEA5760UK; + else if ((manid == 0x402B) && (chipid == 0x5761)) + model = TEA5761UK; + + if(model != 0) { tuner_present = true; - } - /* write initial values */ - tea5760_set_clear(3, (1<<1), 1); /* soft mute on */ - tea5760_set_clear(3, (1<<0), 1); /* stereo noise cancellation on */ - fmradio_i2c_write(I2C_ADR, write_bytes, sizeof(write_bytes)); + /* write initial values */ + tea5760_set_clear(3, (1<<1), 1); /* soft mute on */ + tea5760_set_clear(3, (1<<0), 1); /* stereo noise cancellation on */ + fmradio_i2c_write(I2C_ADR, write_bytes, sizeof(write_bytes)); + } } void tea5760_dbg_info(struct tea5760_dbg_info *info) -- cgit v1.2.3