From 81cd75e38c04268befe128fe5f7c1b19553261ec Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 21 Feb 2010 11:28:21 +0100 Subject: [PATCH] move macros to where they belong --- src/target/firmware/calypso/dsp.c | 11 +---------- src/target/firmware/include/abb/twl3025.h | 3 +++ src/target/firmware/include/calypso/dsp_api.h | 6 ++++++ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/target/firmware/calypso/dsp.c b/src/target/firmware/calypso/dsp.c index f135a8b6d..b857f7e00 100644 --- a/src/target/firmware/calypso/dsp.c +++ b/src/target/firmware/calypso/dsp.c @@ -197,15 +197,6 @@ void dsp_api_memset(uint16_t *ptr, int octets) *ptr++ = 0; } -/* How an ABB register + value is expressed in the API RAM */ -#define ABB_VAL(reg, val) ( (((reg) & 0x1F) << 1) | (((val) & 0x3FF) << 6) ) - -/* How an ABB register + value | TRUE is expressed in the API RAM */ -#define ABB_VAL_T(reg, val) (ABB_VAL(reg, val) | 1) - -/* How a RAMP value is encoded */ -#define RAMP_VAL(up, down) ( ((down & 0x1F) << 5) | (up & 0x1F) ) - static void dsp_ndb_init(void) { T_NDB_MCU_DSP *ndb = dsp_api.ndb; @@ -217,7 +208,7 @@ static void dsp_ndb_init(void) /* load APC ramp: set to "no ramp" so that there will be no output if * not properly initialised at some other place. */ for (i = 0; i < 16; i++) - dsp_api.ndb->a_ramp[i] = ABB_VAL(APCRAM, RAMP_VAL(0, 0)); + dsp_api.ndb->a_ramp[i] = ABB_VAL(APCRAM, ABB_RAMP_VAL(0, 0)); /* Iota registers values will be programmed at 1st DSP communication interrupt */ diff --git a/src/target/firmware/include/abb/twl3025.h b/src/target/firmware/include/abb/twl3025.h index d171db8ef..8ccbf19e4 100644 --- a/src/target/firmware/include/abb/twl3025.h +++ b/src/target/firmware/include/abb/twl3025.h @@ -79,6 +79,9 @@ enum togbr2_bits { TOGBR2_IAPCPTR = (1 << 6), /* Initialize pointer of APC RAM */ }; +/* How a RAMP value is encoded */ +#define ABB_RAMP_VAL(up, down) ( ((down & 0x1F) << 5) | (up & 0x1F) ) + enum twl3025_unit { TWL3025_UNIT_AFC, TWL3025_UNIT_MAD, diff --git a/src/target/firmware/include/calypso/dsp_api.h b/src/target/firmware/include/calypso/dsp_api.h index 5444ec1db..f9751f37a 100644 --- a/src/target/firmware/include/calypso/dsp_api.h +++ b/src/target/firmware/include/calypso/dsp_api.h @@ -1551,4 +1551,10 @@ enum dsp_error { DSP_ERR_STACK_OV = 0x0800, }; +/* How an ABB register + value is expressed in the API RAM */ +#define ABB_VAL(reg, val) ( (((reg) & 0x1F) << 1) | (((val) & 0x3FF) << 6) ) + +/* How an ABB register + value | TRUE is expressed in the API RAM */ +#define ABB_VAL_T(reg, val) (ABB_VAL(reg, val) | 1) + #endif /* _CAL_DSP_API_H */