aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/tx_power.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-03-24 10:41:04 +0100
committerHarald Welte <laforge@gnumonks.org>2017-04-06 18:41:01 +0200
commitbbe90fd6511c9a0abdb5f41d13c5ab0135b903f7 (patch)
tree70b1f03f31d9b84b1b1bf5f00787bc7cf2cadc6b /src/common/tx_power.c
parente16b59357411ffa4903ac110ac4ce46d343e878d (diff)
sysmobts: Don't start with 0dBm TRX output power before ramping
In case a system has a high-gain external PA (like a 40dB PA) connected externally, we cannot simply switch the transceiver to 0 dBm in trx_init() only to then start the ramping at much lower levels once the PHJ completes in trx_init_compl_cb(). The result would be a short 0 + 40 dBm spike followed by later ramping. We want to avoid that spike, particularly its associated inrush current, so let's bring up the board with smething very conservative like -50 dBm, and then ramp from there. Change-Id: I0ad91fce64f65e0213c9fcfde3390ace519055db Fixes: SYS#3259
Diffstat (limited to 'src/common/tx_power.c')
-rw-r--r--src/common/tx_power.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/common/tx_power.c b/src/common/tx_power.c
index c5179181..3dfe1f7e 100644
--- a/src/common/tx_power.c
+++ b/src/common/tx_power.c
@@ -289,3 +289,18 @@ int power_ramp_start(struct gsm_bts_trx *trx, int p_total_tgt_mdBm, int bypass)
return 0;
}
+
+/* determine the initial transceiver output power at start-up time */
+int power_ramp_initial_power_mdBm(struct gsm_bts_trx *trx)
+{
+ struct trx_power_params *tpp = &trx->power_params;
+ int pout_mdBm;
+
+ /* this is the maximum initial output on the antenna connector
+ * towards the antenna */
+ pout_mdBm = tpp->ramp.max_initial_pout_mdBm;
+
+ /* use this as input to compute transceiver board power
+ * (reflecting gains in internal/external amplifiers */
+ return get_p_trxout_eff_mdBm(trx, pout_mdBm);
+}