From: trblinux@gmail.com (Tushar Behera)
To: linux-arm-kernel@lists.infradead.org
Subject: [alsa-devel] [PATCH V2 1/2] ASoC: samsung: Add machine driver for Odroid X2/U3
Date: Wed, 25 Jun 2014 09:01:47 +0530 [thread overview]
Message-ID: <53AA42A3.7030004@gmail.com> (raw)
In-Reply-To: <1403108551-25058-2-git-send-email-s.nawrocki@samsung.com>
On 06/18/2014 09:52 PM, Sylwester Nawrocki wrote:
> This patch adds the sound subsystem driver for Odroid-X2 and
> Odroid-U3 boards. The codec works in I2S master mode; there are
> 2 separate audio routing paths defined as there are differences
> in the signal routing between the X2 and U3 boards, i.e. U3 uses
> single jack for headphones and microphone.
>
> Signed-off-by: Chen Zhen <zhen1.chen@samsung.com>
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> ---
> sound/soc/samsung/Kconfig | 8 ++
> sound/soc/samsung/Makefile | 2 +
> sound/soc/samsung/odroidx2_max98090.c | 191 +++++++++++++++++++++++++++++++++
> 3 files changed, 201 insertions(+)
> create mode 100644 sound/soc/samsung/odroidx2_max98090.c
>
[ ... ]
> +static int odroidx2_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;
> + int ret;
> +
> + ret = snd_soc_dai_set_sysclk(codec_dai, 0, MAX98090_MCLK,
> + SND_SOC_CLOCK_IN);
> + if (ret < 0) {
> + dev_err(codec_dai->dev,
> + "Unable to switch to FLL1: %d\n", ret);
> + return ret;
> + }
> +
> + /* Set the cpu DAI configuration in order to use CDCLK */
> + ret = snd_soc_dai_set_sysclk(cpu_dai, SAMSUNG_I2S_CDCLK,
> + 0, SND_SOC_CLOCK_OUT);
> + if (ret < 0)
> + return ret;
> +
While upstreaming sound-card driver for Snow board, I had a comment from
Mark to move this to probe, if possible. That way, the clock operations
would be done only once and this function and odroidx2_ops can be
removed altogether.
> + dev_dbg(codec_dai->dev, "HiFi DAI %s params: channels: %d, rate: %d\n",
> + snd_pcm_stream_str(substream), params_channels(params),
> + params_rate(params));
> +
> + return 0;
> +}
> +
> +static struct snd_soc_ops odroidx2_ops = {
> + .hw_params = odroidx2_hw_params,
> +};
> +
[ ... ]
> +
> + ret = snd_soc_register_card(card);
devm_snd_soc_register_card ?
> + if (ret) {
> + dev_err(&pdev->dev, "snd_soc_register_card failed: %d\n", ret);
> + goto err_put_cpu_n;
> + }
> +
> + return 0;
> +
> +err_put_cpu_n:
> + of_node_put(odroidx2_dai[0].cpu_of_node);
> +err_put_cod_n:
> + of_node_put(odroidx2_dai[0].codec_of_node);
> + return ret;
> +}
> +
> +static int odroidx2_audio_remove(struct platform_device *pdev)
> +{
> + struct snd_soc_card *card = platform_get_drvdata(pdev);
> +
> + snd_soc_unregister_card(card);
This can be removed when devm_snd_soc_register_card is used.
--
Tushar Behera
next prev parent reply other threads:[~2014-06-25 3:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-18 16:22 [PATCH V2 0/2] Sound support for Exynos4412 Odroid X2, U3 board Sylwester Nawrocki
2014-06-18 16:22 ` [PATCH V2 1/2] ASoC: samsung: Add machine driver for Odroid X2/U3 Sylwester Nawrocki
2014-06-25 3:31 ` Tushar Behera [this message]
2014-06-26 8:47 ` [alsa-devel] " Sylwester Nawrocki
2014-06-30 18:46 ` Mark Brown
2014-07-14 11:27 ` Sylwester Nawrocki
2014-07-14 11:31 ` Mark Brown
2014-06-18 16:22 ` [PATCH V2 2/2] doc: dt bindings: Document Odroid X2/U3 audio subsystem bindings Sylwester Nawrocki
2014-06-23 9:40 ` [PATCH V2 0/2] Sound support for Exynos4412 Odroid X2, U3 board Daniel Drake
2014-06-23 16:32 ` Sylwester Nawrocki
2014-06-23 16:53 ` Sylwester Nawrocki
2014-06-24 8:35 ` Daniel Drake
2014-06-24 9:02 ` Marek Szyprowski
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=53AA42A3.7030004@gmail.com \
--to=trblinux@gmail.com \
--cc=linux-arm-kernel@lists.infradead.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 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).