summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-10-21 23:52:40 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-10-21 23:52:40 +0200
commit9bdf24a4fedadb4844c01c633b97f355abfde6d7 (patch)
tree635607fc1535e291a4749368d52437eabf4e9a5c /firmware
parentb1a6a24ed7952dfcab49a9d0d50537563bf5b15d (diff)
downloadrockbox-9bdf24a4fedadb4844c01c633b97f355abfde6d7.tar.gz
rockbox-9bdf24a4fedadb4844c01c633b97f355abfde6d7.zip
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
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/tuner/tea5760uk.c21
1 files changed, 15 insertions, 6 deletions
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)