summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/target/arm/as3525/ascodec-as3525.c4
-rw-r--r--firmware/target/arm/as3525/clock-target.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/firmware/target/arm/as3525/ascodec-as3525.c b/firmware/target/arm/as3525/ascodec-as3525.c
index 4f13dd6300..43a982f454 100644
--- a/firmware/target/arm/as3525/ascodec-as3525.c
+++ b/firmware/target/arm/as3525/ascodec-as3525.c
@@ -72,8 +72,8 @@ void ascodec_init(void)
72 72
73 /* prescaler for i2c clock */ 73 /* prescaler for i2c clock */
74 prescaler = CLK_DIV(AS3525_PCLK_FREQ, AS3525_I2C_FREQ); 74 prescaler = CLK_DIV(AS3525_PCLK_FREQ, AS3525_I2C_FREQ);
75 I2C2_CPSR0 = prescaler & 0xFF; 75 I2C2_CPSR0 = prescaler & 0xFF; /* 8 lsb */
76 I2C2_CPSR1 = (prescaler >> 8) & 0xFF; 76 I2C2_CPSR1 = (prescaler >> 8) & 0x3; /* 2 msb */
77 77
78 /* set i2c slave address of codec part */ 78 /* set i2c slave address of codec part */
79 I2C2_SLAD0 = AS3514_I2C_ADDR << 1; 79 I2C2_SLAD0 = AS3514_I2C_ADDR << 1;
diff --git a/firmware/target/arm/as3525/clock-target.h b/firmware/target/arm/as3525/clock-target.h
index f4b223cdff..49308ce9ea 100644
--- a/firmware/target/arm/as3525/clock-target.h
+++ b/firmware/target/arm/as3525/clock-target.h
@@ -53,7 +53,7 @@
53#endif 53#endif
54 54
55#define AS3525_I2C_FREQ 400000 55#define AS3525_I2C_FREQ 400000
56#if (CLK_DIV(AS3525_PLLA_FREQ, AS3525_I2C_FREQ)) >= (1<<16) /* 2*8 bits */ 56#if (CLK_DIV(AS3525_PCLK_FREQ, AS3525_I2C_FREQ)) >= (1<<10) /* 2+8 bits */
57#error I2C frequency is too low : clock divider will not fit ! 57#error I2C frequency is too low : clock divider will not fit !
58#endif 58#endif
59 59