struct pid;
+struct snd_pnd_hack_params {
+ unsigned int frames_min;
+ unsigned int frames_max;
+ unsigned int reserved[14];
+};
+
struct snd_pcm_substream {
struct snd_pcm *pcm;
struct snd_pcm_str *pstr;
#endif
/* misc flags */
unsigned int hw_opened: 1;
+ /* pandora hack */
+ struct snd_pnd_hack_params pnd_hack_params;
};
#define SUBSTREAM_BUSY(substream) ((substream)->ref_count > 0)
snd_pcm_stream_unlock_irq(substream);
return res;
}
+ case _IOW('A', 0xfe, struct snd_pnd_hack_params):
+ {
+ /* pandora HACK */
+ if (copy_from_user(&substream->pnd_hack_params, arg,
+ sizeof(substream->pnd_hack_params)))
+ return -EFAULT;
+ printk(KERN_INFO "%s hack set\n", __func__);
+ return 0;
+ }
}
snd_printd("unknown ioctl = 0x%x\n", cmd);
return -ENOTTY;
unsigned int in_freq;
int clk_div;
int wlen;
+ /* pandora hack */
+ struct snd_pcm_substream *substream;
};
static struct omap_mcbsp_data mcbsp_data[NUM_LINKS];
struct snd_interval *channels = hw_param_interval(params,
SNDRV_PCM_HW_PARAM_CHANNELS);
struct omap_mcbsp_data *mcbsp_data = rule->private;
+ struct snd_pcm_substream *substream = mcbsp_data->substream;
struct snd_interval frames;
int size;
frames.min = size / channels->min;
frames.integer = 1;
+
+ if (substream && substream->pnd_hack_params.frames_min > 0
+ && substream->pnd_hack_params.frames_max
+ >= substream->pnd_hack_params.frames_min)
+ {
+ frames.min = substream->pnd_hack_params.frames_min;
+ frames.max = substream->pnd_hack_params.frames_max;
+ }
+
return snd_interval_refine(buffer_size, &frames);
}
int bus_id = mcbsp_data->bus_id;
int err = 0;
- if (!cpu_dai->active)
+ if (!cpu_dai->active) {
err = omap_mcbsp_request(bus_id);
+ mcbsp_data->substream = substream;
+ }
/*
* OMAP3 McBSP FIFO is word structured.
if (!cpu_dai->active) {
omap_mcbsp_free(mcbsp_data->bus_id);
mcbsp_data->configured = 0;
+
+ /* undo pandora hack */
+ mcbsp_data->substream = NULL;
+ substream->pnd_hack_params.frames_min = 0;
+ substream->pnd_hack_params.frames_max = 0;
}
}