aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorKumar Sanghvi <kumar.sanghvi@stericsson.com>2011-05-16 21:00:49 +0530
committersaid m bagheri <ebgheri@steludxu2848.(none)>2011-06-29 10:30:26 +0200
commitd5ec05ba2ff02fad9816a468a4dab1a4a628cfe4 (patch)
tree0083e0746b4df3bdf39c25235c30e7f5de1b527f /drivers
parentd64b0f6a798e8dca1daf20d507430584f2a8c337 (diff)
drivers: modem: Add modem access driver for STE U8500
Adds platform driver which implements mechanism for accessing modem on STE U8500 platform which uses Shared Memory for communicating between Modem and Application processor. The driver also registers itself with the Modem Access framework. ST-Ericsson ID: CR329459 Change-Id: Id5bc18f6f974b026f9be2d3e2756e03417e01e07 Signed-off-by: Kumar Sanghvi <kumar.sanghvi@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/23554 Reviewed-by: QATEST Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/modem/Kconfig19
-rw-r--r--drivers/modem/Makefile3
-rw-r--r--drivers/modem/modem_u8500.c94
3 files changed, 112 insertions, 4 deletions
diff --git a/drivers/modem/Kconfig b/drivers/modem/Kconfig
index 000181cdb3d..a23b5c90e5e 100644
--- a/drivers/modem/Kconfig
+++ b/drivers/modem/Kconfig
@@ -2,6 +2,19 @@ config MODEM
bool "Modem Access Framework"
default n
help
- Add support for Modem Access Framework. It allows different
- platform specific drivers to register modem access mechanisms
- and allows transparent access to modem to the client drivers.
+ Add support for Modem Access Framework. It allows different
+ platform specific drivers to register modem access mechanisms
+ 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
+ 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/Makefile b/drivers/modem/Makefile
index 0526714bebd..57b50916c79 100644
--- a/drivers/modem/Makefile
+++ b/drivers/modem/Makefile
@@ -1,2 +1,3 @@
-obj-$(CONFIG_MODEM) := modem_access.o
+obj-$(CONFIG_MODEM) := modem_access.o
+obj-$(CONFIG_MODEM_U8500) += modem_u8500.o
diff --git a/drivers/modem/modem_u8500.c b/drivers/modem/modem_u8500.c
new file mode 100644
index 00000000000..20b5fe78ef7
--- /dev/null
+++ b/drivers/modem/modem_u8500.c
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) ST-Ericsson SA 2011
+ *
+ * License Terms: GNU General Public License v2
+ * Author: Kumar Sanghvi <kumar.sanghvi@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/modem/modem.h>
+#include <linux/platform_device.h>
+#include <linux/err.h>
+#include <mach/prcmu.h>
+
+static void u8500_modem_request(struct modem_dev *mdev)
+{
+ prcmu_ac_wake_req();
+}
+
+static void u8500_modem_release(struct modem_dev *mdev)
+{
+ prcmu_ac_sleep_req();
+}
+
+static int u8500_modem_is_requested(struct modem_dev *mdev)
+{
+ return prcmu_is_ac_wake_requested();
+}
+
+static struct modem_ops u8500_modem_ops = {
+ .request = u8500_modem_request,
+ .release = u8500_modem_release,
+ .is_requested = u8500_modem_is_requested,
+};
+
+static struct modem_desc u8500_modem_desc = {
+ .name = "u8500-shrm-modem",
+ .id = 0,
+ .ops = &u8500_modem_ops,
+ .owner = THIS_MODULE,
+};
+
+
+static int __devinit u8500_modem_probe(struct platform_device *pdev)
+{
+ struct modem_dev *mdev;
+ int err;
+
+ mdev = modem_register(&u8500_modem_desc, &pdev->dev,
+ NULL);
+ if (IS_ERR(mdev)) {
+ err = PTR_ERR(mdev);
+ pr_err("failed to register %s: err %i\n",
+ u8500_modem_desc.name, err);
+ }
+
+ return 0;
+}
+
+static int __devexit u8500_modem_remove(struct platform_device *pdev)
+{
+
+ 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);