aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-litecell15/misc/lc15bts_misc.c
diff options
context:
space:
mode:
authorMinh-Quang Nguyen <minh-quang.nguyen@nutaq.com>2016-06-09 16:19:12 -0400
committerHarald Welte <laforge@gnumonks.org>2016-06-15 09:44:58 +0000
commitcbbce0be0965c3160c4916384c3d3d5303c57ae2 (patch)
tree5d440086701274a80b37e7b8d557c0fba00dae6e /src/osmo-bts-litecell15/misc/lc15bts_misc.c
parentd0d2c9217a909c1455dfabb26cd3e678493490d9 (diff)
LC15: Hardware changes:
- Change system devices path - Remove obsoleted sensors and add new sensors - Change TRX and sensors numbering to 0,1 instead of 1,2 (JFD) Change-Id: I5172daf68d3145a6398e37df87df21b0e5affe42
Diffstat (limited to 'src/osmo-bts-litecell15/misc/lc15bts_misc.c')
-rw-r--r--src/osmo-bts-litecell15/misc/lc15bts_misc.c62
1 files changed, 25 insertions, 37 deletions
diff --git a/src/osmo-bts-litecell15/misc/lc15bts_misc.c b/src/osmo-bts-litecell15/misc/lc15bts_misc.c
index e0602c82..5ff8e312 100644
--- a/src/osmo-bts-litecell15/misc/lc15bts_misc.c
+++ b/src/osmo-bts-litecell15/misc/lc15bts_misc.c
@@ -74,37 +74,41 @@ static const struct {
.ee_par = LC15BTS_PAR_TEMP_FPGA_MAX,
}, {
- .name = "memory",
+ .name = "logrf",
.has_max = 1,
- .sensor = LC15BTS_TEMP_MEMORY,
- .ee_par = LC15BTS_PAR_TEMP_MEMORY_MAX,
+ .sensor = LC15BTS_TEMP_LOGRF,
+ .ee_par = LC15BTS_PAR_TEMP_LOGRF_MAX,
+ }, {
+ .name = "ocxo",
+ .has_max = 1,
+ .sensor = LC15BTS_TEMP_OCXO,
+ .ee_par = LC15BTS_PAR_TEMP_OCXO_MAX,
+ }, {
+ .name = "tx0",
+ .has_max = 0,
+ .sensor = LC15BTS_TEMP_TX0,
+ .ee_par = LC15BTS_PAR_TEMP_TX0_MAX,
}, {
.name = "tx1",
.has_max = 0,
.sensor = LC15BTS_TEMP_TX1,
.ee_par = LC15BTS_PAR_TEMP_TX1_MAX,
}, {
- .name = "tx2",
- .has_max = 0,
- .sensor = LC15BTS_TEMP_TX2,
- .ee_par = LC15BTS_PAR_TEMP_TX2_MAX,
+ .name = "pa0",
+ .has_max = 1,
+ .sensor = LC15BTS_TEMP_PA0,
+ .ee_par = LC15BTS_PAR_TEMP_PA0_MAX,
}, {
.name = "pa1",
.has_max = 1,
.sensor = LC15BTS_TEMP_PA1,
.ee_par = LC15BTS_PAR_TEMP_PA1_MAX,
- }, {
- .name = "pa2",
- .has_max = 1,
- .sensor = LC15BTS_TEMP_PA2,
- .ee_par = LC15BTS_PAR_TEMP_PA2_MAX,
}
};
void lc15bts_check_temp(int no_rom_write)
{
int temp_old[ARRAY_SIZE(temp_data)];
- int temp_hi[ARRAY_SIZE(temp_data)];
int temp_cur[ARRAY_SIZE(temp_data)];
int i, rc;
@@ -112,40 +116,24 @@ void lc15bts_check_temp(int no_rom_write)
int ret;
rc = lc15bts_par_get_int(temp_data[i].ee_par, &ret);
temp_old[i] = ret * 1000;
- if (temp_data[i].has_max) {
- temp_hi[i] = lc15bts_temp_get(temp_data[i].sensor,
- LC15BTS_TEMP_HIGHEST);
- temp_cur[i] = lc15bts_temp_get(temp_data[i].sensor,
- LC15BTS_TEMP_INPUT);
-
- if ((temp_cur[i] < 0 && temp_cur[i] > -1000) ||
- (temp_hi[i] < 0 && temp_hi[i] > -1000)) {
- LOGP(DTEMP, LOGL_ERROR, "Error reading temperature\n");
- continue;
- }
- }
- else {
- temp_cur[i] = lc15bts_temp_get(temp_data[i].sensor,
- LC15BTS_TEMP_INPUT);
- if (temp_cur[i] < 0 && temp_cur[i] > -1000) {
- LOGP(DTEMP, LOGL_ERROR, "Error reading temperature\n");
- continue;
- }
- temp_hi[i] = temp_cur[i];
+ temp_cur[i] = lc15bts_temp_get(temp_data[i].sensor);
+ if (temp_cur[i] < 0 && temp_cur[i] > -1000) {
+ LOGP(DTEMP, LOGL_ERROR, "Error reading temperature (%d)\n", temp_data[i].sensor);
+ continue;
}
-
+
LOGP(DTEMP, LOGL_DEBUG, "Current %s temperature: %d.%d C\n",
temp_data[i].name, temp_cur[i]/1000, temp_cur[i]%1000);
- if (temp_hi[i] > temp_old[i]) {
+ if (temp_cur[i] > temp_old[i]) {
LOGP(DTEMP, LOGL_NOTICE, "New maximum %s "
"temperature: %d.%d C\n", temp_data[i].name,
- temp_hi[i]/1000, temp_hi[i]%1000);
+ temp_cur[i]/1000, temp_old[i]%1000);
if (!no_rom_write) {
rc = lc15bts_par_set_int(temp_data[i].ee_par,
- temp_hi[i]/1000);
+ temp_cur[i]/1000);
if (rc < 0)
LOGP(DTEMP, LOGL_ERROR, "error writing new %s "
"max temp %d (%s)\n", temp_data[i].name,