Skip to content

Commit

Permalink
Revert "hwmon/adm1275: Support sense resistor parameter from dt"
Browse files Browse the repository at this point in the history
This reverts commit dd13a2c.

Until we convince the hwmon maintainers that we should do scaling with
device tree, we will perform the scaling in userspace.

Signed-off-by: Joel Stanley <joel@jms.id.au>
  • Loading branch information
Joel Stanley committed Mar 29, 2016
1 parent d741944 commit bba98b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 28 deletions.
19 changes: 0 additions & 19 deletions Documentation/devicetree/bindings/hwmon/adm1275.txt

This file was deleted.

11 changes: 2 additions & 9 deletions drivers/hwmon/pmbus/adm1275.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,6 @@ static int adm1275_probe(struct i2c_client *client,
u8 block_buffer[I2C_SMBUS_BLOCK_MAX + 1];
int config, device_config;
int ret;
u32 r_sense = 1;
struct pmbus_driver_info *info;
struct adm1275_data *data;
const struct i2c_device_id *mid;
Expand Down Expand Up @@ -419,12 +418,6 @@ static int adm1275_probe(struct i2c_client *client,
if (!data)
return -ENOMEM;

ret = of_property_read_u32(client->dev.of_node, "sense-resistor",
&r_sense);
if (!ret)
dev_notice(&client->dev, "using r_sense from dt %d\n",
r_sense);

data->id = mid->driver_data;

info = &data->info;
Expand Down Expand Up @@ -598,12 +591,12 @@ static int adm1275_probe(struct i2c_client *client,
info->R[PSC_VOLTAGE_OUT] = coefficients[voindex].R;
}
if (cindex >= 0) {
info->m[PSC_CURRENT_OUT] = coefficients[cindex].m * r_sense;
info->m[PSC_CURRENT_OUT] = coefficients[cindex].m;
info->b[PSC_CURRENT_OUT] = coefficients[cindex].b;
info->R[PSC_CURRENT_OUT] = coefficients[cindex].R;
}
if (pindex >= 0) {
info->m[PSC_POWER] = coefficients[pindex].m * r_sense;
info->m[PSC_POWER] = coefficients[pindex].m;
info->b[PSC_POWER] = coefficients[pindex].b;
info->R[PSC_POWER] = coefficients[pindex].R;
}
Expand Down

0 comments on commit bba98b6

Please sign in to comment.