All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Barry Song <21cnbao@gmail.com>,
	broonie@kernel.org, lgirdwood@gmail.com,
	alsa-devel@alsa-project.org
Cc: Yibo Cai <Yibo.Cai@csr.com>,
	workgroup.linux@csr.com, Barry Song <Baohua.Song@csr.com>
Subject: Re: [PATCH v2] ASoC: bt-sco: support wide band speech
Date: Wed, 26 Nov 2014 12:30:45 +0100	[thread overview]
Message-ID: <5475B9E5.7040705@metafoo.de> (raw)
In-Reply-To: <1416978538-3318-1-git-send-email-21cnbao@gmail.com>

On 11/26/2014 06:08 AM, Barry Song wrote:
> From: Yibo Cai <Yibo.Cai@csr.com>
>
> HFP1.6 requires support for wide band speech(16KHz) over Bluetooth.
>
> Signed-off-by: Yibo Cai <Yibo.Cai@csr.com>
> Signed-off-by: Barry Song <Baohua.Song@csr.com>
> ---
>   sound/soc/codecs/bt-sco.c | 11 +++++++++++
>   1 file changed, 11 insertions(+)
>
> diff --git a/sound/soc/codecs/bt-sco.c b/sound/soc/codecs/bt-sco.c
> index c4cf069..3878491 100644
> --- a/sound/soc/codecs/bt-sco.c
> +++ b/sound/soc/codecs/bt-sco.c
> @@ -52,6 +52,14 @@ static struct snd_soc_codec_driver soc_codec_dev_bt_sco = {
>
>   static int bt_sco_probe(struct platform_device *pdev)
>   {
> +	const struct platform_device_id *id = platform_get_device_id(pdev);
> +
> +	/* Check wide band SCO(16KHz) support */
> +	if (id && (strcmp(id->name, "bt-sco-wb") == 0)) {

Use id->driver_data instead of strcmp.

> +		bt_sco_dai.playback.rates |= SNDRV_PCM_RATE_16000;
> +		bt_sco_dai.capture.rates |= SNDRV_PCM_RATE_16000;

This is modifying a driver global struct with device local data. This is a 
no-go. Either add second snd_soc_dai_driver with the new rates or add a 
startup callback and add the constraints using snd_pcm_hw_constraint_list().

  reply	other threads:[~2014-11-26 11:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-26  5:08 [PATCH v2] ASoC: bt-sco: support wide band speech Barry Song
2014-11-26 11:30 ` Lars-Peter Clausen [this message]
2014-11-26 16:38   ` Mark Brown

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=5475B9E5.7040705@metafoo.de \
    --to=lars@metafoo.de \
    --cc=21cnbao@gmail.com \
    --cc=Baohua.Song@csr.com \
    --cc=Yibo.Cai@csr.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=workgroup.linux@csr.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.