From de373d2eb81306e28f164a4d9b1babd0896cb803 Mon Sep 17 00:00:00 2001 From: Sebastian Witt Date: Wed, 13 Apr 2005 22:25:39 +0200 Subject: [PATCH] --- yaml --- r: 2685 b: refs/heads/master c: 3886246a257e828248ce1e72ced00408a3557f0d h: refs/heads/master i: 2683: 1d2981131ea9d1bc355397a599e6ea767e4eb170 v: v3 --- [refs] | 2 +- trunk/include/linux/i2c-vid.h | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 25941fc402fb..04afe3173194 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 792f156d61d327671f58829dc04ad5609152e393 +refs/heads/master: 3886246a257e828248ce1e72ced00408a3557f0d diff --git a/trunk/include/linux/i2c-vid.h b/trunk/include/linux/i2c-vid.h index 974835e3530f..41d0635e0ba9 100644 --- a/trunk/include/linux/i2c-vid.h +++ b/trunk/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; + } +}