All of lore.kernel.org
 help / color / mirror / Atom feed
From: Han Lu <han.lu@linux.intel.com>
To: Takashi Sakamoto <o-takashi@sakamocchi.jp>,
	han.lu@intel.com, broonie@kernel.org, tiwai@suse.de,
	vinod.koul@intel.com, pierre-louis.bossart@linux.intel.com,
	liam.r.girdwood@linux.intel.com, alsa-devel@alsa-project.org
Subject: Re: [PATCH V7 1/2] ASoC: core: add API for registering and cleaning up DMI card names
Date: Thu, 7 Apr 2016 17:43:20 +0800	[thread overview]
Message-ID: <57062BB8.5070302@linux.intel.com> (raw)
In-Reply-To: <5704DB51.4020303@sakamocchi.jp>



On 04/06/2016 05:48 PM, Takashi Sakamoto wrote:
> Hi,
>
> On Apr 6 2016 16:29, han.lu@intel.com wrote:
>> From: "Lu, Han" <han.lu@intel.com>
>>
>> Add core API for registering and cleaning up DMI card names, so user
>> space utils such as PA and UCM can distinguish various products.
>> Previously on ASoC, the card short name, driver name and long name were
>> all the same as the machine driver name.
>> The patch adds more board information:
>>    card driver name     --->  machine driver name
>>    card short name      --->  DMI_BOARD_NAME or DMI_PRODUCT_NAME
>>    card long name and
>>    card component       --->  short name;driver name;(DMI_SYS_VENDOR,
>>                               optional);(the firmware name, optional)
>>
>> Signed-off-by: Lu, Han <han.lu@intel.com>
>>
>> diff --git a/include/sound/soc.h b/include/sound/soc.h
>> index 02b4a21..911d09e 100644
>> --- a/include/sound/soc.h
>> +++ b/include/sound/soc.h
>> @@ -486,6 +486,9 @@ void snd_soc_runtime_deactivate(struct snd_soc_pcm_runtime *rtd, int stream);
>>   int snd_soc_runtime_set_dai_fmt(struct snd_soc_pcm_runtime *rtd,
>>   	unsigned int dai_fmt);
>>   
>> +int snd_soc_set_card_names(struct snd_soc_card *card, const char *firmware);
>> +void snd_soc_cleanup_card_names(struct snd_soc_card *card);
>> +
>>   /* Utility functions to get clock rates from various things */
>>   int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots);
>>   int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params);
>> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
>> index d2e62b15..c1f3520 100644
>> --- a/sound/soc/soc-core.c
>> +++ b/sound/soc/soc-core.c
>> (omit)
>> +/**
>> + * snd_soc_cleanup_card_names() - cleanup registered DMI names
>> + * @card: The card to cleanup
>> + *
>> + * This function cleanup the registered DMI names from card
>> + */
>> +void snd_soc_cleanup_card_names(struct snd_soc_card *card)
>> +{
>> +	kfree(card->long_name);
>> +}
>> +EXPORT_SYMBOL_GPL(snd_soc_cleanup_card_names);
>> +
> In linux kernel development, such a function with a little statements
> tends to be 'static inline function' defined in a header, instead of
> maintaining more symbols. I think some APIs of Linux workqueue are good
> examples to you. See 'include/linux/workqueue.h'.

Thanks. Since we need to pass the string (firmware name) from machine
driver to core anyway, I guess one API is a must, but the cleanup API may
not necessary if there's no allocation. I'll rethink of it.

BR,
Han
>
>
> Regards
>
> Takashi Sakamoto
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>

  reply	other threads:[~2016-04-07  9:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-06  7:29 [PATCH V7 0/2] ASoC: Add core API to register and cleanup DMI names for card han.lu
2016-04-06  7:29 ` [PATCH V7 1/2] ASoC: core: add API for registering and cleaning up DMI card names han.lu
2016-04-06  9:48   ` Takashi Sakamoto
2016-04-07  9:43     ` Han Lu [this message]
2016-04-06  7:29 ` [PATCH V7 2/2] ASoC: bytcr-rt5640: register DMI names for card han.lu
2016-04-06  8:53 ` [PATCH V7 0/2] ASoC: Add core API to register and cleanup " Takashi Iwai
2016-04-06 17:04   ` Mark Brown
2016-04-07  9:45     ` Han Lu
2016-04-07  9:33   ` Han Lu

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=57062BB8.5070302@linux.intel.com \
    --to=han.lu@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=han.lu@intel.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=o-takashi@sakamocchi.jp \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.de \
    --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.