Commit d0bbcb4e836f0ffc6c0aeba6341ce227384805e3
Committed by
Vinod Koul
1 parent
f046b23340
ASoC: codecs: soundwire: remove port_ready[] usage from codecs.
port_ready will be changed to a fixed array in sdw.h and all initialization work will be done at soundwire side in the following patch. So remove them from codec drivers. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Acked-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20200831134318.11443-2-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Showing 6 changed files with 6 additions and 101 deletions Side-by-side Diff
sound/soc/codecs/max98373-sdw.c
... | ... | @@ -282,7 +282,7 @@ |
282 | 282 | static int max98373_read_prop(struct sdw_slave *slave) |
283 | 283 | { |
284 | 284 | struct sdw_slave_prop *prop = &slave->prop; |
285 | - int nval, i, num_of_ports; | |
285 | + int nval, i; | |
286 | 286 | u32 bit; |
287 | 287 | unsigned long addr; |
288 | 288 | struct sdw_dpn_prop *dpn; |
... | ... | @@ -295,7 +295,6 @@ |
295 | 295 | prop->clk_stop_timeout = 20; |
296 | 296 | |
297 | 297 | nval = hweight32(prop->source_ports); |
298 | - num_of_ports = nval; | |
299 | 298 | prop->src_dpn_prop = devm_kcalloc(&slave->dev, nval, |
300 | 299 | sizeof(*prop->src_dpn_prop), |
301 | 300 | GFP_KERNEL); |
... | ... | @@ -315,7 +314,6 @@ |
315 | 314 | |
316 | 315 | /* do this again for sink now */ |
317 | 316 | nval = hweight32(prop->sink_ports); |
318 | - num_of_ports += nval; | |
319 | 317 | prop->sink_dpn_prop = devm_kcalloc(&slave->dev, nval, |
320 | 318 | sizeof(*prop->sink_dpn_prop), |
321 | 319 | GFP_KERNEL); |
... | ... | @@ -332,17 +330,6 @@ |
332 | 330 | dpn[i].ch_prep_timeout = 10; |
333 | 331 | i++; |
334 | 332 | } |
335 | - | |
336 | - /* Allocate port_ready based on num_of_ports */ | |
337 | - slave->port_ready = devm_kcalloc(&slave->dev, num_of_ports, | |
338 | - sizeof(*slave->port_ready), | |
339 | - GFP_KERNEL); | |
340 | - if (!slave->port_ready) | |
341 | - return -ENOMEM; | |
342 | - | |
343 | - /* Initialize completion */ | |
344 | - for (i = 0; i < num_of_ports; i++) | |
345 | - init_completion(&slave->port_ready[i]); | |
346 | 333 | |
347 | 334 | /* set the timeout values */ |
348 | 335 | prop->clk_stop_timeout = 20; |
sound/soc/codecs/rt1308-sdw.c
... | ... | @@ -118,7 +118,7 @@ |
118 | 118 | static int rt1308_read_prop(struct sdw_slave *slave) |
119 | 119 | { |
120 | 120 | struct sdw_slave_prop *prop = &slave->prop; |
121 | - int nval, i, num_of_ports = 1; | |
121 | + int nval, i; | |
122 | 122 | u32 bit; |
123 | 123 | unsigned long addr; |
124 | 124 | struct sdw_dpn_prop *dpn; |
... | ... | @@ -131,7 +131,6 @@ |
131 | 131 | |
132 | 132 | /* for sink */ |
133 | 133 | nval = hweight32(prop->sink_ports); |
134 | - num_of_ports += nval; | |
135 | 134 | prop->sink_dpn_prop = devm_kcalloc(&slave->dev, nval, |
136 | 135 | sizeof(*prop->sink_dpn_prop), |
137 | 136 | GFP_KERNEL); |
... | ... | @@ -148,17 +147,6 @@ |
148 | 147 | dpn[i].ch_prep_timeout = 10; |
149 | 148 | i++; |
150 | 149 | } |
151 | - | |
152 | - /* Allocate port_ready based on num_of_ports */ | |
153 | - slave->port_ready = devm_kcalloc(&slave->dev, num_of_ports, | |
154 | - sizeof(*slave->port_ready), | |
155 | - GFP_KERNEL); | |
156 | - if (!slave->port_ready) | |
157 | - return -ENOMEM; | |
158 | - | |
159 | - /* Initialize completion */ | |
160 | - for (i = 0; i < num_of_ports; i++) | |
161 | - init_completion(&slave->port_ready[i]); | |
162 | 150 | |
163 | 151 | /* set the timeout values */ |
164 | 152 | prop->clk_stop_timeout = 20; |
sound/soc/codecs/rt5682-sdw.c
... | ... | @@ -537,7 +537,7 @@ |
537 | 537 | static int rt5682_read_prop(struct sdw_slave *slave) |
538 | 538 | { |
539 | 539 | struct sdw_slave_prop *prop = &slave->prop; |
540 | - int nval, i, num_of_ports = 1; | |
540 | + int nval, i; | |
541 | 541 | u32 bit; |
542 | 542 | unsigned long addr; |
543 | 543 | struct sdw_dpn_prop *dpn; |
... | ... | @@ -549,7 +549,6 @@ |
549 | 549 | prop->sink_ports = 0x2; /* BITMAP: 00000010 */ |
550 | 550 | |
551 | 551 | nval = hweight32(prop->source_ports); |
552 | - num_of_ports += nval; | |
553 | 552 | prop->src_dpn_prop = devm_kcalloc(&slave->dev, nval, |
554 | 553 | sizeof(*prop->src_dpn_prop), |
555 | 554 | GFP_KERNEL); |
... | ... | @@ -569,7 +568,6 @@ |
569 | 568 | |
570 | 569 | /* do this again for sink now */ |
571 | 570 | nval = hweight32(prop->sink_ports); |
572 | - num_of_ports += nval; | |
573 | 571 | prop->sink_dpn_prop = devm_kcalloc(&slave->dev, nval, |
574 | 572 | sizeof(*prop->sink_dpn_prop), |
575 | 573 | GFP_KERNEL); |
... | ... | @@ -586,17 +584,6 @@ |
586 | 584 | dpn[i].ch_prep_timeout = 10; |
587 | 585 | i++; |
588 | 586 | } |
589 | - | |
590 | - /* Allocate port_ready based on num_of_ports */ | |
591 | - slave->port_ready = devm_kcalloc(&slave->dev, num_of_ports, | |
592 | - sizeof(*slave->port_ready), | |
593 | - GFP_KERNEL); | |
594 | - if (!slave->port_ready) | |
595 | - return -ENOMEM; | |
596 | - | |
597 | - /* Initialize completion */ | |
598 | - for (i = 0; i < num_of_ports; i++) | |
599 | - init_completion(&slave->port_ready[i]); | |
600 | 587 | |
601 | 588 | /* set the timeout values */ |
602 | 589 | prop->clk_stop_timeout = 20; |
sound/soc/codecs/rt700-sdw.c
... | ... | @@ -333,7 +333,7 @@ |
333 | 333 | static int rt700_read_prop(struct sdw_slave *slave) |
334 | 334 | { |
335 | 335 | struct sdw_slave_prop *prop = &slave->prop; |
336 | - int nval, i, num_of_ports = 1; | |
336 | + int nval, i; | |
337 | 337 | u32 bit; |
338 | 338 | unsigned long addr; |
339 | 339 | struct sdw_dpn_prop *dpn; |
... | ... | @@ -345,7 +345,6 @@ |
345 | 345 | prop->sink_ports = 0xA; /* BITMAP: 00001010 */ |
346 | 346 | |
347 | 347 | nval = hweight32(prop->source_ports); |
348 | - num_of_ports += nval; | |
349 | 348 | prop->src_dpn_prop = devm_kcalloc(&slave->dev, nval, |
350 | 349 | sizeof(*prop->src_dpn_prop), |
351 | 350 | GFP_KERNEL); |
... | ... | @@ -365,7 +364,6 @@ |
365 | 364 | |
366 | 365 | /* do this again for sink now */ |
367 | 366 | nval = hweight32(prop->sink_ports); |
368 | - num_of_ports += nval; | |
369 | 367 | prop->sink_dpn_prop = devm_kcalloc(&slave->dev, nval, |
370 | 368 | sizeof(*prop->sink_dpn_prop), |
371 | 369 | GFP_KERNEL); |
... | ... | @@ -382,17 +380,6 @@ |
382 | 380 | dpn[i].ch_prep_timeout = 10; |
383 | 381 | i++; |
384 | 382 | } |
385 | - | |
386 | - /* Allocate port_ready based on num_of_ports */ | |
387 | - slave->port_ready = devm_kcalloc(&slave->dev, num_of_ports, | |
388 | - sizeof(*slave->port_ready), | |
389 | - GFP_KERNEL); | |
390 | - if (!slave->port_ready) | |
391 | - return -ENOMEM; | |
392 | - | |
393 | - /* Initialize completion */ | |
394 | - for (i = 0; i < num_of_ports; i++) | |
395 | - init_completion(&slave->port_ready[i]); | |
396 | 383 | |
397 | 384 | /* set the timeout values */ |
398 | 385 | prop->clk_stop_timeout = 20; |
sound/soc/codecs/rt711-sdw.c
... | ... | @@ -337,7 +337,7 @@ |
337 | 337 | static int rt711_read_prop(struct sdw_slave *slave) |
338 | 338 | { |
339 | 339 | struct sdw_slave_prop *prop = &slave->prop; |
340 | - int nval, i, num_of_ports = 1; | |
340 | + int nval, i; | |
341 | 341 | u32 bit; |
342 | 342 | unsigned long addr; |
343 | 343 | struct sdw_dpn_prop *dpn; |
... | ... | @@ -349,7 +349,6 @@ |
349 | 349 | prop->sink_ports = 0x8; /* BITMAP: 00001000 */ |
350 | 350 | |
351 | 351 | nval = hweight32(prop->source_ports); |
352 | - num_of_ports += nval; | |
353 | 352 | prop->src_dpn_prop = devm_kcalloc(&slave->dev, nval, |
354 | 353 | sizeof(*prop->src_dpn_prop), |
355 | 354 | GFP_KERNEL); |
... | ... | @@ -369,7 +368,6 @@ |
369 | 368 | |
370 | 369 | /* do this again for sink now */ |
371 | 370 | nval = hweight32(prop->sink_ports); |
372 | - num_of_ports += nval; | |
373 | 371 | prop->sink_dpn_prop = devm_kcalloc(&slave->dev, nval, |
374 | 372 | sizeof(*prop->sink_dpn_prop), |
375 | 373 | GFP_KERNEL); |
... | ... | @@ -386,17 +384,6 @@ |
386 | 384 | dpn[i].ch_prep_timeout = 10; |
387 | 385 | i++; |
388 | 386 | } |
389 | - | |
390 | - /* Allocate port_ready based on num_of_ports */ | |
391 | - slave->port_ready = devm_kcalloc(&slave->dev, num_of_ports, | |
392 | - sizeof(*slave->port_ready), | |
393 | - GFP_KERNEL); | |
394 | - if (!slave->port_ready) | |
395 | - return -ENOMEM; | |
396 | - | |
397 | - /* Initialize completion */ | |
398 | - for (i = 0; i < num_of_ports; i++) | |
399 | - init_completion(&slave->port_ready[i]); | |
400 | 387 | |
401 | 388 | /* set the timeout values */ |
402 | 389 | prop->clk_stop_timeout = 20; |
sound/soc/codecs/rt715-sdw.c
... | ... | @@ -431,7 +431,7 @@ |
431 | 431 | static int rt715_read_prop(struct sdw_slave *slave) |
432 | 432 | { |
433 | 433 | struct sdw_slave_prop *prop = &slave->prop; |
434 | - int nval, i, num_of_ports = 1; | |
434 | + int nval, i; | |
435 | 435 | u32 bit; |
436 | 436 | unsigned long addr; |
437 | 437 | struct sdw_dpn_prop *dpn; |
... | ... | @@ -443,7 +443,6 @@ |
443 | 443 | prop->sink_ports = 0x0; /* BITMAP: 00000000 */ |
444 | 444 | |
445 | 445 | nval = hweight32(prop->source_ports); |
446 | - num_of_ports += nval; | |
447 | 446 | prop->src_dpn_prop = devm_kcalloc(&slave->dev, nval, |
448 | 447 | sizeof(*prop->src_dpn_prop), |
449 | 448 | GFP_KERNEL); |
... | ... | @@ -459,36 +458,6 @@ |
459 | 458 | dpn[i].ch_prep_timeout = 10; |
460 | 459 | i++; |
461 | 460 | } |
462 | - | |
463 | - /* do this again for sink now */ | |
464 | - nval = hweight32(prop->sink_ports); | |
465 | - num_of_ports += nval; | |
466 | - prop->sink_dpn_prop = devm_kcalloc(&slave->dev, nval, | |
467 | - sizeof(*prop->sink_dpn_prop), | |
468 | - GFP_KERNEL); | |
469 | - if (!prop->sink_dpn_prop) | |
470 | - return -ENOMEM; | |
471 | - | |
472 | - dpn = prop->sink_dpn_prop; | |
473 | - i = 0; | |
474 | - addr = prop->sink_ports; | |
475 | - for_each_set_bit(bit, &addr, 32) { | |
476 | - dpn[i].num = bit; | |
477 | - dpn[i].simple_ch_prep_sm = true; | |
478 | - dpn[i].ch_prep_timeout = 10; | |
479 | - i++; | |
480 | - } | |
481 | - | |
482 | - /* Allocate port_ready based on num_of_ports */ | |
483 | - slave->port_ready = devm_kcalloc(&slave->dev, num_of_ports, | |
484 | - sizeof(*slave->port_ready), | |
485 | - GFP_KERNEL); | |
486 | - if (!slave->port_ready) | |
487 | - return -ENOMEM; | |
488 | - | |
489 | - /* Initialize completion */ | |
490 | - for (i = 0; i < num_of_ports; i++) | |
491 | - init_completion(&slave->port_ready[i]); | |
492 | 461 | |
493 | 462 | /* set the timeout values */ |
494 | 463 | prop->clk_stop_timeout = 20; |