diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2013-10-21 23:52:40 +0200 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2013-10-21 23:52:40 +0200 |
commit | 9bdf24a4fedadb4844c01c633b97f355abfde6d7 (patch) | |
tree | 635607fc1535e291a4749368d52437eabf4e9a5c /firmware/drivers | |
parent | b1a6a24ed7952dfcab49a9d0d50537563bf5b15d (diff) | |
download | rockbox-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/drivers')
-rw-r--r-- | firmware/drivers/tuner/tea5760uk.c | 21 |
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 @@ | |||
35 | #define RSSI_MIN 4 | 35 | #define RSSI_MIN 4 |
36 | #define RSSI_MAX 46 | 36 | #define RSSI_MAX 46 |
37 | 37 | ||
38 | #define TEA5760UK 0x5760 | ||
39 | #define TEA5761UK 0x5761 | ||
40 | |||
41 | static int model = 0; | ||
38 | static bool tuner_present = false; | 42 | static bool tuner_present = false; |
39 | static unsigned char write_bytes[7] = { | 43 | static unsigned char write_bytes[7] = { |
40 | 0x00, /* INTREG LSB */ | 44 | 0x00, /* INTREG LSB */ |
@@ -170,19 +174,24 @@ void tea5760_init(void) | |||
170 | 174 | ||
171 | /* read all registers */ | 175 | /* read all registers */ |
172 | fmradio_i2c_read(I2C_ADR, buf, sizeof(buf)); | 176 | fmradio_i2c_read(I2C_ADR, buf, sizeof(buf)); |
173 | 177 | ||
174 | /* check device id */ | 178 | /* check device id */ |
175 | manid = (buf[12] << 8) | buf[13]; | 179 | manid = (buf[12] << 8) | buf[13]; |
176 | chipid = (buf[14] << 8) | buf[15]; | 180 | chipid = (buf[14] << 8) | buf[15]; |
177 | if ((manid == 0x202B) && (chipid == 0x5760)) | 181 | if ((manid == 0x202B) && (chipid == 0x5760)) |
182 | model = TEA5760UK; | ||
183 | else if ((manid == 0x402B) && (chipid == 0x5761)) | ||
184 | model = TEA5761UK; | ||
185 | |||
186 | if(model != 0) | ||
178 | { | 187 | { |
179 | tuner_present = true; | 188 | tuner_present = true; |
180 | } | ||
181 | 189 | ||
182 | /* write initial values */ | 190 | /* write initial values */ |
183 | tea5760_set_clear(3, (1<<1), 1); /* soft mute on */ | 191 | tea5760_set_clear(3, (1<<1), 1); /* soft mute on */ |
184 | tea5760_set_clear(3, (1<<0), 1); /* stereo noise cancellation on */ | 192 | tea5760_set_clear(3, (1<<0), 1); /* stereo noise cancellation on */ |
185 | fmradio_i2c_write(I2C_ADR, write_bytes, sizeof(write_bytes)); | 193 | fmradio_i2c_write(I2C_ADR, write_bytes, sizeof(write_bytes)); |
194 | } | ||
186 | } | 195 | } |
187 | 196 | ||
188 | void tea5760_dbg_info(struct tea5760_dbg_info *info) | 197 | void tea5760_dbg_info(struct tea5760_dbg_info *info) |