netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arun Murthy <arun.murthy@stericsson.com>
To: <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
	<linux-doc@vger.kernel.org>, <gregkh@linuxfoundation.org>,
	<alan@lxorguk.ukuu.org.uk>
Cc: Arun Murthy <arun.murthy@stericsson.com>
Subject: [PATCHv4 2/4] modem_shm: Register u8500 client for MAF
Date: Fri, 28 Sep 2012 13:35:02 +0530	[thread overview]
Message-ID: <1348819504-1303-3-git-send-email-arun.murthy@stericsson.com> (raw)
In-Reply-To: <1348819504-1303-1-git-send-email-arun.murthy@stericsson.com>

Register with Modem Access Framework(MAF) for u8500 platform. This will provide
interface to enable and disable modem access and also provide the status.

Signed-off-by: Arun Murthy <arun.murthy@stericsson.com>
---
 drivers/modem_shm/Kconfig       |   11 +++++
 drivers/modem_shm/Makefile      |    1 +
 drivers/modem_shm/modem_u8500.c |   91 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 103 insertions(+), 0 deletions(-)
 create mode 100644 drivers/modem_shm/modem_u8500.c

diff --git a/drivers/modem_shm/Kconfig b/drivers/modem_shm/Kconfig
index f4b7e54..f59d3dc 100644
--- a/drivers/modem_shm/Kconfig
+++ b/drivers/modem_shm/Kconfig
@@ -7,3 +7,14 @@ config MODEM_SHM
 	 and allows transparent access to modem to the client drivers.
 
 	 If unsure, say N.
+
+config MODEM_U8500
+	bool "Modem Access driver for STE U8500 platform"
+	depends on MODEM_SHM
+	default n
+	help
+	 Add support for Modem Access driver on STE U8500 platform which
+	 uses Shared Memroy as IPC mechanism between Modem processor and
+	 Application processor.
+
+	 If unsure, say N.
diff --git a/drivers/modem_shm/Makefile b/drivers/modem_shm/Makefile
index b77bcc0..a9aac0f 100644
--- a/drivers/modem_shm/Makefile
+++ b/drivers/modem_shm/Makefile
@@ -1 +1,2 @@
 obj-$(CONFIG_MODEM_SHM)		:= modem_access.o
+obj-$(CONFIG_MODEM_U8500)	+= modem_u8500.o
diff --git a/drivers/modem_shm/modem_u8500.c b/drivers/modem_shm/modem_u8500.c
new file mode 100644
index 0000000..924b6a2
--- /dev/null
+++ b/drivers/modem_shm/modem_u8500.c
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) ST-Ericsson SA 2011
+ *
+ * License Terms: GNU General Public License v2
+ * Author: Kumar Sanghvi
+ *	Arun Murthy <arun.murthy@stericsson.com>
+ *
+ * Platform driver implementing access mechanisms to modem
+ * on U8500 which uses Shared Memroy as IPC between Application
+ * Processor and Modem processor.
+ */
+#include <linux/module.h>
+#include <linux/err.h>
+#include <linux/slab.h>
+#include <linux/platform_device.h>
+#include <linux/modem_shm/modem.h>
+#include <linux/mfd/dbx500-prcmu.h>
+
+static int u8500_modem_request(struct modem_desc *mdesc)
+{
+	return prcmu_ac_wake_req();
+}
+
+static void u8500_modem_release(struct modem_desc *mdesc)
+{
+	prcmu_ac_sleep_req();
+}
+
+static int u8500_modem_is_requested(struct modem_desc *mdesc)
+{
+	return prcmu_is_ac_wake_requested();
+}
+
+static struct modem_desc u8500_modem_desc = {
+	.request = u8500_modem_request,
+	.release = u8500_modem_release,
+	.is_requested = u8500_modem_is_requested,
+	.name   = "u8500-shrm-modem",
+	.no_clients = 2,
+	.cli_cnt = ATOMIC_INIT(0),
+	.use_cnt = ATOMIC_INIT(0),
+};
+
+static int __devinit u8500_modem_probe(struct platform_device *pdev)
+{
+	int err = 0;
+
+	u8500_modem_desc.dev = &pdev->dev;
+	err = modem_register(&pdev->dev, &u8500_modem_desc);
+	if (err) {
+		pr_err("failed to register %s: err %i\n",
+				u8500_modem_desc.name, err);
+	}
+
+	return err;
+}
+
+static int __devexit u8500_modem_remove(struct platform_device *pdev)
+{
+	modem_unregister(&u8500_modem_desc);
+	return 0;
+}
+
+static struct platform_driver u8500_modem_driver = {
+	.driver = {
+		.name = "u8500-modem",
+		.owner = THIS_MODULE,
+	},
+	.probe = u8500_modem_probe,
+	.remove = __devexit_p(u8500_modem_remove),
+};
+
+static int __init u8500_modem_init(void)
+{
+	int ret;
+
+	ret = platform_driver_register(&u8500_modem_driver);
+	if (ret < 0) {
+		printk(KERN_ERR "u8500_modem: platform driver reg failed\n");
+		return -ENODEV;
+	}
+
+	return 0;
+}
+
+static void __exit u8500_modem_exit(void)
+{
+	platform_driver_unregister(&u8500_modem_driver);
+}
+
+arch_initcall(u8500_modem_init);
-- 
1.7.4.3

  parent reply	other threads:[~2012-09-28  8:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-28  8:05 [PATCHv4 0/4] modem_shm: U8500 SHaRed Memory driver(SHRM) Arun Murthy
2012-09-28  8:05 ` [PATCHv4 1/4] modem_shm: Add Modem Access Framework Arun Murthy
2012-09-28 16:00   ` Greg KH
2012-10-01  5:30     ` Arun MURTHY
2012-10-01  6:33       ` anish singh
2012-10-01  6:57         ` Arun MURTHY
2012-10-01  8:57           ` anish singh
2012-10-01  9:12             ` Arun MURTHY
2012-10-01 15:59       ` Greg KH
2012-10-03  3:54         ` Arun MURTHY
2012-10-03  4:17           ` anish singh
2012-10-03  4:31             ` Arun MURTHY
2012-10-03 15:17           ` Greg KH
2012-10-04  4:08             ` Arun MURTHY
2012-10-09  5:37             ` Arun MURTHY
2012-10-09 13:59               ` Greg KH
2012-10-11  9:37                 ` Arun MURTHY
2012-10-11 11:01                   ` Greg KH
2012-09-28  8:05 ` Arun Murthy [this message]
2012-09-28  8:05 ` [PATCHv4 3/4] modem_shm: u8500-shm: U8500 Shared Memory Driver Arun Murthy
2012-09-28  8:05 ` [PATCHv4 4/4] Doc: Add u8500_shrm document Arun Murthy

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=1348819504-1303-3-git-send-email-arun.murthy@stericsson.com \
    --to=arun.murthy@stericsson.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).