diff options
author | Kumar Sanghvi <kumar.sanghvi@stericsson.com> | 2011-05-19 14:14:52 +0530 |
---|---|---|
committer | said m bagheri <ebgheri@steludxu2848.(none)> | 2011-06-29 10:30:29 +0200 |
commit | ec3d4a0dbe6744ca43a1f8e57ba21dd183a95f8f (patch) | |
tree | acdd88486c26489b6d5d48e8f5937b7ca1ed8156 | |
parent | a215f739258d08e3b1bd31b31847bd9d3b9ab612 (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.c | 24 | ||||
-rw-r--r-- | drivers/modem/shrm/shrm_protocol.c | 4 | ||||
-rw-r--r-- | include/linux/modem/shrm/shrm_driver.h | 2 | ||||
-rw-r--r-- | include/linux/modem/shrm/shrm_private.h | 1 |
4 files changed, 26 insertions, 5 deletions
diff --git a/drivers/char/shrm_char.c b/drivers/char/shrm_char.c index 32d975bf451..467c7e6999d 100644 --- a/drivers/char/shrm_char.c +++ b/drivers/char/shrm_char.c @@ -24,8 +24,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) @@ -48,6 +48,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"}, }; /* @@ -482,6 +483,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; @@ -636,6 +641,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); @@ -682,7 +691,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; @@ -728,6 +738,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 |