All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bastien Nocera <hadess@hadess.net>
To: Vinod Koul <vinod.koul@intel.com>, alsa-devel@alsa-project.org
Cc: Stephen Just <stephenjust@gmail.com>,
	patches.audio@intel.com,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	liam.r.girdwood@linux.intel.com, apterix@gmail.com,
	broonie@kernel.org, Sachin Mokashi <sachinx.mokashi@intel.com>,
	bugzilla@hadess.net
Subject: Re: [PATCH 3/3] ASoC: Intel: Add surface3 entry in CHT-RT5645 machine
Date: Tue, 19 Jul 2016 16:56:24 +0200	[thread overview]
Message-ID: <1468940184.6761.36.camel@hadess.net> (raw)
In-Reply-To: <1467972591-29175-4-git-send-email-vinod.koul@intel.com>

On Fri, 2016-07-08 at 15:39 +0530, Vinod Koul wrote:
> Surface3 device is a CHT machine, so add entry for it.
> Also update the HID from BIOS.
> 
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=98001
> Signed-off-by: Sachin Mokashi <sachinx.mokashi@intel.com>
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> ---
>  sound/soc/intel/boards/cht_bsw_rt5645.c | 20 +++++++++++++++++++-
>  1 file changed, 19 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/intel/boards/cht_bsw_rt5645.c b/sound/soc/intel/boards/cht_bsw_rt5645.c
> index d7ef292c402d..f26c7b8545ae 100644
> --- a/sound/soc/intel/boards/cht_bsw_rt5645.c
> +++ b/sound/soc/intel/boards/cht_bsw_rt5645.c
> @@ -30,6 +30,7 @@
>  #include 
>  #include "../../codecs/rt5645.h"
>  #include "../atom/sst-atom-controls.h"
> +#include "../common/sst-acpi.h"
>  
>  #define CHT_PLAT_CLK_3_HZ	19200000
>  #define CHT_CODEC_DAI	"rt5645-aif1"
> @@ -340,10 +341,13 @@ static struct snd_soc_card snd_soc_card_chtrt5650 = {
>  };
>  
>  static struct cht_acpi_card snd_soc_cards[] = {
> +	{"10EC5640", CODEC_TYPE_RT5645, &snd_soc_card_chtrt5645},
>  	{"10EC5645", CODEC_TYPE_RT5645, &snd_soc_card_chtrt5645},
>  	{"10EC5650", CODEC_TYPE_RT5650, &snd_soc_card_chtrt5650},
>  };
>  
> +static char cht_rt5640_codec_name[16]; /* i2c-:00 with HID being 8 chars */
> +
>  static int snd_cht_mc_probe(struct platform_device *pdev)
>  {
>  	int ret_val = 0;
> @@ -351,6 +355,9 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
>  	struct cht_mc_private *drv;
>  	struct snd_soc_card *card = snd_soc_cards[0].soc_card;
>  	char codec_name[16];
> +	struct sst_acpi_mach *mach;
> +	const char *i2c_name = NULL;
> +	int dai_index;
>  
>  	drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_ATOMIC);
>  	if (!drv)
> @@ -366,12 +373,23 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
>  		}
>  	}
>  	card->dev = &pdev->dev;
> +	mach = card->dev->platform_data;
>  	sprintf(codec_name, "i2c-%s:00", drv->acpi_card->codec_id);
>  
>  	/* set correct codec name */
>  	for (i = 0; i < ARRAY_SIZE(cht_dailink); i++)
> -		if (!strcmp(card->dai_link[i].codec_name, "i2c-10EC5645:00"))
> +		if (!strcmp(card->dai_link[i].codec_name, "i2c-10EC5645:00")) {
>  			card->dai_link[i].codec_name = kstrdup(codec_name, GFP_KERNEL);
> +			dai_index = i;
> +		}
> +
> +	/* fixup codec name based on HID */
> +	i2c_name = sst_acpi_find_name_from_hid(mach->id);
> +	if (i2c_name != NULL) {
> +		snprintf(cht_rt5640_codec_name, sizeof(cht_rt5640_codec_name),
> +			"%s%s", "i2c-", i2c_name);
> +		cht_dailink[dai_index].codec_name = cht_rt5640_codec_name;

FWIW, I get:
sound/soc/intel/boards/cht_bsw_rt5645.c: In function 'snd_cht_mc_probe':
sound/soc/intel/boards/cht_bsw_rt5645.c:391:37: warning: 'dai_index' may be used uninitialized in this function [-Wmaybe-uninitialized]
   cht_dailink[dai_index].codec_name = cht_rt5640_codec_name;
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~

> +	}
>  
>  	snd_soc_card_set_drvdata(card, drv);
>  	ret_val = devm_snd_soc_register_card(&pdev->dev, card);
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  parent reply	other threads:[~2016-07-19 14:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-08 10:09 [PATCH 0/3] ASoC: Intel: Add support for surface3 tablet Vinod Koul
2016-07-08 10:09 ` [PATCH 1/3] ASoC: Intel: Atom: Add quirk for Surface 3 Vinod Koul
2016-07-08 12:32   ` Applied "ASoC: Intel: Atom: Add quirk for Surface 3" to the asoc tree Mark Brown
2016-07-08 10:09 ` [PATCH 2/3] ASoC: rt5645: Add ACPI ID 10EC5640 Vinod Koul
2016-07-08 10:09 ` [PATCH 3/3] ASoC: Intel: Add surface3 entry in CHT-RT5645 machine Vinod Koul
2016-07-08 12:32   ` Applied "ASoC: Intel: Add surface3 entry in CHT-RT5645 machine" to the asoc tree Mark Brown
2016-07-19 14:56   ` Bastien Nocera [this message]
2016-07-20  3:58     ` [PATCH 3/3] ASoC: Intel: Add surface3 entry in CHT-RT5645 machine Vinod Koul
2016-07-20 11:27       ` Bastien Nocera
2016-07-20 11:33         ` Mokashi, SachinX
2016-07-20 11:51           ` Bastien Nocera
2016-07-20 14:47 ` [PATCH 0/3] ASoC: Intel: Add support for surface3 tablet Bastien Nocera
2016-07-20 15:05   ` Stephen J
2016-07-20 16:12     ` Bastien Nocera

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=1468940184.6761.36.camel@hadess.net \
    --to=hadess@hadess.net \
    --cc=alsa-devel@alsa-project.org \
    --cc=apterix@gmail.com \
    --cc=broonie@kernel.org \
    --cc=bugzilla@hadess.net \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=patches.audio@intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=sachinx.mokashi@intel.com \
    --cc=stephenjust@gmail.com \
    --cc=vinod.koul@intel.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.