Loading include/sound/dmaengine_pcm.h +5 −0 Original line number Diff line number Diff line Loading @@ -140,6 +140,9 @@ struct snd_dmaengine_pcm_config { struct dma_chan *(*compat_request_channel)( struct snd_soc_pcm_runtime *rtd, struct snd_pcm_substream *substream); int (*process)(struct snd_pcm_substream *substream, int channel, unsigned long hwoff, void *buf, unsigned long bytes); dma_filter_fn compat_filter_fn; struct device *dma_dev; const char *chan_names[SNDRV_PCM_STREAM_LAST + 1]; Loading @@ -161,4 +164,6 @@ int snd_dmaengine_pcm_prepare_slave_config(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct dma_slave_config *slave_config); #define SND_DMAENGINE_PCM_DRV_NAME "snd_dmaengine_pcm" #endif include/uapi/sound/asound.h +1 −0 Original line number Diff line number Diff line Loading @@ -242,6 +242,7 @@ typedef int __bitwise snd_pcm_format_t; #define SNDRV_PCM_FORMAT_DSD_U16_BE ((__force snd_pcm_format_t) 51) /* DSD, 2-byte samples DSD (x16), big endian */ #define SNDRV_PCM_FORMAT_DSD_U32_BE ((__force snd_pcm_format_t) 52) /* DSD, 4-byte samples DSD (x32), big endian */ #define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_DSD_U32_BE #define SNDRV_PCM_FORMAT_FIRST SNDRV_PCM_FORMAT_S8 #ifdef SNDRV_LITTLE_ENDIAN #define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE Loading sound/soc/amd/acp-pcm-dma.c +18 −11 Original line number Diff line number Diff line Loading @@ -23,6 +23,8 @@ #include <drm/amd_asic_type.h> #include "acp.h" #define DRV_NAME "acp_audio_dma" #define PLAYBACK_MIN_NUM_PERIODS 2 #define PLAYBACK_MAX_NUM_PERIODS 2 #define PLAYBACK_MAX_PERIOD_SIZE 16384 Loading Loading @@ -702,8 +704,8 @@ static int acp_dma_open(struct snd_pcm_substream *substream) int ret = 0; struct snd_pcm_runtime *runtime = substream->runtime; struct snd_soc_pcm_runtime *prtd = substream->private_data; struct audio_drv_data *intr_data = dev_get_drvdata(prtd->platform->dev); struct snd_soc_component *component = snd_soc_rtdcom_lookup(prtd, DRV_NAME); struct audio_drv_data *intr_data = dev_get_drvdata(component->dev); struct audio_substream_data *adata = kzalloc(sizeof(struct audio_substream_data), GFP_KERNEL); if (adata == NULL) Loading @@ -730,7 +732,7 @@ static int acp_dma_open(struct snd_pcm_substream *substream) ret = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); if (ret < 0) { dev_err(prtd->platform->dev, "set integer constraint failed\n"); dev_err(component->dev, "set integer constraint failed\n"); kfree(adata); return ret; } Loading Loading @@ -778,7 +780,8 @@ static int acp_dma_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_runtime *runtime; struct audio_substream_data *rtd; struct snd_soc_pcm_runtime *prtd = substream->private_data; struct audio_drv_data *adata = dev_get_drvdata(prtd->platform->dev); struct snd_soc_component *component = snd_soc_rtdcom_lookup(prtd, DRV_NAME); struct audio_drv_data *adata = dev_get_drvdata(component->dev); runtime = substream->runtime; rtd = runtime->private_data; Loading Loading @@ -907,6 +910,7 @@ static int acp_dma_trigger(struct snd_pcm_substream *substream, int cmd) struct snd_pcm_runtime *runtime = substream->runtime; struct snd_soc_pcm_runtime *prtd = substream->private_data; struct audio_substream_data *rtd = runtime->private_data; struct snd_soc_component *component = snd_soc_rtdcom_lookup(prtd, DRV_NAME); if (!rtd) return -EINVAL; Loading @@ -924,7 +928,7 @@ static int acp_dma_trigger(struct snd_pcm_substream *substream, int cmd) while (acp_reg_read(rtd->acp_mmio, mmACP_DMA_CH_STS) & BIT(SYSRAM_TO_ACP_CH_NUM)) { if (!loops--) { dev_err(prtd->platform->dev, dev_err(component->dev, "acp dma start timeout\n"); return -ETIMEDOUT; } Loading Loading @@ -970,7 +974,8 @@ static int acp_dma_trigger(struct snd_pcm_substream *substream, int cmd) static int acp_dma_new(struct snd_soc_pcm_runtime *rtd) { int ret; struct audio_drv_data *adata = dev_get_drvdata(rtd->platform->dev); struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, DRV_NAME); struct audio_drv_data *adata = dev_get_drvdata(component->dev); switch (adata->asic_type) { case CHIP_STONEY: Loading @@ -987,7 +992,7 @@ static int acp_dma_new(struct snd_soc_pcm_runtime *rtd) break; } if (ret < 0) dev_err(rtd->platform->dev, dev_err(component->dev, "buffer preallocation failer error:%d\n", ret); return ret; } Loading @@ -998,7 +1003,8 @@ static int acp_dma_close(struct snd_pcm_substream *substream) struct snd_pcm_runtime *runtime = substream->runtime; struct audio_substream_data *rtd = runtime->private_data; struct snd_soc_pcm_runtime *prtd = substream->private_data; struct audio_drv_data *adata = dev_get_drvdata(prtd->platform->dev); struct snd_soc_component *component = snd_soc_rtdcom_lookup(prtd, DRV_NAME); struct audio_drv_data *adata = dev_get_drvdata(component->dev); kfree(rtd); Loading Loading @@ -1044,7 +1050,8 @@ static const struct snd_pcm_ops acp_dma_ops = { .prepare = acp_dma_prepare, }; static struct snd_soc_platform_driver acp_asoc_platform = { static struct snd_soc_component_driver acp_asoc_platform = { .name = DRV_NAME, .ops = &acp_dma_ops, .pcm_new = acp_dma_new, }; Loading Loading @@ -1102,7 +1109,8 @@ static int acp_audio_probe(struct platform_device *pdev) return status; } status = snd_soc_register_platform(&pdev->dev, &acp_asoc_platform); status = devm_snd_soc_register_component(&pdev->dev, &acp_asoc_platform, NULL, 0); if (status != 0) { dev_err(&pdev->dev, "Fail to register ALSA platform device\n"); return status; Loading @@ -1123,7 +1131,6 @@ static int acp_audio_remove(struct platform_device *pdev) status = acp_deinit(adata->acp_mmio); if (status) dev_err(&pdev->dev, "ACP Deinit failed status:%d\n", status); snd_soc_unregister_platform(&pdev->dev); pm_runtime_disable(&pdev->dev); return 0; Loading sound/soc/atmel/atmel-classd.c +3 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ struct atmel_classd { struct regmap *regmap; struct clk *pclk; struct clk *gclk; struct device *dev; int irq; const struct atmel_classd_pdata *pdata; }; Loading Loading @@ -165,7 +166,7 @@ atmel_classd_platform_configure_dma(struct snd_pcm_substream *substream, struct atmel_classd *dd = snd_soc_card_get_drvdata(rtd->card); if (params_physical_width(params) != 16) { dev_err(rtd->platform->dev, dev_err(dd->dev, "only supports 16-bit audio data\n"); return -EINVAL; } Loading Loading @@ -587,6 +588,7 @@ static int atmel_classd_probe(struct platform_device *pdev) } dd->phy_base = res->start; dd->dev = dev; dd->regmap = devm_regmap_init_mmio(dev, io_base, &atmel_classd_regmap_config); Loading sound/soc/atmel/atmel-pcm-pdc.c +3 −3 Original line number Diff line number Diff line Loading @@ -393,7 +393,7 @@ static const struct snd_pcm_ops atmel_pcm_ops = { .mmap = atmel_pcm_mmap, }; static struct snd_soc_platform_driver atmel_soc_platform = { static struct snd_soc_component_driver atmel_soc_platform = { .ops = &atmel_pcm_ops, .pcm_new = atmel_pcm_new, .pcm_free = atmel_pcm_free, Loading @@ -401,13 +401,13 @@ static struct snd_soc_platform_driver atmel_soc_platform = { int atmel_pcm_pdc_platform_register(struct device *dev) { return snd_soc_register_platform(dev, &atmel_soc_platform); return devm_snd_soc_register_component(dev, &atmel_soc_platform, NULL, 0); } EXPORT_SYMBOL(atmel_pcm_pdc_platform_register); void atmel_pcm_pdc_platform_unregister(struct device *dev) { snd_soc_unregister_platform(dev); } EXPORT_SYMBOL(atmel_pcm_pdc_platform_unregister); Loading Loading
include/sound/dmaengine_pcm.h +5 −0 Original line number Diff line number Diff line Loading @@ -140,6 +140,9 @@ struct snd_dmaengine_pcm_config { struct dma_chan *(*compat_request_channel)( struct snd_soc_pcm_runtime *rtd, struct snd_pcm_substream *substream); int (*process)(struct snd_pcm_substream *substream, int channel, unsigned long hwoff, void *buf, unsigned long bytes); dma_filter_fn compat_filter_fn; struct device *dma_dev; const char *chan_names[SNDRV_PCM_STREAM_LAST + 1]; Loading @@ -161,4 +164,6 @@ int snd_dmaengine_pcm_prepare_slave_config(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct dma_slave_config *slave_config); #define SND_DMAENGINE_PCM_DRV_NAME "snd_dmaengine_pcm" #endif
include/uapi/sound/asound.h +1 −0 Original line number Diff line number Diff line Loading @@ -242,6 +242,7 @@ typedef int __bitwise snd_pcm_format_t; #define SNDRV_PCM_FORMAT_DSD_U16_BE ((__force snd_pcm_format_t) 51) /* DSD, 2-byte samples DSD (x16), big endian */ #define SNDRV_PCM_FORMAT_DSD_U32_BE ((__force snd_pcm_format_t) 52) /* DSD, 4-byte samples DSD (x32), big endian */ #define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_DSD_U32_BE #define SNDRV_PCM_FORMAT_FIRST SNDRV_PCM_FORMAT_S8 #ifdef SNDRV_LITTLE_ENDIAN #define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE Loading
sound/soc/amd/acp-pcm-dma.c +18 −11 Original line number Diff line number Diff line Loading @@ -23,6 +23,8 @@ #include <drm/amd_asic_type.h> #include "acp.h" #define DRV_NAME "acp_audio_dma" #define PLAYBACK_MIN_NUM_PERIODS 2 #define PLAYBACK_MAX_NUM_PERIODS 2 #define PLAYBACK_MAX_PERIOD_SIZE 16384 Loading Loading @@ -702,8 +704,8 @@ static int acp_dma_open(struct snd_pcm_substream *substream) int ret = 0; struct snd_pcm_runtime *runtime = substream->runtime; struct snd_soc_pcm_runtime *prtd = substream->private_data; struct audio_drv_data *intr_data = dev_get_drvdata(prtd->platform->dev); struct snd_soc_component *component = snd_soc_rtdcom_lookup(prtd, DRV_NAME); struct audio_drv_data *intr_data = dev_get_drvdata(component->dev); struct audio_substream_data *adata = kzalloc(sizeof(struct audio_substream_data), GFP_KERNEL); if (adata == NULL) Loading @@ -730,7 +732,7 @@ static int acp_dma_open(struct snd_pcm_substream *substream) ret = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); if (ret < 0) { dev_err(prtd->platform->dev, "set integer constraint failed\n"); dev_err(component->dev, "set integer constraint failed\n"); kfree(adata); return ret; } Loading Loading @@ -778,7 +780,8 @@ static int acp_dma_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_runtime *runtime; struct audio_substream_data *rtd; struct snd_soc_pcm_runtime *prtd = substream->private_data; struct audio_drv_data *adata = dev_get_drvdata(prtd->platform->dev); struct snd_soc_component *component = snd_soc_rtdcom_lookup(prtd, DRV_NAME); struct audio_drv_data *adata = dev_get_drvdata(component->dev); runtime = substream->runtime; rtd = runtime->private_data; Loading Loading @@ -907,6 +910,7 @@ static int acp_dma_trigger(struct snd_pcm_substream *substream, int cmd) struct snd_pcm_runtime *runtime = substream->runtime; struct snd_soc_pcm_runtime *prtd = substream->private_data; struct audio_substream_data *rtd = runtime->private_data; struct snd_soc_component *component = snd_soc_rtdcom_lookup(prtd, DRV_NAME); if (!rtd) return -EINVAL; Loading @@ -924,7 +928,7 @@ static int acp_dma_trigger(struct snd_pcm_substream *substream, int cmd) while (acp_reg_read(rtd->acp_mmio, mmACP_DMA_CH_STS) & BIT(SYSRAM_TO_ACP_CH_NUM)) { if (!loops--) { dev_err(prtd->platform->dev, dev_err(component->dev, "acp dma start timeout\n"); return -ETIMEDOUT; } Loading Loading @@ -970,7 +974,8 @@ static int acp_dma_trigger(struct snd_pcm_substream *substream, int cmd) static int acp_dma_new(struct snd_soc_pcm_runtime *rtd) { int ret; struct audio_drv_data *adata = dev_get_drvdata(rtd->platform->dev); struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, DRV_NAME); struct audio_drv_data *adata = dev_get_drvdata(component->dev); switch (adata->asic_type) { case CHIP_STONEY: Loading @@ -987,7 +992,7 @@ static int acp_dma_new(struct snd_soc_pcm_runtime *rtd) break; } if (ret < 0) dev_err(rtd->platform->dev, dev_err(component->dev, "buffer preallocation failer error:%d\n", ret); return ret; } Loading @@ -998,7 +1003,8 @@ static int acp_dma_close(struct snd_pcm_substream *substream) struct snd_pcm_runtime *runtime = substream->runtime; struct audio_substream_data *rtd = runtime->private_data; struct snd_soc_pcm_runtime *prtd = substream->private_data; struct audio_drv_data *adata = dev_get_drvdata(prtd->platform->dev); struct snd_soc_component *component = snd_soc_rtdcom_lookup(prtd, DRV_NAME); struct audio_drv_data *adata = dev_get_drvdata(component->dev); kfree(rtd); Loading Loading @@ -1044,7 +1050,8 @@ static const struct snd_pcm_ops acp_dma_ops = { .prepare = acp_dma_prepare, }; static struct snd_soc_platform_driver acp_asoc_platform = { static struct snd_soc_component_driver acp_asoc_platform = { .name = DRV_NAME, .ops = &acp_dma_ops, .pcm_new = acp_dma_new, }; Loading Loading @@ -1102,7 +1109,8 @@ static int acp_audio_probe(struct platform_device *pdev) return status; } status = snd_soc_register_platform(&pdev->dev, &acp_asoc_platform); status = devm_snd_soc_register_component(&pdev->dev, &acp_asoc_platform, NULL, 0); if (status != 0) { dev_err(&pdev->dev, "Fail to register ALSA platform device\n"); return status; Loading @@ -1123,7 +1131,6 @@ static int acp_audio_remove(struct platform_device *pdev) status = acp_deinit(adata->acp_mmio); if (status) dev_err(&pdev->dev, "ACP Deinit failed status:%d\n", status); snd_soc_unregister_platform(&pdev->dev); pm_runtime_disable(&pdev->dev); return 0; Loading
sound/soc/atmel/atmel-classd.c +3 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ struct atmel_classd { struct regmap *regmap; struct clk *pclk; struct clk *gclk; struct device *dev; int irq; const struct atmel_classd_pdata *pdata; }; Loading Loading @@ -165,7 +166,7 @@ atmel_classd_platform_configure_dma(struct snd_pcm_substream *substream, struct atmel_classd *dd = snd_soc_card_get_drvdata(rtd->card); if (params_physical_width(params) != 16) { dev_err(rtd->platform->dev, dev_err(dd->dev, "only supports 16-bit audio data\n"); return -EINVAL; } Loading Loading @@ -587,6 +588,7 @@ static int atmel_classd_probe(struct platform_device *pdev) } dd->phy_base = res->start; dd->dev = dev; dd->regmap = devm_regmap_init_mmio(dev, io_base, &atmel_classd_regmap_config); Loading
sound/soc/atmel/atmel-pcm-pdc.c +3 −3 Original line number Diff line number Diff line Loading @@ -393,7 +393,7 @@ static const struct snd_pcm_ops atmel_pcm_ops = { .mmap = atmel_pcm_mmap, }; static struct snd_soc_platform_driver atmel_soc_platform = { static struct snd_soc_component_driver atmel_soc_platform = { .ops = &atmel_pcm_ops, .pcm_new = atmel_pcm_new, .pcm_free = atmel_pcm_free, Loading @@ -401,13 +401,13 @@ static struct snd_soc_platform_driver atmel_soc_platform = { int atmel_pcm_pdc_platform_register(struct device *dev) { return snd_soc_register_platform(dev, &atmel_soc_platform); return devm_snd_soc_register_component(dev, &atmel_soc_platform, NULL, 0); } EXPORT_SYMBOL(atmel_pcm_pdc_platform_register); void atmel_pcm_pdc_platform_unregister(struct device *dev) { snd_soc_unregister_platform(dev); } EXPORT_SYMBOL(atmel_pcm_pdc_platform_unregister); Loading