Merge remote-tracking branches 'asoc/topic/dwc', 'asoc/topic/es8316', 'asoc/topic/fsi', 'asoc/topic/fsl' and 'asoc/topic/hdmi' into asoc-next

This commit is contained in:
Mark Brown 2017-09-01 12:12:36 +01:00
14 changed files with 33 additions and 45 deletions

View file

@ -67,14 +67,14 @@ struct hdmi_codec_cea_spk_alloc {
}; };
/* Channel maps stereo HDMI */ /* Channel maps stereo HDMI */
const struct snd_pcm_chmap_elem hdmi_codec_stereo_chmaps[] = { static const struct snd_pcm_chmap_elem hdmi_codec_stereo_chmaps[] = {
{ .channels = 2, { .channels = 2,
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } }, .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
{ } { }
}; };
/* Channel maps for multi-channel playbacks, up to 8 n_ch */ /* Channel maps for multi-channel playbacks, up to 8 n_ch */
const struct snd_pcm_chmap_elem hdmi_codec_8ch_chmaps[] = { static const struct snd_pcm_chmap_elem hdmi_codec_8ch_chmaps[] = {
{ .channels = 2, /* CA_ID 0x00 */ { .channels = 2, /* CA_ID 0x00 */
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } }, .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
{ .channels = 4, /* CA_ID 0x01 */ { .channels = 4, /* CA_ID 0x01 */
@ -340,7 +340,7 @@ static unsigned long hdmi_codec_spk_mask_from_alloc(int spk_alloc)
return spk_mask; return spk_mask;
} }
void hdmi_codec_eld_chmap(struct hdmi_codec_priv *hcp) static void hdmi_codec_eld_chmap(struct hdmi_codec_priv *hcp)
{ {
u8 spk_alloc; u8 spk_alloc;
unsigned long spk_mask; unsigned long spk_mask;
@ -696,7 +696,7 @@ static const struct snd_soc_dai_driver hdmi_i2s_dai = {
.name = "i2s-hifi", .name = "i2s-hifi",
.id = DAI_ID_I2S, .id = DAI_ID_I2S,
.playback = { .playback = {
.stream_name = "Playback", .stream_name = "I2S Playback",
.channels_min = 2, .channels_min = 2,
.channels_max = 8, .channels_max = 8,
.rates = HDMI_RATES, .rates = HDMI_RATES,
@ -711,7 +711,7 @@ static const struct snd_soc_dai_driver hdmi_spdif_dai = {
.name = "spdif-hifi", .name = "spdif-hifi",
.id = DAI_ID_SPDIF, .id = DAI_ID_SPDIF,
.playback = { .playback = {
.stream_name = "Playback", .stream_name = "SPDIF Playback",
.channels_min = 2, .channels_min = 2,
.channels_max = 2, .channels_max = 2,
.rates = HDMI_RATES, .rates = HDMI_RATES,

View file

@ -381,7 +381,7 @@ static int dw_i2s_set_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
return ret; return ret;
} }
static struct snd_soc_dai_ops dw_i2s_dai_ops = { static const struct snd_soc_dai_ops dw_i2s_dai_ops = {
.startup = dw_i2s_startup, .startup = dw_i2s_startup,
.shutdown = dw_i2s_shutdown, .shutdown = dw_i2s_shutdown,
.hw_params = dw_i2s_hw_params, .hw_params = dw_i2s_hw_params,
@ -617,10 +617,8 @@ static int dw_i2s_probe(struct platform_device *pdev)
const char *clk_id; const char *clk_id;
dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL); dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
if (!dev) { if (!dev)
dev_warn(&pdev->dev, "kzalloc fail\n");
return -ENOMEM; return -ENOMEM;
}
dw_i2s_dai = devm_kzalloc(&pdev->dev, sizeof(*dw_i2s_dai), GFP_KERNEL); dw_i2s_dai = devm_kzalloc(&pdev->dev, sizeof(*dw_i2s_dai), GFP_KERNEL);
if (!dw_i2s_dai) if (!dw_i2s_dai)

View file

@ -683,7 +683,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
snd_soc_card_set_drvdata(&priv->card, priv); snd_soc_card_set_drvdata(&priv->card, priv);
ret = devm_snd_soc_register_card(&pdev->dev, &priv->card); ret = devm_snd_soc_register_card(&pdev->dev, &priv->card);
if (ret) if (ret && ret != -EPROBE_DEFER)
dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret); dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret);
asrc_fail: asrc_fail:

View file

@ -542,7 +542,7 @@ static int fsl_asrc_dai_trigger(struct snd_pcm_substream *substream, int cmd,
return 0; return 0;
} }
static struct snd_soc_dai_ops fsl_asrc_dai_ops = { static const struct snd_soc_dai_ops fsl_asrc_dai_ops = {
.hw_params = fsl_asrc_dai_hw_params, .hw_params = fsl_asrc_dai_hw_params,
.hw_free = fsl_asrc_dai_hw_free, .hw_free = fsl_asrc_dai_hw_free,
.trigger = fsl_asrc_dai_trigger, .trigger = fsl_asrc_dai_trigger,

View file

@ -20,7 +20,7 @@
#define FSL_ASRC_DMABUF_SIZE (256 * 1024) #define FSL_ASRC_DMABUF_SIZE (256 * 1024)
static struct snd_pcm_hardware snd_imx_hardware = { static const struct snd_pcm_hardware snd_imx_hardware = {
.info = SNDRV_PCM_INFO_INTERLEAVED | .info = SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP |
@ -279,10 +279,8 @@ static int fsl_asrc_dma_startup(struct snd_pcm_substream *substream)
struct fsl_asrc_pair *pair; struct fsl_asrc_pair *pair;
pair = kzalloc(sizeof(struct fsl_asrc_pair), GFP_KERNEL); pair = kzalloc(sizeof(struct fsl_asrc_pair), GFP_KERNEL);
if (!pair) { if (!pair)
dev_err(dev, "failed to allocate pair\n");
return -ENOMEM; return -ENOMEM;
}
pair->asrc_priv = asrc_priv; pair->asrc_priv = asrc_priv;

View file

@ -63,7 +63,6 @@ struct dma_object {
struct ccsr_dma_channel __iomem *channel; struct ccsr_dma_channel __iomem *channel;
unsigned int irq; unsigned int irq;
bool assigned; bool assigned;
char path[1];
}; };
/* /*
@ -870,7 +869,7 @@ static struct device_node *find_ssi_node(struct device_node *dma_channel_np)
return NULL; return NULL;
} }
static struct snd_pcm_ops fsl_dma_ops = { static const struct snd_pcm_ops fsl_dma_ops = {
.open = fsl_dma_open, .open = fsl_dma_open,
.close = fsl_dma_close, .close = fsl_dma_close,
.ioctl = snd_pcm_lib_ioctl, .ioctl = snd_pcm_lib_ioctl,
@ -897,20 +896,18 @@ static int fsl_soc_dma_probe(struct platform_device *pdev)
ret = of_address_to_resource(ssi_np, 0, &res); ret = of_address_to_resource(ssi_np, 0, &res);
if (ret) { if (ret) {
dev_err(&pdev->dev, "could not determine resources for %s\n", dev_err(&pdev->dev, "could not determine resources for %pOF\n",
ssi_np->full_name); ssi_np);
of_node_put(ssi_np); of_node_put(ssi_np);
return ret; return ret;
} }
dma = kzalloc(sizeof(*dma) + strlen(np->full_name), GFP_KERNEL); dma = kzalloc(sizeof(*dma), GFP_KERNEL);
if (!dma) { if (!dma) {
dev_err(&pdev->dev, "could not allocate dma object\n");
of_node_put(ssi_np); of_node_put(ssi_np);
return -ENOMEM; return -ENOMEM;
} }
strcpy(dma->path, np->full_name);
dma->dai.ops = &fsl_dma_ops; dma->dai.ops = &fsl_dma_ops;
dma->dai.pcm_new = fsl_dma_new; dma->dai.pcm_new = fsl_dma_new;
dma->dai.pcm_free = fsl_dma_free_dma_buffers; dma->dai.pcm_free = fsl_dma_free_dma_buffers;

View file

@ -620,7 +620,7 @@ static int fsl_esai_trigger(struct snd_pcm_substream *substream, int cmd,
return 0; return 0;
} }
static struct snd_soc_dai_ops fsl_esai_dai_ops = { static const struct snd_soc_dai_ops fsl_esai_dai_ops = {
.startup = fsl_esai_startup, .startup = fsl_esai_startup,
.shutdown = fsl_esai_shutdown, .shutdown = fsl_esai_shutdown,
.trigger = fsl_esai_trigger, .trigger = fsl_esai_trigger,

View file

@ -626,7 +626,7 @@ static int fsl_spdif_trigger(struct snd_pcm_substream *substream,
return 0; return 0;
} }
static struct snd_soc_dai_ops fsl_spdif_dai_ops = { static const struct snd_soc_dai_ops fsl_spdif_dai_ops = {
.startup = fsl_spdif_startup, .startup = fsl_spdif_startup,
.hw_params = fsl_spdif_hw_params, .hw_params = fsl_spdif_hw_params,
.trigger = fsl_spdif_trigger, .trigger = fsl_spdif_trigger,

View file

@ -1432,10 +1432,8 @@ static int fsl_ssi_probe(struct platform_device *pdev)
ssi_private = devm_kzalloc(&pdev->dev, sizeof(*ssi_private), ssi_private = devm_kzalloc(&pdev->dev, sizeof(*ssi_private),
GFP_KERNEL); GFP_KERNEL);
if (!ssi_private) { if (!ssi_private)
dev_err(&pdev->dev, "could not allocate DAI object\n");
return -ENOMEM; return -ENOMEM;
}
ssi_private->soc = of_id->data; ssi_private->soc = of_id->data;
ssi_private->dev = &pdev->dev; ssi_private->dev = &pdev->dev;

View file

@ -268,13 +268,13 @@ static int imx_audmux_parse_dt_defaults(struct platform_device *pdev,
ret = of_property_read_u32(child, "fsl,audmux-port", &port); ret = of_property_read_u32(child, "fsl,audmux-port", &port);
if (ret) { if (ret) {
dev_warn(&pdev->dev, "Failed to get fsl,audmux-port of child node \"%s\"\n", dev_warn(&pdev->dev, "Failed to get fsl,audmux-port of child node \"%pOF\"\n",
child->full_name); child);
continue; continue;
} }
if (!of_property_read_bool(child, "fsl,port-config")) { if (!of_property_read_bool(child, "fsl,port-config")) {
dev_warn(&pdev->dev, "child node \"%s\" does not have property fsl,port-config\n", dev_warn(&pdev->dev, "child node \"%pOF\" does not have property fsl,port-config\n",
child->full_name); child);
continue; continue;
} }
@ -292,15 +292,15 @@ static int imx_audmux_parse_dt_defaults(struct platform_device *pdev,
} }
if (ret != -EOVERFLOW) { if (ret != -EOVERFLOW) {
dev_err(&pdev->dev, "Failed to read u32 at index %d of child %s\n", dev_err(&pdev->dev, "Failed to read u32 at index %d of child %pOF\n",
i, child->full_name); i, child);
continue; continue;
} }
if (audmux_type == IMX31_AUDMUX) { if (audmux_type == IMX31_AUDMUX) {
if (i % 2) { if (i % 2) {
dev_err(&pdev->dev, "One pdcr value is missing in child node %s\n", dev_err(&pdev->dev, "One pdcr value is missing in child node %pOF\n",
child->full_name); child);
continue; continue;
} }
imx_audmux_v2_configure_port(port, ptcr, pdcr); imx_audmux_v2_configure_port(port, ptcr, pdcr);

View file

@ -154,7 +154,7 @@ static snd_pcm_uframes_t snd_imx_pcm_pointer(struct snd_pcm_substream *substream
return bytes_to_frames(substream->runtime, iprtd->offset); return bytes_to_frames(substream->runtime, iprtd->offset);
} }
static struct snd_pcm_hardware snd_imx_hardware = { static const struct snd_pcm_hardware snd_imx_hardware = {
.info = SNDRV_PCM_INFO_INTERLEAVED | .info = SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP |
@ -227,7 +227,7 @@ static int snd_imx_pcm_mmap(struct snd_pcm_substream *substream,
return ret; return ret;
} }
static struct snd_pcm_ops imx_pcm_ops = { static const struct snd_pcm_ops imx_pcm_ops = {
.open = snd_imx_open, .open = snd_imx_open,
.close = snd_imx_close, .close = snd_imx_close,
.ioctl = snd_pcm_lib_ioctl, .ioctl = snd_pcm_lib_ioctl,
@ -341,7 +341,7 @@ static void imx_pcm_fiq_free(struct snd_pcm *pcm)
imx_pcm_free(pcm); imx_pcm_free(pcm);
} }
static struct snd_soc_platform_driver imx_soc_platform_fiq = { static const struct snd_soc_platform_driver imx_soc_platform_fiq = {
.ops = &imx_pcm_ops, .ops = &imx_pcm_ops,
.pcm_new = imx_pcm_fiq_new, .pcm_new = imx_pcm_fiq_new,
.pcm_free = imx_pcm_fiq_free, .pcm_free = imx_pcm_fiq_free,

View file

@ -287,7 +287,7 @@ psc_dma_hw_params(struct snd_pcm_substream *substream,
return 0; return 0;
} }
static struct snd_pcm_ops psc_dma_ops = { static const struct snd_pcm_ops psc_dma_ops = {
.open = psc_dma_open, .open = psc_dma_open,
.close = psc_dma_close, .close = psc_dma_close,
.hw_free = psc_dma_hw_free, .hw_free = psc_dma_hw_free,
@ -356,7 +356,7 @@ static void psc_dma_free(struct snd_pcm *pcm)
} }
} }
static struct snd_soc_platform_driver mpc5200_audio_dma_platform = { static const struct snd_soc_platform_driver mpc5200_audio_dma_platform = {
.ops = &psc_dma_ops, .ops = &psc_dma_ops,
.pcm_new = &psc_dma_new, .pcm_new = &psc_dma_new,
.pcm_free = &psc_dma_free, .pcm_free = &psc_dma_free,

View file

@ -140,7 +140,6 @@ static int mxs_sgtl5000_probe(struct platform_device *pdev)
} }
card->dev = &pdev->dev; card->dev = &pdev->dev;
platform_set_drvdata(pdev, card);
ret = devm_snd_soc_register_card(&pdev->dev, card); ret = devm_snd_soc_register_card(&pdev->dev, card);
if (ret) { if (ret) {

View file

@ -1962,10 +1962,8 @@ static int fsi_probe(struct platform_device *pdev)
} }
master = devm_kzalloc(&pdev->dev, sizeof(*master), GFP_KERNEL); master = devm_kzalloc(&pdev->dev, sizeof(*master), GFP_KERNEL);
if (!master) { if (!master)
dev_err(&pdev->dev, "Could not allocate master\n");
return -ENOMEM; return -ENOMEM;
}
master->base = devm_ioremap_nocache(&pdev->dev, master->base = devm_ioremap_nocache(&pdev->dev,
res->start, resource_size(res)); res->start, resource_size(res));
@ -2109,7 +2107,7 @@ static int fsi_resume(struct device *dev)
return 0; return 0;
} }
static struct dev_pm_ops fsi_pm_ops = { static const struct dev_pm_ops fsi_pm_ops = {
.suspend = fsi_suspend, .suspend = fsi_suspend,
.resume = fsi_resume, .resume = fsi_resume,
}; };