2018-07-02 06:24:18 +00:00
|
|
|
|
|
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
|
|
|
|
|
2018-07-02 06:24:18 +00:00
|
|
|
|
|
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-09-04 14:15:24 +03:00
|
|
|
|
2024-04-22 18:15:13 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-03-03 15:25:04 -06:00
|
|
|
|
2024-04-22 18:15:13 +03:00
|
|
|
|
2012-09-14 13:57:27 +02:00
|
|
|
|
2024-04-22 18:15:13 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-16 17:10:40 +05:30
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
2024-04-22 18:15:13 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-04 14:05:00 +00:00
|
|
|
|
|
|
|
|
|
2014-10-25 20:25:56 +02:00
|
|
|
|
|
|
|
|
|
2022-08-16 18:21:29 +01:00
|
|
|
|
2014-10-25 20:25:56 +02:00
|
|
|
|
2025-03-04 14:05:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-01-16 16:02:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-16 18:21:29 +01:00
|
|
|
|
2014-01-16 16:02:11 +01:00
|
|
|
|
2025-03-03 17:14:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-10 14:37:42 +01:00
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-04 14:05:00 +00:00
|
|
|
|
2012-05-31 15:18:01 +01:00
|
|
|
|
|
|
|
|
|
2025-03-18 17:14:53 +00:00
|
|
|
|
2025-03-18 17:14:54 +00:00
|
|
|
|
2025-03-04 14:05:00 +00:00
|
|
|
|
2008-01-10 14:37:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-04 14:05:00 +00:00
|
|
|
|
2012-03-30 10:43:55 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-14 13:31:24 +01:00
|
|
|
|
2012-03-30 10:43:55 -05:00
|
|
|
|
|
|
|
|
|
2025-03-04 14:05:00 +00:00
|
|
|
|
2012-05-31 15:18:01 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-18 17:14:52 +00:00
|
|
|
|
2025-03-18 17:14:54 +00:00
|
|
|
|
2025-03-04 14:05:00 +00:00
|
|
|
|
2011-10-04 14:39:38 +03:00
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-10-04 14:39:38 +03:00
|
|
|
|
2025-03-04 14:05:00 +00:00
|
|
|
|
2015-12-08 15:58:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-04 14:05:00 +00:00
|
|
|
|
2008-07-29 11:42:26 +01:00
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
2011-10-05 10:29:23 +03:00
|
|
|
|
2011-10-05 10:29:25 +03:00
|
|
|
|
2011-10-04 14:39:39 +03:00
|
|
|
|
2025-03-03 17:14:23 +00:00
|
|
|
|
2012-06-22 11:40:55 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-18 17:14:52 +00:00
|
|
|
|
2025-03-18 17:14:54 +00:00
|
|
|
|
2025-03-03 17:14:23 +00:00
|
|
|
|
2012-06-22 11:40:55 +01:00
|
|
|
|
2011-10-04 14:39:38 +03:00
|
|
|
|
2008-01-10 14:37:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-10-04 14:39:38 +03:00
|
|
|
|
2025-03-04 14:05:00 +00:00
|
|
|
|
2022-06-21 11:20:41 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-04 14:05:00 +00:00
|
|
|
|
|
|
|
|
|
2024-03-05 15:36:30 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-04 14:05:00 +00:00
|
|
|
|
|
|
|
|
|
2008-07-29 11:42:26 +01:00
|
|
|
|
2008-01-10 14:37:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-10-05 10:29:23 +03:00
|
|
|
|
2011-10-05 10:29:25 +03:00
|
|
|
|
2011-10-04 14:39:39 +03:00
|
|
|
|
2025-03-03 17:14:23 +00:00
|
|
|
|
2012-06-22 11:40:55 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-18 17:14:52 +00:00
|
|
|
|
2025-03-18 17:14:54 +00:00
|
|
|
|
2025-03-03 17:14:23 +00:00
|
|
|
|
2012-06-22 11:40:55 +01:00
|
|
|
|
2012-03-30 10:43:55 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-14 13:31:24 +01:00
|
|
|
|
2012-03-30 10:43:55 -05:00
|
|
|
|
|
|
|
|
|
2025-03-03 17:14:23 +00:00
|
|
|
|
2014-01-16 16:02:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-05 14:54:15 +01:00
|
|
|
|
|
|
|
|
|
2016-05-27 14:45:45 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-16 18:21:29 +01:00
|
|
|
|
2016-05-27 14:45:45 +01:00
|
|
|
|
2008-07-29 11:42:26 +01:00
|
|
|
|
2008-05-28 17:58:05 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-10-25 20:25:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-02-18 08:11:42 +01:00
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
2014-02-18 08:11:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-01-05 09:54:57 +02:00
|
|
|
|
2014-02-18 08:11:42 +01:00
|
|
|
|
2015-05-01 12:37:23 +01:00
|
|
|
|
|
|
|
|
|
2015-05-01 12:37:26 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-02-28 08:31:05 +01:00
|
|
|
|
|
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-07-29 11:42:27 +01:00
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
|
|
|
|
|
2007-02-02 17:13:05 +01:00
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
2025-03-04 14:05:00 +00:00
|
|
|
|
2011-10-04 14:39:38 +03:00
|
|
|
|
2009-04-24 16:37:44 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-10-04 14:39:38 +03:00
|
|
|
|
2025-03-04 14:05:00 +00:00
|
|
|
|
2015-09-29 16:43:56 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-03 17:14:23 +00:00
|
|
|
|
2008-07-29 11:42:27 +01:00
|
|
|
|
2008-06-11 13:47:13 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-04 14:05:00 +00:00
|
|
|
|
2015-09-16 13:59:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-18 17:14:52 +00:00
|
|
|
|
2015-09-16 13:59:42 +01:00
|
|
|
|
2025-03-04 14:05:00 +00:00
|
|
|
|
2009-07-15 20:33:47 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-10-04 14:39:38 +03:00
|
|
|
|
2025-03-04 14:05:00 +00:00
|
|
|
|
2009-07-15 20:33:50 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-10-05 10:29:23 +03:00
|
|
|
|
2009-07-15 20:33:50 +09:00
|
|
|
|
2011-10-04 14:39:39 +03:00
|
|
|
|
2025-03-03 17:14:23 +00:00
|
|
|
|
2022-04-25 13:50:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-25 13:50:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-03-25 17:08:40 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
|
|
|
|
|
2013-08-10 21:33:10 +02:00
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
|
|
|
|
|
2014-07-07 13:16:54 +01:00
|
|
|
|
|
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
2025-11-20 13:44:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-10-10 18:31:26 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-20 14:08:43 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-11-20 13:44:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-15 17:30:01 +02:00
|
|
|
|
2012-02-17 16:20:33 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-23 21:22:29 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-05-02 10:58:11 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-15 21:34:48 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-08-18 14:53:03 +05:30
|
|
|
|
2014-07-15 21:34:48 +05:30
|
|
|
|
|
|
|
|
|
2012-04-20 11:32:13 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-04-20 11:32:44 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-21 22:04:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-02-18 09:08:51 +01:00
|
|
|
|
2010-01-21 22:04:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-02-18 09:08:51 +01:00
|
|
|
|
2010-01-21 22:04:03 +01:00
|
|
|
|
2014-02-18 09:08:51 +01:00
|
|
|
|
2010-01-21 22:04:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-01 12:37:26 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-02-28 08:31:05 +01:00
|
|
|
|
|
|
|
|
|
2010-01-21 22:04:03 +01:00
|
|
|
|
2009-01-07 17:31:10 +00:00
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
2008-07-07 16:07:17 +01:00
|
|
|
|
2010-03-17 20:15:21 +00:00
|
|
|
|
2010-02-22 15:58:04 +09:00
|
|
|
|
2013-03-11 18:27:21 -07:00
|
|
|
|
|
|
|
|
|
2009-01-07 17:31:10 +00:00
|
|
|
|
|
|
|
|
|
2024-04-22 18:15:13 +03:00
|
|
|
|
2010-11-05 15:53:46 +02:00
|
|
|
|
ASoC: dpcm: Add Dynamic PCM core operations.
The Dynamic PCM core allows digital audio data to be dynamically
routed between different ALSA PCMs and DAI links on SoC CPUs with
on chip DSP devices. e.g. audio data could be played on pcm:0,0 and
routed to any (or all) SoC DAI links.
Dynamic PCM introduces the concept of Front End (FE) PCMs and Back
End (BE) PCMs. The FE PCMs are normal ALSA PCM devices except that
they can dynamically route digital audio data to any supported BE
PCM. A BE PCM has no ALSA device, but represents a DAI link and it's
substream and audio HW parameters.
e.g. pcm:0,0 routing digital data to 2 external codecs.
FE pcm:0,0 ----> BE (McBSP.0) ----> CODEC 0
+--> BE (McPDM.0) ----> CODEC 1
e.g. pcm:0,0 and pcm:0,1 routing digital data to 1 external codec.
FE pcm:0,0 ---
+--> BE (McBSP.0) ----> CODEC
FE pcm:0,1 ---
The digital audio routing is controlled by the usual ALSA method
of mixer kcontrols. Dynamic PCM uses a DAPM graph to work out the
routing based upon the mixer settings and configures the BE PCMs
based on routing and the FE HW params.
DPCM is designed so that most ASoC component drivers will need no
modification at all. It's intended that existing CODEC, DAI and
platform drivers can be used in DPCM based audio devices without
any changes. However, there will be some cases where minor changes
are required (e.g. for very tightly coupled HW) and there are
helpers to support this too.
Somethimes the HW params of a FE and BE do not match or are
incompatible, so in these cases the machine driver can reconfigure
any hw_params and make any DSP perform sample rate / format conversion.
This patch adds the core DPCM code and contains :-
o The FE and BE PCM operations.
o FE and BE DAI link support.
o FE and BE PCM creation.
o BE support API.
o BE and FE link management.
Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-25 12:12:49 +01:00
|
|
|
|
2016-01-15 16:13:28 +08:00
|
|
|
|
2010-03-17 20:15:21 +00:00
|
|
|
|
2011-01-14 19:22:48 +05:30
|
|
|
|
2022-06-21 16:58:34 +02:00
|
|
|
|
2013-09-16 18:02:05 +01:00
|
|
|
|
2026-04-30 16:07:52 +02:00
|
|
|
|
2015-04-19 09:45:48 +08:00
|
|
|
|
2011-01-26 14:59:27 +00:00
|
|
|
|
|
|
|
|
|
2015-04-19 09:45:48 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-26 14:59:27 +00:00
|
|
|
|
2026-07-23 06:34:27 +00:00
|
|
|
|
2017-08-07 02:06:23 +00:00
|
|
|
|
2013-03-11 18:27:21 -07:00
|
|
|
|
2026-07-23 06:34:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-04 20:37:34 +01:00
|
|
|
|
2017-08-07 02:06:23 +00:00
|
|
|
|
2013-09-04 20:37:34 +01:00
|
|
|
|
2025-05-12 02:33:16 +00:00
|
|
|
|
2020-07-07 09:42:37 +02:00
|
|
|
|
|
|
|
|
|
2020-06-12 15:37:48 +08:00
|
|
|
|
|
|
|
|
|
2017-10-02 05:09:52 +00:00
|
|
|
|
|
|
|
|
|
2026-02-25 21:50:02 +08:00
|
|
|
|
2014-11-08 16:38:07 +01:00
|
|
|
|
2024-10-24 01:29:58 +00:00
|
|
|
|
2015-10-13 23:41:00 +08:00
|
|
|
|
2024-10-24 01:29:58 +00:00
|
|
|
|
2018-05-29 18:30:02 -05:00
|
|
|
|
2024-10-24 01:29:58 +00:00
|
|
|
|
2018-05-29 18:30:02 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-13 23:41:00 +08:00
|
|
|
|
2008-12-03 19:40:30 +00:00
|
|
|
|
2012-04-25 12:12:53 +01:00
|
|
|
|
2019-12-10 09:34:08 +09:00
|
|
|
|
2012-04-25 12:12:53 +01:00
|
|
|
|
2014-03-05 13:17:42 +01:00
|
|
|
|
2020-05-15 09:46:21 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-03-05 13:17:42 +01:00
|
|
|
|
2020-03-04 23:11:42 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-06 15:17:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-11-10 16:08:04 +00:00
|
|
|
|
|
|
|
|
|
2024-06-17 15:03:21 +02:00
|
|
|
|
2009-11-19 11:36:10 +00:00
|
|
|
|
2024-06-17 15:03:21 +02:00
|
|
|
|
|
|
|
|
|
2022-04-05 14:54:16 +01:00
|
|
|
|
2025-02-05 00:16:10 +00:00
|
|
|
|
2009-11-10 16:08:04 +00:00
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
2024-10-16 01:35:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
2018-01-29 02:58:25 +00:00
|
|
|
|
|
|
|
|
|
2015-07-21 21:53:01 +02:00
|
|
|
|
2018-01-29 02:58:25 +00:00
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
2018-11-02 16:18:21 +01:00
|
|
|
|
2013-06-26 12:45:59 +01:00
|
|
|
|
2013-08-19 17:05:55 +02:00
|
|
|
|
|
|
|
|
|
2013-06-26 12:45:59 +01:00
|
|
|
|
2014-11-10 22:41:46 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-16 17:07:42 -08:00
|
|
|
|
2011-03-08 17:23:24 +00:00
|
|
|
|
2014-07-17 22:01:08 +02:00
|
|
|
|
|
|
|
|
|
2012-02-03 17:43:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-14 13:31:24 +01:00
|
|
|
|
|
|
|
|
|
2008-05-13 14:03:40 +02:00
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-10-06 07:43:21 +03:00
|
|
|
|
|
|
|
|
|
2012-03-30 10:43:55 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-18 17:04:33 +02:00
|
|
|
|
2010-05-07 14:05:49 +03:00
|
|
|
|
2011-10-10 18:31:26 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-05-02 10:58:11 +05:30
|
|
|
|
|
|
|
|
|
2014-07-15 21:34:48 +05:30
|
|
|
|
|
|
|
|
|
2012-04-20 11:32:13 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-04-20 11:32:44 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
2023-06-08 06:48:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
|
|
|
|
|
2010-03-17 20:15:21 +00:00
|
|
|
|
2007-02-02 17:13:05 +01:00
|
|
|
|
2023-11-17 13:05:57 +01:00
|
|
|
|
2007-02-02 17:13:05 +01:00
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-01-16 18:38:51 +00:00
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-16 17:10:40 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-08-08 06:17:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-08 23:19:34 +02:00
|
|
|
|
|
|
|
|
|
2014-11-25 12:14:48 +01:00
|
|
|
|
2014-07-08 23:19:34 +02:00
|
|
|
|
2024-06-17 15:03:20 +02:00
|
|
|
|
ASoC: soc-core: Enable to use extra format on each DAI
Current ASoC is using dai_link->dai_fmt to set DAI format for both
CPU/Codec. But because it is using same settings, and
SND_SOC_DAIFMT_CLOCK_PROVIDER is flipped for CPU, we can't set both
CPU/Codec as clock consumer, for example.
To solve this issue, this patch enable to use extra format for each
DAI which can keep compatibility with legacy system,
1. SND_SOC_DAIFMT_FORMAT_MASK
2. SND_SOC_DAIFMT_CLOCK
3. SND_SOC_DAIFMT_INV
4. SND_SOC_DAIFMT_CLOCK_PROVIDER
Legacy
dai_fmt includes 1, 2, 3, 4
New idea
dai_fmt includes 1, 2, 3
ext_fmt includes 4
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Stephen Gordon <gordoste@iinet.net.au>
Link: https://patch.msgid.link/87r05go5ja.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-01-06 05:49:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-08 23:19:34 +02:00
|
|
|
|
|
|
|
|
|
2023-11-13 01:28:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-09-10 12:44:56 +01:00
|
|
|
|
2026-09-10 12:44:57 +01:00
|
|
|
|
2023-06-07 11:12:41 +08:00
|
|
|
|
|
|
|
|
|
2010-03-17 20:15:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ASoC: soc.h: add explanation of legacy/modern style of dai_link
Current ALSA SoC is assuming 1 CPU 1 Platform (= DMA) style system.
Because of this background, it is directly using
xxx_name / xxx_of_node / xxx_dai_name on dai_link.
Let's call it as legacy style here.
More complex style system like multi CPU multi Platform (= DMA) will
coming. To supporting it, we can use snd_soc_dai_link_component on
dai_link. Let's call it as modern style here.
But current ALSA SoC can't support it so far. Thus, we need to have
multi CPU / multi Codec / multi Platform style in the future on ALSA SoC.
Currently we already have multi Codec support. Platform is starting to
use modern style on dai_link, but still style only. Multi Platform is
not yet implemented. And we still don't have multi CPU support on ALSA
SoC, and not have modern style either.
Currently, if driver is using legacy style Codec/Platform, it will be
converted to modern style on soc-core. This means, we are using glue code
for legacy vs modern style so far on ALSA SoC.
We can fully switch to modern style on all drivers if ALSA SoC supported
modern style for CPU, and then, legacy style code will be removed from
ALSA SoC.
Untile then, we need to keep both legacy/modern style and its glue code.
This patch adds such future plan and background on soc.h
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-18 11:20:41 +09:00
|
|
|
|
ASoC: make snd_soc_dai_link more symmetrical
Prior to this patch, the CPU side of a DAI link was specified using a
single name. Often, this was the result of calling dev_name() on the
device providing the DAI, but in the case of a CPU DAI driver that
provided multiple DAIs, it needed to mix together both the device name
and some device-relative name, in order to form a single globally unique
name.
However, the CODEC side of the DAI link was specified using separate
fields for device (name or OF node) and device-relative DAI name.
This patch allows the CPU side of a DAI link to be specified in the same
way as the CODEC side, separating concepts of device and device-relative
DAI name.
I believe this will be important in multi-codec and/or dynamic PCM
scenarios, where a single CPU driver provides multiple DAIs, while also
booting using device tree, with accompanying desire not to hard-code the
CPU side device's name into the original .cpu_dai_name field.
Ideally, both the CPU DAI and CODEC DAI loops in soc_bind_dai_link()
would now be identical. However, two things prevent that at present:
1) The need to save rtd->codec for the CODEC side, which means we have
to search for the CODEC explicitly, and not just the CODEC side DAI.
2) Since we know the CODEC side DAI is part of a codec, and not just
a standalone DAI, it's slightly more efficient to convert .codec_name/
.codec_of_node into a codec first, and then compare each DAI's .codec
field, since this avoids strcmp() on each DAI's CODEC's name within
the loop.
However, the two loops are essentially semantically equivalent.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-25 18:22:11 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-06-06 13:07:22 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ASoC: make snd_soc_dai_link more symmetrical
Prior to this patch, the CPU side of a DAI link was specified using a
single name. Often, this was the result of calling dev_name() on the
device providing the DAI, but in the case of a CPU DAI driver that
provided multiple DAIs, it needed to mix together both the device name
and some device-relative name, in order to form a single globally unique
name.
However, the CODEC side of the DAI link was specified using separate
fields for device (name or OF node) and device-relative DAI name.
This patch allows the CPU side of a DAI link to be specified in the same
way as the CODEC side, separating concepts of device and device-relative
DAI name.
I believe this will be important in multi-codec and/or dynamic PCM
scenarios, where a single CPU driver provides multiple DAIs, while also
booting using device tree, with accompanying desire not to hard-code the
CPU side device's name into the original .cpu_dai_name field.
Ideally, both the CPU DAI and CODEC DAI loops in soc_bind_dai_link()
would now be identical. However, two things prevent that at present:
1) The need to save rtd->codec for the CODEC side, which means we have
to search for the CODEC explicitly, and not just the CODEC side DAI.
2) Since we know the CODEC side DAI is part of a codec, and not just
a standalone DAI, it's slightly more efficient to convert .codec_name/
.codec_of_node into a codec first, and then compare each DAI's .codec
field, since this avoids strcmp() on each DAI's CODEC's name within
the loop.
However, the two loops are essentially semantically equivalent.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-25 18:22:11 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-08 23:19:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-11-13 01:28:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ASoC: make snd_soc_dai_link more symmetrical
Prior to this patch, the CPU side of a DAI link was specified using a
single name. Often, this was the result of calling dev_name() on the
device providing the DAI, but in the case of a CPU DAI driver that
provided multiple DAIs, it needed to mix together both the device name
and some device-relative name, in order to form a single globally unique
name.
However, the CODEC side of the DAI link was specified using separate
fields for device (name or OF node) and device-relative DAI name.
This patch allows the CPU side of a DAI link to be specified in the same
way as the CODEC side, separating concepts of device and device-relative
DAI name.
I believe this will be important in multi-codec and/or dynamic PCM
scenarios, where a single CPU driver provides multiple DAIs, while also
booting using device tree, with accompanying desire not to hard-code the
CPU side device's name into the original .cpu_dai_name field.
Ideally, both the CPU DAI and CODEC DAI loops in soc_bind_dai_link()
would now be identical. However, two things prevent that at present:
1) The need to save rtd->codec for the CODEC side, which means we have
to search for the CODEC explicitly, and not just the CODEC side DAI.
2) Since we know the CODEC side DAI is part of a codec, and not just
a standalone DAI, it's slightly more efficient to convert .codec_name/
.codec_of_node into a codec first, and then compare each DAI's .codec
field, since this avoids strcmp() on each DAI's CODEC's name within
the loop.
However, the two loops are essentially semantically equivalent.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-25 18:22:11 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ASoC: soc-core: allow no Platform on dai_link
dai_link is used to selecting Component (= CPU/Codec/Platform) and
DAI (= CPU/Codec). And selected CPU/Codec/Platform components are
*listed* on Card.
Many drivers don't need special Platform component, but was
mandatory at legacy style ALSA SoC.
Thus, there is this kind of settings on many drivers.
dai_link->platform_of_node = dai_link->cpu_of_node;
In this case, soc_bind_dai_link() will pick-up "CPU component" as
"Platform component", and try to add it to snd_soc_pcm_runtime.
But it will be ignored, because it is already added when CPU bindings.
Historically, this kind of "CPU component" is used/selected as
"Platform" on many ALSA SoC drivers.
OTOH, Dummy Platform will be selected automatically by ALSA SoC if
driver doesn't have Platform settings.
These indicates that there are 2 type of Platforms exist at current
ALSA SoC if driver doesn't need special Platform.
1) use Dummy Platform as Platform component
2) use CPU component as Platform component
ALSA SoC will call Dummy Platform callback function if it is using
Dummy Platform, but it is completely pointless. Because it is the
sound card which doesn't need special Platform.
Thus, the behavior we request to ALSA SoC is selecting 2) automatically
instead of 1) if sound card doesn't need special Platform.
And, 2) means "do nothing" as above explain.
These were needed at legacy style dai_link, but is no longer needed
at modern style dai_link anymore.
This patch allows "no Platform" settings on dai_link, and will do
nothing for it if there was no platform settings. This is same as 2).
By this patch, all drivers which is selecting "CPU component" as
"Platform" can remove such settings.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-06-19 10:14:07 +09:00
|
|
|
|
ASoC: make snd_soc_dai_link more symmetrical
Prior to this patch, the CPU side of a DAI link was specified using a
single name. Often, this was the result of calling dev_name() on the
device providing the DAI, but in the case of a CPU DAI driver that
provided multiple DAIs, it needed to mix together both the device name
and some device-relative name, in order to form a single globally unique
name.
However, the CODEC side of the DAI link was specified using separate
fields for device (name or OF node) and device-relative DAI name.
This patch allows the CPU side of a DAI link to be specified in the same
way as the CODEC side, separating concepts of device and device-relative
DAI name.
I believe this will be important in multi-codec and/or dynamic PCM
scenarios, where a single CPU driver provides multiple DAIs, while also
booting using device tree, with accompanying desire not to hard-code the
CPU side device's name into the original .cpu_dai_name field.
Ideally, both the CPU DAI and CODEC DAI loops in soc_bind_dai_link()
would now be identical. However, two things prevent that at present:
1) The need to save rtd->codec for the CODEC side, which means we have
to search for the CODEC explicitly, and not just the CODEC side DAI.
2) Since we know the CODEC side DAI is part of a codec, and not just
a standalone DAI, it's slightly more efficient to convert .codec_name/
.codec_of_node into a codec first, and then compare each DAI's .codec
field, since this avoids strcmp() on each DAI's CODEC's name within
the loop.
However, the two loops are essentially semantically equivalent.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-25 18:22:11 -06:00
|
|
|
|
2019-01-21 09:32:32 +09:00
|
|
|
|
|
|
|
|
|
2018-08-31 03:10:08 +00:00
|
|
|
|
2016-04-19 13:12:35 +08:00
|
|
|
|
2008-01-10 14:39:01 +01:00
|
|
|
|
2023-04-02 22:59:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-09-27 16:41:01 +01:00
|
|
|
|
|
|
|
|
|
ASoC: dpcm: Add Dynamic PCM core operations.
The Dynamic PCM core allows digital audio data to be dynamically
routed between different ALSA PCMs and DAI links on SoC CPUs with
on chip DSP devices. e.g. audio data could be played on pcm:0,0 and
routed to any (or all) SoC DAI links.
Dynamic PCM introduces the concept of Front End (FE) PCMs and Back
End (BE) PCMs. The FE PCMs are normal ALSA PCM devices except that
they can dynamically route digital audio data to any supported BE
PCM. A BE PCM has no ALSA device, but represents a DAI link and it's
substream and audio HW parameters.
e.g. pcm:0,0 routing digital data to 2 external codecs.
FE pcm:0,0 ----> BE (McBSP.0) ----> CODEC 0
+--> BE (McPDM.0) ----> CODEC 1
e.g. pcm:0,0 and pcm:0,1 routing digital data to 1 external codec.
FE pcm:0,0 ---
+--> BE (McBSP.0) ----> CODEC
FE pcm:0,1 ---
The digital audio routing is controlled by the usual ALSA method
of mixer kcontrols. Dynamic PCM uses a DAPM graph to work out the
routing based upon the mixer settings and configures the BE PCMs
based on routing and the FE HW params.
DPCM is designed so that most ASoC component drivers will need no
modification at all. It's intended that existing CODEC, DAI and
platform drivers can be used in DPCM based audio devices without
any changes. However, there will be some cases where minor changes
are required (e.g. for very tightly coupled HW) and there are
helpers to support this too.
Somethimes the HW params of a FE and BE do not match or are
incompatible, so in these cases the machine driver can reconfigure
any hw_params and make any DSP perform sample rate / format conversion.
This patch adds the core DPCM code and contains :-
o The FE and BE PCM operations.
o FE and BE DAI link support.
o FE and BE PCM creation.
o BE support API.
o BE and FE link management.
Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-25 12:12:49 +01:00
|
|
|
|
|
|
|
|
|
2010-03-17 20:15:21 +00:00
|
|
|
|
|
|
|
|
|
2009-04-07 18:10:13 +01:00
|
|
|
|
2020-06-22 10:42:37 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ASoC: dpcm: Add Dynamic PCM core operations.
The Dynamic PCM core allows digital audio data to be dynamically
routed between different ALSA PCMs and DAI links on SoC CPUs with
on chip DSP devices. e.g. audio data could be played on pcm:0,0 and
routed to any (or all) SoC DAI links.
Dynamic PCM introduces the concept of Front End (FE) PCMs and Back
End (BE) PCMs. The FE PCMs are normal ALSA PCM devices except that
they can dynamically route digital audio data to any supported BE
PCM. A BE PCM has no ALSA device, but represents a DAI link and it's
substream and audio HW parameters.
e.g. pcm:0,0 routing digital data to 2 external codecs.
FE pcm:0,0 ----> BE (McBSP.0) ----> CODEC 0
+--> BE (McPDM.0) ----> CODEC 1
e.g. pcm:0,0 and pcm:0,1 routing digital data to 1 external codec.
FE pcm:0,0 ---
+--> BE (McBSP.0) ----> CODEC
FE pcm:0,1 ---
The digital audio routing is controlled by the usual ALSA method
of mixer kcontrols. Dynamic PCM uses a DAPM graph to work out the
routing based upon the mixer settings and configures the BE PCMs
based on routing and the FE HW params.
DPCM is designed so that most ASoC component drivers will need no
modification at all. It's intended that existing CODEC, DAI and
platform drivers can be used in DPCM based audio devices without
any changes. However, there will be some cases where minor changes
are required (e.g. for very tightly coupled HW) and there are
helpers to support this too.
Somethimes the HW params of a FE and BE do not match or are
incompatible, so in these cases the machine driver can reconfigure
any hw_params and make any DSP perform sample rate / format conversion.
This patch adds the core DPCM code and contains :-
o The FE and BE PCM operations.
o FE and BE DAI link support.
o FE and BE PCM creation.
o BE support API.
o BE and FE link management.
Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-25 12:12:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-03-17 20:15:21 +00:00
|
|
|
|
2013-01-10 17:06:15 +01:00
|
|
|
|
|
|
|
|
|
2013-08-29 10:32:13 -03:00
|
|
|
|
2023-06-08 06:48:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-21 07:02:34 +00:00
|
|
|
|
2020-05-28 10:47:37 +09:00
|
|
|
|
2015-04-21 07:02:34 +00:00
|
|
|
|
2016-10-24 00:44:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-21 07:02:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-15 13:52:54 +09:00
|
|
|
|
2015-04-21 07:02:34 +00:00
|
|
|
|
2021-01-15 13:52:54 +09:00
|
|
|
|
2015-04-21 07:02:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-12 02:03:33 +00:00
|
|
|
|
|
|
|
|
|
2018-06-20 18:25:20 +09:00
|
|
|
|
|
|
|
|
|
2018-07-05 12:13:49 +02:00
|
|
|
|
|
|
|
|
|
2015-05-12 02:03:33 +00:00
|
|
|
|
2015-04-21 07:02:34 +00:00
|
|
|
|
|
|
|
|
|
2015-12-02 14:11:22 +08:00
|
|
|
|
2018-07-02 16:59:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-05 15:47:26 +09:00
|
|
|
|
2015-12-02 14:11:22 +08:00
|
|
|
|
2019-11-05 15:47:26 +09:00
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
2021-03-22 11:48:15 +09:00
|
|
|
|
2024-06-17 15:03:21 +02:00
|
|
|
|
|
|
|
|
|
2023-11-13 01:28:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-22 11:48:15 +09:00
|
|
|
|
2023-09-11 23:47:02 +00:00
|
|
|
|
2021-03-22 11:48:15 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-09-11 23:47:02 +00:00
|
|
|
|
2021-03-22 11:48:15 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-09-11 23:47:02 +00:00
|
|
|
|
2021-03-22 11:48:15 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-09-03 02:12:40 +00:00
|
|
|
|
|
|
|
|
|
2021-03-22 11:48:15 +09:00
|
|
|
|
2023-09-11 23:47:02 +00:00
|
|
|
|
2018-09-03 02:12:40 +00:00
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
2019-06-27 14:13:50 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-09-11 23:47:02 +00:00
|
|
|
|
2019-06-27 14:13:50 +02:00
|
|
|
|
|
|
|
|
|
2020-02-25 21:39:12 +08:00
|
|
|
|
|
|
|
|
|
2021-03-22 11:48:15 +09:00
|
|
|
|
2023-09-11 23:47:02 +00:00
|
|
|
|
2020-02-25 21:39:12 +08:00
|
|
|
|
|
|
|
|
|
2023-11-13 01:28:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-06-06 13:07:42 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-09-04 14:15:24 +03:00
|
|
|
|
2019-06-06 13:07:42 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-08 14:52:33 +09:00
|
|
|
|
2019-12-13 09:54:36 +09:00
|
|
|
|
ASoC: soc.h: don't create dummy Component via COMP_DUMMY()
Many ASoC drivers define CPU/Codec/Platform dai_link by below macro.
SND_SOC_DAILINK_DEFS(link,
(A) DAILINK_COMP_ARRAY(COMP_CPU("cpu_dai")),
(B) DAILINK_COMP_ARRAY(COMP_CODEC("codec", "dai1"),
(B) COMP_CODEC("codec", "dai2")),
(C) DAILINK_COMP_ARRAY(COMP_EMPTY()));
In this case, this macro will be converted to like below
[o] = static struct snd_soc_dai_link_component
(A) [o] link_cpus[] = {{ .dai_name = "cpu_dai" }};
(B) [o] link_codecs[] = {{ .dai_name = "dai1", .name = "codec" },
{ .dai_name = "dai2", .name = "codec" }}
(C) [o] link_platforms[] = {{ }};
CPU and Codec info will be filled by COMP_CPU() / COMP_CODEC (= A,B),
and Platform will have empty data by COMP_EMPTY() (= C) in this case.
Platform empty info will be filled when driver probe()
(most of case, CPU info will be copied to use soc-generic-dmaengine-pcm).
For example in case of DPCM FE/BE, it will be like below.
Codec will be dummy Component / DAI in this case (X).
SND_SOC_DAILINK_DEFS(link,
DAILINK_COMP_ARRAY(COMP_CPU(...)),
(X) DAILINK_COMP_ARRAY(COMP_DUMMY()),
DAILINK_COMP_ARRAY(COMP_EMPTY()));
(X) part will converted like below
[o] link_codecs[] = {{ .name = "snd-soc-dummy",
.dai_name = "snd-soc-dummy-dai", }}
Even though we already have common asoc_dummy_dlc for dummy
Component / DAI, this macro will re-create new dummy dlc.
Some drivers defines many dai_link info via SND_SOC_DAILINK_DEFS(),
this means many dummy dlc also will be re-created. This is waste of
memory.
If we can use existing common asoc_dummy_dlc at (X),
we can avoid to re-creating dummy dlc, then, we can save the memory.
At that time, we want to keep existing code as much as possible, because
too many drivers are using this macro. But because of its original style,
using common asoc_dummy_dlc from it is very difficult or impossible.
So let's change the mind. The macro is used like below
SND_SOC_DAILINK_DEFS(link,
DAILINK_COMP_ARRAY(COMP_CPU(...)),
(x) DAILINK_COMP_ARRAY(COMP_DUMMY()),
DAILINK_COMP_ARRAY(COMP_EMPTY()));
static struct snd_soc_dai_link dai_links[] = {
{
.name = ...,
.stream_name = ...,
(y) SND_SOC_DAILINK_REG(link),
},
(y) part will be like below
static struct snd_soc_dai_link dai_links[] = {
{
.name = ...,
.stream_name = ...,
^ ...
| .codecs = link_codecs,
(y) .num_codecs = ARRAY_SIZE(link_codecs),
v ...
}
This patch try to use trick on COMP_DUMMY()
- #define COMP_DUMMY() { .name = "snd-soc-dummy", .dai_name = "snd-soc-dummy-dai", }
+ #define COMP_DUMMY()
By this tric, (x) part will be like below.
before
[o] link_codecs[] = {{ .name = "snd-soc-dummy", .dai_name = "snd-soc-dummy-dai", }}
after
[o] link_codecs[] = { };
This is same as below
[o] link_codecs[0];
This means it has pointer (link_codecs), but the array size is 0.
(y) part will be like below.
static struct snd_soc_dai_link dai_links[] = {
{
...
.codecs = link_codecs,
.num_codecs = 0,
...
},
This is very special settings that normal use usually not do,
but new macro do.
We can find this special settings on soc-core.c and fill it as
"dummy DAI" (= asoc_dummy_dlc). By this tric, we can avoid to re-create
dummy dlc and save the memory.
This patch add tric at COMP_DUMMY() and add snd_soc_fill_dummy_dai()
to fill dummy DAI.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://msgid.link/r/871qbi93qu.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-12-19 05:10:33 +00:00
|
|
|
|
2019-06-06 13:07:42 +09:00
|
|
|
|
|
|
|
|
|
2023-09-11 23:47:02 +00:00
|
|
|
|
2025-04-16 06:27:10 +00:00
|
|
|
|
2019-06-06 13:07:42 +09:00
|
|
|
|
2010-12-02 14:53:03 +00:00
|
|
|
|
2014-04-28 16:07:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-12-13 09:54:36 +09:00
|
|
|
|
|
|
|
|
|
2010-12-02 14:53:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ASoC: Add optional name_prefix for codec kcontrol, widget and route names
There is a need to prefix codec kcontrol, widget and internal route names in
an ASoC machine that has multiple codecs with conflicting names. The name
collision would occur when codec drivers try to registering kcontrols with
the same name or when building audio paths.
This patch introduces optional prefix_map into struct snd_soc_card. With it
machine drivers can specify a unique name prefix to each codec that have
conflicting names with anothers. Prefix to codec is matched with codec
name.
Following example illustrates a machine that has two same codec instances.
Name collision from kcontrol registration is avoided by specifying a name
prefix "foo" for the second codec. As the codec widget names are prefixed
then second audio map for that codec shows a prefixed widget name.
static const struct snd_soc_dapm_route map0[] = {
{"Spk", NULL, "MONO"},
};
static const struct snd_soc_dapm_route map1[] = {
{"Vibra", NULL, "foo MONO"},
};
static struct snd_soc_prefix_map codec_prefix[] = {
{
.dev_name = "codec.2",
.name_prefix = "foo",
},
};
static struct snd_soc_card card = {
...
.prefix_map = codec_prefix,
.num_prefixes = ARRAY_SIZE(codec_prefix),
};
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-13 20:40:44 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-11-25 17:47:38 +02:00
|
|
|
|
2014-04-28 16:07:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-08 14:52:33 +09:00
|
|
|
|
|
|
|
|
|
2010-11-25 17:47:38 +02:00
|
|
|
|
2014-08-19 15:51:23 +02:00
|
|
|
|
2010-11-25 17:47:38 +02:00
|
|
|
|
|
|
|
|
|
2008-11-18 20:50:34 +00:00
|
|
|
|
|
|
|
|
|
2010-03-17 20:15:21 +00:00
|
|
|
|
2011-05-12 16:14:04 +01:00
|
|
|
|
|
|
|
|
|
2019-11-19 18:49:32 +01:00
|
|
|
|
2023-09-12 17:32:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-05-28 00:48:01 +00:00
|
|
|
|
2017-01-14 16:13:02 +08:00
|
|
|
|
2008-11-28 13:29:45 +00:00
|
|
|
|
2010-03-17 20:15:21 +00:00
|
|
|
|
|
|
|
|
|
2008-11-28 13:29:45 +00:00
|
|
|
|
2010-03-17 20:15:21 +00:00
|
|
|
|
2012-03-07 10:38:26 +00:00
|
|
|
|
2008-11-28 13:29:45 +00:00
|
|
|
|
2019-08-13 13:45:32 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-26 14:17:20 +00:00
|
|
|
|
2011-03-02 18:36:34 +00:00
|
|
|
|
2022-06-06 21:19:09 +02:00
|
|
|
|
2011-01-26 14:17:20 +00:00
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-26 14:05:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
2008-01-10 14:36:20 +01:00
|
|
|
|
2008-11-18 20:50:34 +00:00
|
|
|
|
2011-06-06 19:13:23 +01:00
|
|
|
|
2008-05-19 12:31:28 +02:00
|
|
|
|
2010-12-04 12:41:04 +00:00
|
|
|
|
2011-06-06 19:13:23 +01:00
|
|
|
|
2010-12-04 12:41:04 +00:00
|
|
|
|
2008-01-10 14:36:20 +01:00
|
|
|
|
2015-12-02 14:11:32 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
2015-12-02 14:11:22 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-18 02:34:11 -05:00
|
|
|
|
2010-03-17 20:15:21 +00:00
|
|
|
|
2008-12-02 15:08:03 +00:00
|
|
|
|
2010-12-02 14:53:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ASoC: Add optional name_prefix for codec kcontrol, widget and route names
There is a need to prefix codec kcontrol, widget and internal route names in
an ASoC machine that has multiple codecs with conflicting names. The name
collision would occur when codec drivers try to registering kcontrols with
the same name or when building audio paths.
This patch introduces optional prefix_map into struct snd_soc_card. With it
machine drivers can specify a unique name prefix to each codec that have
conflicting names with anothers. Prefix to codec is matched with codec
name.
Following example illustrates a machine that has two same codec instances.
Name collision from kcontrol registration is avoided by specifying a name
prefix "foo" for the second codec. As the codec widget names are prefixed
then second audio map for that codec shows a prefixed widget name.
static const struct snd_soc_dapm_route map0[] = {
{"Spk", NULL, "MONO"},
};
static const struct snd_soc_dapm_route map1[] = {
{"Vibra", NULL, "foo MONO"},
};
static struct snd_soc_prefix_map codec_prefix[] = {
{
.dev_name = "codec.2",
.name_prefix = "foo",
},
};
static struct snd_soc_card card = {
...
.prefix_map = codec_prefix,
.num_prefixes = ARRAY_SIZE(codec_prefix),
};
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-13 20:40:44 +02:00
|
|
|
|
2010-11-25 17:47:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-12-29 14:11:21 +01:00
|
|
|
|
2010-11-25 17:47:38 +02:00
|
|
|
|
2011-04-07 19:18:44 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-02 18:35:51 +00:00
|
|
|
|
|
|
|
|
|
2015-02-14 17:22:49 -08:00
|
|
|
|
2011-03-02 18:35:51 +00:00
|
|
|
|
2011-04-12 19:31:01 +02:00
|
|
|
|
2011-03-02 18:35:51 +00:00
|
|
|
|
2011-04-12 19:31:01 +02:00
|
|
|
|
2011-03-02 18:35:51 +00:00
|
|
|
|
2026-05-07 10:36:53 +09:00
|
|
|
|
|
|
|
|
|
2015-02-14 17:22:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-05-07 10:36:53 +09:00
|
|
|
|
|
|
|
|
|
2011-03-02 18:35:51 +00:00
|
|
|
|
2010-03-17 20:15:21 +00:00
|
|
|
|
2016-11-30 06:22:36 +00:00
|
|
|
|
2018-09-12 10:15:00 +01:00
|
|
|
|
2010-11-05 20:35:19 +02:00
|
|
|
|
2010-12-14 12:18:31 +02:00
|
|
|
|
2010-12-14 12:18:30 +02:00
|
|
|
|
2010-12-14 12:18:32 +02:00
|
|
|
|
2011-10-03 21:06:40 +01:00
|
|
|
|
2010-12-14 12:18:30 +02:00
|
|
|
|
2011-03-02 18:21:57 +00:00
|
|
|
|
2026-01-20 00:14:54 +00:00
|
|
|
|
2011-09-20 21:43:24 +01:00
|
|
|
|
2011-03-02 18:21:57 +00:00
|
|
|
|
2010-11-05 20:35:19 +02:00
|
|
|
|
|
|
|
|
|
2019-08-07 10:31:24 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-11-05 20:35:19 +02:00
|
|
|
|
2020-05-28 10:47:37 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-28 10:50:21 +09:00
|
|
|
|
2020-11-02 20:40:09 +05:30
|
|
|
|
2025-04-04 12:16:21 +02:00
|
|
|
|
2020-05-28 10:47:37 +09:00
|
|
|
|
2011-01-28 13:11:47 +00:00
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
2018-09-18 01:28:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-08 14:54:44 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
2018-09-18 01:29:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-09-18 01:29:16 +00:00
|
|
|
|
2019-08-08 14:54:44 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-09-18 01:29:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-09 13:08:16 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-09 13:08:21 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 01:59:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-09-04 05:21:25 +00:00
|
|
|
|
|
|
|
|
|
2026-01-20 00:14:54 +00:00
|
|
|
|
2025-09-04 05:21:25 +00:00
|
|
|
|
|
|
|
|
|
2010-03-17 20:15:21 +00:00
|
|
|
|
2011-11-10 11:46:13 +00:00
|
|
|
|
2012-01-06 17:12:45 -08:00
|
|
|
|
2008-11-18 20:50:34 +00:00
|
|
|
|
2010-03-17 20:15:21 +00:00
|
|
|
|
2011-06-09 17:04:39 +01:00
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
2023-04-02 22:59:35 +00:00
|
|
|
|
2018-09-05 15:21:02 +01:00
|
|
|
|
ASoC: dpcm: Add Dynamic PCM core operations.
The Dynamic PCM core allows digital audio data to be dynamically
routed between different ALSA PCMs and DAI links on SoC CPUs with
on chip DSP devices. e.g. audio data could be played on pcm:0,0 and
routed to any (or all) SoC DAI links.
Dynamic PCM introduces the concept of Front End (FE) PCMs and Back
End (BE) PCMs. The FE PCMs are normal ALSA PCM devices except that
they can dynamically route digital audio data to any supported BE
PCM. A BE PCM has no ALSA device, but represents a DAI link and it's
substream and audio HW parameters.
e.g. pcm:0,0 routing digital data to 2 external codecs.
FE pcm:0,0 ----> BE (McBSP.0) ----> CODEC 0
+--> BE (McPDM.0) ----> CODEC 1
e.g. pcm:0,0 and pcm:0,1 routing digital data to 1 external codec.
FE pcm:0,0 ---
+--> BE (McBSP.0) ----> CODEC
FE pcm:0,1 ---
The digital audio routing is controlled by the usual ALSA method
of mixer kcontrols. Dynamic PCM uses a DAPM graph to work out the
routing based upon the mixer settings and configures the BE PCMs
based on routing and the FE HW params.
DPCM is designed so that most ASoC component drivers will need no
modification at all. It's intended that existing CODEC, DAI and
platform drivers can be used in DPCM based audio devices without
any changes. However, there will be some cases where minor changes
are required (e.g. for very tightly coupled HW) and there are
helpers to support this too.
Somethimes the HW params of a FE and BE do not match or are
incompatible, so in these cases the machine driver can reconfigure
any hw_params and make any DSP perform sample rate / format conversion.
This patch adds the core DPCM code and contains :-
o The FE and BE PCM operations.
o FE and BE DAI link support.
o FE and BE PCM creation.
o BE support API.
o BE and FE link management.
Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-25 12:12:49 +01:00
|
|
|
|
2022-09-20 06:32:25 +00:00
|
|
|
|
2022-09-20 06:32:36 +00:00
|
|
|
|
ASoC: dpcm: Add Dynamic PCM core operations.
The Dynamic PCM core allows digital audio data to be dynamically
routed between different ALSA PCMs and DAI links on SoC CPUs with
on chip DSP devices. e.g. audio data could be played on pcm:0,0 and
routed to any (or all) SoC DAI links.
Dynamic PCM introduces the concept of Front End (FE) PCMs and Back
End (BE) PCMs. The FE PCMs are normal ALSA PCM devices except that
they can dynamically route digital audio data to any supported BE
PCM. A BE PCM has no ALSA device, but represents a DAI link and it's
substream and audio HW parameters.
e.g. pcm:0,0 routing digital data to 2 external codecs.
FE pcm:0,0 ----> BE (McBSP.0) ----> CODEC 0
+--> BE (McPDM.0) ----> CODEC 1
e.g. pcm:0,0 and pcm:0,1 routing digital data to 1 external codec.
FE pcm:0,0 ---
+--> BE (McBSP.0) ----> CODEC
FE pcm:0,1 ---
The digital audio routing is controlled by the usual ALSA method
of mixer kcontrols. Dynamic PCM uses a DAPM graph to work out the
routing based upon the mixer settings and configures the BE PCMs
based on routing and the FE HW params.
DPCM is designed so that most ASoC component drivers will need no
modification at all. It's intended that existing CODEC, DAI and
platform drivers can be used in DPCM based audio devices without
any changes. However, there will be some cases where minor changes
are required (e.g. for very tightly coupled HW) and there are
helpers to support this too.
Somethimes the HW params of a FE and BE do not match or are
incompatible, so in these cases the machine driver can reconfigure
any hw_params and make any DSP perform sample rate / format conversion.
This patch adds the core DPCM code and contains :-
o The FE and BE PCM operations.
o FE and BE DAI link support.
o FE and BE PCM creation.
o BE support API.
o BE and FE link management.
Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-25 12:12:49 +01:00
|
|
|
|
2010-03-17 20:15:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-16 17:10:40 +05:30
|
|
|
|
2020-03-30 10:48:27 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-09-11 23:47:02 +00:00
|
|
|
|
|
|
|
|
|
2020-03-30 10:48:27 +09:00
|
|
|
|
2020-03-16 15:36:58 +09:00
|
|
|
|
2020-02-25 21:39:12 +08:00
|
|
|
|
2010-03-17 20:15:21 +00:00
|
|
|
|
2019-12-03 09:30:07 -08:00
|
|
|
|
2012-04-25 12:12:50 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-18 02:34:11 -05:00
|
|
|
|
2024-10-24 01:29:13 +00:00
|
|
|
|
2015-11-18 02:34:11 -05:00
|
|
|
|
2016-10-24 05:24:36 +00:00
|
|
|
|
ASoC: soc-link: add mark for snd_soc_link_startup/shutdown()
soc_pcm_open() does rollback when failed (A),
but, it is almost same as soc_pcm_close().
static int soc_pcm_open(xxx)
{
...
if (ret < 0)
goto xxx_err;
...
return 0;
^ config_err:
| ...
| rtd_startup_err:
(A) ...
| component_err:
| ...
v return ret;
}
The difference is
soc_pcm_close() is for all dai/component/substream,
rollback is for succeeded part only.
This kind of duplicated code can be a hotbed of bugs,
thus, we want to share soc_pcm_close() and rollback.
Now, soc_pcm_open/close() are handling
1) snd_soc_dai_startup/shutdown()
=> 2) snd_soc_link_startup/shutdown()
3) snd_soc_component_module_get/put()
4) snd_soc_component_open/close()
5) pm_runtime_put/get()
This patch is for 2) snd_soc_link_startup/shutdown().
The idea of having bit-flag or counter is not enough for this purpose.
For example if one DAI is used for 2xPlaybacks for some reasons,
and if 1st Playback was succeeded but 2nd Playback was failed,
2nd Playback rollback doesn't need to call shutdown.
But it has succeeded bit-flag or counter via 1st Playback,
thus, 2nd Playback rollback will call unneeded shutdown.
And 1st Playback's necessary shutdown will not be called,
because bit-flag or counter was cleared by wrong 2nd Playback rollback.
To avoid such case, this patch marks substream pointer when startup() was
succeeded. If rollback needed, it will check rollback flag and marked
substream pointer.
One note here is that it cares *current* startup() only now.
but we might want to check *whole* marked substream in the future.
This patch is using macro named "push/pop", so that it can be easily
update.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87k0webwnv.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-28 09:00:57 +09:00
|
|
|
|
|
|
|
|
|
ASoC: soc-link: add mark for snd_soc_link_hw_params/free()
soc_pcm_hw_params() does rollback when failed (A),
but, it is almost same as soc_pcm_hw_free().
static int soc_pcm_hw_params(xxx)
{
...
if (ret < 0)
goto xxx_err;
...
return ret;
^ component_err:
| ...
| interface_err:
(A) ...
| codec_err:
| ...
v return ret;
}
The difference is
soc_pcm_hw_free() is for all dai/component/substream,
rollback is for succeeded part only.
This kind of duplicated code can be a hotbed of bugs,
thus, we want to share soc_pcm_hw_free() and rollback.
Now, soc_pcm_hw_params/free() are handling
=> 1) snd_soc_link_hw_params/free()
2) snd_soc_pcm_component_hw_params/free()
3) snd_soc_dai_hw_params/free()
This patch is for 1) snd_soc_link_hw_params/free().
The idea of having bit-flag or counter is not enough for this purpose.
For example if one DAI is used for 2xPlaybacks for some reasons,
and if 1st Playback was succeeded but 2nd Playback was failed,
2nd Playback rollback doesn't need to call shutdown.
But it has succeeded bit-flag or counter via 1st Playback,
thus, 2nd Playback rollback will call unneeded shutdown.
And 1st Playback's necessary shutdown will not be called,
because bit-flag or counter was cleared by wrong 2nd Playback rollback.
To avoid such case, this patch marks substream pointer when hw_params() was
succeeded. If rollback needed, it will check rollback flag and marked
substream pointer.
One note here ist that it cares *previous* hw_params() only now,
but we might want to check *whole* marked substream in the future.
This patch is using macro named "push/pop", so that it can be easily
update.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87lfgtgqba.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-29 13:31:25 +09:00
|
|
|
|
ASoC: soc-pcm: care trigger rollback
soc_pcm_trigger() calls DAI/Component/Link trigger,
but some of them might be failed.
static int soc_pcm_trigger(...)
{
...
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
ret = snd_soc_link_trigger(substream, cmd);
if (ret < 0)
break;
(*) ret = snd_soc_pcm_component_trigger(substream, cmd);
if (ret < 0)
break;
ret = snd_soc_pcm_dai_trigger(substream, cmd);
break;
case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_SUSPEND:
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
ret = snd_soc_pcm_dai_trigger(substream, cmd);
if (ret < 0)
break;
ret = snd_soc_pcm_component_trigger(substream, cmd);
if (ret < 0)
break;
ret = snd_soc_link_trigger(substream, cmd);
break;
}
...
}
For example, if soc_pcm_trigger() failed at (*) point,
we need to rollback previous succeeded trigger.
This patch adds trigger mark for DAI/Component/Link,
and do STOP if START/RESUME/PAUSE_RELEASE were failed.
Because it need to use new rollback parameter,
we need to modify DAI/Component/Link trigger functions in the same time.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87a6uycssd.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-01 08:51:33 +09:00
|
|
|
|
2020-11-19 08:50:14 +09:00
|
|
|
|
ASoC: soc-link: add mark for snd_soc_link_startup/shutdown()
soc_pcm_open() does rollback when failed (A),
but, it is almost same as soc_pcm_close().
static int soc_pcm_open(xxx)
{
...
if (ret < 0)
goto xxx_err;
...
return 0;
^ config_err:
| ...
| rtd_startup_err:
(A) ...
| component_err:
| ...
v return ret;
}
The difference is
soc_pcm_close() is for all dai/component/substream,
rollback is for succeeded part only.
This kind of duplicated code can be a hotbed of bugs,
thus, we want to share soc_pcm_close() and rollback.
Now, soc_pcm_open/close() are handling
1) snd_soc_dai_startup/shutdown()
=> 2) snd_soc_link_startup/shutdown()
3) snd_soc_component_module_get/put()
4) snd_soc_component_open/close()
5) pm_runtime_put/get()
This patch is for 2) snd_soc_link_startup/shutdown().
The idea of having bit-flag or counter is not enough for this purpose.
For example if one DAI is used for 2xPlaybacks for some reasons,
and if 1st Playback was succeeded but 2nd Playback was failed,
2nd Playback rollback doesn't need to call shutdown.
But it has succeeded bit-flag or counter via 1st Playback,
thus, 2nd Playback rollback will call unneeded shutdown.
And 1st Playback's necessary shutdown will not be called,
because bit-flag or counter was cleared by wrong 2nd Playback rollback.
To avoid such case, this patch marks substream pointer when startup() was
succeeded. If rollback needed, it will check rollback flag and marked
substream pointer.
One note here is that it cares *current* startup() only now.
but we might want to check *whole* marked substream in the future.
This patch is using macro named "push/pop", so that it can be easily
update.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87k0webwnv.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-28 09:00:57 +09:00
|
|
|
|
2016-10-24 05:24:36 +00:00
|
|
|
|
|
|
|
|
|
2019-05-13 16:07:27 +09:00
|
|
|
|
2024-09-05 05:14:29 +00:00
|
|
|
|
2023-09-29 12:32:43 +02:00
|
|
|
|
2024-07-26 17:52:36 +02:00
|
|
|
|
ASoC: soc-core: remove snd_soc_rtdcom_list
Current ALSA SoC is using struct snd_soc_rtdcom_list to
connecting component to rtd by using list_head.
struct snd_soc_rtdcom_list {
struct snd_soc_component *component;
struct list_head list; /* rtd::component_list */
};
struct snd_soc_pcm_runtime {
...
struct list_head component_list; /* list of connected components */
...
};
The CPU/Codec/Platform component which will be connected to rtd (a)
is indicated via dai_link at snd_soc_add_pcm_runtime()
int snd_soc_add_pcm_runtime(...)
{
...
/* Find CPU from registered CPUs */
rtd->cpu_dai = snd_soc_find_dai(dai_link->cpus);
...
(a) snd_soc_rtdcom_add(rtd, rtd->cpu_dai->component);
...
/* Find CODEC from registered CODECs */
(b) for_each_link_codecs(dai_link, i, codec) {
rtd->codec_dais[i] = snd_soc_find_dai(codec);
...
(a) snd_soc_rtdcom_add(rtd, rtd->codec_dais[i]->component);
}
...
/* Find PLATFORM from registered PLATFORMs */
(b) for_each_link_platforms(dai_link, i, platform) {
for_each_component(component) {
...
(a) snd_soc_rtdcom_add(rtd, component);
}
}
}
It shows, it is possible to know how many components will be
connected to rtd by using
dai_link->num_cpus
dai_link->num_codecs
dai_link->num_platforms
If so, we can use component pointer array instead of list_head,
in such case, code can be more simple.
This patch removes struct snd_soc_rtdcom_list that is only
of temporary value, and convert to pointer array.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87a76wt4wm.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-10 11:35:21 +09:00
|
|
|
|
2024-07-26 17:52:36 +02:00
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
2023-09-11 23:47:02 +00:00
|
|
|
|
2020-03-23 14:16:57 +09:00
|
|
|
|
2023-09-11 23:47:02 +00:00
|
|
|
|
|
|
|
|
|
2024-05-01 19:51:27 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-23 14:16:57 +09:00
|
|
|
|
ASoC: soc-core: remove snd_soc_rtdcom_list
Current ALSA SoC is using struct snd_soc_rtdcom_list to
connecting component to rtd by using list_head.
struct snd_soc_rtdcom_list {
struct snd_soc_component *component;
struct list_head list; /* rtd::component_list */
};
struct snd_soc_pcm_runtime {
...
struct list_head component_list; /* list of connected components */
...
};
The CPU/Codec/Platform component which will be connected to rtd (a)
is indicated via dai_link at snd_soc_add_pcm_runtime()
int snd_soc_add_pcm_runtime(...)
{
...
/* Find CPU from registered CPUs */
rtd->cpu_dai = snd_soc_find_dai(dai_link->cpus);
...
(a) snd_soc_rtdcom_add(rtd, rtd->cpu_dai->component);
...
/* Find CODEC from registered CODECs */
(b) for_each_link_codecs(dai_link, i, codec) {
rtd->codec_dais[i] = snd_soc_find_dai(codec);
...
(a) snd_soc_rtdcom_add(rtd, rtd->codec_dais[i]->component);
}
...
/* Find PLATFORM from registered PLATFORMs */
(b) for_each_link_platforms(dai_link, i, platform) {
for_each_component(component) {
...
(a) snd_soc_rtdcom_add(rtd, component);
}
}
}
It shows, it is possible to know how many components will be
connected to rtd by using
dai_link->num_cpus
dai_link->num_codecs
dai_link->num_platforms
If so, we can use component pointer array instead of list_head,
in such case, code can be more simple.
This patch removes struct snd_soc_rtdcom_list that is only
of temporary value, and convert to pointer array.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87a76wt4wm.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-10 11:35:21 +09:00
|
|
|
|
2020-04-28 23:47:31 +02:00
|
|
|
|
ASoC: soc-core: remove snd_soc_rtdcom_list
Current ALSA SoC is using struct snd_soc_rtdcom_list to
connecting component to rtd by using list_head.
struct snd_soc_rtdcom_list {
struct snd_soc_component *component;
struct list_head list; /* rtd::component_list */
};
struct snd_soc_pcm_runtime {
...
struct list_head component_list; /* list of connected components */
...
};
The CPU/Codec/Platform component which will be connected to rtd (a)
is indicated via dai_link at snd_soc_add_pcm_runtime()
int snd_soc_add_pcm_runtime(...)
{
...
/* Find CPU from registered CPUs */
rtd->cpu_dai = snd_soc_find_dai(dai_link->cpus);
...
(a) snd_soc_rtdcom_add(rtd, rtd->cpu_dai->component);
...
/* Find CODEC from registered CODECs */
(b) for_each_link_codecs(dai_link, i, codec) {
rtd->codec_dais[i] = snd_soc_find_dai(codec);
...
(a) snd_soc_rtdcom_add(rtd, rtd->codec_dais[i]->component);
}
...
/* Find PLATFORM from registered PLATFORMs */
(b) for_each_link_platforms(dai_link, i, platform) {
for_each_component(component) {
...
(a) snd_soc_rtdcom_add(rtd, component);
}
}
}
It shows, it is possible to know how many components will be
connected to rtd by using
dai_link->num_cpus
dai_link->num_codecs
dai_link->num_platforms
If so, we can use component pointer array instead of list_head,
in such case, code can be more simple.
This patch removes struct snd_soc_rtdcom_list that is only
of temporary value, and convert to pointer array.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87a76wt4wm.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-10 11:35:21 +09:00
|
|
|
|
|
|
|
|
|
2020-03-09 13:07:29 +09:00
|
|
|
|
|
|
|
|
|
2023-09-11 23:47:02 +00:00
|
|
|
|
2020-03-09 13:07:29 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-09-11 23:47:02 +00:00
|
|
|
|
2020-03-09 13:07:29 +09:00
|
|
|
|
2020-03-16 15:36:58 +09:00
|
|
|
|
|
|
|
|
|
2022-09-20 06:32:16 +00:00
|
|
|
|
2020-03-16 15:36:58 +09:00
|
|
|
|
|
|
|
|
|
2024-04-26 11:57:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-11-13 01:28:27 +00:00
|
|
|
|
2020-03-09 13:07:29 +09:00
|
|
|
|
2020-01-10 11:36:17 +09:00
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
2008-07-29 11:42:26 +01:00
|
|
|
|
|
|
|
|
|
2025-02-28 15:14:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-10-06 13:43:49 +02:00
|
|
|
|
|
|
|
|
|
2025-02-17 11:21:07 +01:00
|
|
|
|
2014-01-16 16:02:10 +01:00
|
|
|
|
2013-08-05 11:27:31 +02:00
|
|
|
|
|
|
|
|
|
2019-11-05 15:47:26 +09:00
|
|
|
|
2015-05-29 19:06:14 +01:00
|
|
|
|
2019-11-05 15:47:26 +09:00
|
|
|
|
2008-07-29 11:42:26 +01:00
|
|
|
|
|
|
|
|
|
2011-10-10 18:31:26 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-17 16:20:33 -08:00
|
|
|
|
2011-10-10 18:31:26 +01:00
|
|
|
|
|
|
|
|
|
2014-05-02 10:58:11 +05:30
|
|
|
|
|
|
|
|
|
2019-11-05 15:47:26 +09:00
|
|
|
|
2015-05-29 19:06:14 +01:00
|
|
|
|
2019-11-05 15:47:26 +09:00
|
|
|
|
2014-07-15 21:34:48 +05:30
|
|
|
|
2015-11-09 23:20:00 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-05-02 10:58:11 +05:30
|
|
|
|
|
|
|
|
|
2012-04-20 11:32:13 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|
|
|
|
|
|
2014-02-28 08:31:05 +01:00
|
|
|
|
2009-01-05 09:54:57 +02:00
|
|
|
|
|
|
|
|
|
2014-02-18 08:11:42 +01:00
|
|
|
|
2009-01-05 09:54:57 +02:00
|
|
|
|
2011-05-03 12:50:29 +02:00
|
|
|
|
2009-01-05 09:54:57 +02:00
|
|
|
|
2015-05-01 12:37:26 +01:00
|
|
|
|
2019-11-05 15:47:26 +09:00
|
|
|
|
2015-05-29 19:06:14 +01:00
|
|
|
|
2019-11-05 15:47:26 +09:00
|
|
|
|
2009-01-05 09:54:57 +02:00
|
|
|
|
|
|
|
|
|
2024-06-17 15:03:21 +02:00
|
|
|
|
2011-10-05 10:29:22 +03:00
|
|
|
|
|
|
|
|
|
2020-04-22 15:18:05 +08:00
|
|
|
|
2011-10-05 10:29:22 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-22 15:18:05 +08:00
|
|
|
|
2011-10-05 10:29:22 +03:00
|
|
|
|
|
|
|
|
|
2024-06-17 15:03:21 +02:00
|
|
|
|
2014-02-28 08:31:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-17 15:03:21 +02:00
|
|
|
|
2014-02-28 08:31:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-04-28 10:57:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-27 06:37:51 +00:00
|
|
|
|
|
|
|
|
|
2017-01-27 06:37:34 +00:00
|
|
|
|
|
|
|
|
|
2021-12-14 15:20:46 +01:00
|
|
|
|
2018-07-17 17:43:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-02-14 09:34:35 +08:00
|
|
|
|
2015-09-09 21:27:43 +03:00
|
|
|
|
|
|
|
|
|
2014-02-14 09:34:35 +08:00
|
|
|
|
|
|
|
|
|
2018-11-22 00:55:09 +00:00
|
|
|
|
2015-07-15 07:07:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-11-22 00:55:09 +00:00
|
|
|
|
2017-01-27 06:36:50 +00:00
|
|
|
|
|
|
|
|
|
2020-08-01 12:02:55 +02:00
|
|
|
|
2026-05-07 10:36:53 +09:00
|
|
|
|
2021-06-14 09:56:54 +09:00
|
|
|
|
2022-05-13 10:05:30 +01:00
|
|
|
|
2021-06-14 09:56:46 +09:00
|
|
|
|
2021-06-14 09:57:08 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-17 15:03:21 +02:00
|
|
|
|
2023-06-20 02:14:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-18 01:39:25 +00:00
|
|
|
|
2021-02-21 16:30:24 +01:00
|
|
|
|
2016-11-11 01:19:28 +00:00
|
|
|
|
2013-09-10 17:39:56 -07:00
|
|
|
|
2023-06-20 02:14:11 +00:00
|
|
|
|
2014-11-25 13:16:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-03-09 18:48:54 +01:00
|
|
|
|
2022-03-31 02:04:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-12 15:55:34 -07:00
|
|
|
|
2023-03-27 00:34:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-12-10 09:34:23 +09:00
|
|
|
|
|
|
|
|
|
2015-12-02 14:11:22 +08:00
|
|
|
|
2023-07-10 10:20:11 +09:00
|
|
|
|
|
|
|
|
|
2023-07-10 10:20:17 +09:00
|
|
|
|
2024-02-16 15:54:48 +01:00
|
|
|
|
|
|
|
|
|
2019-11-05 15:47:14 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-05 15:47:04 +09:00
|
|
|
|
2015-12-31 16:40:43 +08:00
|
|
|
|
2016-04-19 13:12:25 +08:00
|
|
|
|
|
|
|
|
|
2020-08-27 08:55:39 +09:00
|
|
|
|
|
|
|
|
|
2016-04-19 13:12:25 +08:00
|
|
|
|
2026-02-19 04:53:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-07-23 14:03:07 +01:00
|
|
|
|
|
|
|
|
|
2019-01-25 14:34:55 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-22 11:48:54 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-22 11:48:40 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-01-25 14:34:55 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-06-06 13:22:19 +09:00
|
|
|
|
|
|
|
|
|
2019-01-25 14:34:55 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-07 22:36:11 -07:00
|
|
|
|
2011-01-10 22:25:21 +00:00
|
|
|
|
2011-01-07 22:36:11 -07:00
|
|
|
|
|
|
|
|
|
2011-01-26 14:59:27 +00:00
|
|
|
|
|
|
|
|
|
ASoC: expand snd_soc_dapm_mutex_lock/unlock()
soc.h has snd_soc_dapm_mutex_lock/unlock() definition and
many drivers are using it, but soc-dapm.c is not.
1st reason is snd_soc_dapm_mutex_lock/unlock() requests
snd_soc_dapm_context pointer as parameter (A), but sometimes soc-dapm.c
needs to use snd_soc_card (B).
(A) static inline void snd_soc_dapm_mutex_lock(struct snd_soc_dapm_context *dapm)
{
mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
} ^^^^^^^^^^
(B) mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
^^^^
2nd reason is it want to use SND_SOC_DAPM_CLASS_INIT for mutex_lock_nested(),
but helper is using _RUNTIME (A).
The conclusion is we want to use "dapm vs card" and "_RUNTIME vs _INIT"
for dapm lock/unlock. To enable this selfish request, this patch uses
_Generic macro. We can use snd_soc_dapm_mutex_lock/unlock() for both
dapm and card case.
snd_soc_dapm_mutex_lock(dapm); snd_soc_dapm_mutex_unlock(dapm);
snd_soc_dapm_mutex_lock(card); snd_soc_dapm_mutex_unlock(card);
Current soc-dapm.c is using both mutex_lock() and mutex_lock_nested().
This patch handles mutex_lock() as mutex_lock_nested(..., 0),
in other words, handles below as same.
mutex_lock(&card->dapm_mutex);
mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT);
Because people might misunderstand that _init() is mutex initialization,
this patch renames _INIT to _ROOT and adds new
snd_soc_dapm_mutex_lock_root() for it.
This patch also moves snd_soc_dapm_subclass definition from soc-dapm.h
to soc.h to keep related code together.
Because very complex soc.h vs soc-dapm.h relationship,
it is difficult/impossible to define these helper into soc-dapm.h.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87cz4hx3v0.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-04-06 00:15:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-02-18 15:22:13 +00:00
|
|
|
|
ASoC: expand snd_soc_dapm_mutex_lock/unlock()
soc.h has snd_soc_dapm_mutex_lock/unlock() definition and
many drivers are using it, but soc-dapm.c is not.
1st reason is snd_soc_dapm_mutex_lock/unlock() requests
snd_soc_dapm_context pointer as parameter (A), but sometimes soc-dapm.c
needs to use snd_soc_card (B).
(A) static inline void snd_soc_dapm_mutex_lock(struct snd_soc_dapm_context *dapm)
{
mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
} ^^^^^^^^^^
(B) mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
^^^^
2nd reason is it want to use SND_SOC_DAPM_CLASS_INIT for mutex_lock_nested(),
but helper is using _RUNTIME (A).
The conclusion is we want to use "dapm vs card" and "_RUNTIME vs _INIT"
for dapm lock/unlock. To enable this selfish request, this patch uses
_Generic macro. We can use snd_soc_dapm_mutex_lock/unlock() for both
dapm and card case.
snd_soc_dapm_mutex_lock(dapm); snd_soc_dapm_mutex_unlock(dapm);
snd_soc_dapm_mutex_lock(card); snd_soc_dapm_mutex_unlock(card);
Current soc-dapm.c is using both mutex_lock() and mutex_lock_nested().
This patch handles mutex_lock() as mutex_lock_nested(..., 0),
in other words, handles below as same.
mutex_lock(&card->dapm_mutex);
mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT);
Because people might misunderstand that _init() is mutex initialization,
this patch renames _INIT to _ROOT and adds new
snd_soc_dapm_mutex_lock_root() for it.
This patch also moves snd_soc_dapm_subclass definition from soc-dapm.h
to soc.h to keep related code together.
Because very complex soc.h vs soc-dapm.h relationship,
it is difficult/impossible to define these helper into soc-dapm.h.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87cz4hx3v0.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-04-06 00:15:48 +00:00
|
|
|
|
2014-02-18 15:22:13 +00:00
|
|
|
|
|
|
|
|
|
ASoC: expand snd_soc_dapm_mutex_lock/unlock()
soc.h has snd_soc_dapm_mutex_lock/unlock() definition and
many drivers are using it, but soc-dapm.c is not.
1st reason is snd_soc_dapm_mutex_lock/unlock() requests
snd_soc_dapm_context pointer as parameter (A), but sometimes soc-dapm.c
needs to use snd_soc_card (B).
(A) static inline void snd_soc_dapm_mutex_lock(struct snd_soc_dapm_context *dapm)
{
mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
} ^^^^^^^^^^
(B) mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
^^^^
2nd reason is it want to use SND_SOC_DAPM_CLASS_INIT for mutex_lock_nested(),
but helper is using _RUNTIME (A).
The conclusion is we want to use "dapm vs card" and "_RUNTIME vs _INIT"
for dapm lock/unlock. To enable this selfish request, this patch uses
_Generic macro. We can use snd_soc_dapm_mutex_lock/unlock() for both
dapm and card case.
snd_soc_dapm_mutex_lock(dapm); snd_soc_dapm_mutex_unlock(dapm);
snd_soc_dapm_mutex_lock(card); snd_soc_dapm_mutex_unlock(card);
Current soc-dapm.c is using both mutex_lock() and mutex_lock_nested().
This patch handles mutex_lock() as mutex_lock_nested(..., 0),
in other words, handles below as same.
mutex_lock(&card->dapm_mutex);
mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT);
Because people might misunderstand that _init() is mutex initialization,
this patch renames _INIT to _ROOT and adds new
snd_soc_dapm_mutex_lock_root() for it.
This patch also moves snd_soc_dapm_subclass definition from soc-dapm.h
to soc.h to keep related code together.
Because very complex soc.h vs soc-dapm.h relationship,
it is difficult/impossible to define these helper into soc-dapm.h.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87cz4hx3v0.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-04-06 00:15:48 +00:00
|
|
|
|
2014-02-18 15:22:13 +00:00
|
|
|
|
ASoC: expand snd_soc_dapm_mutex_lock/unlock()
soc.h has snd_soc_dapm_mutex_lock/unlock() definition and
many drivers are using it, but soc-dapm.c is not.
1st reason is snd_soc_dapm_mutex_lock/unlock() requests
snd_soc_dapm_context pointer as parameter (A), but sometimes soc-dapm.c
needs to use snd_soc_card (B).
(A) static inline void snd_soc_dapm_mutex_lock(struct snd_soc_dapm_context *dapm)
{
mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
} ^^^^^^^^^^
(B) mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
^^^^
2nd reason is it want to use SND_SOC_DAPM_CLASS_INIT for mutex_lock_nested(),
but helper is using _RUNTIME (A).
The conclusion is we want to use "dapm vs card" and "_RUNTIME vs _INIT"
for dapm lock/unlock. To enable this selfish request, this patch uses
_Generic macro. We can use snd_soc_dapm_mutex_lock/unlock() for both
dapm and card case.
snd_soc_dapm_mutex_lock(dapm); snd_soc_dapm_mutex_unlock(dapm);
snd_soc_dapm_mutex_lock(card); snd_soc_dapm_mutex_unlock(card);
Current soc-dapm.c is using both mutex_lock() and mutex_lock_nested().
This patch handles mutex_lock() as mutex_lock_nested(..., 0),
in other words, handles below as same.
mutex_lock(&card->dapm_mutex);
mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT);
Because people might misunderstand that _init() is mutex initialization,
this patch renames _INIT to _ROOT and adds new
snd_soc_dapm_mutex_lock_root() for it.
This patch also moves snd_soc_dapm_subclass definition from soc-dapm.h
to soc.h to keep related code together.
Because very complex soc.h vs soc-dapm.h relationship,
it is difficult/impossible to define these helper into soc-dapm.h.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87cz4hx3v0.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-04-06 00:15:48 +00:00
|
|
|
|
2014-02-18 15:22:13 +00:00
|
|
|
|
|
|
|
|
|
ASoC: expand snd_soc_dapm_mutex_lock/unlock()
soc.h has snd_soc_dapm_mutex_lock/unlock() definition and
many drivers are using it, but soc-dapm.c is not.
1st reason is snd_soc_dapm_mutex_lock/unlock() requests
snd_soc_dapm_context pointer as parameter (A), but sometimes soc-dapm.c
needs to use snd_soc_card (B).
(A) static inline void snd_soc_dapm_mutex_lock(struct snd_soc_dapm_context *dapm)
{
mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
} ^^^^^^^^^^
(B) mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
^^^^
2nd reason is it want to use SND_SOC_DAPM_CLASS_INIT for mutex_lock_nested(),
but helper is using _RUNTIME (A).
The conclusion is we want to use "dapm vs card" and "_RUNTIME vs _INIT"
for dapm lock/unlock. To enable this selfish request, this patch uses
_Generic macro. We can use snd_soc_dapm_mutex_lock/unlock() for both
dapm and card case.
snd_soc_dapm_mutex_lock(dapm); snd_soc_dapm_mutex_unlock(dapm);
snd_soc_dapm_mutex_lock(card); snd_soc_dapm_mutex_unlock(card);
Current soc-dapm.c is using both mutex_lock() and mutex_lock_nested().
This patch handles mutex_lock() as mutex_lock_nested(..., 0),
in other words, handles below as same.
mutex_lock(&card->dapm_mutex);
mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT);
Because people might misunderstand that _init() is mutex initialization,
this patch renames _INIT to _ROOT and adds new
snd_soc_dapm_mutex_lock_root() for it.
This patch also moves snd_soc_dapm_subclass definition from soc-dapm.h
to soc.h to keep related code together.
Because very complex soc.h vs soc-dapm.h relationship,
it is difficult/impossible to define these helper into soc-dapm.h.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87cz4hx3v0.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-04-06 00:15:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-11-11 00:17:48 +00:00
|
|
|
|
ASoC: expand snd_soc_dapm_mutex_lock/unlock()
soc.h has snd_soc_dapm_mutex_lock/unlock() definition and
many drivers are using it, but soc-dapm.c is not.
1st reason is snd_soc_dapm_mutex_lock/unlock() requests
snd_soc_dapm_context pointer as parameter (A), but sometimes soc-dapm.c
needs to use snd_soc_card (B).
(A) static inline void snd_soc_dapm_mutex_lock(struct snd_soc_dapm_context *dapm)
{
mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
} ^^^^^^^^^^
(B) mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
^^^^
2nd reason is it want to use SND_SOC_DAPM_CLASS_INIT for mutex_lock_nested(),
but helper is using _RUNTIME (A).
The conclusion is we want to use "dapm vs card" and "_RUNTIME vs _INIT"
for dapm lock/unlock. To enable this selfish request, this patch uses
_Generic macro. We can use snd_soc_dapm_mutex_lock/unlock() for both
dapm and card case.
snd_soc_dapm_mutex_lock(dapm); snd_soc_dapm_mutex_unlock(dapm);
snd_soc_dapm_mutex_lock(card); snd_soc_dapm_mutex_unlock(card);
Current soc-dapm.c is using both mutex_lock() and mutex_lock_nested().
This patch handles mutex_lock() as mutex_lock_nested(..., 0),
in other words, handles below as same.
mutex_lock(&card->dapm_mutex);
mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT);
Because people might misunderstand that _init() is mutex initialization,
this patch renames _INIT to _ROOT and adds new
snd_soc_dapm_mutex_lock_root() for it.
This patch also moves snd_soc_dapm_subclass definition from soc-dapm.h
to soc.h to keep related code together.
Because very complex soc.h vs soc-dapm.h relationship,
it is difficult/impossible to define these helper into soc-dapm.h.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87cz4hx3v0.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-04-06 00:15:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-11-11 00:17:48 +00:00
|
|
|
|
ASoC: expand snd_soc_dapm_mutex_lock/unlock()
soc.h has snd_soc_dapm_mutex_lock/unlock() definition and
many drivers are using it, but soc-dapm.c is not.
1st reason is snd_soc_dapm_mutex_lock/unlock() requests
snd_soc_dapm_context pointer as parameter (A), but sometimes soc-dapm.c
needs to use snd_soc_card (B).
(A) static inline void snd_soc_dapm_mutex_lock(struct snd_soc_dapm_context *dapm)
{
mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
} ^^^^^^^^^^
(B) mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
^^^^
2nd reason is it want to use SND_SOC_DAPM_CLASS_INIT for mutex_lock_nested(),
but helper is using _RUNTIME (A).
The conclusion is we want to use "dapm vs card" and "_RUNTIME vs _INIT"
for dapm lock/unlock. To enable this selfish request, this patch uses
_Generic macro. We can use snd_soc_dapm_mutex_lock/unlock() for both
dapm and card case.
snd_soc_dapm_mutex_lock(dapm); snd_soc_dapm_mutex_unlock(dapm);
snd_soc_dapm_mutex_lock(card); snd_soc_dapm_mutex_unlock(card);
Current soc-dapm.c is using both mutex_lock() and mutex_lock_nested().
This patch handles mutex_lock() as mutex_lock_nested(..., 0),
in other words, handles below as same.
mutex_lock(&card->dapm_mutex);
mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT);
Because people might misunderstand that _init() is mutex initialization,
this patch renames _INIT to _ROOT and adds new
snd_soc_dapm_mutex_lock_root() for it.
This patch also moves snd_soc_dapm_subclass definition from soc-dapm.h
to soc.h to keep related code together.
Because very complex soc.h vs soc-dapm.h relationship,
it is difficult/impossible to define these helper into soc-dapm.h.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87cz4hx3v0.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-04-06 00:15:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-11-11 00:17:48 +00:00
|
|
|
|
ASoC: expand snd_soc_dapm_mutex_lock/unlock()
soc.h has snd_soc_dapm_mutex_lock/unlock() definition and
many drivers are using it, but soc-dapm.c is not.
1st reason is snd_soc_dapm_mutex_lock/unlock() requests
snd_soc_dapm_context pointer as parameter (A), but sometimes soc-dapm.c
needs to use snd_soc_card (B).
(A) static inline void snd_soc_dapm_mutex_lock(struct snd_soc_dapm_context *dapm)
{
mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
} ^^^^^^^^^^
(B) mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
^^^^
2nd reason is it want to use SND_SOC_DAPM_CLASS_INIT for mutex_lock_nested(),
but helper is using _RUNTIME (A).
The conclusion is we want to use "dapm vs card" and "_RUNTIME vs _INIT"
for dapm lock/unlock. To enable this selfish request, this patch uses
_Generic macro. We can use snd_soc_dapm_mutex_lock/unlock() for both
dapm and card case.
snd_soc_dapm_mutex_lock(dapm); snd_soc_dapm_mutex_unlock(dapm);
snd_soc_dapm_mutex_lock(card); snd_soc_dapm_mutex_unlock(card);
Current soc-dapm.c is using both mutex_lock() and mutex_lock_nested().
This patch handles mutex_lock() as mutex_lock_nested(..., 0),
in other words, handles below as same.
mutex_lock(&card->dapm_mutex);
mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT);
Because people might misunderstand that _init() is mutex initialization,
this patch renames _INIT to _ROOT and adds new
snd_soc_dapm_mutex_lock_root() for it.
This patch also moves snd_soc_dapm_subclass definition from soc-dapm.h
to soc.h to keep related code together.
Because very complex soc.h vs soc-dapm.h relationship,
it is difficult/impossible to define these helper into soc-dapm.h.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87cz4hx3v0.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-04-06 00:15:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-11-11 00:17:48 +00:00
|
|
|
|
ASoC: expand snd_soc_dapm_mutex_lock/unlock()
soc.h has snd_soc_dapm_mutex_lock/unlock() definition and
many drivers are using it, but soc-dapm.c is not.
1st reason is snd_soc_dapm_mutex_lock/unlock() requests
snd_soc_dapm_context pointer as parameter (A), but sometimes soc-dapm.c
needs to use snd_soc_card (B).
(A) static inline void snd_soc_dapm_mutex_lock(struct snd_soc_dapm_context *dapm)
{
mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
} ^^^^^^^^^^
(B) mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
^^^^
2nd reason is it want to use SND_SOC_DAPM_CLASS_INIT for mutex_lock_nested(),
but helper is using _RUNTIME (A).
The conclusion is we want to use "dapm vs card" and "_RUNTIME vs _INIT"
for dapm lock/unlock. To enable this selfish request, this patch uses
_Generic macro. We can use snd_soc_dapm_mutex_lock/unlock() for both
dapm and card case.
snd_soc_dapm_mutex_lock(dapm); snd_soc_dapm_mutex_unlock(dapm);
snd_soc_dapm_mutex_lock(card); snd_soc_dapm_mutex_unlock(card);
Current soc-dapm.c is using both mutex_lock() and mutex_lock_nested().
This patch handles mutex_lock() as mutex_lock_nested(..., 0),
in other words, handles below as same.
mutex_lock(&card->dapm_mutex);
mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT);
Because people might misunderstand that _init() is mutex initialization,
this patch renames _INIT to _ROOT and adds new
snd_soc_dapm_mutex_lock_root() for it.
This patch also moves snd_soc_dapm_subclass definition from soc-dapm.h
to soc.h to keep related code together.
Because very complex soc.h vs soc-dapm.h relationship,
it is difficult/impossible to define these helper into soc-dapm.h.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87cz4hx3v0.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-04-06 00:15:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-04-06 00:16:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-02-27 01:17:19 +00:00
|
|
|
|
2023-04-06 00:16:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-26 13:49:48 +09:00
|
|
|
|
2020-05-28 10:47:46 +09:00
|
|
|
|
2020-11-30 08:45:26 +09:00
|
|
|
|
2016-11-29 15:44:38 +00:00
|
|
|
|
2006-10-06 18:20:14 +02:00
|
|
|
|