Merge remote-tracking branches 'asoc/topic/codecs', 'asoc/topic/compress' and 'asoc/topic/cq93vc' into asoc-next
This commit is contained in:
commit
9a2fef7c41
@ -7,10 +7,12 @@ Required properties:
|
||||
|
||||
Optional properties:
|
||||
- dmicen-gpios: GPIO specifier for dmic to control start and stop
|
||||
- num-channels: Number of microphones on this DAI
|
||||
|
||||
Example node:
|
||||
|
||||
dmic_codec: dmic@0 {
|
||||
compatible = "dmic-codec";
|
||||
dmicen-gpios = <&gpio4 3 GPIO_ACTIVE_HIGH>;
|
||||
num-channels = <1>;
|
||||
};
|
||||
|
@ -121,17 +121,19 @@ static struct snd_soc_dai_driver cq93vc_dai = {
|
||||
.ops = &cq93vc_dai_ops,
|
||||
};
|
||||
|
||||
static struct regmap *cq93vc_get_regmap(struct device *dev)
|
||||
static int cq93vc_probe(struct snd_soc_component *component)
|
||||
{
|
||||
struct davinci_vc *davinci_vc = dev->platform_data;
|
||||
struct davinci_vc *davinci_vc = component->dev->platform_data;
|
||||
|
||||
return davinci_vc->regmap;
|
||||
snd_soc_component_init_regmap(component, davinci_vc->regmap);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct snd_soc_codec_driver soc_codec_dev_cq93vc = {
|
||||
.set_bias_level = cq93vc_set_bias_level,
|
||||
.get_regmap = cq93vc_get_regmap,
|
||||
.component_driver = {
|
||||
.probe = cq93vc_probe,
|
||||
.controls = cq93vc_snd_controls,
|
||||
.num_controls = ARRAY_SIZE(cq93vc_snd_controls),
|
||||
},
|
||||
|
@ -107,8 +107,30 @@ static const struct snd_soc_codec_driver soc_dmic = {
|
||||
|
||||
static int dmic_dev_probe(struct platform_device *pdev)
|
||||
{
|
||||
int err;
|
||||
u32 chans;
|
||||
struct snd_soc_dai_driver *dai_drv = &dmic_dai;
|
||||
|
||||
if (pdev->dev.of_node) {
|
||||
err = of_property_read_u32(pdev->dev.of_node, "num-channels", &chans);
|
||||
if (err && (err != -ENOENT))
|
||||
return err;
|
||||
|
||||
if (!err) {
|
||||
if (chans < 1 || chans > 8)
|
||||
return -EINVAL;
|
||||
|
||||
dai_drv = devm_kzalloc(&pdev->dev, sizeof(*dai_drv), GFP_KERNEL);
|
||||
if (!dai_drv)
|
||||
return -ENOMEM;
|
||||
|
||||
memcpy(dai_drv, &dmic_dai, sizeof(*dai_drv));
|
||||
dai_drv->capture.channels_max = chans;
|
||||
}
|
||||
}
|
||||
|
||||
return snd_soc_register_codec(&pdev->dev,
|
||||
&soc_dmic, &dmic_dai, 1);
|
||||
&soc_dmic, dai_drv, 1);
|
||||
}
|
||||
|
||||
static int dmic_dev_remove(struct platform_device *pdev)
|
||||
|
@ -1096,7 +1096,6 @@ static struct snd_compr_ops soc_compr_dyn_ops = {
|
||||
*/
|
||||
int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
|
||||
{
|
||||
struct snd_soc_codec *codec = rtd->codec;
|
||||
struct snd_soc_platform *platform = rtd->platform;
|
||||
struct snd_soc_component *component;
|
||||
struct snd_soc_rtdcom_list *rtdcom;
|
||||
@ -1199,8 +1198,9 @@ int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
|
||||
ret = snd_compress_new(rtd->card->snd_card, num, direction,
|
||||
new_name, compr);
|
||||
if (ret < 0) {
|
||||
component = rtd->codec_dai->component;
|
||||
pr_err("compress asoc: can't create compress for codec %s\n",
|
||||
codec->component.name);
|
||||
component->name);
|
||||
goto compr_err;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user