提交 547acec7 编写于 作者: A Andres Salomon 提交者: Ingo Molnar

x86: GEODE: cache results from geode_has_vsa2() and uninline

This moves geode_has_vsa2 into a .c file, caches the result we get from
the VSA virtual registers, and causes the function to no longer be inline.

[akpm@linux-foundation.org: cleanup]
Signed-off-by: NAndres Salomon <dilinger@debian.org>
Cc: Jordan Crouse <jordan.crouse@amd.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 ac44cc96
...@@ -161,6 +161,25 @@ void geode_gpio_setup_event(unsigned int gpio, int pair, int pme) ...@@ -161,6 +161,25 @@ void geode_gpio_setup_event(unsigned int gpio, int pair, int pme)
} }
EXPORT_SYMBOL_GPL(geode_gpio_setup_event); EXPORT_SYMBOL_GPL(geode_gpio_setup_event);
int geode_has_vsa2(void)
{
static int has_vsa2 = -1;
if (has_vsa2 == -1) {
/*
* The VSA has virtual registers that we can query for a
* signature.
*/
outw(VSA_VR_UNLOCK, VSA_VRC_INDEX);
outw(VSA_VR_SIGNATURE, VSA_VRC_INDEX);
has_vsa2 = (inw(VSA_VRC_DATA) == VSA_SIG);
}
return has_vsa2;
}
EXPORT_SYMBOL_GPL(geode_has_vsa2);
static int __init geode_southbridge_init(void) static int __init geode_southbridge_init(void)
{ {
if (!is_geode()) if (!is_geode())
......
...@@ -185,16 +185,7 @@ static inline int is_geode(void) ...@@ -185,16 +185,7 @@ static inline int is_geode(void)
return (is_geode_gx() || is_geode_lx()); return (is_geode_gx() || is_geode_lx());
} }
/* extern int geode_has_vsa2(void);
* The VSA has virtual registers that we can query for a signature.
*/
static inline int geode_has_vsa2(void)
{
outw(VSA_VR_UNLOCK, VSA_VRC_INDEX);
outw(VSA_VR_SIGNATURE, VSA_VRC_INDEX);
return (inw(VSA_VRC_DATA) == VSA_SIG);
}
/* MFGPTs */ /* MFGPTs */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册