diff options
author | Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | 2019-05-01 11:57:38 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-05-02 11:16:28 -0400 |
commit | d542bc9e22342d29de9ef0a7f31b8f158711753a (patch) | |
tree | 4cc5641fff42671877ff552dd8f08739457fe448 /drivers/soundwire | |
parent | 505ccb0065208214a9b582dea6984532c1c241c6 (diff) |
soundwire: intel: fix alignment issues
Use Linux style
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/soundwire')
-rw-r--r-- | drivers/soundwire/intel.c | 59 |
1 files changed, 29 insertions, 30 deletions
diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c index 70ca27ccad85..56d6c1dda0ff 100644 --- a/drivers/soundwire/intel.c +++ b/drivers/soundwire/intel.c | |||
@@ -236,7 +236,7 @@ static int intel_shim_init(struct sdw_intel *sdw) | |||
236 | /* Set SyncCPU bit */ | 236 | /* Set SyncCPU bit */ |
237 | sync_reg |= SDW_SHIM_SYNC_SYNCCPU; | 237 | sync_reg |= SDW_SHIM_SYNC_SYNCCPU; |
238 | ret = intel_clear_bit(shim, SDW_SHIM_SYNC, sync_reg, | 238 | ret = intel_clear_bit(shim, SDW_SHIM_SYNC, sync_reg, |
239 | SDW_SHIM_SYNC_SYNCCPU); | 239 | SDW_SHIM_SYNC_SYNCCPU); |
240 | if (ret < 0) | 240 | if (ret < 0) |
241 | dev_err(sdw->cdns.dev, "Failed to set sync period: %d", ret); | 241 | dev_err(sdw->cdns.dev, "Failed to set sync period: %d", ret); |
242 | 242 | ||
@@ -247,7 +247,7 @@ static int intel_shim_init(struct sdw_intel *sdw) | |||
247 | * PDI routines | 247 | * PDI routines |
248 | */ | 248 | */ |
249 | static void intel_pdi_init(struct sdw_intel *sdw, | 249 | static void intel_pdi_init(struct sdw_intel *sdw, |
250 | struct sdw_cdns_stream_config *config) | 250 | struct sdw_cdns_stream_config *config) |
251 | { | 251 | { |
252 | void __iomem *shim = sdw->res->shim; | 252 | void __iomem *shim = sdw->res->shim; |
253 | unsigned int link_id = sdw->instance; | 253 | unsigned int link_id = sdw->instance; |
@@ -296,9 +296,9 @@ intel_pdi_get_ch_cap(struct sdw_intel *sdw, unsigned int pdi_num, bool pcm) | |||
296 | } | 296 | } |
297 | 297 | ||
298 | static int intel_pdi_get_ch_update(struct sdw_intel *sdw, | 298 | static int intel_pdi_get_ch_update(struct sdw_intel *sdw, |
299 | struct sdw_cdns_pdi *pdi, | 299 | struct sdw_cdns_pdi *pdi, |
300 | unsigned int num_pdi, | 300 | unsigned int num_pdi, |
301 | unsigned int *num_ch, bool pcm) | 301 | unsigned int *num_ch, bool pcm) |
302 | { | 302 | { |
303 | int i, ch_count = 0; | 303 | int i, ch_count = 0; |
304 | 304 | ||
@@ -313,16 +313,16 @@ static int intel_pdi_get_ch_update(struct sdw_intel *sdw, | |||
313 | } | 313 | } |
314 | 314 | ||
315 | static int intel_pdi_stream_ch_update(struct sdw_intel *sdw, | 315 | static int intel_pdi_stream_ch_update(struct sdw_intel *sdw, |
316 | struct sdw_cdns_streams *stream, bool pcm) | 316 | struct sdw_cdns_streams *stream, bool pcm) |
317 | { | 317 | { |
318 | intel_pdi_get_ch_update(sdw, stream->bd, stream->num_bd, | 318 | intel_pdi_get_ch_update(sdw, stream->bd, stream->num_bd, |
319 | &stream->num_ch_bd, pcm); | 319 | &stream->num_ch_bd, pcm); |
320 | 320 | ||
321 | intel_pdi_get_ch_update(sdw, stream->in, stream->num_in, | 321 | intel_pdi_get_ch_update(sdw, stream->in, stream->num_in, |
322 | &stream->num_ch_in, pcm); | 322 | &stream->num_ch_in, pcm); |
323 | 323 | ||
324 | intel_pdi_get_ch_update(sdw, stream->out, stream->num_out, | 324 | intel_pdi_get_ch_update(sdw, stream->out, stream->num_out, |
325 | &stream->num_ch_out, pcm); | 325 | &stream->num_ch_out, pcm); |
326 | 326 | ||
327 | return 0; | 327 | return 0; |
328 | } | 328 | } |
@@ -387,9 +387,9 @@ intel_pdi_alh_configure(struct sdw_intel *sdw, struct sdw_cdns_pdi *pdi) | |||
387 | } | 387 | } |
388 | 388 | ||
389 | static int intel_config_stream(struct sdw_intel *sdw, | 389 | static int intel_config_stream(struct sdw_intel *sdw, |
390 | struct snd_pcm_substream *substream, | 390 | struct snd_pcm_substream *substream, |
391 | struct snd_soc_dai *dai, | 391 | struct snd_soc_dai *dai, |
392 | struct snd_pcm_hw_params *hw_params, int link_id) | 392 | struct snd_pcm_hw_params *hw_params, int link_id) |
393 | { | 393 | { |
394 | if (sdw->res->ops && sdw->res->ops->config_stream) | 394 | if (sdw->res->ops && sdw->res->ops->config_stream) |
395 | return sdw->res->ops->config_stream(sdw->res->arg, | 395 | return sdw->res->ops->config_stream(sdw->res->arg, |
@@ -454,7 +454,7 @@ static int intel_post_bank_switch(struct sdw_bus *bus) | |||
454 | sync_reg |= SDW_SHIM_SYNC_SYNCGO; | 454 | sync_reg |= SDW_SHIM_SYNC_SYNCGO; |
455 | 455 | ||
456 | ret = intel_clear_bit(shim, SDW_SHIM_SYNC, sync_reg, | 456 | ret = intel_clear_bit(shim, SDW_SHIM_SYNC, sync_reg, |
457 | SDW_SHIM_SYNC_SYNCGO); | 457 | SDW_SHIM_SYNC_SYNCGO); |
458 | if (ret < 0) | 458 | if (ret < 0) |
459 | dev_err(sdw->cdns.dev, "Post bank switch failed: %d", ret); | 459 | dev_err(sdw->cdns.dev, "Post bank switch failed: %d", ret); |
460 | 460 | ||
@@ -466,7 +466,7 @@ static int intel_post_bank_switch(struct sdw_bus *bus) | |||
466 | */ | 466 | */ |
467 | 467 | ||
468 | static struct sdw_cdns_port *intel_alloc_port(struct sdw_intel *sdw, | 468 | static struct sdw_cdns_port *intel_alloc_port(struct sdw_intel *sdw, |
469 | u32 ch, u32 dir, bool pcm) | 469 | u32 ch, u32 dir, bool pcm) |
470 | { | 470 | { |
471 | struct sdw_cdns *cdns = &sdw->cdns; | 471 | struct sdw_cdns *cdns = &sdw->cdns; |
472 | struct sdw_cdns_port *port = NULL; | 472 | struct sdw_cdns_port *port = NULL; |
@@ -526,8 +526,8 @@ static void intel_port_cleanup(struct sdw_cdns_dma_data *dma) | |||
526 | } | 526 | } |
527 | 527 | ||
528 | static int intel_hw_params(struct snd_pcm_substream *substream, | 528 | static int intel_hw_params(struct snd_pcm_substream *substream, |
529 | struct snd_pcm_hw_params *params, | 529 | struct snd_pcm_hw_params *params, |
530 | struct snd_soc_dai *dai) | 530 | struct snd_soc_dai *dai) |
531 | { | 531 | { |
532 | struct sdw_cdns *cdns = snd_soc_dai_get_drvdata(dai); | 532 | struct sdw_cdns *cdns = snd_soc_dai_get_drvdata(dai); |
533 | struct sdw_intel *sdw = cdns_to_intel(cdns); | 533 | struct sdw_intel *sdw = cdns_to_intel(cdns); |
@@ -575,7 +575,7 @@ static int intel_hw_params(struct snd_pcm_substream *substream, | |||
575 | /* Inform DSP about PDI stream number */ | 575 | /* Inform DSP about PDI stream number */ |
576 | for (i = 0; i < dma->nr_ports; i++) { | 576 | for (i = 0; i < dma->nr_ports; i++) { |
577 | ret = intel_config_stream(sdw, substream, dai, params, | 577 | ret = intel_config_stream(sdw, substream, dai, params, |
578 | dma->port[i]->pdi->intel_alh_id); | 578 | dma->port[i]->pdi->intel_alh_id); |
579 | if (ret) | 579 | if (ret) |
580 | goto port_error; | 580 | goto port_error; |
581 | } | 581 | } |
@@ -605,7 +605,7 @@ static int intel_hw_params(struct snd_pcm_substream *substream, | |||
605 | } | 605 | } |
606 | 606 | ||
607 | ret = sdw_stream_add_master(&cdns->bus, &sconfig, | 607 | ret = sdw_stream_add_master(&cdns->bus, &sconfig, |
608 | pconfig, dma->nr_ports, dma->stream); | 608 | pconfig, dma->nr_ports, dma->stream); |
609 | if (ret) { | 609 | if (ret) { |
610 | dev_err(cdns->dev, "add master to stream failed:%d", ret); | 610 | dev_err(cdns->dev, "add master to stream failed:%d", ret); |
611 | goto stream_error; | 611 | goto stream_error; |
@@ -636,7 +636,7 @@ intel_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) | |||
636 | ret = sdw_stream_remove_master(&cdns->bus, dma->stream); | 636 | ret = sdw_stream_remove_master(&cdns->bus, dma->stream); |
637 | if (ret < 0) | 637 | if (ret < 0) |
638 | dev_err(dai->dev, "remove master from stream %s failed: %d", | 638 | dev_err(dai->dev, "remove master from stream %s failed: %d", |
639 | dma->stream->name, ret); | 639 | dma->stream->name, ret); |
640 | 640 | ||
641 | intel_port_cleanup(dma); | 641 | intel_port_cleanup(dma); |
642 | kfree(dma->port); | 642 | kfree(dma->port); |
@@ -644,13 +644,13 @@ intel_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) | |||
644 | } | 644 | } |
645 | 645 | ||
646 | static int intel_pcm_set_sdw_stream(struct snd_soc_dai *dai, | 646 | static int intel_pcm_set_sdw_stream(struct snd_soc_dai *dai, |
647 | void *stream, int direction) | 647 | void *stream, int direction) |
648 | { | 648 | { |
649 | return cdns_set_sdw_stream(dai, stream, true, direction); | 649 | return cdns_set_sdw_stream(dai, stream, true, direction); |
650 | } | 650 | } |
651 | 651 | ||
652 | static int intel_pdm_set_sdw_stream(struct snd_soc_dai *dai, | 652 | static int intel_pdm_set_sdw_stream(struct snd_soc_dai *dai, |
653 | void *stream, int direction) | 653 | void *stream, int direction) |
654 | { | 654 | { |
655 | return cdns_set_sdw_stream(dai, stream, false, direction); | 655 | return cdns_set_sdw_stream(dai, stream, false, direction); |
656 | } | 656 | } |
@@ -674,9 +674,9 @@ static const struct snd_soc_component_driver dai_component = { | |||
674 | }; | 674 | }; |
675 | 675 | ||
676 | static int intel_create_dai(struct sdw_cdns *cdns, | 676 | static int intel_create_dai(struct sdw_cdns *cdns, |
677 | struct snd_soc_dai_driver *dais, | 677 | struct snd_soc_dai_driver *dais, |
678 | enum intel_pdi_type type, | 678 | enum intel_pdi_type type, |
679 | u32 num, u32 off, u32 max_ch, bool pcm) | 679 | u32 num, u32 off, u32 max_ch, bool pcm) |
680 | { | 680 | { |
681 | int i; | 681 | int i; |
682 | 682 | ||
@@ -686,7 +686,7 @@ static int intel_create_dai(struct sdw_cdns *cdns, | |||
686 | /* TODO: Read supported rates/formats from hardware */ | 686 | /* TODO: Read supported rates/formats from hardware */ |
687 | for (i = off; i < (off + num); i++) { | 687 | for (i = off; i < (off + num); i++) { |
688 | dais[i].name = kasprintf(GFP_KERNEL, "SDW%d Pin%d", | 688 | dais[i].name = kasprintf(GFP_KERNEL, "SDW%d Pin%d", |
689 | cdns->instance, i); | 689 | cdns->instance, i); |
690 | if (!dais[i].name) | 690 | if (!dais[i].name) |
691 | return -ENOMEM; | 691 | return -ENOMEM; |
692 | 692 | ||
@@ -787,7 +787,7 @@ static int intel_register_dai(struct sdw_intel *sdw) | |||
787 | return ret; | 787 | return ret; |
788 | 788 | ||
789 | return snd_soc_register_component(cdns->dev, &dai_component, | 789 | return snd_soc_register_component(cdns->dev, &dai_component, |
790 | dais, num_dai); | 790 | dais, num_dai); |
791 | } | 791 | } |
792 | 792 | ||
793 | static int intel_prop_read(struct sdw_bus *bus) | 793 | static int intel_prop_read(struct sdw_bus *bus) |
@@ -873,12 +873,11 @@ static int intel_probe(struct platform_device *pdev) | |||
873 | intel_pdi_ch_update(sdw); | 873 | intel_pdi_ch_update(sdw); |
874 | 874 | ||
875 | /* Acquire IRQ */ | 875 | /* Acquire IRQ */ |
876 | ret = request_threaded_irq(sdw->res->irq, sdw_cdns_irq, | 876 | ret = request_threaded_irq(sdw->res->irq, sdw_cdns_irq, sdw_cdns_thread, |
877 | sdw_cdns_thread, IRQF_SHARED, KBUILD_MODNAME, | 877 | IRQF_SHARED, KBUILD_MODNAME, &sdw->cdns); |
878 | &sdw->cdns); | ||
879 | if (ret < 0) { | 878 | if (ret < 0) { |
880 | dev_err(sdw->cdns.dev, "unable to grab IRQ %d, disabling device\n", | 879 | dev_err(sdw->cdns.dev, "unable to grab IRQ %d, disabling device\n", |
881 | sdw->res->irq); | 880 | sdw->res->irq); |
882 | goto err_init; | 881 | goto err_init; |
883 | } | 882 | } |
884 | 883 | ||