summaryrefslogtreecommitdiff
path: root/include/linux/i2c-vid.h
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-08-10 21:46:28 +0400
committerJeff Garzik <jgarzik@pobox.com>2005-08-10 21:46:28 +0400
commit2f058256cb64e346f4fb4499ff4e0f1c2791a4b4 (patch)
tree91e06602f4d3abb6812ea8c9bc9ba4501e14c84e /include/linux/i2c-vid.h
parent0274aa2506fd2fe89a58dd6cd64d3b3f7b976af8 (diff)
parent86b3786078d63242d3194ffc58ae8dae1d1bbef3 (diff)
downloadlinux-2f058256cb64e346f4fb4499ff4e0f1c2791a4b4.tar.xz
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'include/linux/i2c-vid.h')
-rw-r--r--include/linux/i2c-vid.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/i2c-vid.h b/include/linux/i2c-vid.h
index 974835e3530f..41d0635e0ba9 100644
--- a/include/linux/i2c-vid.h
+++ b/include/linux/i2c-vid.h
@@ -97,3 +97,15 @@ static inline int vid_from_reg(int val, int vrm)
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;
+ }
+}