@@ -51,6 +51,9 @@ struct omap_mcbsp_data {
unsigned int bus_id;
struct omap_mcbsp_reg_cfg regs;
unsigned int fmt;
+
+ /* optional machine set_threshold() sample value */
+ void (*mach_set_threshold)(struct snd_pcm_substream *substream);
/*
* Flags indicating is the bus already activated and configured by
* another substream
@@ -306,7 +309,11 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
} else if (cpu_is_omap343x()) {
dma = omap24xx_dma_reqs[bus_id][substream->stream];
port = omap34xx_mcbsp_port[bus_id][substream->stream];
- omap_mcbsp_dai_dma_params[id][substream->stream].set_threshold =
+ if (mcbsp_data->mach_set_threshold)
+ omap_mcbsp_dai_dma_params[id][substream->stream].set_threshold =
+ mcbsp_data->mach_set_threshold;
+ else
+ omap_mcbsp_dai_dma_params[id][substream->stream].set_threshold =
omap_mcbsp_set_threshold;
/* TODO: Currently, MODE_ELEMENT == MODE_FRAME */
if (omap_mcbsp_get_dma_op_mode(bus_id) ==
@@ -835,6 +842,19 @@ int omap_mcbsp_st_add_controls(struct snd_soc_codec *codec, int mcbsp_id)
}
EXPORT_SYMBOL_GPL(omap_mcbsp_st_add_controls);
+int omap_bcbsp_set_threshold_func(struct snd_soc_dai *cpu_dai,
+ void (*mach_set_threshold)(struct snd_pcm_substream *substream))
+{
+ struct omap_mcbsp_data *mcbsp_data = to_mcbsp(cpu_dai->private_data);
+
+ if (!cpu_is_omap34xx())
+ return -ENODEV;
+
+ mcbsp_data->mach_set_threshold = mach_set_threshold;
+ return 0;
+}
+EXPORT_SYMBOL_GPL(omap_bcbsp_set_threshold_func);
+
static int __init snd_omap_mcbsp_init(void)
{
return snd_soc_register_dais(omap_mcbsp_dai,
@@ -58,5 +58,7 @@ enum omap_mcbsp_div {
extern struct snd_soc_dai omap_mcbsp_dai[NUM_LINKS];
int omap_mcbsp_st_add_controls(struct snd_soc_codec *codec, int mcbsp_id);
+int omap_bcbsp_set_threshold_func(struct snd_soc_dai *cpu_dai,
+ void (*mach_set_threshold)(struct snd_pcm_substream *substream));
#endif