diff options
author | Xiubo Li <Li.Xiubo@freescale.com> | 2014-09-09 21:59:55 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-09-10 06:52:37 -0400 |
commit | 0dd4fc3c2f663b9124855daf3fd841d70b4dbeea (patch) | |
tree | 81e0bf1243aa1e124dc978562f1023ec1bedc76f /sound/soc | |
parent | 2080437d375f4d8ba2fe37254199427f3f5e7bc2 (diff) |
ASoC: simple-card: Adjust the comments of simple card.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/generic/simple-card.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index e0abe772c040..f79347c4c62f 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c | |||
@@ -122,7 +122,7 @@ asoc_simple_card_sub_parse_of(struct device_node *np, | |||
122 | int ret; | 122 | int ret; |
123 | 123 | ||
124 | /* | 124 | /* |
125 | * get node via "sound-dai = <&phandle port>" | 125 | * Get node via "sound-dai = <&phandle port>" |
126 | * it will be used as xxx_of_node on soc_bind_dai_link() | 126 | * it will be used as xxx_of_node on soc_bind_dai_link() |
127 | */ | 127 | */ |
128 | ret = of_parse_phandle_with_args(np, "sound-dai", | 128 | ret = of_parse_phandle_with_args(np, "sound-dai", |
@@ -135,19 +135,19 @@ asoc_simple_card_sub_parse_of(struct device_node *np, | |||
135 | if (args_count) | 135 | if (args_count) |
136 | *args_count = args.args_count; | 136 | *args_count = args.args_count; |
137 | 137 | ||
138 | /* get dai->name */ | 138 | /* Get dai->name */ |
139 | ret = snd_soc_of_get_dai_name(np, name); | 139 | ret = snd_soc_of_get_dai_name(np, name); |
140 | if (ret < 0) | 140 | if (ret < 0) |
141 | return ret; | 141 | return ret; |
142 | 142 | ||
143 | /* parse TDM slot */ | 143 | /* Parse TDM slot */ |
144 | ret = snd_soc_of_parse_tdm_slot(np, &dai->slots, &dai->slot_width); | 144 | ret = snd_soc_of_parse_tdm_slot(np, &dai->slots, &dai->slot_width); |
145 | if (ret) | 145 | if (ret) |
146 | return ret; | 146 | return ret; |
147 | 147 | ||
148 | /* | 148 | /* |
149 | * dai->sysclk come from | 149 | * Parse dai->sysclk come from "clocks = <&xxx>" |
150 | * "clocks = <&xxx>" (if system has common clock) | 150 | * (if system has common clock) |
151 | * or "system-clock-frequency = <xxx>" | 151 | * or "system-clock-frequency = <xxx>" |
152 | * or device's module clock. | 152 | * or device's module clock. |
153 | */ | 153 | */ |
@@ -240,9 +240,11 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, | |||
240 | goto dai_link_of_err; | 240 | goto dai_link_of_err; |
241 | 241 | ||
242 | if (strlen(prefix) && !bitclkmaster && !framemaster) { | 242 | if (strlen(prefix) && !bitclkmaster && !framemaster) { |
243 | /* No dai-link level and master setting was not found from | 243 | /* |
244 | sound node level, revert back to legacy DT parsing and | 244 | * No DAI link level and master setting was found |
245 | take the settings from codec node. */ | 245 | * from sound node level, revert back to legacy DT |
246 | * parsing and take the settings from codec node. | ||
247 | */ | ||
246 | dev_dbg(dev, "%s: Revert to legacy daifmt parsing\n", | 248 | dev_dbg(dev, "%s: Revert to legacy daifmt parsing\n", |
247 | __func__); | 249 | __func__); |
248 | dai_props->cpu_dai.fmt = dai_props->codec_dai.fmt = | 250 | dai_props->cpu_dai.fmt = dai_props->codec_dai.fmt = |
@@ -271,10 +273,10 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, | |||
271 | goto dai_link_of_err; | 273 | goto dai_link_of_err; |
272 | } | 274 | } |
273 | 275 | ||
274 | /* simple-card assumes platform == cpu */ | 276 | /* Simple Card assumes platform == cpu */ |
275 | dai_link->platform_of_node = dai_link->cpu_of_node; | 277 | dai_link->platform_of_node = dai_link->cpu_of_node; |
276 | 278 | ||
277 | /* Link name is created from CPU/CODEC dai name */ | 279 | /* DAI link name is created from CPU/CODEC dai name */ |
278 | name = devm_kzalloc(dev, | 280 | name = devm_kzalloc(dev, |
279 | strlen(dai_link->cpu_dai_name) + | 281 | strlen(dai_link->cpu_dai_name) + |
280 | strlen(dai_link->codec_dai_name) + 2, | 282 | strlen(dai_link->codec_dai_name) + 2, |
@@ -296,11 +298,11 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, | |||
296 | dai_props->codec_dai.sysclk); | 298 | dai_props->codec_dai.sysclk); |
297 | 299 | ||
298 | /* | 300 | /* |
299 | * soc_bind_dai_link() will check cpu name | 301 | * In soc_bind_dai_link() will check cpu name after |
300 | * after of_node matching if dai_link has cpu_dai_name. | 302 | * of_node matching if dai_link has cpu_dai_name. |
301 | * but, it will never match if name was created by fmt_single_name() | 303 | * but, it will never match if name was created by |
302 | * remove cpu_dai_name if cpu_args was 0. | 304 | * fmt_single_name() remove cpu_dai_name if cpu_args |
303 | * see | 305 | * was 0. See: |
304 | * fmt_single_name() | 306 | * fmt_single_name() |
305 | * fmt_multiple_name() | 307 | * fmt_multiple_name() |
306 | */ | 308 | */ |
@@ -329,10 +331,10 @@ static int asoc_simple_card_parse_of(struct device_node *node, | |||
329 | if (!node) | 331 | if (!node) |
330 | return -EINVAL; | 332 | return -EINVAL; |
331 | 333 | ||
332 | /* parsing the card name from DT */ | 334 | /* Parse the card name from DT */ |
333 | snd_soc_of_parse_card_name(&priv->snd_card, "simple-audio-card,name"); | 335 | snd_soc_of_parse_card_name(&priv->snd_card, "simple-audio-card,name"); |
334 | 336 | ||
335 | /* off-codec widgets */ | 337 | /* The off-codec widgets */ |
336 | if (of_property_read_bool(node, "simple-audio-card,widgets")) { | 338 | if (of_property_read_bool(node, "simple-audio-card,widgets")) { |
337 | ret = snd_soc_of_parse_audio_simple_widgets(&priv->snd_card, | 339 | ret = snd_soc_of_parse_audio_simple_widgets(&priv->snd_card, |
338 | "simple-audio-card,widgets"); | 340 | "simple-audio-card,widgets"); |
@@ -387,7 +389,7 @@ static int asoc_simple_card_parse_of(struct device_node *node, | |||
387 | return 0; | 389 | return 0; |
388 | } | 390 | } |
389 | 391 | ||
390 | /* update the reference count of the devices nodes at end of probe */ | 392 | /* Decrease the reference count of the device nodes */ |
391 | static int asoc_simple_card_unref(struct platform_device *pdev) | 393 | static int asoc_simple_card_unref(struct platform_device *pdev) |
392 | { | 394 | { |
393 | struct snd_soc_card *card = platform_get_drvdata(pdev); | 395 | struct snd_soc_card *card = platform_get_drvdata(pdev); |
@@ -416,29 +418,27 @@ static int asoc_simple_card_probe(struct platform_device *pdev) | |||
416 | struct device *dev = &pdev->dev; | 418 | struct device *dev = &pdev->dev; |
417 | int num_links, ret; | 419 | int num_links, ret; |
418 | 420 | ||
419 | /* get the number of DAI links */ | 421 | /* Get the number of DAI links */ |
420 | if (np && of_get_child_by_name(np, "simple-audio-card,dai-link")) | 422 | if (np && of_get_child_by_name(np, "simple-audio-card,dai-link")) |
421 | num_links = of_get_child_count(np); | 423 | num_links = of_get_child_count(np); |
422 | else | 424 | else |
423 | num_links = 1; | 425 | num_links = 1; |
424 | 426 | ||
425 | /* allocate the private data and the DAI link array */ | 427 | /* Allocate the private data and the DAI link array */ |
426 | priv = devm_kzalloc(dev, | 428 | priv = devm_kzalloc(dev, |
427 | sizeof(*priv) + sizeof(*dai_link) * num_links, | 429 | sizeof(*priv) + sizeof(*dai_link) * num_links, |
428 | GFP_KERNEL); | 430 | GFP_KERNEL); |
429 | if (!priv) | 431 | if (!priv) |
430 | return -ENOMEM; | 432 | return -ENOMEM; |
431 | 433 | ||
432 | /* | 434 | /* Init snd_soc_card */ |
433 | * init snd_soc_card | ||
434 | */ | ||
435 | priv->snd_card.owner = THIS_MODULE; | 435 | priv->snd_card.owner = THIS_MODULE; |
436 | priv->snd_card.dev = dev; | 436 | priv->snd_card.dev = dev; |
437 | dai_link = priv->dai_link; | 437 | dai_link = priv->dai_link; |
438 | priv->snd_card.dai_link = dai_link; | 438 | priv->snd_card.dai_link = dai_link; |
439 | priv->snd_card.num_links = num_links; | 439 | priv->snd_card.num_links = num_links; |
440 | 440 | ||
441 | /* get room for the other properties */ | 441 | /* Get room for the other properties */ |
442 | priv->dai_props = devm_kzalloc(dev, | 442 | priv->dai_props = devm_kzalloc(dev, |
443 | sizeof(*priv->dai_props) * num_links, | 443 | sizeof(*priv->dai_props) * num_links, |
444 | GFP_KERNEL); | 444 | GFP_KERNEL); |