All of lore.kernel.org
 help / color / mirror / Atom feed
From: feng.tang@intel.com
To: linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@elte.hu,
	hpa@zytor.com, jacob.jun.pan@intel.com, dtor@mail.ru,
	randy.dunlap@oracle.com
Cc: Feng Tang <feng.tang@intel.com>
Subject: [PATCH v2 1/5] x86: add i8042 pre-detection hook to x86_platform_ops
Date: Mon,  5 Jul 2010 23:03:18 +0800	[thread overview]
Message-ID: <1278342202-10973-2-git-send-email-feng.tang@intel.com> (raw)
In-Reply-To: <1278342202-10973-1-git-send-email-feng.tang@intel.com>

From: Feng Tang <feng.tang@intel.com>

Some x86 platforms like intel MID platforms don't have i8042 controllers,
and i8042 driver's probe to some legacy IO ports may hang the MID
processor. With this hook, i8042 driver can runtime check and skip the
probe when the pretection fail which also saves some probe time

Signed-off-by: Feng Tang <feng.tang@intel.com>
---
 arch/x86/include/asm/x86_init.h |    2 ++
 arch/x86/kernel/x86_init.c      |    4 +++-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
index 519b543..baa579c 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -142,6 +142,7 @@ struct x86_cpuinit_ops {
  * @set_wallclock:		set time back to HW clock
  * @is_untracked_pat_range	exclude from PAT logic
  * @nmi_init			enable NMI on cpus
+ * @i8042_detect		pre-detect if i8042 controller exists
  */
 struct x86_platform_ops {
 	unsigned long (*calibrate_tsc)(void);
@@ -150,6 +151,7 @@ struct x86_platform_ops {
 	void (*iommu_shutdown)(void);
 	bool (*is_untracked_pat_range)(u64 start, u64 end);
 	void (*nmi_init)(void);
+	int (*i8042_detect)(void);
 };
 
 extern struct x86_init_ops x86_init;
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
index 61a1e8c..1e0c863 100644
--- a/arch/x86/kernel/x86_init.c
+++ b/arch/x86/kernel/x86_init.c
@@ -85,6 +85,7 @@ struct x86_cpuinit_ops x86_cpuinit __cpuinitdata = {
 };
 
 static void default_nmi_init(void) { };
+static int default_i8042_detect(void) { return 1; };
 
 struct x86_platform_ops x86_platform = {
 	.calibrate_tsc			= native_calibrate_tsc,
@@ -92,5 +93,6 @@ struct x86_platform_ops x86_platform = {
 	.set_wallclock			= mach_set_rtc_mmss,
 	.iommu_shutdown			= iommu_shutdown_noop,
 	.is_untracked_pat_range		= is_ISA_range,
-	.nmi_init			= default_nmi_init
+	.nmi_init			= default_nmi_init,
+	.i8042_detect			= default_i8042_detect
 };
-- 
1.7.0.4


  reply	other threads:[~2010-07-05 14:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-05 15:03 [PATCH v2 0/5] patches to settle i8042 with Intel MID platforms feng.tang
2010-07-05 15:03 ` feng.tang [this message]
2010-07-08  7:16   ` [tip:x86/urgent] x86: Add i8042 pre-detection hook to x86_platform_ops tip-bot for Feng Tang
2010-07-05 15:03 ` [PATCH v2 2/5] x86, mrst: add i8042_detect API for Moorestwon platform feng.tang
2010-07-08  7:16   ` [tip:x86/urgent] x86, mrst: Add " tip-bot for Feng Tang
2010-07-05 15:03 ` [PATCH v2 3/5] Revert "Input: do not force selecting i8042 on Moorestown" feng.tang
2010-07-08  7:16   ` [tip:x86/urgent] " tip-bot for Feng Tang
2010-07-05 15:03 ` [PATCH v2 4/5] Revert "Input: fixup X86_MRST selects" feng.tang
2010-07-08  7:16   ` [tip:x86/urgent] " tip-bot for Feng Tang
2010-07-05 15:03 ` [PATCH v2 5/5] input: i8042 - add runtime check in x86's i8042_platform_init feng.tang
2010-07-07 20:02   ` Luck, Tony
2010-07-08  7:17     ` [tip:x86/urgent] " tip-bot for Feng Tang
2010-07-05 19:45 ` [PATCH v2 0/5] patches to settle i8042 with Intel MID platforms H. Peter Anvin
2010-07-05 20:22   ` Dmitry Torokhov
2010-07-05 20:24     ` H. Peter Anvin
2010-07-05 20:29       ` Dmitry Torokhov
2010-07-07 23:12     ` H. Peter Anvin
2010-07-08  7:15 ` [tip:x86/urgent] x86, platform: Export x86_platform to modules tip-bot for H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1278342202-10973-2-git-send-email-feng.tang@intel.com \
    --to=feng.tang@intel.com \
    --cc=dtor@mail.ru \
    --cc=hpa@zytor.com \
    --cc=jacob.jun.pan@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=randy.dunlap@oracle.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.