All of lore.kernel.org
 help / color / mirror / Atom feed
From: CF Adad <cfadad@rocketmail.com>
To: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: "Broken" McBSP1 on AM3517?
Date: Mon, 16 Jul 2012 14:42:26 -0700 (PDT)	[thread overview]
Message-ID: <1342474946.72910.YahooMailNeo@web125204.mail.ne1.yahoo.com> (raw)
In-Reply-To: <1342461393.69195.YahooMailNeo@web125205.mail.ne1.yahoo.com>

I was able to determine it was a bug in the OMAP McBSP code.  The following patch fixed it for me.
--- linux-a/sound/soc/omap/mcbsp.c      2012-06-28 17:11:54.203508660 -0400
+++ linux-b/sound/soc/omap/mcbsp.c      2012-07-16 17:31:52.000000000 -0400
@@ -745,7 +745,7 @@
 {
        const char *signal, *src;

-       if (mcbsp->pdata->mux_signal)
+       if (mcbsp->pdata->mux_signal == NULL)
                return -EINVAL;

        switch (mux) {





----- Original Message -----

I've tried getting this to the alsa-devel list, but have been a bit stymied.  Perhaps it would be relevant here too since this is directly related to the OMAP world.  As noted below, I suspect that recent changes from March in the handling of McBSP1 (6-wire interface) on the omap2/3 are what is causing me issues.  However, I've yet to figure out how to correct it on my platform.  Is detection of AM35xx perhaps part of my issue here?


----- Forwarded Message -----

All,

Over the past several months, we have been successfully interfacing with multiple digital audio devices using McBSPs 2, 3, and 4 on an AM3517 processor using a basic, custom digital audio driver.  (What we're using now is just a newer vesion of to what we shared back in February: http://www.mail-archive.com/linux-omap@vger.kernel.org/msg63844.html.)  Recently we've had an opportunity to try to use McBSP1 as well.  So, I followed our standard formula, added it to our driver and started trying to use it.  What I'm seeing is that my transmit side functions reasonably, but my receive side does not.  I have put an o-scope on it, and I can see data coming back along the receive data line.  So I know there is stuff there.  However, I cannot arecord it.  I've checked my pinmux in u-boot, and:

    MUX_VAL(CP(MCBSP1_CLKR),    (IEN  | PTD | DIS | M0)) \
    MUX_VAL(CP(MCBSP1_FSR),        (IEN  | PTU | DIS | M0)) \
    MUX_VAL(CP(MCBSP1_DX),        (IDIS | PTD | DIS | M0)) \
    MUX_VAL(CP(MCBSP1_DR),        (IEN  | PTD | DIS | M0)) \
    MUX_VAL(CP(MCBSP1_FSX),        (IEN  | PTD | DIS | M0)) \
    MUX_VAL(CP(MCBSP1_CLKX),    (IEN  | PTD | DIS | M0)) \

Since I'm not changing anything in the pinmux in Linux, that should be good.

We are using a very recent linux-omap kernel (3.5.0-rc4), and I'm 99.9999% sure the issue is something simple, likely from the recently patched up omap-mcbsp/mcbsp driver(s).  Our connection is 4-wire only, and I suspect I'm stuck in 6-wire mode.  Historically, folks were instructed to insert the following into their drivers to switch McBSP1 to 4-wire config (http://mailman.alsa-project.org/pipermail/alsa-devel/2009-August/020771.html):


---------------------------------------------------------------------------------------------------------------------------------------------------------------------

    /* set cpu CLKR & FSR as inputs (unused) */
    ret = snd_soc_dai_set_sysclk(cpu_dai, OMAP_MCBSP_CLKR_SRC_CLKX, 0,
                SND_SOC_CLOCK_IN);
    if (ret < 0) {
        printk(KERN_ERR "can't set CPU system clock OMAP_MCBSP_CLKR_SRC_CLKX\n");
        return ret;
    }

    ret = snd_soc_dai_set_sysclk(cpu_dai, OMAP_MCBSP_FSR_SRC_FSX, 0,
                SND_SOC_CLOCK_IN);
    if (ret < 0) {
        printk(KERN_ERR "can't set CPU system clock OMAP_MCBSP_FSR_SRC_FSX\n");
        return ret;
    }


---------------------------------------------------------------------------------------------------------------------------------------------------------------------
However, when I enable that code now, I now get ret < 0 and the error messages.

I suspect all this has to do with the patches from March of this year, as it appears several changes were incorporated recently to this.  My problem is I cannot figure out what I'm missing.  Digging through the code, it looks to me like I should still be able to make this call.  However, it fails.  If things have changed, what is the new procedure for using McBSP1 on an AM35xx in a 4-pin config?  My driver matches very closely to the sound/soc/omap/am3517evm.c at least in this component.  I notice that it has not been altered.  Is that a "bug", or does it work fine over there?

Any ideas on how to "fix" this, presuming this is the problem I'm having with my record path?

Thanks!
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2012-07-16 21:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1341961350.32611.YahooMailNeo@web125202.mail.ne1.yahoo.com>
     [not found] ` <1342459273.74158.YahooMailNeo@web125201.mail.ne1.yahoo.com>
2012-07-16 17:56   ` "Broken" McBSP1 on AM3517? CF Adad
2012-07-16 21:42     ` CF Adad [this message]

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=1342474946.72910.YahooMailNeo@web125204.mail.ne1.yahoo.com \
    --to=cfadad@rocketmail.com \
    --cc=linux-omap@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.