i2c-vid.h: Support for VID to reg conversion
PATCH 1/1 i2c-vid.h: Support for VID to reg conversion
Quoted 5 lines · Sebastian Witt
Adds conversion from VID (mV) to register value. Used by the atxp1 I2C module.
Signed-off-by Sebastian Witt <[email protected]>
Your email client just ate all of the tabs for lunch, and spit out the remainder as a linewrapped mess :(
Care to try this again?
thanks,
greg k-h
PATCH 1/1 i2c-vid.h: Support for VID to reg conversion
Adds conversion from VID (mV) to register value. Used by the atxp1 I2C module.
diff -ruN linux-2.6.12-rc2-mm3-orig/include/linux/i2c-vid.h linux-2.6.12-rc2-mm3/include/linux/i2c-vid.h
--- linux-2.6.12-rc2-mm3-orig/include/linux/i2c-vid.h 2005-03-02
08:37:31.000000000 +0100
+++ linux-2.6.12-rc2-mm3/include/linux/i2c-vid.h 2005-04-12
18:22:23.000000000 +0200
@@ -97,3 +97,22 @@
2050 - (val) * 50);
} }
+
+static inline int vid_to_reg(int val, int vrm)
+{
+
+ switch (vrm) {
+
+ case 0:
+ return -1;
+
+ case 91: /* VRM 9.1 */ + case 90: /* VRM 9.0 */
+ return ((val >= 1100) && (val <= 1850) ?
+ ((18500 - val * 10) / 25 + 5) / 10 : -1);
+
+ default:
+ return -1;
+
+ }
+}
PATCH 1/1 i2c-vid.h: Support for VID to reg conversion
In reply to Greg KHHi Sebastian,
Review
Quoted 7 lines
(quoted diff) +7
-0+static inline int vid_to_reg(int val, int vrm) +{ + + switch (vrm) { + + case 0: + return -1;
This one doesn't make much sense to me, as the default case will catch it with the exact same effect anyway.
Review
Quoted 11 lines
(quoted diff) +11
-0+ + case 91: /* VRM 9.1 */ + case 90: /* VRM 9.0 */ + return ((val >= 1100) && (val <= 1850) ? + ((18500 - val * 10) / 25 + 5) / 10 : -1); + + default: + return -1; + + } +}
Thanks,
Signature · 1 line
Jean Delvare
PATCH 1/1 i2c-vid.h: Support for VID to reg conversion 2
In reply to Greg KHAdds conversion from VID (mV) to register value. Used by the atxp1 I2C module. Removed uneeded switch case.
-------------- next part --------------
include/linux/i2c-vid.h 2005-04-12 18:22:23.000000000 +0200 renamed from include/linux/i2c-vid.h 2005-03-02 08:37:31.000000000 +0100 +16 -0
@@ -97,3 +97,22 @@ 2050 - (val) * 50); } } + +static inline int vid_to_reg(int val, int vrm) +{ + + switch (vrm) { + + case 91: /* VRM 9.1 */ + case 90: /* VRM 9.0 */ + return ((val >= 1100) && (val <= 1850) ? + ((18499 - val * 10) / 25 + 5) / 10 : -1); + + default: + return -1; + + } +}
PATCH 1/1 i2c-vid.h: Support for VID to reg conversion 2
In reply to Greg KHQuoted 6 lines · Sebastian Witt
Adds conversion from VID (mV) to register value. Used by the atxp1 I2C module.
Removed uneeded switch case.Signed-off-by Sebastian Witt <[email protected]>
Wow, that's a messed up patch. I fixed it up by hand and applied it.
thanks,
greg k-h