From patchwork Tue May 18 20:13:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liam Girdwood X-Patchwork-Id: 100596 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4IKDtxu020832 for ; Tue, 18 May 2010 20:13:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757465Ab0ERUNy (ORCPT ); Tue, 18 May 2010 16:13:54 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:48480 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754806Ab0ERUNx (ORCPT ); Tue, 18 May 2010 16:13:53 -0400 Received: by mail-wy0-f174.google.com with SMTP id 39so1699320wyb.19 for ; Tue, 18 May 2010 13:13:52 -0700 (PDT) Received: by 10.227.143.211 with SMTP id w19mr6715739wbu.182.1274213632612; Tue, 18 May 2010 13:13:52 -0700 (PDT) Received: from localhost.localdomain (host81-136-218-57.in-addr.btopenworld.com [81.136.218.57]) by mx.google.com with ESMTPS id l23sm50762912wbb.8.2010.05.18.13.13.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 18 May 2010 13:13:51 -0700 (PDT) From: Liam Girdwood To: , Cc: Liam Girdwood , Mark Brown , Peter Ujfalusi , Jarkko Nikula , Tony Lindgren Subject: [PATCH 3/4] ASoC: mcbsp - add machine threshold callback Date: Tue, 18 May 2010 21:13:13 +0100 Message-Id: <1274213594-26554-4-git-send-email-lrg@slimlogic.co.uk> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1274213594-26554-1-git-send-email-lrg@slimlogic.co.uk> References: <1274213594-26554-1-git-send-email-lrg@slimlogic.co.uk> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 18 May 2010 20:13:55 +0000 (UTC) diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c index 6f44cb4..9a1583d 100644 --- a/sound/soc/omap/omap-mcbsp.c +++ b/sound/soc/omap/omap-mcbsp.c @@ -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, diff --git a/sound/soc/omap/omap-mcbsp.h b/sound/soc/omap/omap-mcbsp.h index 6c363e5..f8d8044 100644 --- a/sound/soc/omap/omap-mcbsp.h +++ b/sound/soc/omap/omap-mcbsp.h @@ -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