From: tapio.vihuri@nokia.com
To: dmitry.torokhov@gmail.com
Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org,
ilkka.koskinen@nokia.com, samu.p.onkalo@nokia.com
Subject: [PATCH 3/3] ECI: adding platform data for ECI driver
Date: Wed, 22 Dec 2010 14:20:35 +0200 [thread overview]
Message-ID: <1293020435-5680-4-git-send-email-tapio.vihuri@nokia.com> (raw)
In-Reply-To: <1293020435-5680-3-git-send-email-tapio.vihuri@nokia.com>
From: Tapio Vihuri <tapio.vihuri@nokia.com>
Gives platform data for ECI accessory input driver and
ECI bus controller driver.
Signed-off-by: Tapio Vihuri <tapio.vihuri@nokia.com>
---
arch/x86/platform/mrst/mrst.c | 59 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 59 insertions(+), 0 deletions(-)
diff --git a/arch/x86/platform/mrst/mrst.c b/arch/x86/platform/mrst/mrst.c
index 79ae681..60dca78 100644
--- a/arch/x86/platform/mrst/mrst.c
+++ b/arch/x86/platform/mrst/mrst.c
@@ -14,6 +14,7 @@
#include <linux/sfi.h>
#include <linux/irq.h>
#include <linux/module.h>
+#include <linux/platform_device.h>
#include <asm/setup.h>
#include <asm/mpspec_def.h>
@@ -309,3 +310,61 @@ static inline int __init setup_x86_mrst_timer(char *arg)
return 0;
}
__setup("x86_mrst_timer=", setup_x86_mrst_timer);
+
+#if defined(CONFIG_ECI) || defined(CONFIG_ECI_MODULE)
+#include <linux/input/eci.h>
+
+#define GPIO_ECI_RSTn 126 /* GP_CORE_030 + 96 */
+#define GPIO_ECI_SW_CTRL 178 /* GP_CORE_082 + 96 */
+#define GPIO_ECI_INT 16 /* GP_AON_016 */
+
+static struct ecibus_platform_data medfield_ecibus_control = {
+ .ecibus_rst_gpio = GPIO_ECI_RSTn,
+ .ecibus_sw_ctrl_gpio = GPIO_ECI_SW_CTRL,
+ .ecibus_int_gpio = GPIO_ECI_INT,
+};
+
+/*
+ * This is just example, should be used in platform audio driver
+ * hsmic_event->event(hsmic_event->private, true)
+ */
+static void medfield_register_hsmic_event_cb(struct audio_hsmic_event *event)
+{
+ struct audio_hsmic_event *hsmic_event;
+
+ hsmic_event = event;
+}
+
+static struct eci_platform_data medfield_eci_platform_data = {
+ .register_hsmic_event_cb = medfield_register_hsmic_event_cb,
+};
+
+static struct platform_device medfield_ecibus_device = {
+ .name = "ecibus",
+ .id = 1,
+ .dev = {
+ .platform_data = &medfield_ecibus_control,
+ },
+};
+
+static struct platform_device medfield_eci_device = {
+ .name = "ECI_accessory",
+ .dev = {
+ .platform_data = &medfield_eci_platform_data,
+ },
+};
+
+static int __init medfield_ecibus_init(void)
+{
+ int retval;
+
+ retval = platform_device_register(&medfield_ecibus_device);
+ if (retval < 0)
+ return retval;
+
+ retval = platform_device_register(&medfield_eci_device);
+
+ return retval;
+}
+device_initcall(medfield_ecibus_init);
+#endif
--
1.6.5
next prev parent reply other threads:[~2010-12-22 12:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-22 12:20 [PATCH 0/3] input: Add support for ECI (multimedia) accessories tapio.vihuri
2010-12-22 12:20 ` [PATCH 1/3] ECI: input: introduce ECI accessory input driver tapio.vihuri
2010-12-22 12:20 ` [PATCH 2/3] ECI: introducing ECI bus driver tapio.vihuri
2010-12-22 12:20 ` tapio.vihuri [this message]
2010-12-22 17:11 ` Randy Dunlap
2010-12-22 17:17 ` Randy Dunlap
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=1293020435-5680-4-git-send-email-tapio.vihuri@nokia.com \
--to=tapio.vihuri@nokia.com \
--cc=alsa-devel@alsa-project.org \
--cc=dmitry.torokhov@gmail.com \
--cc=ilkka.koskinen@nokia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=samu.p.onkalo@nokia.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®