summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2023-08-14 12:24:03 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2023-08-14 12:24:03 +0200
commitedee197198987b06a24eeb12b6dcd65333ebbf39 (patch)
tree3d772a08560bfe5b7d57f8c6e85952779f33c33c
parentbbdef98fc22cb9d6330d623942a8bf1404ea46e5 (diff)
Minor changes
-rwxr-xr-xREADME.md13
-rwxr-xr-xina260.c4
2 files changed, 15 insertions, 2 deletions
diff --git a/README.md b/README.md
index 055c7e1..2a31055 100755
--- a/README.md
+++ b/README.md
@@ -1,7 +1,11 @@
-# INA260-sysfs-driver
+# INA260 Linux Drivers
Link to the [ina260 datasheet](https://www.ti.com/lit/gpn/INA260).
+This project provides two drivers:
+1) `ina260.c` that is compatible with the [hwmon](https://docs.kernel.org/hwmon/hwmon-kernel-api.html)
+2) `ina260_full.c` that provides an entire support for registers and fields of the ina260 and maximize performance over compatibility
+
## Installation
$ make
@@ -11,7 +15,12 @@ Link to the [ina260 datasheet](https://www.ti.com/lit/gpn/INA260).
- Add device: `echo ina260 [devaddr] > /sys/bus/i2c/devices/<bus>/new_device`
- Delete device: `echo [devaddr] > /sys/bus/i2c/devices/<bus>/delete_device`
-## Sysfs structure
+## Sysfs structure for the `ina260.c`
+
+You will mostly use the [lm-sensors](https://github.com/lm-sensors/lm-sensors) utility. Although, the ina260 registers
+are accessible from `/sys/class/hwmon/hwmon[0-9]+/registers/`.
+
+## Sysfs structure for the `ina260_full.c`
- Overview: `tree /sys/kernel/ina260`
- You can access to each device registers in `/sys/kernel/ina260/<device>/registers/`
- You can access to each device register fields in `/sys/kernel/ina260/<device>/fields/`
diff --git a/ina260.c b/ina260.c
index 220ebc3..bf97b7f 100755
--- a/ina260.c
+++ b/ina260.c
@@ -49,6 +49,10 @@ static ssize_t _attr##_store(struct device *dev, struct device_attribute *attr,
return count; \
}
+/**
+ * @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, \