Skip to contentSkip to conversation

w1_therm: adding eeprom sysfs entry

PATCH Superseded Akira Shimahara 1 participant 1 message May 10, 2020 W1 dallas's 1-wire bus

v5 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH v5 6/9 w1_therm: adding eeprom sysfs entry

Adding eeprom sysfs entry (WO) to trigger either device EEPROM save (by writing 'save' in the sysfs), either device EEPROM restore (by writing 'restore' in the sysfs). All the RAM of the device will be save/restore, whatever its size (actually 2 or 3 bytes): resolution config register and alarms level will be save/restore.

The driver implement 2 hardware functions to access device RAM:
* copy_scratchpad
* recall_scratchpad
They act according to device specifications.

As EEPROM operations are not device dependent (all w1_therm can perform EEPROM read/write operation following the same protocol), it is removed from device families structures.

Updating Documentation/ABI/testing/sysfs-driver-w1_therm accordingly.

---
Changes in v5:
- All patch serie in one .c file
- Correcting some comments
- adding <linux/string.h> include

 .../ABI/testing/sysfs-driver-w1_therm         |  14 ++
 drivers/w1/slaves/w1_therm.c                  | 176 ++++++++++++------
 2 files changed, 133 insertions(+), 57 deletions(-)
Documentation/ABI/testing/sysfs-driver-w1_therm +14 -0
index 7ed95e9..8b7ee89 100644
@@ -1,3 +1,17 @@
+What:		/sys/bus/w1/devices/.../eeprom
+Date:		May 2020
+Contact:	Akira Shimahara <[email protected]>
+Description:
+		(WO) writing that file will either trigger a save of the
+		device data to its embedded EEPROM, either restore data
+		embedded in device EEPROM. Be aware that devices support
+		limited EEPROM writing cycles (typical 50k)
+			* 'save': save device RAM to EEPROM
+			* 'restore': restore EEPROM data in device RAM
+Users:		any user space application which wants to communicate with
+		w1_term device
+
+
 What:		/sys/bus/w1/devices/.../ext_power
 Date:		May 2020
 Contact:	Akira Shimahara <[email protected]>
drivers/w1/slaves/w1_therm.c +119 -57

306 lines not on this page · raw message

Signature · 1 line
2.26.2