/* PCI Routines */
static struct pci_device_id intel_sst_ids[] = {
{ PCI_VDEVICE(INTEL, SST_MRST_PCI_ID), 3},
- { PCI_VDEVICE(INTEL, SST_MFLD_PCI_ID), 6},
+ { PCI_VDEVICE(INTEL, SST_MFLD_PCI_ID), 5},
{ 0, }
};
MODULE_DEVICE_TABLE(pci, intel_sst_ids);
if (copy_from_user(¶ms, (void __user *)arg, sizeof(params)))
return -EFAULT;
- if (params.size > SST_MAILBOX_SIZE)
- return -ENOMEM;
- pr_debug("Parameter %d, Stream %d, Size %d\n", params.type,
+ pr_debug("sst: Parameter %d, Stream %d, Size %d\n", params.type,
params.str_id, params.size);
if (sst_create_large_msg(&msg))
return -ENOMEM;
* @list_spin_lock : sst driver spin lock block
* @scard_ops : sst card ops
* @pci : sst pci device struture
- * @active_streams : sst active streams
* @sst_lock : sst device lock
* @stream_lock : sst stream lock
* @unique_id : sst unique id
spinlock_t list_spin_lock; /* mutex for IPC list locking */
struct snd_pmic_ops *scard_ops;
struct pci_dev *pci;
- int active_streams[MAX_NUM_STREAMS];
void *mmap_mem;
struct mutex sst_lock;
struct mutex stream_lock;
static inline unsigned int sst_assign_pvt_id(struct intel_sst_drv *sst_drv_ctx)
{
sst_drv_ctx->unique_id++;
- if (sst_drv_ctx->unique_id >= MAX_NUM_STREAMS)
+ if (sst_drv_ctx->unique_id > MAX_NUM_STREAMS)
sst_drv_ctx->unique_id = 1;
return sst_drv_ctx->unique_id;
}
static int sst_parse_module(struct fw_module_header *module)
{
struct dma_block_info *block;
- struct sst_firmware_list *node;
+ struct sst_firmware_list *node = NULL;
u32 count, offset;
unsigned long ram;
return -ENODEV;
}
dma->ch = dma_request_channel(mask, chan_filter, dma);
+ if (!dma->ch) {
+ pr_err("unable to request dma channel\n");
+ return -EIO;
+ }
slave->dma_slave.direction = DMA_FROM_DEVICE;
slave->hs_mode = 0;
retval = dmaengine_slave_config(dma->ch, &slave->dma_slave);
if (retval) {
pr_err("unable to set slave config, err %d\n", retval);
+ dma_release_channel(dma->ch);
return -EIO;
}
return retval;
*/
#define MAX_NUM_STREAMS_MRST 3
-#define MAX_NUM_STREAMS_MFLD 6
-#define MAX_NUM_STREAMS 6
+#define MAX_NUM_STREAMS_MFLD 5
+#define MAX_NUM_STREAMS 5
#define MAX_DBG_RW_BYTES 80
#define MAX_NUM_SCATTER_BUFFERS 8
#define MAX_LOOP_BACK_DWORDS 8
mailbox_params = (struct snd_ppp_params *)msg->mailbox;
get_params = kzalloc(sizeof(*get_params), GFP_KERNEL);
if (!get_params) {
- pr_debug("mem alloc failed\n");
+ pr_err("sst: mem alloc failed\n");
break;
}
memcpy_fromio(get_params, mailbox_params,
get_params->params = kzalloc(mailbox_params->size,
GFP_KERNEL);
if (!get_params->params) {
- pr_debug("mem alloc failed\n");
+ pr_err("sst: mem alloc failed\n");
kfree(get_params);
- pr_err("out of memory for ALG PARAMS block");
break;
}
params = msg->mailbox;
} else {
pr_err("Msg %x reply error %x\n",
msg->header.part.msg_id, msg->header.part.data);
+ break;
}
sst_wake_up_alloc_block(sst_drv_ctx, FW_DWNL_ID, retval, NULL);
break;
*/
static int sst_check_device_type(u32 device, u32 num_chan, u32 *pcm_slot)
{
- if (device >= MAX_NUM_STREAMS_MFLD) {
- pr_debug("device type invalid %d\n", device);
+ /* device id range starts from 1 */
+ if (device > MAX_NUM_STREAMS_MFLD) {
+ pr_debug("sst: device type invalid %d\n", device);
return -EINVAL;
}
if (sst_drv_ctx->streams[device].status == STREAM_UN_INIT) {
pr_debug("Target Device Select\n");
- if (target->device_route < 0 || target->device_route > 2) {
- pr_err("device route is invalid\n");
- return -EINVAL;
- }
-
if (target->device_route != 0) {
pr_err("Unsupported config\n");
return -EIO;