aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKumar Sanghvi <kumar.sanghvi@stericsson.com>2011-05-19 14:14:52 +0530
committerPhilippe Langlais <philippe.langlais@stericsson.com>2011-12-06 11:01:01 +0100
commit4ee4f6cc3ac5743380c100bc90d16e5f3242f94f (patch)
treec0febdcedbbbfd4bf69507d00697c7bbacec2d61
parentc9a822898bc7c88c1bd291fd236ff0e54d6e6789 (diff)
u8500: shrm: Add support for CIQ L2Mux channel
Adds support for the CIQ L2Mux channel ST-Ericsson ID: CR334399 Change-Id: Ib189a1090c11b3537fafd6f3b9bc8becf1c63c2f Signed-off-by: Kumar Sanghvi <kumar.sanghvi@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/23373 Reviewed-by: QATEST Tested-by: Sean SANDOVAL <sean.xx.sandoval@stericsson.com> Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
-rw-r--r--drivers/char/shrm_char.c24
-rw-r--r--drivers/modem/shrm/shrm_protocol.c4
-rw-r--r--include/linux/modem/shrm/shrm_driver.h2
-rw-r--r--include/linux/modem/shrm/shrm_private.h1
4 files changed, 26 insertions, 5 deletions
diff --git a/drivers/char/shrm_char.c b/drivers/char/shrm_char.c
index 31f1fedd704..fa44b469b98 100644
--- a/drivers/char/shrm_char.c
+++ b/drivers/char/shrm_char.c
@@ -25,8 +25,8 @@
#define NAME "IPC_ISA"
-/* L2 header for common loopback device is 0xc0 and hence 0xc0+1 = 193*/
-#define MAX_L2_HEADERS 193
+/* L2 header for ciq device is 0xc3 and hence 0xc3+1 = 196*/
+#define MAX_L2_HEADERS 196
#define SIZE_OF_FIFO (512*1024)
@@ -49,6 +49,7 @@ static struct map_device map_dev[] = {
{SECURITY_MESSAGING, 3, "sec"},
{COMMON_LOOPBACK_MESSAGING, 4, "common_loopback"},
{AUDIO_LOOPBACK_MESSAGING, 5, "audio_loopback"},
+ {CIQ_MESSAGING, 6, "ciq"},
};
/*
@@ -483,6 +484,10 @@ ssize_t isa_write(struct file *filp, const char __user *buf,
dev_dbg(shrm->dev, "Audio loopback\n");
addr = isadev->addr;
break;
+ case CIQ_MESSAGING:
+ dev_dbg(shrm->dev, "CIQ\n");
+ addr = isadev->addr;
+ break;
default:
dev_dbg(shrm->dev, "Wrong device\n");
return -EFAULT;
@@ -637,6 +642,10 @@ static int isa_close(struct inode *inode, struct file *filp)
kfree(isadev->addr);
dev_info(shrm->dev, "Close AUDIO_LOOPBACK_MESSAGING Device\n");
break;
+ case CIQ_MESSAGING:
+ kfree(isadev->addr);
+ dev_info(shrm->dev, "Close CIQ_MESSAGING Device\n");
+ break;
default:
dev_info(shrm->dev, "No such device present\n");
mutex_unlock(&isa_lock);
@@ -683,7 +692,8 @@ static int isa_open(struct inode *inode, struct file *filp)
(m != AUDIO_LOOPBACK_MESSAGING) &&
(m != COMMON_LOOPBACK_MESSAGING) &&
(m != AUDIO_MESSAGING) &&
- (m != SECURITY_MESSAGING)) {
+ (m != SECURITY_MESSAGING) &&
+ (m != CIQ_MESSAGING)) {
dev_err(shrm->dev, "No such device present\n");
mutex_unlock(&isa_lock);
return -ENODEV;
@@ -729,6 +739,14 @@ static int isa_open(struct inode *inode, struct file *filp)
}
dev_info(shrm->dev, "Open AUDIO_LOOPBACK_MESSAGING Device\n");
break;
+ case CIQ_MESSAGING:
+ isadev->addr = kzalloc(10 * 1024, GFP_KERNEL);
+ if (!isadev->addr) {
+ mutex_unlock(&isa_lock);
+ return -ENOMEM;
+ }
+ dev_info(shrm->dev, "Open CIQ_MESSAGING Device\n");
+ break;
};
mutex_unlock(&isa_lock);
diff --git a/drivers/modem/shrm/shrm_protocol.c b/drivers/modem/shrm/shrm_protocol.c
index 99a58aa6f71..14fe28ca267 100644
--- a/drivers/modem/shrm/shrm_protocol.c
+++ b/drivers/modem/shrm/shrm_protocol.c
@@ -29,6 +29,7 @@
#define L2_HEADER_COMMON_ADVANCED_LOOPBACK 0xC1
#define L2_HEADER_AUDIO_SIMPLE_LOOPBACK 0x80
#define L2_HEADER_AUDIO_ADVANCED_LOOPBACK 0x81
+#define L2_HEADER_CIQ 0xC3
#define MAX_PAYLOAD 1024
static u8 boot_state = BOOT_INIT;
@@ -993,7 +994,8 @@ int shm_write_msg(struct shrm_dev *shrm, u8 l2_header,
(l2_header == L2_HEADER_RPC) ||
(l2_header == L2_HEADER_SECURITY) ||
(l2_header == L2_HEADER_COMMON_SIMPLE_LOOPBACK) ||
- (l2_header == L2_HEADER_COMMON_ADVANCED_LOOPBACK)) {
+ (l2_header == L2_HEADER_COMMON_ADVANCED_LOOPBACK) ||
+ (l2_header == L2_HEADER_CIQ)) {
channel = 0;
if (shrm_common_tx_state == SHRM_SLEEP_STATE)
shrm_common_tx_state = SHRM_PTR_FREE;
diff --git a/include/linux/modem/shrm/shrm_driver.h b/include/linux/modem/shrm/shrm_driver.h
index f662a0c4533..e7b87005565 100644
--- a/include/linux/modem/shrm/shrm_driver.h
+++ b/include/linux/modem/shrm/shrm_driver.h
@@ -24,7 +24,7 @@
#include <linux/modem/shrm/shrm.h>
#include <linux/cdev.h>
-#define ISA_DEVICES 6
+#define ISA_DEVICES 7
#define BOOT_INIT (0)
#define BOOT_INFO_SYNC (1)
diff --git a/include/linux/modem/shrm/shrm_private.h b/include/linux/modem/shrm/shrm_private.h
index 2063f6d6e8e..888a7c200fd 100644
--- a/include/linux/modem/shrm/shrm_private.h
+++ b/include/linux/modem/shrm/shrm_private.h
@@ -46,6 +46,7 @@
#define SECURITY_MESSAGING (3)
#define COMMON_LOOPBACK_MESSAGING (0xC0)
#define AUDIO_LOOPBACK_MESSAGING (0x80)
+#define CIQ_MESSAGING (0xC3)
#define COMMON_CHANNEL 0
#define AUDIO_CHANNEL 1