wm8998.c (f8bade6c9a6213c2c5ba6e5bf32415ecab6e41e5) wm8998.c (37dbabf14ff65510fa5aeecc1707ca390e608e00)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * wm8998.c -- ALSA SoC Audio driver for WM8998 codecs
4 *
5 * Copyright 2015 Cirrus Logic, Inc.
6 *
7 * Author: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
8 */

--- 1302 unchanged lines hidden (view full) ---

1311 ARIZONA_DAC_DIGITAL_VOLUME_5R,
1312};
1313
1314static const struct snd_soc_component_driver soc_component_dev_wm8998 = {
1315 .probe = wm8998_component_probe,
1316 .remove = wm8998_component_remove,
1317 .set_sysclk = arizona_set_sysclk,
1318 .set_pll = wm8998_set_fll,
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * wm8998.c -- ALSA SoC Audio driver for WM8998 codecs
4 *
5 * Copyright 2015 Cirrus Logic, Inc.
6 *
7 * Author: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
8 */

--- 1302 unchanged lines hidden (view full) ---

1311 ARIZONA_DAC_DIGITAL_VOLUME_5R,
1312};
1313
1314static const struct snd_soc_component_driver soc_component_dev_wm8998 = {
1315 .probe = wm8998_component_probe,
1316 .remove = wm8998_component_remove,
1317 .set_sysclk = arizona_set_sysclk,
1318 .set_pll = wm8998_set_fll,
1319 .set_jack = arizona_jack_set_jack,
1319 .controls = wm8998_snd_controls,
1320 .num_controls = ARRAY_SIZE(wm8998_snd_controls),
1321 .dapm_widgets = wm8998_dapm_widgets,
1322 .num_dapm_widgets = ARRAY_SIZE(wm8998_dapm_widgets),
1323 .dapm_routes = wm8998_dapm_routes,
1324 .num_dapm_routes = ARRAY_SIZE(wm8998_dapm_routes),
1325 .use_pmdown_time = 1,
1326 .endianness = 1,

--- 18 unchanged lines hidden (view full) ---

1345 if (ret < 0)
1346 return ret;
1347 }
1348 }
1349
1350 wm8998->core.arizona = arizona;
1351 wm8998->core.num_inputs = 3; /* IN1L, IN1R, IN2 */
1352
1320 .controls = wm8998_snd_controls,
1321 .num_controls = ARRAY_SIZE(wm8998_snd_controls),
1322 .dapm_widgets = wm8998_dapm_widgets,
1323 .num_dapm_widgets = ARRAY_SIZE(wm8998_dapm_widgets),
1324 .dapm_routes = wm8998_dapm_routes,
1325 .num_dapm_routes = ARRAY_SIZE(wm8998_dapm_routes),
1326 .use_pmdown_time = 1,
1327 .endianness = 1,

--- 18 unchanged lines hidden (view full) ---

1346 if (ret < 0)
1347 return ret;
1348 }
1349 }
1350
1351 wm8998->core.arizona = arizona;
1352 wm8998->core.num_inputs = 3; /* IN1L, IN1R, IN2 */
1353
1354 /* This may return -EPROBE_DEFER, so do this early on */
1355 ret = arizona_jack_codec_dev_probe(&wm8998->core, &pdev->dev);
1356 if (ret)
1357 return ret;
1358
1353 for (i = 0; i < ARRAY_SIZE(wm8998->fll); i++)
1354 wm8998->fll[i].vco_mult = 1;
1355
1356 arizona_init_fll(arizona, 1, ARIZONA_FLL1_CONTROL_1 - 1,
1357 ARIZONA_IRQ_FLL1_LOCK, ARIZONA_IRQ_FLL1_CLOCK_OK,
1358 &wm8998->fll[0]);
1359 arizona_init_fll(arizona, 2, ARIZONA_FLL2_CONTROL_1 - 1,
1360 ARIZONA_IRQ_FLL2_LOCK, ARIZONA_IRQ_FLL2_CLOCK_OK,

--- 26 unchanged lines hidden (view full) ---

1387 }
1388
1389 return ret;
1390
1391err_spk_irqs:
1392 arizona_free_spk_irqs(arizona);
1393err_pm_disable:
1394 pm_runtime_disable(&pdev->dev);
1359 for (i = 0; i < ARRAY_SIZE(wm8998->fll); i++)
1360 wm8998->fll[i].vco_mult = 1;
1361
1362 arizona_init_fll(arizona, 1, ARIZONA_FLL1_CONTROL_1 - 1,
1363 ARIZONA_IRQ_FLL1_LOCK, ARIZONA_IRQ_FLL1_CLOCK_OK,
1364 &wm8998->fll[0]);
1365 arizona_init_fll(arizona, 2, ARIZONA_FLL2_CONTROL_1 - 1,
1366 ARIZONA_IRQ_FLL2_LOCK, ARIZONA_IRQ_FLL2_CLOCK_OK,

--- 26 unchanged lines hidden (view full) ---

1393 }
1394
1395 return ret;
1396
1397err_spk_irqs:
1398 arizona_free_spk_irqs(arizona);
1399err_pm_disable:
1400 pm_runtime_disable(&pdev->dev);
1401 arizona_jack_codec_dev_remove(&wm8998->core);
1395
1396 return ret;
1397}
1398
1399static int wm8998_remove(struct platform_device *pdev)
1400{
1401 struct wm8998_priv *wm8998 = platform_get_drvdata(pdev);
1402 struct arizona *arizona = wm8998->core.arizona;
1403
1404 pm_runtime_disable(&pdev->dev);
1405
1406 arizona_free_spk_irqs(arizona);
1407
1402
1403 return ret;
1404}
1405
1406static int wm8998_remove(struct platform_device *pdev)
1407{
1408 struct wm8998_priv *wm8998 = platform_get_drvdata(pdev);
1409 struct arizona *arizona = wm8998->core.arizona;
1410
1411 pm_runtime_disable(&pdev->dev);
1412
1413 arizona_free_spk_irqs(arizona);
1414
1415 arizona_jack_codec_dev_remove(&wm8998->core);
1416
1408 return 0;
1409}
1410
1411static struct platform_driver wm8998_codec_driver = {
1412 .driver = {
1413 .name = "wm8998-codec",
1414 },
1415 .probe = wm8998_probe,
1416 .remove = wm8998_remove,
1417};
1418
1419module_platform_driver(wm8998_codec_driver);
1420
1421MODULE_DESCRIPTION("ASoC WM8998 driver");
1422MODULE_AUTHOR("Richard Fitzgerald <rf@opensource.wolfsonmicro.com>");
1423MODULE_LICENSE("GPL v2");
1424MODULE_ALIAS("platform:wm8998-codec");
1417 return 0;
1418}
1419
1420static struct platform_driver wm8998_codec_driver = {
1421 .driver = {
1422 .name = "wm8998-codec",
1423 },
1424 .probe = wm8998_probe,
1425 .remove = wm8998_remove,
1426};
1427
1428module_platform_driver(wm8998_codec_driver);
1429
1430MODULE_DESCRIPTION("ASoC WM8998 driver");
1431MODULE_AUTHOR("Richard Fitzgerald <rf@opensource.wolfsonmicro.com>");
1432MODULE_LICENSE("GPL v2");
1433MODULE_ALIAS("platform:wm8998-codec");