From bba98b65c826efeb83486deb65e36d2d1b25fb08 Mon Sep 17 00:00:00 2001 From: Joel Stanley Date: Tue, 29 Mar 2016 19:25:07 +1030 Subject: [PATCH] Revert "hwmon/adm1275: Support sense resistor parameter from dt" This reverts commit dd13a2c59d1221f8dd7ca3eb61b587a652c32d8f. 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 --- .../devicetree/bindings/hwmon/adm1275.txt | 19 ------------------- drivers/hwmon/pmbus/adm1275.c | 11 ++--------- 2 files changed, 2 insertions(+), 28 deletions(-) delete mode 100644 Documentation/devicetree/bindings/hwmon/adm1275.txt diff --git a/Documentation/devicetree/bindings/hwmon/adm1275.txt b/Documentation/devicetree/bindings/hwmon/adm1275.txt deleted file mode 100644 index abfba34e91ba1..0000000000000 --- a/Documentation/devicetree/bindings/hwmon/adm1275.txt +++ /dev/null @@ -1,19 +0,0 @@ -adm1275 temperature sensor --------------------------- - -Required property: - - - compatible: "adi,adm1278" - - reg: i2c device address - -Optional property: - -- sense-resistor: external sense resistor value in milliOhms - -Example: - -sensor { - reg = <0x11>; - compatible = "adi,adm1278"; - sense-resistor = < 100 > -} diff --git a/drivers/hwmon/pmbus/adm1275.c b/drivers/hwmon/pmbus/adm1275.c index a5534e40f4b12..1476a127dbdba 100644 --- a/drivers/hwmon/pmbus/adm1275.c +++ b/drivers/hwmon/pmbus/adm1275.c @@ -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; @@ -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; @@ -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; }