adau7002.c (0cce284537fb42d9c28b9b31038ffc9b464555f5) | adau7002.c (d5bc548469dae9cd83f6553437637b0d0b7d5c5c) |
---|---|
1/* 2 * ADAU7002 Stereo PDM-to-I2S/TDM converter driver 3 * 4 * Copyright 2014-2016 Analog Devices 5 * Author: Lars-Peter Clausen <lars@metafoo.de> 6 * 7 * Licensed under the GPL-2. 8 */ --- 24 unchanged lines hidden (view full) --- 33 .rates = SNDRV_PCM_RATE_8000_96000, 34 .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S18_3LE | 35 SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S24_LE | 36 SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S32_LE, 37 .sig_bits = 20, 38 }, 39}; 40 | 1/* 2 * ADAU7002 Stereo PDM-to-I2S/TDM converter driver 3 * 4 * Copyright 2014-2016 Analog Devices 5 * Author: Lars-Peter Clausen <lars@metafoo.de> 6 * 7 * Licensed under the GPL-2. 8 */ --- 24 unchanged lines hidden (view full) --- 33 .rates = SNDRV_PCM_RATE_8000_96000, 34 .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S18_3LE | 35 SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S24_LE | 36 SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S32_LE, 37 .sig_bits = 20, 38 }, 39}; 40 |
41static const struct snd_soc_codec_driver adau7002_codec_driver = { 42 .component_driver = { 43 .dapm_widgets = adau7002_widgets, 44 .num_dapm_widgets = ARRAY_SIZE(adau7002_widgets), 45 .dapm_routes = adau7002_routes, 46 .num_dapm_routes = ARRAY_SIZE(adau7002_routes), 47 }, | 41static const struct snd_soc_component_driver adau7002_component_driver = { 42 .dapm_widgets = adau7002_widgets, 43 .num_dapm_widgets = ARRAY_SIZE(adau7002_widgets), 44 .dapm_routes = adau7002_routes, 45 .num_dapm_routes = ARRAY_SIZE(adau7002_routes), 46 .idle_bias_on = 1, 47 .use_pmdown_time = 1, 48 .endianness = 1, 49 .non_legacy_dai_naming = 1, |
48}; 49 50static int adau7002_probe(struct platform_device *pdev) 51{ | 50}; 51 52static int adau7002_probe(struct platform_device *pdev) 53{ |
52 return snd_soc_register_codec(&pdev->dev, &adau7002_codec_driver, | 54 return devm_snd_soc_register_component(&pdev->dev, 55 &adau7002_component_driver, |
53 &adau7002_dai, 1); 54} 55 56static int adau7002_remove(struct platform_device *pdev) 57{ | 56 &adau7002_dai, 1); 57} 58 59static int adau7002_remove(struct platform_device *pdev) 60{ |
58 snd_soc_unregister_codec(&pdev->dev); | |
59 return 0; 60} 61 62#ifdef CONFIG_OF 63static const struct of_device_id adau7002_dt_ids[] = { 64 { .compatible = "adi,adau7002", }, 65 { } 66}; --- 16 unchanged lines hidden --- | 61 return 0; 62} 63 64#ifdef CONFIG_OF 65static const struct of_device_id adau7002_dt_ids[] = { 66 { .compatible = "adi,adau7002", }, 67 { } 68}; --- 16 unchanged lines hidden --- |