|
@@ -34,6 +34,7 @@
|
|
|
#include <linux/hwmon.h>
|
|
|
#include <linux/hwmon-sysfs.h>
|
|
|
#include <linux/jiffies.h>
|
|
|
+#include <linux/of.h>
|
|
|
|
|
|
#include <linux/platform_data/ina2xx.h>
|
|
|
|
|
@@ -221,6 +222,7 @@ static int ina2xx_probe(struct i2c_client *client,
|
|
|
struct ina2xx_data *data;
|
|
|
struct ina2xx_platform_data *pdata;
|
|
|
int ret;
|
|
|
+ u32 val;
|
|
|
long shunt = 10000; /* default shunt value 10mOhms */
|
|
|
|
|
|
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WORD_DATA))
|
|
@@ -234,6 +236,9 @@ static int ina2xx_probe(struct i2c_client *client,
|
|
|
pdata =
|
|
|
(struct ina2xx_platform_data *)client->dev.platform_data;
|
|
|
shunt = pdata->shunt_uohms;
|
|
|
+ } else if (!of_property_read_u32(client->dev.of_node,
|
|
|
+ "shunt-resistor", &val)) {
|
|
|
+ shunt = val;
|
|
|
}
|
|
|
|
|
|
if (shunt <= 0)
|