summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xina260.c30
1 files changed, 9 insertions, 21 deletions
diff --git a/ina260.c b/ina260.c
index 090e168..757af1c 100755
--- a/ina260.c
+++ b/ina260.c
@@ -17,14 +17,14 @@
#include <linux/regmap.h>
// INA260 registers
-#define INA260_REG_CONFIGURATION 0x00
-#define INA260_REG_CURRENT 0x01
-#define INA260_REG_VOLTAGE 0x02
-#define INA260_REG_POWER 0x03
-#define INA260_REG_MASKENABLE 0x06
-#define INA260_REG_ALERTLIMIT 0x07
-#define INA260_REG_MANUFACTURER 0xFE
-#define INA260_REG_DIE 0xFF
+#define INA260_REG_CONFIGURATION 0x00
+#define INA260_REG_CURRENT 0x01
+#define INA260_REG_VOLTAGE 0x02
+#define INA260_REG_POWER 0x03
+#define INA260_REG_MASKENABLE 0x06
+#define INA260_REG_ALERTLIMIT 0x07
+#define INA260_REG_MANUFACTURER 0xFE
+#define INA260_REG_DIE 0xFF
static struct regmap_config ina260_regmap_config = {
.max_register = INA260_REG_DIE,
@@ -41,7 +41,7 @@ static ssize_t _attr##_show(struct device *dev, struct device_attribute *attr, c
err = regmap_read(cdata->regmap, (_reg), &rvalue); \
if(err>0) \
return err; \
- return sprintf(buf, "%x\n", rvalue); \
+ return sprintf(buf, "0x%x\n", rvalue); \
}
#define INA260_REG_STORE(_attr,_reg) \
@@ -58,18 +58,6 @@ static ssize_t _attr##_store(struct device *dev, struct device_attribute *attr,
}
/**
- * @brief This macro is not available on old kernel especially the one
- * used by Beaglebones Single Board Computers
- */
-#define HWMON_CHANNEL_INFO(stype, ...) \
- (&(struct hwmon_channel_info) { \
- .type = hwmon_##stype, \
- .config = (u32 []) { \
- __VA_ARGS__, 0 \
- } \
- })
-
-/**
* @brief Embedded user data
*/
struct client_data {