diff options
| author | Linus Nielsen Feltzing <linus@haxx.se> | 2002-08-14 12:54:38 +0000 |
|---|---|---|
| committer | Linus Nielsen Feltzing <linus@haxx.se> | 2002-08-14 12:54:38 +0000 |
| commit | 5407edc5ad3d1481611a1fb62e6932d2fbcd3568 (patch) | |
| tree | 3389e38cc2f0ef30565be331f6923e3ab38660df /firmware/drivers/dac.c | |
| parent | 65f3e98ce050581a57744b1d05a1c7b99a3993dd (diff) | |
| download | rockbox-5407edc5ad3d1481611a1fb62e6932d2fbcd3568.zip rockbox-5407edc5ad3d1481611a1fb62e6932d2fbcd3568.tar.gz rockbox-5407edc5ad3d1481611a1fb62e6932d2fbcd3568.tar.bz2 rockbox-5407edc5ad3d1481611a1fb62e6932d2fbcd3568.tar.xz | |
Another strike against the evil distortion problem
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1732 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/dac.c')
| -rw-r--r-- | firmware/drivers/dac.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/firmware/drivers/dac.c b/firmware/drivers/dac.c index 9a40244..72d4c40 100644 --- a/firmware/drivers/dac.c +++ b/firmware/drivers/dac.c @@ -37,7 +37,7 @@ int dac_volume(unsigned int left, unsigned int right, bool deemph) buf[1] = (left & 0x3f) | (deemph ? 0x40 : 0); buf[2] = right & 0x3f; - /* send read command */ + /* send write command */ if (i2c_write(DAC_DEV_WRITE,buf,3)) { ret = -1; @@ -66,7 +66,7 @@ int dac_config(int value) buf[0] = DAC_REG_WRITE | DAC_GCFG; buf[1] = value; - /* send read command */ + /* send write command */ if (i2c_write(DAC_DEV_WRITE,buf,2)) { ret = -1; @@ -75,3 +75,17 @@ int dac_config(int value) i2c_end(); return ret; } + +void dac_init(void) +{ + unsigned char buf[2]; + + i2c_begin(); + + buf[0] = DAC_REG_WRITE | DAC_SR_REG; + buf[1] = 0x07; + + /* send write command */ + i2c_write(DAC_DEV_WRITE,buf,2); + i2c_end(); +} |