From: Xing Zheng <zhengxing@rock-chips.com>
To: Steve Barber <smbarber@google.com>,
Adam Thomson <Adam.Thomson@diasemi.com>
Cc: linux-rockchip@lists.infradead.org,
"Mark Rutland" <mark.rutland@arm.com>,
devicetree@vger.kernel.org, alsa-devel@alsa-project.org,
"Pawel Moll" <pawel.moll@arm.com>,
"Ian Campbell" <ijc+devicetree@hellion.org.uk>,
linux-kernel@vger.kernel.org, "Mark Brown" <broonie@kernel.org>,
"Takashi Iwai" <tiwai@suse.com>,
"Douglas Anderson" <dianders@chromium.org>,
"Liam Girdwood" <lgirdwood@gmail.com>,
"Rob Herring" <robh+dt@kernel.org>,
"Kumar Gala" <galak@codeaurora.org>,
"Jaroslav Kysela" <perex@perex.cz>,
linux-arm-kernel@lists.infradead.org,
"Heiko Stübner" <heiko@sntech.de>
Subject: Re: [PATCH v5] ASoC: rockchip: Add machine driver for RK3399 GRU Boards
Date: Thu, 16 Jun 2016 09:15:22 +0800 [thread overview]
Message-ID: <5761FDAA.1070802@rock-chips.com> (raw)
In-Reply-To: <CADR9n49m7anZpDbbb3=ZGBaacOuXc4F=Yid0eyMey1LfEJx8Pw@mail.gmail.com>
// + Adam,
On 2016年06月16日 03:43, Steve Barber wrote:
> On Mon, Jun 13, 2016 at 1:42 AM, Xing Zheng<zhengxing@rock-chips.com> wrote:
>> +
>> +static int rockchip_sound_da7219_hw_params(struct snd_pcm_substream *substream,
>> + struct snd_pcm_hw_params *params)
>> +{
>> + struct snd_soc_pcm_runtime *rtd = substream->private_data;
>> + struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
>> + struct snd_soc_dai *codec_dai = rtd->codec_dai;
>> + struct snd_soc_dapm_context *dapm =&rtd->card->dapm;
>> + int mclk, ret;
>> +
>> + snd_soc_dapm_disable_pin(dapm, "Speakers");
>> + snd_soc_dapm_disable_pin(dapm, "Int Mic");
>> + snd_soc_dapm_enable_pin(dapm, "Headphones");
>> + snd_soc_dapm_enable_pin(dapm, "Headset Mic");
>> + snd_soc_dapm_sync(dapm);
>> +
>> + /* in bypass mode, the mclk has to be one of the frequencies below */
>> + switch (params_rate(params)) {
>> + case 8000:
>> + case 16000:
>> + case 24000:
>> + case 32000:
>> + case 48000:
>> + case 64000:
>> + case 96000:
>> + mclk = 12288000;
>> + break;
>> + case 11025:
>> + case 22050:
>> + case 44100:
>> + case 88200:
>> + mclk = 11289600;
>> + break;
>> + default:
>> + return -EINVAL;
>> + }
>> +
>> + ret = snd_soc_dai_set_sysclk(cpu_dai, 0, mclk,
>> + SND_SOC_CLOCK_OUT);
>> + if (ret< 0) {
>> + dev_err(codec_dai->dev, "Can't set cpu clock out %d\n", ret);
>> + return ret;
>> + }
>> +
>> + ret = snd_soc_dai_set_sysclk(codec_dai, 0, mclk,
>> + SND_SOC_CLOCK_IN);
>> + if (ret< 0) {
>> + dev_err(codec_dai->dev, "Can't set codec clock in %d\n", ret);
>> + return ret;
>> + }
>> +
>> + ret = snd_soc_dai_set_pll(codec_dai, 0, DA7219_SYSCLK_MCLK, 0, 0);
>> + if (ret< 0) {
>> + dev_err(codec_dai->dev, "Can't set pll sysclk mclk %d\n", ret);
>> + return ret;
>> + }
>> +
>> + return 0;
>> +}
>> +
>> +static int rockchip_sound_da7219_init(struct snd_soc_pcm_runtime *rtd)
>> +{
>> + struct snd_soc_codec *codec = rtd->codec_dais[0]->codec;
>> + int ret;
>> +
>> + /* Enable Headset and 4 Buttons Jack detection */
>> + ret = snd_soc_card_jack_new(rtd->card, "Headset Jack",
>> + SND_JACK_HEADSET |
> Should this also include SND_JACK_LINEOUT? da7219 differentiates
> between the two so not including lineout means, for example, we can
> miss jack insertion/removal events.
>
Hi Adam,
Could you please confirm Steve says that about SND_JACK_LINEOUT?
Thanks.
--
- Xing Zheng
WARNING: multiple messages have this Message-ID (diff)
From: zhengxing@rock-chips.com (Xing Zheng)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5] ASoC: rockchip: Add machine driver for RK3399 GRU Boards
Date: Thu, 16 Jun 2016 09:15:22 +0800 [thread overview]
Message-ID: <5761FDAA.1070802@rock-chips.com> (raw)
In-Reply-To: <CADR9n49m7anZpDbbb3=ZGBaacOuXc4F=Yid0eyMey1LfEJx8Pw@mail.gmail.com>
// + Adam,
On 2016?06?16? 03:43, Steve Barber wrote:
> On Mon, Jun 13, 2016 at 1:42 AM, Xing Zheng<zhengxing@rock-chips.com> wrote:
>> +
>> +static int rockchip_sound_da7219_hw_params(struct snd_pcm_substream *substream,
>> + struct snd_pcm_hw_params *params)
>> +{
>> + struct snd_soc_pcm_runtime *rtd = substream->private_data;
>> + struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
>> + struct snd_soc_dai *codec_dai = rtd->codec_dai;
>> + struct snd_soc_dapm_context *dapm =&rtd->card->dapm;
>> + int mclk, ret;
>> +
>> + snd_soc_dapm_disable_pin(dapm, "Speakers");
>> + snd_soc_dapm_disable_pin(dapm, "Int Mic");
>> + snd_soc_dapm_enable_pin(dapm, "Headphones");
>> + snd_soc_dapm_enable_pin(dapm, "Headset Mic");
>> + snd_soc_dapm_sync(dapm);
>> +
>> + /* in bypass mode, the mclk has to be one of the frequencies below */
>> + switch (params_rate(params)) {
>> + case 8000:
>> + case 16000:
>> + case 24000:
>> + case 32000:
>> + case 48000:
>> + case 64000:
>> + case 96000:
>> + mclk = 12288000;
>> + break;
>> + case 11025:
>> + case 22050:
>> + case 44100:
>> + case 88200:
>> + mclk = 11289600;
>> + break;
>> + default:
>> + return -EINVAL;
>> + }
>> +
>> + ret = snd_soc_dai_set_sysclk(cpu_dai, 0, mclk,
>> + SND_SOC_CLOCK_OUT);
>> + if (ret< 0) {
>> + dev_err(codec_dai->dev, "Can't set cpu clock out %d\n", ret);
>> + return ret;
>> + }
>> +
>> + ret = snd_soc_dai_set_sysclk(codec_dai, 0, mclk,
>> + SND_SOC_CLOCK_IN);
>> + if (ret< 0) {
>> + dev_err(codec_dai->dev, "Can't set codec clock in %d\n", ret);
>> + return ret;
>> + }
>> +
>> + ret = snd_soc_dai_set_pll(codec_dai, 0, DA7219_SYSCLK_MCLK, 0, 0);
>> + if (ret< 0) {
>> + dev_err(codec_dai->dev, "Can't set pll sysclk mclk %d\n", ret);
>> + return ret;
>> + }
>> +
>> + return 0;
>> +}
>> +
>> +static int rockchip_sound_da7219_init(struct snd_soc_pcm_runtime *rtd)
>> +{
>> + struct snd_soc_codec *codec = rtd->codec_dais[0]->codec;
>> + int ret;
>> +
>> + /* Enable Headset and 4 Buttons Jack detection */
>> + ret = snd_soc_card_jack_new(rtd->card, "Headset Jack",
>> + SND_JACK_HEADSET |
> Should this also include SND_JACK_LINEOUT? da7219 differentiates
> between the two so not including lineout means, for example, we can
> miss jack insertion/removal events.
>
Hi Adam,
Could you please confirm Steve says that about SND_JACK_LINEOUT?
Thanks.
--
- Xing Zheng
next prev parent reply other threads:[~2016-06-16 1:15 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-13 8:42 [PATCH v5] ASoC: rockchip: Add machine driver for RK3399 GRU Boards Xing Zheng
2016-06-13 8:42 ` Xing Zheng
[not found] ` <1465807339-1100-1-git-send-email-zhengxing-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-06-14 22:38 ` Rob Herring
2016-06-14 22:38 ` Rob Herring
2016-06-14 22:38 ` Rob Herring
2016-06-15 9:53 ` Mark Brown
2016-06-15 9:53 ` Mark Brown
2016-06-15 9:53 ` Mark Brown
2016-06-15 12:44 ` Rob Herring
2016-06-15 12:44 ` Rob Herring
2016-06-16 2:36 ` [alsa-devel] " Ben Zhang
2016-06-16 2:36 ` Ben Zhang
[not found] ` <CAL_JsqKEDw14HmbW=78_4P03nFDfmT7kOn4RsTF-PrBi+jWr0g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-17 12:20 ` Mark Brown
2016-06-17 12:20 ` Mark Brown
2016-06-17 12:20 ` Mark Brown
2016-06-15 19:43 ` Steve Barber
2016-06-15 19:43 ` Steve Barber
2016-06-16 1:15 ` Xing Zheng [this message]
2016-06-16 1:15 ` Xing Zheng
2016-06-16 8:40 ` Opensource [Adam Thomson]
2016-06-16 8:40 ` Opensource [Adam Thomson]
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=5761FDAA.1070802@rock-chips.com \
--to=zhengxing@rock-chips.com \
--cc=Adam.Thomson@diasemi.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dianders@chromium.org \
--cc=galak@codeaurora.org \
--cc=heiko@sntech.de \
--cc=ijc+devicetree@hellion.org.uk \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=pawel.moll@arm.com \
--cc=perex@perex.cz \
--cc=robh+dt@kernel.org \
--cc=smbarber@google.com \
--cc=tiwai@suse.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 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.