summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers')
-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 @@
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
41static int model = 0;
38static bool tuner_present = false; 42static bool tuner_present = false;
39static unsigned char write_bytes[7] = { 43static 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
188void tea5760_dbg_info(struct tea5760_dbg_info *info) 197void tea5760_dbg_info(struct tea5760_dbg_info *info)