提交 3886246a 编写于 作者: S Sebastian Witt 提交者: Greg Kroah-Hartman

[PATCH] I2C: i2c-vid.h: Support for VID to reg conversion

Adds conversion from VID (mV) to register value. Used by the atxp1 I2C module.
Removed uneeded switch case.
Signed-off-by: NSebastian Witt <se.witt@gmx.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 792f156d
...@@ -97,3 +97,15 @@ static inline int vid_from_reg(int val, int vrm) ...@@ -97,3 +97,15 @@ static inline int vid_from_reg(int val, int vrm)
2050 - (val) * 50); 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;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册