/*
* cmt_speech.c - HSI CMT speech driver
*
* Copyright (C) 2008,2009,2010 Nokia Corporation. All rights reserved.
*
* Contact: Kai Vehmanen <kai.vehmanen@nokia.com>
* Original author: Peter Ujfalusi <peter.ujfalusi@nokia.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/miscdevice.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/fs.h>
#include <linux/poll.h>
#include <linux/sched.h>
#include <linux/ioctl.h>
#include <linux/uaccess.h>
#include <linux/pm_qos.h>
#include <linux/hsi/hsi.h>
#include <linux/hsi/ssi_protocol.h>
#include <linux/hsi/cs-protocol.h>
#define CS_MMAP_SIZE PAGE_SIZE
struct char_queue {
struct list_head list;
u32 msg;
};
struct cs_char {
unsigned int opened;
struct hsi_client *cl;
struct cs_hsi_iface *hi;
struct list_head chardev_queue;
struct list_head dataind_queue;
int dataind_pending;
/* mmap things */
unsigned long mmap_base;
unsigned long mmap_size;
spinlock_t lock;
struct fasync_struct *async_queue;
wait_queue_head_t wait;
/* hsi channel ids */
int channel_id_cmd;
int channel_id_data;
};
#define SSI_CHANNEL_STATE_READING 1
#define SSI_CHANNEL_STATE_WRITING (1 << 1)