Commit d542bc9e authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Greg Kroah-Hartman

soundwire: intel: fix alignment issues

Use Linux style
Reviewed-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 505ccb00
...@@ -236,7 +236,7 @@ static int intel_shim_init(struct sdw_intel *sdw) ...@@ -236,7 +236,7 @@ static int intel_shim_init(struct sdw_intel *sdw)
/* Set SyncCPU bit */ /* Set SyncCPU bit */
sync_reg |= SDW_SHIM_SYNC_SYNCCPU; sync_reg |= SDW_SHIM_SYNC_SYNCCPU;
ret = intel_clear_bit(shim, SDW_SHIM_SYNC, sync_reg, ret = intel_clear_bit(shim, SDW_SHIM_SYNC, sync_reg,
SDW_SHIM_SYNC_SYNCCPU); SDW_SHIM_SYNC_SYNCCPU);
if (ret < 0) if (ret < 0)
dev_err(sdw->cdns.dev, "Failed to set sync period: %d", ret); dev_err(sdw->cdns.dev, "Failed to set sync period: %d", ret);
...@@ -247,7 +247,7 @@ static int intel_shim_init(struct sdw_intel *sdw) ...@@ -247,7 +247,7 @@ static int intel_shim_init(struct sdw_intel *sdw)
* PDI routines * PDI routines
*/ */
static void intel_pdi_init(struct sdw_intel *sdw, static void intel_pdi_init(struct sdw_intel *sdw,
struct sdw_cdns_stream_config *config) struct sdw_cdns_stream_config *config)
{ {
void __iomem *shim = sdw->res->shim; void __iomem *shim = sdw->res->shim;
unsigned int link_id = sdw->instance; 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,9 +296,9 @@ intel_pdi_get_ch_cap(struct sdw_intel *sdw, unsigned int pdi_num, bool pcm)
} }
static int intel_pdi_get_ch_update(struct sdw_intel *sdw, static int intel_pdi_get_ch_update(struct sdw_intel *sdw,
struct sdw_cdns_pdi *pdi, struct sdw_cdns_pdi *pdi,
unsigned int num_pdi, unsigned int num_pdi,
unsigned int *num_ch, bool pcm) unsigned int *num_ch, bool pcm)
{ {
int i, ch_count = 0; int i, ch_count = 0;
...@@ -313,16 +313,16 @@ static int intel_pdi_get_ch_update(struct sdw_intel *sdw, ...@@ -313,16 +313,16 @@ static int intel_pdi_get_ch_update(struct sdw_intel *sdw,
} }
static int intel_pdi_stream_ch_update(struct sdw_intel *sdw, static int intel_pdi_stream_ch_update(struct sdw_intel *sdw,
struct sdw_cdns_streams *stream, bool pcm) struct sdw_cdns_streams *stream, bool pcm)
{ {
intel_pdi_get_ch_update(sdw, stream->bd, stream->num_bd, intel_pdi_get_ch_update(sdw, stream->bd, stream->num_bd,
&stream->num_ch_bd, pcm); &stream->num_ch_bd, pcm);
intel_pdi_get_ch_update(sdw, stream->in, stream->num_in, intel_pdi_get_ch_update(sdw, stream->in, stream->num_in,
&stream->num_ch_in, pcm); &stream->num_ch_in, pcm);
intel_pdi_get_ch_update(sdw, stream->out, stream->num_out, intel_pdi_get_ch_update(sdw, stream->out, stream->num_out,
&stream->num_ch_out, pcm); &stream->num_ch_out, pcm);
return 0; return 0;
} }
...@@ -387,9 +387,9 @@ intel_pdi_alh_configure(struct sdw_intel *sdw, struct sdw_cdns_pdi *pdi) ...@@ -387,9 +387,9 @@ intel_pdi_alh_configure(struct sdw_intel *sdw, struct sdw_cdns_pdi *pdi)
} }
static int intel_config_stream(struct sdw_intel *sdw, static int intel_config_stream(struct sdw_intel *sdw,
struct snd_pcm_substream *substream, struct snd_pcm_substream *substream,
struct snd_soc_dai *dai, struct snd_soc_dai *dai,
struct snd_pcm_hw_params *hw_params, int link_id) struct snd_pcm_hw_params *hw_params, int link_id)
{ {
if (sdw->res->ops && sdw->res->ops->config_stream) if (sdw->res->ops && sdw->res->ops->config_stream)
return sdw->res->ops->config_stream(sdw->res->arg, return sdw->res->ops->config_stream(sdw->res->arg,
...@@ -454,7 +454,7 @@ static int intel_post_bank_switch(struct sdw_bus *bus) ...@@ -454,7 +454,7 @@ static int intel_post_bank_switch(struct sdw_bus *bus)
sync_reg |= SDW_SHIM_SYNC_SYNCGO; sync_reg |= SDW_SHIM_SYNC_SYNCGO;
ret = intel_clear_bit(shim, SDW_SHIM_SYNC, sync_reg, ret = intel_clear_bit(shim, SDW_SHIM_SYNC, sync_reg,
SDW_SHIM_SYNC_SYNCGO); SDW_SHIM_SYNC_SYNCGO);
if (ret < 0) if (ret < 0)
dev_err(sdw->cdns.dev, "Post bank switch failed: %d", ret); dev_err(sdw->cdns.dev, "Post bank switch failed: %d", ret);
...@@ -466,7 +466,7 @@ static int intel_post_bank_switch(struct sdw_bus *bus) ...@@ -466,7 +466,7 @@ static int intel_post_bank_switch(struct sdw_bus *bus)
*/ */
static struct sdw_cdns_port *intel_alloc_port(struct sdw_intel *sdw, static struct sdw_cdns_port *intel_alloc_port(struct sdw_intel *sdw,
u32 ch, u32 dir, bool pcm) u32 ch, u32 dir, bool pcm)
{ {
struct sdw_cdns *cdns = &sdw->cdns; struct sdw_cdns *cdns = &sdw->cdns;
struct sdw_cdns_port *port = NULL; struct sdw_cdns_port *port = NULL;
...@@ -526,8 +526,8 @@ static void intel_port_cleanup(struct sdw_cdns_dma_data *dma) ...@@ -526,8 +526,8 @@ static void intel_port_cleanup(struct sdw_cdns_dma_data *dma)
} }
static int intel_hw_params(struct snd_pcm_substream *substream, static int intel_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params, struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai) struct snd_soc_dai *dai)
{ {
struct sdw_cdns *cdns = snd_soc_dai_get_drvdata(dai); struct sdw_cdns *cdns = snd_soc_dai_get_drvdata(dai);
struct sdw_intel *sdw = cdns_to_intel(cdns); struct sdw_intel *sdw = cdns_to_intel(cdns);
...@@ -575,7 +575,7 @@ static int intel_hw_params(struct snd_pcm_substream *substream, ...@@ -575,7 +575,7 @@ static int intel_hw_params(struct snd_pcm_substream *substream,
/* Inform DSP about PDI stream number */ /* Inform DSP about PDI stream number */
for (i = 0; i < dma->nr_ports; i++) { for (i = 0; i < dma->nr_ports; i++) {
ret = intel_config_stream(sdw, substream, dai, params, ret = intel_config_stream(sdw, substream, dai, params,
dma->port[i]->pdi->intel_alh_id); dma->port[i]->pdi->intel_alh_id);
if (ret) if (ret)
goto port_error; goto port_error;
} }
...@@ -605,7 +605,7 @@ static int intel_hw_params(struct snd_pcm_substream *substream, ...@@ -605,7 +605,7 @@ static int intel_hw_params(struct snd_pcm_substream *substream,
} }
ret = sdw_stream_add_master(&cdns->bus, &sconfig, ret = sdw_stream_add_master(&cdns->bus, &sconfig,
pconfig, dma->nr_ports, dma->stream); pconfig, dma->nr_ports, dma->stream);
if (ret) { if (ret) {
dev_err(cdns->dev, "add master to stream failed:%d", ret); dev_err(cdns->dev, "add master to stream failed:%d", ret);
goto stream_error; goto stream_error;
...@@ -636,7 +636,7 @@ intel_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) ...@@ -636,7 +636,7 @@ intel_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
ret = sdw_stream_remove_master(&cdns->bus, dma->stream); ret = sdw_stream_remove_master(&cdns->bus, dma->stream);
if (ret < 0) if (ret < 0)
dev_err(dai->dev, "remove master from stream %s failed: %d", dev_err(dai->dev, "remove master from stream %s failed: %d",
dma->stream->name, ret); dma->stream->name, ret);
intel_port_cleanup(dma); intel_port_cleanup(dma);
kfree(dma->port); kfree(dma->port);
...@@ -644,13 +644,13 @@ intel_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) ...@@ -644,13 +644,13 @@ intel_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
} }
static int intel_pcm_set_sdw_stream(struct snd_soc_dai *dai, static int intel_pcm_set_sdw_stream(struct snd_soc_dai *dai,
void *stream, int direction) void *stream, int direction)
{ {
return cdns_set_sdw_stream(dai, stream, true, direction); return cdns_set_sdw_stream(dai, stream, true, direction);
} }
static int intel_pdm_set_sdw_stream(struct snd_soc_dai *dai, static int intel_pdm_set_sdw_stream(struct snd_soc_dai *dai,
void *stream, int direction) void *stream, int direction)
{ {
return cdns_set_sdw_stream(dai, stream, false, direction); return cdns_set_sdw_stream(dai, stream, false, direction);
} }
...@@ -674,9 +674,9 @@ static const struct snd_soc_component_driver dai_component = { ...@@ -674,9 +674,9 @@ static const struct snd_soc_component_driver dai_component = {
}; };
static int intel_create_dai(struct sdw_cdns *cdns, static int intel_create_dai(struct sdw_cdns *cdns,
struct snd_soc_dai_driver *dais, struct snd_soc_dai_driver *dais,
enum intel_pdi_type type, enum intel_pdi_type type,
u32 num, u32 off, u32 max_ch, bool pcm) u32 num, u32 off, u32 max_ch, bool pcm)
{ {
int i; int i;
...@@ -686,7 +686,7 @@ static int intel_create_dai(struct sdw_cdns *cdns, ...@@ -686,7 +686,7 @@ static int intel_create_dai(struct sdw_cdns *cdns,
/* TODO: Read supported rates/formats from hardware */ /* TODO: Read supported rates/formats from hardware */
for (i = off; i < (off + num); i++) { for (i = off; i < (off + num); i++) {
dais[i].name = kasprintf(GFP_KERNEL, "SDW%d Pin%d", dais[i].name = kasprintf(GFP_KERNEL, "SDW%d Pin%d",
cdns->instance, i); cdns->instance, i);
if (!dais[i].name) if (!dais[i].name)
return -ENOMEM; return -ENOMEM;
...@@ -787,7 +787,7 @@ static int intel_register_dai(struct sdw_intel *sdw) ...@@ -787,7 +787,7 @@ static int intel_register_dai(struct sdw_intel *sdw)
return ret; return ret;
return snd_soc_register_component(cdns->dev, &dai_component, return snd_soc_register_component(cdns->dev, &dai_component,
dais, num_dai); dais, num_dai);
} }
static int intel_prop_read(struct sdw_bus *bus) static int intel_prop_read(struct sdw_bus *bus)
...@@ -873,12 +873,11 @@ static int intel_probe(struct platform_device *pdev) ...@@ -873,12 +873,11 @@ static int intel_probe(struct platform_device *pdev)
intel_pdi_ch_update(sdw); intel_pdi_ch_update(sdw);
/* Acquire IRQ */ /* Acquire IRQ */
ret = request_threaded_irq(sdw->res->irq, sdw_cdns_irq, ret = request_threaded_irq(sdw->res->irq, sdw_cdns_irq, sdw_cdns_thread,
sdw_cdns_thread, IRQF_SHARED, KBUILD_MODNAME, IRQF_SHARED, KBUILD_MODNAME, &sdw->cdns);
&sdw->cdns);
if (ret < 0) { if (ret < 0) {
dev_err(sdw->cdns.dev, "unable to grab IRQ %d, disabling device\n", dev_err(sdw->cdns.dev, "unable to grab IRQ %d, disabling device\n",
sdw->res->irq); sdw->res->irq);
goto err_init; goto err_init;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment