alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Han Lu <han.lu@linux.intel.com>
To: Takashi Iwai <tiwai@suse.de>, han.lu@intel.com
Cc: vinod.koul@intel.com, liam.r.girdwood@linux.intel.com,
	alsa-devel@alsa-project.org, broonie@kernel.org,
	pierre-louis.bossart@linux.intel.com
Subject: Re: [PATCH V7 0/2] ASoC: Add core API to register and cleanup DMI names for card
Date: Thu, 7 Apr 2016 17:33:48 +0800	[thread overview]
Message-ID: <5706297C.8080900@linux.intel.com> (raw)
In-Reply-To: <s5h4mbfxgne.wl-tiwai@suse.de>



On 04/06/2016 04:53 PM, Takashi Iwai wrote:
> On Wed, 06 Apr 2016 09:29:17 +0200,
> han.lu@intel.com wrote:
>> From: "Lu, Han" <han.lu@intel.com>
>>
>>   Share more product information, for user space utils such as PA and UCM to
>>   distinguish different products.
>>    1. Add core APIs to register and cleanup DMI names for card.
>>    2. Apply the APIs to bytcr-rt5640 driver.
> Han, one good advice is: be patient.  This is no urgent fix, so there
> is no many reason to rush too much with a pile of newer patchset.
> Give some more time for other people to review.

sorry, I was too hurry. I'll update patch after more review.
>
> About the patch: I still have a few concerns, and some are in the
> fundamental level:
>
> - Is calling dmi_*() function in ASoC core is appropriate and
>    preferred?

I was intended to add a common function for each machine driver to call, and
to add firmware name if necessary. I can move all dmi_*() functions to 
machine
drivers too, only pass the name strings as arguments.
>
> - When is this function supposed to be called?  Since you're accessing
>    card->snd_card, it must be after instantiation, that is,
>    snd_soc_register_card().  If so, it should be documented.  And, in
>    that case, there is no need to allocate a buffer; you can set the
>    strings directly in card->snd_card. (For snd_component_add(), you
>    may pass the card->snd_card->longname[]).
>
>    OTOH, if the function may be called before instantiation, the code
>    needs more rethink, including the string allocation and release.
the intention was to set the card->long_name, before the accessing to it in
snd_soc_instantiate_card():
     ...
     snprintf(card->snd_card->longname, sizeof(card->snd_card->longname),
          "%s", card->long_name ? card->long_name : card->name);
     ...
or it may be better to overwrite the card->snd_card->longname[] after
instantiation, so no need to allocate and release at all?
>
> - A semicolon is no taboo character, either.  A firmware or vendor
>    string may contain such a letter, too.  You need to either escape or
>    replace such a letter instead of praying the well-mannered
>    firmware.
so any printable ASCII character may have the same risk, may I use a control
code such as '\t', or a non ASCII value like 0x80?

BR,
Han
>
> thanks,
>
> Takashi
>
>>   changes on V7:
>>    1. Remove inconsistent API description
>>    
>>   changes on V6:
>>    1. Use dynamic allocate and cleanup for card long name
>>    2. Remove unneccessary arguments to simplify the API
>>    
>>   changes on V5:
>>    1. Use independent space to store card long_name, to avoid irrelavant
>>    info sharing from card component
>>    2. Use letter ';' instead of ':' to separate strings in long name, in
>>    case name strings may also contain ':' and confuse user
>>    3. Fix error that vendor name and firmware name were not optional
>>     
>>   changes on V4:
>>    1. Replace kmalloc() and snprintf() with ksaprintf() to simplify code
>>      
>>   changes on V3:
>>    1. Split the core API and the API call to two patches
>>    2. Replace misused strcat() with snprintf()
>>    3. Code and comment fix
>>
>> Lu, Han (2):
>>    ASoC: core: add API for registering and cleaning up DMI card names
>>    ASoC: bytcr-rt5640: register DMI names for card
>>
>>   include/sound/soc.h                   |  3 ++
>>   sound/soc/intel/boards/bytcr_rt5640.c | 18 ++++++++
>>   sound/soc/soc-core.c                  | 85 +++++++++++++++++++++++++++++++++++
>>   3 files changed, 106 insertions(+)
>>
>> -- 
>> 2.5.0
>>
>> _______________________________________________
>> Alsa-devel mailing list
>> Alsa-devel@alsa-project.org
>> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>

      parent reply	other threads:[~2016-04-07  9:33 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
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 [this message]

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=5706297C.8080900@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=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 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).