add temperature attribute for MCI cards

This commit is contained in:
Ralph Metzler 2018-05-25 00:12:31 +02:00
parent 1b89edb4b1
commit 2e5056c4a1
2 changed files with 9 additions and 1 deletions

View File

@ -3584,7 +3584,7 @@ static ssize_t temp_show(struct device *device,
int i; int i;
u8 tmp[2]; u8 tmp[2];
if (link->info->type == DDB_MOD) { if (link->info->type == DDB_MOD ) {
if (link->info->version >= 2) { if (link->info->version >= 2) {
temp = 0xffff & ddbreadl(dev, TEMPMON2_BOARD); temp = 0xffff & ddbreadl(dev, TEMPMON2_BOARD);
temp = (temp * 1000) >> 8; temp = (temp * 1000) >> 8;
@ -3614,6 +3614,12 @@ static ssize_t temp_show(struct device *device,
} }
return sprintf(buf, "%d %d\n", temp, temp2); return sprintf(buf, "%d %d\n", temp, temp2);
} }
if (link->info->type == DDB_OCTOPUS_MCI ) {
temp = 0xffff & ddbreadl(dev, TEMPMON_SENSOR0);
temp = (temp * 1000) >> 8;
return sprintf(buf, "%d\n", temp);
}
if (!link->info->temp_num) if (!link->info->temp_num)
return sprintf(buf, "no sensor\n"); return sprintf(buf, "no sensor\n");
adap = &dev->i2c[link->info->temp_bus].adap; adap = &dev->i2c[link->info->temp_bus].adap;

View File

@ -584,6 +584,7 @@ static const struct ddb_info ddb_s2x_48 = {
.tempmon_irq = 24, .tempmon_irq = 24,
.mci_ports = 4, .mci_ports = 4,
.mci_type = 0, .mci_type = 0,
.temp_num = 1,
}; };
static const struct ddb_info ddb_m4 = { static const struct ddb_info ddb_m4 = {
@ -595,6 +596,7 @@ static const struct ddb_info ddb_m4 = {
.tempmon_irq = 24, .tempmon_irq = 24,
.mci_ports = 2, .mci_ports = 2,
.mci_type = 1, .mci_type = 1,
.temp_num = 1,
}; };
/****************************************************************************/ /****************************************************************************/