diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2006-10-23 19:48:42 +0000 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2006-10-23 19:48:42 +0000 |
commit | 76b2efbb433258097e23e0a35b09a5f5aa4d2e42 (patch) | |
tree | f5b18d25821bf9aa556e0833e14c4a523d2d7597 /firmware | |
parent | d5df1caababefad938bf1171841d3b4bb913c6ef (diff) | |
download | rockbox-76b2efbb433258097e23e0a35b09a5f5aa4d2e42.tar.gz rockbox-76b2efbb433258097e23e0a35b09a5f5aa4d2e42.zip |
Don't reset everything when (un)sleeping the TEA5767. Fixes FS#6162.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11321 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/tuner_philips.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/firmware/tuner_philips.c b/firmware/tuner_philips.c index 89c7dd11c7..0a6f5c4c7f 100644 --- a/firmware/tuner_philips.c +++ b/firmware/tuner_philips.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include "fmradio_i2c.h" /* physical interface driver */ | 26 | #include "fmradio_i2c.h" /* physical interface driver */ |
27 | 27 | ||
28 | #define I2C_ADR 0xC0 | 28 | #define I2C_ADR 0xC0 |
29 | static unsigned char write_bytes[5]; | 29 | static unsigned char write_bytes[5] = { 0x00, 0x00, 0x00, 0x00, 0x00 }; |
30 | 30 | ||
31 | /* tuner abstraction layer: set something to the tuner */ | 31 | /* tuner abstraction layer: set something to the tuner */ |
32 | void philips_set(int setting, int value) | 32 | void philips_set(int setting, int value) |
@@ -35,20 +35,16 @@ void philips_set(int setting, int value) | |||
35 | { | 35 | { |
36 | case RADIO_SLEEP: | 36 | case RADIO_SLEEP: |
37 | /* init values */ | 37 | /* init values */ |
38 | write_bytes[0] = 0x80; /* mute */ | 38 | write_bytes[0] |= (1<<7); /* mute */ |
39 | write_bytes[1] = 0x00; | ||
40 | write_bytes[2] = 0x00; | ||
41 | #if CONFIG_TUNER_XTAL == 32768 | 39 | #if CONFIG_TUNER_XTAL == 32768 |
42 | write_bytes[3] = 0x1A; /* 32.768kHz, soft mute, | 40 | /* 32.768kHz, soft mute, stereo noise cancelling */ |
43 | stereo noise cancelling */ | 41 | write_bytes[3] |= (1<<4) | (1<<3) | (1<<1); |
44 | #else | 42 | #else |
45 | write_bytes[3] = 0x0A; /* soft mute, stereo noise cancelling */ | 43 | /* soft mute, stereo noise cancelling */ |
44 | write_bytes[3] |= (1<<3) | (1<<1); | ||
46 | #endif | 45 | #endif |
47 | write_bytes[4] = 0x00; | 46 | /* sleep / standby mode */ |
48 | if (value) /* sleep */ | 47 | write_bytes[3] &= ~(1<<6) | (value ? (1<<6) : 0); |
49 | { | ||
50 | write_bytes[3] |= 0x40; /* standby mode */ | ||
51 | } | ||
52 | break; | 48 | break; |
53 | 49 | ||
54 | case RADIO_FREQUENCY: | 50 | case RADIO_FREQUENCY: |
@@ -70,17 +66,14 @@ void philips_set(int setting, int value) | |||
70 | 66 | ||
71 | case RADIO_FORCE_MONO: | 67 | case RADIO_FORCE_MONO: |
72 | write_bytes[2] = (write_bytes[2] & 0xF7) | (value ? 0x08 : 0); | 68 | write_bytes[2] = (write_bytes[2] & 0xF7) | (value ? 0x08 : 0); |
73 | fmradio_i2c_write(I2C_ADR, write_bytes, sizeof(write_bytes)); | ||
74 | break; | 69 | break; |
75 | 70 | ||
76 | case RADIO_SET_DEEMPHASIS: | 71 | case RADIO_SET_DEEMPHASIS: |
77 | write_bytes[4] = (write_bytes[4] & ~(1<<6)) | (value ? (1<<6) : 0); | 72 | write_bytes[4] = (write_bytes[4] & ~(1<<6)) | (value ? (1<<6) : 0); |
78 | fmradio_i2c_write(I2C_ADR, write_bytes, sizeof(write_bytes)); | ||
79 | break; | 73 | break; |
80 | 74 | ||
81 | case RADIO_SET_BAND: | 75 | case RADIO_SET_BAND: |
82 | write_bytes[3] = (write_bytes[3] & ~(1<<5)) | (value ? (1<<5) : 0); | 76 | write_bytes[3] = (write_bytes[3] & ~(1<<5)) | (value ? (1<<5) : 0); |
83 | fmradio_i2c_write(I2C_ADR, write_bytes, sizeof(write_bytes)); | ||
84 | default: | 77 | default: |
85 | return; | 78 | return; |
86 | } | 79 | } |