Skip to contentSkip to conversation

isaset: Add support for word (16-bit)

PATCH In review Jean Delvare 2 participants 2 messages Apr 12, 2011 – Apr 14, 2011

lore
Share & tools
lore
#0 lore raw

PATCH v2 2/2 isaset: Add support for word (16-bit)

Sometimes the hardware expects 16-bit or 32-bit writes rather than byte writes. Add support to isaset so that the user can ask for such writes.

---
 prog/dump/isaset.8 |   13 +++++++--
 prog/dump/isaset.c |   75 ++++++++++++++++++++++++++++------------------------
 prog/dump/util.c   |   15 ++++++++++
 prog/dump/util.h   |    1 
 4 files changed, 68 insertions(+), 36 deletions(-)
prog/dump/isaset.8 +11 -2
@@ -1,10 +1,11 @@
-.TH ISASET 8 "May 2005"
+.TH ISASET 8 "April 2011"
 .SH "NAME"
 isaset \- set ISA registers
 
 .SH SYNOPSIS
 .B isaset
 .RB [ -y ]
+.RB [ -W | -L ]
 .I addrreg
 .I datareg
 .I address
@@ -13,8 +14,10 @@ isaset \- set ISA registers
 #for I2C-like access
 .br
 .B isaset
+.B -f
 .RB [ -y ]
-.BI "-f " address
+.RB [ -W | -L ]
+.I address
 .I value
 .RI [ mask ]
 #for flat address space
@@ -33,6 +36,12 @@ Disable interactive mode. By default, is
 from the user before messing with the ISA bus. When this flag is used, it
 will perform the operation directly. This is mainly meant to be used in
 scripts.
+.TP
+.B -W
+Perform a 16-bit write.
+.TP
+.B -L
+Perform a 32-bit write.
 
 .SH OPTIONS (I2C-like access mode)
 Four options must be provided to isaset. \fIaddrreg\fR contains the
prog/dump/isaset.c +41 -34

159 lines not on this page · raw message

prog/dump/util.c +15 -0
@@ -67,3 +67,18 @@ unsigned long inx(int addr, int width)
 		return inb(addr);
 	}
 }
+
+/* I/O write of specified size */
+void outx(unsigned long value, int addr, int width)
+{
+	switch (width) {
+	case 2:
+		outw(value, addr);
+		break;
+	case 4:
+		outl(value, addr);
+		break;
+	default:
+		outb(value, addr);
+	}
+}
prog/dump/util.h +1 -0
@@ -13,5 +13,6 @@
 
 extern int user_ack(int def);
 extern unsigned long inx(int addr, int width);
+extern void outx(unsigned long value, int addr, int width);
 
 #endif /* _UTIL_H */
Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Acked-by on v2 2/2
#1 lore raw

Re: [lm-sensors] [PATCH v2 2/2] isaset: Add support for word

Quoted 4 lines · Jean Delvare

Sometimes the hardware expects 16-bit or 32-bit writes rather than byte writes. Add support to isaset so that the user can ask for such writes.

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors