Commit 7c003136 authored by Mark Brown's avatar Mark Brown

Merge remote-tracking branches 'asoc/topic/davinci',...

Merge remote-tracking branches 'asoc/topic/davinci', 'asoc/topic/davinci-vcif', 'asoc/topic/doc' and 'asoc/topic/dpcm' into asoc-next
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
<sect1><title>ASoC Core API</title> <sect1><title>ASoC Core API</title>
!Iinclude/sound/soc.h !Iinclude/sound/soc.h
!Esound/soc/soc-core.c !Esound/soc/soc-core.c
!Esound/soc/soc-cache.c <!-- !Esound/soc/soc-cache.c no docbook comments here -->
!Esound/soc/soc-devres.c !Esound/soc/soc-devres.c
!Esound/soc/soc-io.c !Esound/soc/soc-io.c
!Esound/soc/soc-pcm.c !Esound/soc/soc-pcm.c
......
...@@ -620,6 +620,7 @@ int snd_soc_put_strobe(struct snd_kcontrol *kcontrol, ...@@ -620,6 +620,7 @@ int snd_soc_put_strobe(struct snd_kcontrol *kcontrol,
* @pin: name of the pin to update * @pin: name of the pin to update
* @mask: bits to check for in reported jack status * @mask: bits to check for in reported jack status
* @invert: if non-zero then pin is enabled when status is not reported * @invert: if non-zero then pin is enabled when status is not reported
* @list: internal list entry
*/ */
struct snd_soc_jack_pin { struct snd_soc_jack_pin {
struct list_head list; struct list_head list;
...@@ -636,7 +637,7 @@ struct snd_soc_jack_pin { ...@@ -636,7 +637,7 @@ struct snd_soc_jack_pin {
* @jack_type: type of jack that is expected for this voltage * @jack_type: type of jack that is expected for this voltage
* @debounce_time: debounce_time for jack, codec driver should wait for this * @debounce_time: debounce_time for jack, codec driver should wait for this
* duration before reading the adc for voltages * duration before reading the adc for voltages
* @:list: list container * @list: internal list entry
*/ */
struct snd_soc_jack_zone { struct snd_soc_jack_zone {
unsigned int min_mv; unsigned int min_mv;
...@@ -652,12 +653,12 @@ struct snd_soc_jack_zone { ...@@ -652,12 +653,12 @@ struct snd_soc_jack_zone {
* @gpio: legacy gpio number * @gpio: legacy gpio number
* @idx: gpio descriptor index within the function of the GPIO * @idx: gpio descriptor index within the function of the GPIO
* consumer device * consumer device
* @gpiod_dev GPIO consumer device * @gpiod_dev: GPIO consumer device
* @name: gpio name. Also as connection ID for the GPIO consumer * @name: gpio name. Also as connection ID for the GPIO consumer
* device function name lookup * device function name lookup
* @report: value to report when jack detected * @report: value to report when jack detected
* @invert: report presence in low state * @invert: report presence in low state
* @debouce_time: debouce time in ms * @debounce_time: debounce time in ms
* @wake: enable as wake source * @wake: enable as wake source
* @jack_status_check: callback function which overrides the detection * @jack_status_check: callback function which overrides the detection
* to provide more complex checks (eg, reading an * to provide more complex checks (eg, reading an
...@@ -673,11 +674,13 @@ struct snd_soc_jack_gpio { ...@@ -673,11 +674,13 @@ struct snd_soc_jack_gpio {
int debounce_time; int debounce_time;
bool wake; bool wake;
/* private: */
struct snd_soc_jack *jack; struct snd_soc_jack *jack;
struct delayed_work work; struct delayed_work work;
struct gpio_desc *desc; struct gpio_desc *desc;
void *data; void *data;
/* public: */
int (*jack_status_check)(void *data); int (*jack_status_check)(void *data);
}; };
...@@ -1315,7 +1318,7 @@ static inline struct snd_soc_dapm_context *snd_soc_codec_get_dapm( ...@@ -1315,7 +1318,7 @@ static inline struct snd_soc_dapm_context *snd_soc_codec_get_dapm(
/** /**
* snd_soc_dapm_init_bias_level() - Initialize CODEC DAPM bias level * snd_soc_dapm_init_bias_level() - Initialize CODEC DAPM bias level
* @dapm: The CODEC for which to initialize the DAPM bias level * @codec: The CODEC for which to initialize the DAPM bias level
* @level: The DAPM level to initialize to * @level: The DAPM level to initialize to
* *
* Initializes the CODEC DAPM bias level. See snd_soc_dapm_init_bias_level(). * Initializes the CODEC DAPM bias level. See snd_soc_dapm_init_bias_level().
......
...@@ -651,23 +651,15 @@ static const struct snd_soc_component_driver davinci_i2s_component = { ...@@ -651,23 +651,15 @@ static const struct snd_soc_component_driver davinci_i2s_component = {
static int davinci_i2s_probe(struct platform_device *pdev) static int davinci_i2s_probe(struct platform_device *pdev)
{ {
struct davinci_mcbsp_dev *dev; struct davinci_mcbsp_dev *dev;
struct resource *mem, *ioarea, *res; struct resource *mem, *res;
void __iomem *io_base;
int *dma; int *dma;
int ret; int ret;
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!mem) { io_base = devm_ioremap_resource(&pdev->dev, mem);
dev_err(&pdev->dev, "no mem resource?\n"); if (IS_ERR(io_base))
return -ENODEV; return PTR_ERR(io_base);
}
ioarea = devm_request_mem_region(&pdev->dev, mem->start,
resource_size(mem),
pdev->name);
if (!ioarea) {
dev_err(&pdev->dev, "McBSP region already claimed\n");
return -EBUSY;
}
dev = devm_kzalloc(&pdev->dev, sizeof(struct davinci_mcbsp_dev), dev = devm_kzalloc(&pdev->dev, sizeof(struct davinci_mcbsp_dev),
GFP_KERNEL); GFP_KERNEL);
...@@ -679,12 +671,7 @@ static int davinci_i2s_probe(struct platform_device *pdev) ...@@ -679,12 +671,7 @@ static int davinci_i2s_probe(struct platform_device *pdev)
return -ENODEV; return -ENODEV;
clk_enable(dev->clk); clk_enable(dev->clk);
dev->base = devm_ioremap(&pdev->dev, mem->start, resource_size(mem)); dev->base = io_base;
if (!dev->base) {
dev_err(&pdev->dev, "ioremap failed\n");
ret = -ENOMEM;
goto err_release_clk;
}
dev->dma_data[SNDRV_PCM_STREAM_PLAYBACK].addr = dev->dma_data[SNDRV_PCM_STREAM_PLAYBACK].addr =
(dma_addr_t)(mem->start + DAVINCI_MCBSP_DXR_REG); (dma_addr_t)(mem->start + DAVINCI_MCBSP_DXR_REG);
......
...@@ -1613,7 +1613,7 @@ static int davinci_mcasp_get_dma_type(struct davinci_mcasp *mcasp) ...@@ -1613,7 +1613,7 @@ static int davinci_mcasp_get_dma_type(struct davinci_mcasp *mcasp)
static int davinci_mcasp_probe(struct platform_device *pdev) static int davinci_mcasp_probe(struct platform_device *pdev)
{ {
struct snd_dmaengine_dai_dma_data *dma_data; struct snd_dmaengine_dai_dma_data *dma_data;
struct resource *mem, *ioarea, *res, *dat; struct resource *mem, *res, *dat;
struct davinci_mcasp_pdata *pdata; struct davinci_mcasp_pdata *pdata;
struct davinci_mcasp *mcasp; struct davinci_mcasp *mcasp;
char *irq_name; char *irq_name;
...@@ -1648,22 +1648,12 @@ static int davinci_mcasp_probe(struct platform_device *pdev) ...@@ -1648,22 +1648,12 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
} }
} }
ioarea = devm_request_mem_region(&pdev->dev, mem->start, mcasp->base = devm_ioremap_resource(&pdev->dev, mem);
resource_size(mem), pdev->name); if (IS_ERR(mcasp->base))
if (!ioarea) { return PTR_ERR(mcasp->base);
dev_err(&pdev->dev, "Audio region already claimed\n");
return -EBUSY;
}
pm_runtime_enable(&pdev->dev); pm_runtime_enable(&pdev->dev);
mcasp->base = devm_ioremap(&pdev->dev, mem->start, resource_size(mem));
if (!mcasp->base) {
dev_err(&pdev->dev, "ioremap failed\n");
ret = -ENOMEM;
goto err;
}
mcasp->op_mode = pdata->op_mode; mcasp->op_mode = pdata->op_mode;
/* sanity check for tdm slots parameter */ /* sanity check for tdm slots parameter */
if (mcasp->op_mode == DAVINCI_MCASP_IIS_MODE) { if (mcasp->op_mode == DAVINCI_MCASP_IIS_MODE) {
......
...@@ -231,8 +231,9 @@ static int davinci_vcif_probe(struct platform_device *pdev) ...@@ -231,8 +231,9 @@ static int davinci_vcif_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, davinci_vcif_dev); dev_set_drvdata(&pdev->dev, davinci_vcif_dev);
ret = snd_soc_register_component(&pdev->dev, &davinci_vcif_component, ret = devm_snd_soc_register_component(&pdev->dev,
&davinci_vcif_dai, 1); &davinci_vcif_component,
&davinci_vcif_dai, 1);
if (ret != 0) { if (ret != 0) {
dev_err(&pdev->dev, "could not register dai\n"); dev_err(&pdev->dev, "could not register dai\n");
return ret; return ret;
...@@ -241,23 +242,14 @@ static int davinci_vcif_probe(struct platform_device *pdev) ...@@ -241,23 +242,14 @@ static int davinci_vcif_probe(struct platform_device *pdev)
ret = edma_pcm_platform_register(&pdev->dev); ret = edma_pcm_platform_register(&pdev->dev);
if (ret) { if (ret) {
dev_err(&pdev->dev, "register PCM failed: %d\n", ret); dev_err(&pdev->dev, "register PCM failed: %d\n", ret);
snd_soc_unregister_component(&pdev->dev);
return ret; return ret;
} }
return 0; return 0;
} }
static int davinci_vcif_remove(struct platform_device *pdev)
{
snd_soc_unregister_component(&pdev->dev);
return 0;
}
static struct platform_driver davinci_vcif_driver = { static struct platform_driver davinci_vcif_driver = {
.probe = davinci_vcif_probe, .probe = davinci_vcif_probe,
.remove = davinci_vcif_remove,
.driver = { .driver = {
.name = "davinci-vcif", .name = "davinci-vcif",
}, },
......
...@@ -2140,7 +2140,7 @@ EXPORT_SYMBOL_GPL(snd_soc_codec_set_pll); ...@@ -2140,7 +2140,7 @@ EXPORT_SYMBOL_GPL(snd_soc_codec_set_pll);
/** /**
* snd_soc_dai_set_bclk_ratio - configure BCLK to sample rate ratio. * snd_soc_dai_set_bclk_ratio - configure BCLK to sample rate ratio.
* @dai: DAI * @dai: DAI
* @ratio Ratio of BCLK to Sample rate. * @ratio: Ratio of BCLK to Sample rate.
* *
* Configures the DAI for a preset BCLK to sample rate ratio. * Configures the DAI for a preset BCLK to sample rate ratio.
*/ */
...@@ -2808,6 +2808,7 @@ EXPORT_SYMBOL_GPL(snd_soc_register_component); ...@@ -2808,6 +2808,7 @@ EXPORT_SYMBOL_GPL(snd_soc_register_component);
/** /**
* snd_soc_unregister_component - Unregister a component from the ASoC core * snd_soc_unregister_component - Unregister a component from the ASoC core
* *
* @dev: The device to unregister
*/ */
void snd_soc_unregister_component(struct device *dev) void snd_soc_unregister_component(struct device *dev)
{ {
...@@ -2848,7 +2849,7 @@ static void snd_soc_platform_drv_remove(struct snd_soc_component *component) ...@@ -2848,7 +2849,7 @@ static void snd_soc_platform_drv_remove(struct snd_soc_component *component)
* snd_soc_add_platform - Add a platform to the ASoC core * snd_soc_add_platform - Add a platform to the ASoC core
* @dev: The parent device for the platform * @dev: The parent device for the platform
* @platform: The platform to add * @platform: The platform to add
* @platform_driver: The driver for the platform * @platform_drv: The driver for the platform
*/ */
int snd_soc_add_platform(struct device *dev, struct snd_soc_platform *platform, int snd_soc_add_platform(struct device *dev, struct snd_soc_platform *platform,
const struct snd_soc_platform_driver *platform_drv) const struct snd_soc_platform_driver *platform_drv)
...@@ -2887,7 +2888,8 @@ EXPORT_SYMBOL_GPL(snd_soc_add_platform); ...@@ -2887,7 +2888,8 @@ EXPORT_SYMBOL_GPL(snd_soc_add_platform);
/** /**
* snd_soc_register_platform - Register a platform with the ASoC core * snd_soc_register_platform - Register a platform with the ASoC core
* *
* @platform: platform to register * @dev: The device for the platform
* @platform_drv: The driver for the platform
*/ */
int snd_soc_register_platform(struct device *dev, int snd_soc_register_platform(struct device *dev,
const struct snd_soc_platform_driver *platform_drv) const struct snd_soc_platform_driver *platform_drv)
...@@ -2948,7 +2950,7 @@ EXPORT_SYMBOL_GPL(snd_soc_lookup_platform); ...@@ -2948,7 +2950,7 @@ EXPORT_SYMBOL_GPL(snd_soc_lookup_platform);
/** /**
* snd_soc_unregister_platform - Unregister a platform from the ASoC core * snd_soc_unregister_platform - Unregister a platform from the ASoC core
* *
* @platform: platform to unregister * @dev: platform to unregister
*/ */
void snd_soc_unregister_platform(struct device *dev) void snd_soc_unregister_platform(struct device *dev)
{ {
...@@ -3039,7 +3041,10 @@ static int snd_soc_codec_set_bias_level(struct snd_soc_dapm_context *dapm, ...@@ -3039,7 +3041,10 @@ static int snd_soc_codec_set_bias_level(struct snd_soc_dapm_context *dapm,
/** /**
* snd_soc_register_codec - Register a codec with the ASoC core * snd_soc_register_codec - Register a codec with the ASoC core
* *
* @codec: codec to register * @dev: The parent device for this codec
* @codec_drv: Codec driver
* @dai_drv: The associated DAI driver
* @num_dai: Number of DAIs
*/ */
int snd_soc_register_codec(struct device *dev, int snd_soc_register_codec(struct device *dev,
const struct snd_soc_codec_driver *codec_drv, const struct snd_soc_codec_driver *codec_drv,
...@@ -3140,7 +3145,7 @@ EXPORT_SYMBOL_GPL(snd_soc_register_codec); ...@@ -3140,7 +3145,7 @@ EXPORT_SYMBOL_GPL(snd_soc_register_codec);
/** /**
* snd_soc_unregister_codec - Unregister a codec from the ASoC core * snd_soc_unregister_codec - Unregister a codec from the ASoC core
* *
* @codec: codec to unregister * @dev: codec to unregister
*/ */
void snd_soc_unregister_codec(struct device *dev) void snd_soc_unregister_codec(struct device *dev)
{ {
......
...@@ -2876,7 +2876,7 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_weak_routes); ...@@ -2876,7 +2876,7 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_weak_routes);
/** /**
* snd_soc_dapm_new_widgets - add new dapm widgets * snd_soc_dapm_new_widgets - add new dapm widgets
* @dapm: DAPM context * @card: card to be checked for new dapm widgets
* *
* Checks the codec for any new dapm widgets and creates them if found. * Checks the codec for any new dapm widgets and creates them if found.
* *
......
...@@ -1299,7 +1299,12 @@ static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream, ...@@ -1299,7 +1299,12 @@ static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream,
switch (list->widgets[i]->id) { switch (list->widgets[i]->id) {
case snd_soc_dapm_dai_in: case snd_soc_dapm_dai_in:
if (stream != SNDRV_PCM_STREAM_PLAYBACK)
continue;
break;
case snd_soc_dapm_dai_out: case snd_soc_dapm_dai_out:
if (stream != SNDRV_PCM_STREAM_CAPTURE)
continue;
break; break;
default: default:
continue; continue;
......
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