diff options
author | Chris Blair <chris.blair@stericsson.com> | 2011-11-04 08:20:33 +0000 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-05-22 11:07:19 +0200 |
commit | 64b767f38d9f08d78444b2d5c8cf47198aab132a (patch) | |
tree | c60d8666aae77d09612991657b4bbe97fa0db502 | |
parent | c5eb0e12bed431f77f06a59d1d4d92e9bfe8421f (diff) |
modem: Add M6718 modem access driver
Adds support for the STE M6718 modem to the modem access framework.
ST-Ericsson ID: 369397
ST-Ericsson FOSS-OUT ID: STETL-FOSS-OUT-12224
ST-Ericsson Linux next: NA
Change-Id: Iefbd8db9a7ab77c21fb09cbb3699a7d34ee555e1
Signed-off-by: Chris Blair <chris.blair@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/36316
Reviewed-by: QATOOLS
Reviewed-by: QABUILD
Reviewed-by: Andrew LYNN <andrew.lynn@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
-rw-r--r-- | drivers/modem/Kconfig | 9 | ||||
-rw-r--r-- | drivers/modem/Makefile | 2 | ||||
-rw-r--r-- | drivers/modem/modem_m6718.c | 95 |
3 files changed, 105 insertions, 1 deletions
diff --git a/drivers/modem/Kconfig b/drivers/modem/Kconfig index 95d4307775b..9ecbe00fd61 100644 --- a/drivers/modem/Kconfig +++ b/drivers/modem/Kconfig @@ -20,3 +20,12 @@ config MODEM_U8500 If unsure, say N. source "drivers/modem/shrm/Kconfig" + +config MODEM_M6718 + tristate "Modem Access driver for STE M6718 modem" + depends on MODEM + default n + help + Add support for the modem access driver for the M6718 modem. + + If unsure, say N. diff --git a/drivers/modem/Makefile b/drivers/modem/Makefile index e1b3f376cce..c0df71e65a1 100644 --- a/drivers/modem/Makefile +++ b/drivers/modem/Makefile @@ -1,4 +1,4 @@ obj-$(CONFIG_MODEM) := modem_access.o obj-$(CONFIG_MODEM_U8500) += modem_u8500.o obj-$(CONFIG_U8500_SHRM) += shrm/ - +obj-$(CONFIG_MODEM_M6718) += modem_m6718.o diff --git a/drivers/modem/modem_m6718.c b/drivers/modem/modem_m6718.c new file mode 100644 index 00000000000..5e457c16003 --- /dev/null +++ b/drivers/modem/modem_m6718.c @@ -0,0 +1,95 @@ +/* + * Copyright (C) ST-Ericsson SA 2011 + * + * License Terms: GNU General Public License v2 + * Author: Chris Blair <chris.blair@stericsson.com> + * based on modem_u8500.c + * + * Platform driver implementing access mechanisms to the M6718 modem. + */ +#include <linux/modem/modem.h> +#include <linux/platform_device.h> +#include <linux/err.h> + +static void modem_m6718_request(struct modem_dev *mdev) +{ + /* nothing to do - modem will wake when data is sent */ +} + +static void modem_m6718_release(struct modem_dev *mdev) +{ + /* nothing to do - modem does not need to be requested/released */ +} + +static int modem_m6718_is_requested(struct modem_dev *mdev) +{ + return 0; +} + +static struct modem_ops modem_m6718_ops = { + .request = modem_m6718_request, + .release = modem_m6718_release, + .is_requested = modem_m6718_is_requested, +}; + +static struct modem_desc modem_m6718_desc = { + .name = "m6718", + .id = 0, + .ops = &modem_m6718_ops, + .owner = THIS_MODULE, +}; + +static int __devinit modem_m6718_probe(struct platform_device *pdev) +{ + struct modem_dev *mdev; + int err; + + mdev = modem_register(&modem_m6718_desc, &pdev->dev, + NULL); + if (IS_ERR(mdev)) { + err = PTR_ERR(mdev); + dev_err(&pdev->dev, "failed to register %s: err %i\n", + modem_m6718_desc.name, err); + } + + return 0; +} + +static int __devexit modem_m6718_remove(struct platform_device *pdev) +{ + return 0; +} + +static struct platform_driver modem_m6718_driver = { + .driver = { + .name = "modem-m6718", + .owner = THIS_MODULE, + }, + .probe = modem_m6718_probe, + .remove = __devexit_p(modem_m6718_remove), +}; + +static int __init modem_m6718_init(void) +{ + int ret; + + ret = platform_driver_register(&modem_m6718_driver); + if (ret < 0) { + printk(KERN_ERR "modem_m6718: platform driver reg failed\n"); + return ret; + } + + return 0; +} + +static void __exit modem_m6718_exit(void) +{ + platform_driver_unregister(&modem_m6718_driver); +} + +module_init(modem_m6718_init); +module_exit(modem_m6718_exit); + +MODULE_AUTHOR("Chris Blair <chris.blair@stericsson.com>"); +MODULE_DESCRIPTION("M6718 modem access driver"); +MODULE_LICENSE("GPL v2"); |