alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@nokia.com>
To: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org
Cc: broonie@opensource.wolfsonmicro.com, lrg@slimlogic.co.uk,
	jhnikula@gmail.com, tony@atomide.com,
	ext-eero.nurkkala@nokia.com, eduardo.valentin@nokia.com
Subject: [RFC PATCH 1/5] OMAP: McBSP: Function to query the FIFO size
Date: Mon, 31 May 2010 11:16:46 +0300	[thread overview]
Message-ID: <1275293810-31984-2-git-send-email-peter.ujfalusi@nokia.com> (raw)
In-Reply-To: <1275293810-31984-1-git-send-email-peter.ujfalusi@nokia.com>

Users of McBSP can use the omap_mcbsp_get_fifo_size function to query
the size of the McBSP FIFO.
The function will return the FIFO size in words (the HW maximum).

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
---
 arch/arm/plat-omap/include/plat/mcbsp.h |    2 ++
 arch/arm/plat-omap/mcbsp.c              |   14 ++++++++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/include/plat/mcbsp.h b/arch/arm/plat-omap/include/plat/mcbsp.h
index 1bd7021..e126951 100644
--- a/arch/arm/plat-omap/include/plat/mcbsp.h
+++ b/arch/arm/plat-omap/include/plat/mcbsp.h
@@ -473,6 +473,7 @@ void omap_mcbsp_set_tx_threshold(unsigned int id, u16 threshold);
 void omap_mcbsp_set_rx_threshold(unsigned int id, u16 threshold);
 u16 omap_mcbsp_get_max_tx_threshold(unsigned int id);
 u16 omap_mcbsp_get_max_rx_threshold(unsigned int id);
+u16 omap_mcbsp_get_fifo_size(unsigned int id);
 u16 omap_mcbsp_get_tx_delay(unsigned int id);
 u16 omap_mcbsp_get_rx_delay(unsigned int id);
 int omap_mcbsp_get_dma_op_mode(unsigned int id);
@@ -483,6 +484,7 @@ static inline void omap_mcbsp_set_rx_threshold(unsigned int id, u16 threshold)
 { }
 static inline u16 omap_mcbsp_get_max_tx_threshold(unsigned int id) { return 0; }
 static inline u16 omap_mcbsp_get_max_rx_threshold(unsigned int id) { return 0; }
+static inline u16 omap_mcbsp_get_fifo_size(unsigned int id) { return 0; }
 static inline u16 omap_mcbsp_get_tx_delay(unsigned int id) { return 0; }
 static inline u16 omap_mcbsp_get_rx_delay(unsigned int id) { return 0; }
 static inline int omap_mcbsp_get_dma_op_mode(unsigned int id) { return 0; }
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index 4820cab..51d8abf 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -559,6 +559,20 @@ u16 omap_mcbsp_get_max_rx_threshold(unsigned int id)
 }
 EXPORT_SYMBOL(omap_mcbsp_get_max_rx_threshold);
 
+u16 omap_mcbsp_get_fifo_size(unsigned int id)
+{
+	struct omap_mcbsp *mcbsp;
+
+	if (!omap_mcbsp_check_valid_id(id)) {
+		printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
+		return -ENODEV;
+	}
+	mcbsp = id_to_mcbsp_ptr(id);
+
+	return mcbsp->pdata->buffer_size;
+}
+EXPORT_SYMBOL(omap_mcbsp_get_fifo_size);
+
 #define MCBSP2_FIFO_SIZE	0x500 /* 1024 + 256 locations */
 #define MCBSP1345_FIFO_SIZE	0x80  /* 128 locations */
 /*
-- 
1.7.1


  reply	other threads:[~2010-05-31  8:16 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-31  8:16 [RFC PATCH 0/5] OMAP/ASoC: McBSP: FIFO handling related fixes Peter Ujfalusi
2010-05-31  8:16 ` Peter Ujfalusi [this message]
2010-05-31  8:16 ` [RFC PATCH 2/5] OMAP3: McBSP: Change the way how the FIFO is handled Peter Ujfalusi
2010-05-31 17:41   ` Nishanth Menon
2010-06-01  6:59     ` Peter Ujfalusi
2010-06-02  4:24       ` Nishanth Menon
2010-05-31  8:16 ` [RFC PATCH 3/5] OMAP3: McBSP: Use the port's buffer_size when calculating tx delay Peter Ujfalusi
2010-05-31  8:16 ` [RFC PATCH 4/5] ASoC: omap-mcbsp: Save, and use wlen for threshold configuration Peter Ujfalusi
2010-05-31  8:16 ` [RFC PATCH 5/5] ASoC: omap-mcbsp: Place correct constraints for streams Peter Ujfalusi
2010-05-31  8:41   ` Peter Ujfalusi
2010-05-31 10:00   ` [alsa-devel] " Liam Girdwood
2010-05-31 11:57     ` Peter Ujfalusi
2010-06-01  6:38       ` Jarkko Nikula
2010-06-01  6:47         ` Peter Ujfalusi
2010-06-01  7:38           ` Jarkko Nikula
2010-06-01  8:07             ` Peter Ujfalusi
2010-06-01  8:19             ` Peter Ujfalusi
2010-06-01  9:29               ` Jarkko Nikula
2010-06-01 10:30                 ` Peter Ujfalusi
2010-06-01 11:20                   ` [alsa-devel] " Jarkko Nikula
2010-06-01 11:34                     ` Peter Ujfalusi
  -- strict thread matches above, loose matches on Subject: below --
2010-05-31  8:03 [RFC PATCH 0/5] OMAP/ASoC: McBSP: FIFO handling related fixes Peter Ujfalusi
2010-05-31  8:03 ` [RFC PATCH 1/5] OMAP: McBSP: Function to query the FIFO size Peter Ujfalusi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1275293810-31984-2-git-send-email-peter.ujfalusi@nokia.com \
    --to=peter.ujfalusi@nokia.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=eduardo.valentin@nokia.com \
    --cc=ext-eero.nurkkala@nokia.com \
    --cc=jhnikula@gmail.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).