From: Nishanth Menon <menon.nishanth@gmail.com>
To: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Cc: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org,
broonie@opensource.wolfsonmicro.com, lrg@slimlogic.co.uk,
jhnikula@gmail.com, tony@atomide.com,
ext-eero.nurkkala@nokia.com, eduardo.valentin@nokia.com
Subject: Re: [RFC PATCH 2/5] OMAP3: McBSP: Change the way how the FIFO is handled
Date: Mon, 31 May 2010 20:41:12 +0300 [thread overview]
Message-ID: <4C03F4B8.9090306@gmail.com> (raw)
In-Reply-To: <1275293810-31984-3-git-send-email-peter.ujfalusi@nokia.com>
On 05/31/2010 11:16 AM, Peter Ujfalusi wrote:
> Use the actual FIFO size in words as buffer_size on OMAP2.
> Change the threshold configuration to use 1 based numbering, when
> specifying the allowed threshold maximum or the McBSP threshold value.
> Set the default maximum threshold to (buffer_size - 0x10) intialy.
>> From users of McBSP, now it is expected to use this method.
> Asking for threshold 1 means that the value written to threshold registers
> are going to be 0, which means 1 word threshold.
just a 2cent minor comment: maybe omap_mcbsp_platform_data needs
structure documentation.. it might be difficult for folks to figure that
out from commit ID itself..
>
> Signed-off-by: Peter Ujfalusi<peter.ujfalusi@nokia.com>
> ---
> arch/arm/mach-omap2/mcbsp.c | 10 +++++-----
> arch/arm/plat-omap/mcbsp.c | 10 ++++++----
> 2 files changed, 11 insertions(+), 9 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c
> index 016fe60..9139958 100644
> --- a/arch/arm/mach-omap2/mcbsp.c
> +++ b/arch/arm/mach-omap2/mcbsp.c
> @@ -132,7 +132,7 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {
> .rx_irq = INT_24XX_MCBSP1_IRQ_RX,
> .tx_irq = INT_24XX_MCBSP1_IRQ_TX,
> .ops =&omap2_mcbsp_ops,
> - .buffer_size = 0x6F,
> + .buffer_size = 0x80,
> },
> {
> .phys_base = OMAP34XX_MCBSP2_BASE,
> @@ -142,7 +142,7 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {
> .rx_irq = INT_24XX_MCBSP2_IRQ_RX,
> .tx_irq = INT_24XX_MCBSP2_IRQ_TX,
> .ops =&omap2_mcbsp_ops,
> - .buffer_size = 0x3FF,
> + .buffer_size = 0x500,
> },
> {
> .phys_base = OMAP34XX_MCBSP3_BASE,
> @@ -152,7 +152,7 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {
> .rx_irq = INT_24XX_MCBSP3_IRQ_RX,
> .tx_irq = INT_24XX_MCBSP3_IRQ_TX,
> .ops =&omap2_mcbsp_ops,
> - .buffer_size = 0x6F,
> + .buffer_size = 0x80,
> },
> {
> .phys_base = OMAP34XX_MCBSP4_BASE,
> @@ -161,7 +161,7 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {
> .rx_irq = INT_24XX_MCBSP4_IRQ_RX,
> .tx_irq = INT_24XX_MCBSP4_IRQ_TX,
> .ops =&omap2_mcbsp_ops,
> - .buffer_size = 0x6F,
> + .buffer_size = 0x80,
> },
> {
> .phys_base = OMAP34XX_MCBSP5_BASE,
> @@ -170,7 +170,7 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {
> .rx_irq = INT_24XX_MCBSP5_IRQ_RX,
> .tx_irq = INT_24XX_MCBSP5_IRQ_TX,
> .ops =&omap2_mcbsp_ops,
> - .buffer_size = 0x6F,
> + .buffer_size = 0x80,
> },
> };
> #define OMAP34XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap34xx_mcbsp_pdata)
> diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
> index 51d8abf..6462968 100644
> --- a/arch/arm/plat-omap/mcbsp.c
> +++ b/arch/arm/plat-omap/mcbsp.c
> @@ -497,7 +497,8 @@ void omap_mcbsp_set_tx_threshold(unsigned int id, u16 threshold)
> }
> mcbsp = id_to_mcbsp_ptr(id);
>
> - MCBSP_WRITE(mcbsp, THRSH2, threshold);
> + if (threshold&& threshold<= mcbsp->max_tx_thres)
> + MCBSP_WRITE(mcbsp, THRSH2, threshold - 1);
> }
> EXPORT_SYMBOL(omap_mcbsp_set_tx_threshold);
>
> @@ -519,7 +520,8 @@ void omap_mcbsp_set_rx_threshold(unsigned int id, u16 threshold)
> }
> mcbsp = id_to_mcbsp_ptr(id);
>
> - MCBSP_WRITE(mcbsp, THRSH1, threshold);
> + if (threshold&& threshold<= mcbsp->max_rx_thres)
> + MCBSP_WRITE(mcbsp, THRSH1, threshold - 1);
> }
> EXPORT_SYMBOL(omap_mcbsp_set_rx_threshold);
>
> @@ -1696,8 +1698,8 @@ static inline void __devinit omap34xx_device_init(struct omap_mcbsp *mcbsp)
> {
> mcbsp->dma_op_mode = MCBSP_DMA_MODE_ELEMENT;
> if (cpu_is_omap34xx()) {
> - mcbsp->max_tx_thres = max_thres(mcbsp);
> - mcbsp->max_rx_thres = max_thres(mcbsp);
> + mcbsp->max_tx_thres = max_thres(mcbsp) - 0x10;
> + mcbsp->max_rx_thres = max_thres(mcbsp) - 0x10;
> /*
> * REVISIT: Set dmap_op_mode to THRESHOLD as default
> * for mcbsp2 instances.
next prev parent reply other threads:[~2010-05-31 17:41 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 ` [RFC PATCH 1/5] OMAP: McBSP: Function to query the FIFO size Peter Ujfalusi
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 [this message]
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 2/5] OMAP3: McBSP: Change the way how the FIFO is handled 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=4C03F4B8.9090306@gmail.com \
--to=menon.nishanth@gmail.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=peter.ujfalusi@nokia.com \
--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).