sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget//translations/zh_CN/driver-api/soundwire/streammodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget//translations/zh_TW/driver-api/soundwire/streammodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget//translations/it_IT/driver-api/soundwire/streammodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget//translations/ja_JP/driver-api/soundwire/streammodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget//translations/ko_KR/driver-api/soundwire/streammodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget//translations/sp_SP/driver-api/soundwire/streammodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(hAudio Stream in SoundWireh]hAudio Stream in SoundWire}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhI/var/lib/git/docbuild/linux/Documentation/driver-api/soundwire/stream.rsthKubh paragraph)}(hBAn audio stream is a logical or virtual connection created betweenh]hBAn audio stream is a logical or virtual connection created between}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh block_quote)}(h(1) System memory buffer(s) and Codec(s) (2) DSP memory buffer(s) and Codec(s) (3) FIFO(s) and Codec(s) (4) Codec(s) and Codec(s) h]henumerated_list)}(hhh](h list_item)}(h%System memory buffer(s) and Codec(s) h]h)}(h$System memory buffer(s) and Codec(s)h]h$System memory buffer(s) and Codec(s)}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhubah}(h]h ]h"]h$]h&]uh1hhhubh)}(h"DSP memory buffer(s) and Codec(s) h]h)}(h!DSP memory buffer(s) and Codec(s)h]h!DSP memory buffer(s) and Codec(s)}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhubah}(h]h ]h"]h$]h&]uh1hhhubh)}(hFIFO(s) and Codec(s) h]h)}(hFIFO(s) and Codec(s)h]hFIFO(s) and Codec(s)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hjubah}(h]h ]h"]h$]h&]uh1hhhubh)}(hCodec(s) and Codec(s) h]h)}(hCodec(s) and Codec(s)h]hCodec(s) and Codec(s)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hjubah}(h]h ]h"]h$]h&]uh1hhhubeh}(h]h ]h"]h$]h&]enumtypearabicprefix(suffix)uh1hhhubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hwhich is typically driven by a DMA(s) channel through the data link. An audio stream contains one or more channels of data. All channels within stream must have same sample rate and same sample size.h]hwhich is typically driven by a DMA(s) channel through the data link. An audio stream contains one or more channels of data. All channels within stream must have same sample rate and same sample size.}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hAssume a stream with two channels (Left & Right) is opened using SoundWire interface. Below are some ways a stream can be represented in SoundWire.h]hAssume a stream with two channels (Left & Right) is opened using SoundWire interface. Below are some ways a stream can be represented in SoundWire.}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(h?Stream Sample in memory (System memory, DSP memory or FIFOs) ::h]h +---------------+h]hX'+---------------+ Clock Signal +---------------+ | Master +----------------------------------+ Slave | | Interface | | Interface | | | | 1 | | | Data Signal | | | L + R +----------------------------------+ L + R | | (Data) | Data Direction | (Data) | +---------------+ +-----------------------> +---------------+}hjsbah}(h]h ]h"]h$]h&]jjuh1jphhhKhhhhubh)}(hExample 2: Stereo Stream with L and R channels is captured from Slave to Master. Both Master and Slave is using single port. ::h]h|Example 2: Stereo Stream with L and R channels is captured from Slave to Master. Both Master and Slave is using single port.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK)hhhhubjq)}(hX'+---------------+ Clock Signal +---------------+ | Master +----------------------------------+ Slave | | Interface | | Interface | | | | 1 | | | Data Signal | | | L + R +----------------------------------+ L + R | | (Data) | Data Direction | (Data) | +---------------+ <-----------------------+ +---------------+h]hX'+---------------+ Clock Signal +---------------+ | Master +----------------------------------+ Slave | | Interface | | Interface | | | | 1 | | | Data Signal | | | L + R +----------------------------------+ L + R | | (Data) | Data Direction | (Data) | +---------------+ <-----------------------+ +---------------+}hjsbah}(h]h ]h"]h$]h&]jjuh1jphhhK-hhhhubh)}(hExample 3: Stereo Stream with L and R channels is rendered by Master. Each of the L and R channel is received by two different Slaves. Master and both Slaves are using single port. ::h]hExample 3: Stereo Stream with L and R channels is rendered by Master. Each of the L and R channel is received by two different Slaves. Master and both Slaves are using single port.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK7hhhhubjq)}(hX+---------------+ Clock Signal +---------------+ | Master +---------+------------------------+ Slave | | Interface | | | Interface | | | | | 1 | | | | Data Signal | | | L + R +---+------------------------------+ L | | (Data) | | | Data Direction | (Data) | +---------------+ | | +-------------> +---------------+ | | | | | | +---------------+ | +----------------------> | Slave | | | Interface | | | 2 | | | | +----------------------------> | R | | (Data) | +---------------+h]hX+---------------+ Clock Signal +---------------+ | Master +---------+------------------------+ Slave | | Interface | | | Interface | | | | | 1 | | | | Data Signal | | | L + R +---+------------------------------+ L | | (Data) | | | Data Direction | (Data) | +---------------+ | | +-------------> +---------------+ | | | | | | +---------------+ | +----------------------> | Slave | | | Interface | | | 2 | | | | +----------------------------> | R | | (Data) | +---------------+}hjsbah}(h]h ]h"]h$]h&]jjuh1jphhhK;hhhhubh)}(hX^Example 4: Stereo Stream with L and R channels is rendered by Master. Both of the L and R channels are received by two different Slaves. Master and both Slaves are using single port handling L+R. Each Slave device processes the L + R data locally, typically based on static configuration or dynamic orientation, and may drive one or more speakers. ::h]hX[Example 4: Stereo Stream with L and R channels is rendered by Master. Both of the L and R channels are received by two different Slaves. Master and both Slaves are using single port handling L+R. Each Slave device processes the L + R data locally, typically based on static configuration or dynamic orientation, and may drive one or more speakers.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKNhhhhubjq)}(hX+---------------+ Clock Signal +---------------+ | Master +---------+------------------------+ Slave | | Interface | | | Interface | | | | | 1 | | | | Data Signal | | | L + R +---+------------------------------+ L + R | | (Data) | | | Data Direction | (Data) | +---------------+ | | +-------------> +---------------+ | | | | | | +---------------+ | +----------------------> | Slave | | | Interface | | | 2 | | | | +----------------------------> | L + R | | (Data) | +---------------+h]hX+---------------+ Clock Signal +---------------+ | Master +---------+------------------------+ Slave | | Interface | | | Interface | | | | | 1 | | | | Data Signal | | | L + R +---+------------------------------+ L + R | | (Data) | | | Data Direction | (Data) | +---------------+ | | +-------------> +---------------+ | | | | | | +---------------+ | +----------------------> | Slave | | | Interface | | | 2 | | | | +----------------------------> | L + R | | (Data) | +---------------+}hjsbah}(h]h ]h"]h$]h&]jjuh1jphhhKUhhhhubh)}(hExample 5: Stereo Stream with L and R channel is rendered by two different Ports of the Master and is received by only single Port of the Slave interface. ::h]hExample 5: Stereo Stream with L and R channel is rendered by two different Ports of the Master and is received by only single Port of the Slave interface.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhhubjq)}(hX+--------------------+ | | | +--------------+ +----------------+ | | || | | | | Data Port || L Channel | | | | 1 |------------+ | | | | L Channel || | +-----+----+ | | | (Data) || | L + R Channel || Data | | | Master +----------+ | +---+---------> || Port | | | Interface | | || 1 | | | +--------------+ | || | | | | || | +----------+ | | | Data Port |------------+ | | | | 2 || R Channel | Slave | | | R Channel || | Interface | | | (Data) || | 1 | | +--------------+ Clock Signal | L + R | | +---------------------------> | (Data) | +--------------------+ | | +----------------+h]hX+--------------------+ | | | +--------------+ +----------------+ | | || | | | | Data Port || L Channel | | | | 1 |------------+ | | | | L Channel || | +-----+----+ | | | (Data) || | L + R Channel || Data | | | Master +----------+ | +---+---------> || Port | | | Interface | | || 1 | | | +--------------+ | || | | | | || | +----------+ | | | Data Port |------------+ | | | | 2 || R Channel | Slave | | | R Channel || | Interface | | | (Data) || | 1 | | +--------------+ Clock Signal | L + R | | +---------------------------> | (Data) | +--------------------+ | | +----------------+}hjsbah}(h]h ]h"]h$]h&]jjuh1jphhhKlhhhhubh)}(hExample 6: Stereo Stream with L and R channel is rendered by 2 Masters, each rendering one channel, and is received by two different Slaves, each receiving one channel. Both Masters and both Slaves are using single port. ::h]hExample 6: Stereo Stream with L and R channel is rendered by 2 Masters, each rendering one channel, and is received by two different Slaves, each receiving one channel. Both Masters and both Slaves are using single port.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubjq)}(hXP+---------------+ Clock Signal +---------------+ | Master +----------------------------------+ Slave | | Interface | | Interface | | 1 | | 1 | | | Data Signal | | | L +----------------------------------+ L | | (Data) | Data Direction | (Data) | +---------------+ +-----------------------> +---------------+ +---------------+ Clock Signal +---------------+ | Master +----------------------------------+ Slave | | Interface | | Interface | | 2 | | 2 | | | Data Signal | | | R +----------------------------------+ R | | (Data) | Data Direction | (Data) | +---------------+ +-----------------------> +---------------+h]hXP+---------------+ Clock Signal +---------------+ | Master +----------------------------------+ Slave | | Interface | | Interface | | 1 | | 1 | | | Data Signal | | | L +----------------------------------+ L | | (Data) | Data Direction | (Data) | +---------------+ +-----------------------> +---------------+ +---------------+ Clock Signal +---------------+ | Master +----------------------------------+ Slave | | Interface | | Interface | | 2 | | 2 | | | Data Signal | | | R +----------------------------------+ R | | (Data) | Data Direction | (Data) | +---------------+ +-----------------------> +---------------+}hjsbah}(h]h ]h"]h$]h&]jjuh1jphhhKhhhhubh)}(hExample 7: Stereo Stream with L and R channel is rendered by 2 Masters, each rendering both channels. Each Slave receives L + R. This is the same application as Example 4 but with Slaves placed on separate links. ::h]hExample 7: Stereo Stream with L and R channel is rendered by 2 Masters, each rendering both channels. Each Slave receives L + R. This is the same application as Example 4 but with Slaves placed on separate links.}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubjq)}(hXP+---------------+ Clock Signal +---------------+ | Master +----------------------------------+ Slave | | Interface | | Interface | | 1 | | 1 | | | Data Signal | | | L + R +----------------------------------+ L + R | | (Data) | Data Direction | (Data) | +---------------+ +-----------------------> +---------------+ +---------------+ Clock Signal +---------------+ | Master +----------------------------------+ Slave | | Interface | | Interface | | 2 | | 2 | | | Data Signal | | | L + R +----------------------------------+ L + R | | (Data) | Data Direction | (Data) | +---------------+ +-----------------------> +---------------+h]hXP+---------------+ Clock Signal +---------------+ | Master +----------------------------------+ Slave | | Interface | | Interface | | 1 | | 1 | | | Data Signal | | | L + R +----------------------------------+ L + R | | (Data) | Data Direction | (Data) | +---------------+ +-----------------------> +---------------+ +---------------+ Clock Signal +---------------+ | Master +----------------------------------+ Slave | | Interface | | Interface | | 2 | | 2 | | | Data Signal | | | L + R +----------------------------------+ L + R | | (Data) | Data Direction | (Data) | +---------------+ +-----------------------> +---------------+}hj8sbah}(h]h ]h"]h$]h&]jjuh1jphhhKhhhhubh)}(huExample 8: 4-channel Stream is rendered by 2 Masters, each rendering a 2 channels. Each Slave receives 2 channels. ::h]hrExample 8: 4-channel Stream is rendered by 2 Masters, each rendering a 2 channels. Each Slave receives 2 channels.}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubjq)}(hXP+---------------+ Clock Signal +---------------+ | Master +----------------------------------+ Slave | | Interface | | Interface | | 1 | | 1 | | | Data Signal | | | L1 + R1 +----------------------------------+ L1 + R1 | | (Data) | Data Direction | (Data) | +---------------+ +-----------------------> +---------------+ +---------------+ Clock Signal +---------------+ | Master +----------------------------------+ Slave | | Interface | | Interface | | 2 | | 2 | | | Data Signal | | | L2 + R2 +----------------------------------+ L2 + R2 | | (Data) | Data Direction | (Data) | +---------------+ +-----------------------> +---------------+h]hXP+---------------+ Clock Signal +---------------+ | Master +----------------------------------+ Slave | | Interface | | Interface | | 1 | | 1 | | | Data Signal | | | L1 + R1 +----------------------------------+ L1 + R1 | | (Data) | Data Direction | (Data) | +---------------+ +-----------------------> +---------------+ +---------------+ Clock Signal +---------------+ | Master +----------------------------------+ Slave | | Interface | | Interface | | 2 | | 2 | | | Data Signal | | | L2 + R2 +----------------------------------+ L2 + R2 | | (Data) | Data Direction | (Data) | +---------------+ +-----------------------> +---------------+}hjTsbah}(h]h ]h"]h$]h&]jjuh1jphhhKhhhhubh)}(hX,Note1: In multi-link cases like above, to lock, one would acquire a global lock and then go on locking bus instances. But, in this case the caller framework(ASoC DPCM) guarantees that stream operations on a card are always serialized. So, there is no race condition and hence no need for global lock.h]hX,Note1: In multi-link cases like above, to lock, one would acquire a global lock and then go on locking bus instances. But, in this case the caller framework(ASoC DPCM) guarantees that stream operations on a card are always serialized. So, there is no race condition and hence no need for global lock.}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hX Note2: A Slave device may be configured to receive all channels transmitted on a link for a given Stream (Example 4) or just a subset of the data (Example 3). The configuration of the Slave device is not handled by a SoundWire subsystem API, but instead by the snd_soc_dai_set_tdm_slot() API. The platform or machine driver will typically configure which of the slots are used. For Example 4, the same slots would be used by all Devices, while for Example 3 the Slave Device1 would use e.g. Slot 0 and Slave device2 slot 1.h]hX Note2: A Slave device may be configured to receive all channels transmitted on a link for a given Stream (Example 4) or just a subset of the data (Example 3). The configuration of the Slave device is not handled by a SoundWire subsystem API, but instead by the snd_soc_dai_set_tdm_slot() API. The platform or machine driver will typically configure which of the slots are used. For Example 4, the same slots would be used by all Devices, while for Example 3 the Slave Device1 would use e.g. Slot 0 and Slave device2 slot 1.}(hjphhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hNote3: Multiple Sink ports can extract the same information for the same bitSlots in the SoundWire frame, however multiple Source ports shall be configured with different bitSlot configurations. This is the same limitation as with I2S/PCM TDM usages.h]hNote3: Multiple Sink ports can extract the same information for the same bitSlots in the SoundWire frame, however multiple Source ports shall be configured with different bitSlot configurations. This is the same limitation as with I2S/PCM TDM usages.}(hj~hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhh](h)}(h SoundWire Stream Management flowh]h SoundWire Stream Management flow}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(hStream definitionsh]hStream definitions}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hX7(1) Current stream: This is classified as the stream on which operation has to be performed like prepare, enable, disable, de-prepare etc. (2) Active stream: This is classified as the stream which is already active on Bus other than current stream. There can be multiple active streams on the Bus. h]h)}(hhh](h)}(hCurrent stream: This is classified as the stream on which operation has to be performed like prepare, enable, disable, de-prepare etc. h]h)}(hCurrent stream: This is classified as the stream on which operation has to be performed like prepare, enable, disable, de-prepare etc.h]hCurrent stream: This is classified as the stream on which operation has to be performed like prepare, enable, disable, de-prepare etc.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hActive stream: This is classified as the stream which is already active on Bus other than current stream. There can be multiple active streams on the Bus. h]h)}(hActive stream: This is classified as the stream which is already active on Bus other than current stream. There can be multiple active streams on the Bus.h]hActive stream: This is classified as the stream which is already active on Bus other than current stream. There can be multiple active streams on the Bus.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]j:j;j<j=j>j?uh1hhjubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXSoundWire Bus manages stream operations for each stream getting rendered/captured on the SoundWire Bus. This section explains Bus operations done for each of the stream allocated/released on Bus. Following are the stream states maintained by the Bus for each of the audio stream.h]hXSoundWire Bus manages stream operations for each stream getting rendered/captured on the SoundWire Bus. This section explains Bus operations done for each of the stream allocated/released on Bus. Following are the stream states maintained by the Bus for each of the audio stream.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]stream-definitionsah ]h"]stream definitionsah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(hSoundWire stream statesh]hSoundWire stream states}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hHBelow shows the SoundWire stream states and state transition diagram. ::h]hEBelow shows the SoundWire stream states and state transition diagram.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubjq)}(hXH+-----------+ +------------+ +----------+ +----------+ | ALLOCATED +---->| CONFIGURED +---->| PREPARED +---->| ENABLED | | STATE | | STATE | | STATE | | STATE | +-----------+ +------------+ +---+--+---+ +----+-----+ ^ ^ ^ | | | __| |___________ | | | | v | v +----------+ +-----+------+ +-+--+-----+ | RELEASED |<----------+ DEPREPARED |<-------+ DISABLED | | STATE | | STATE | | STATE | +----------+ +------------+ +----------+h]hXH+-----------+ +------------+ +----------+ +----------+ | ALLOCATED +---->| CONFIGURED +---->| PREPARED +---->| ENABLED | | STATE | | STATE | | STATE | | STATE | +-----------+ +------------+ +---+--+---+ +----+-----+ ^ ^ ^ | | | __| |___________ | | | | v | v +----------+ +-----+------+ +-+--+-----+ | RELEASED |<----------+ DEPREPARED |<-------+ DISABLED | | STATE | | STATE | | STATE | +----------+ +------------+ +----------+}hj&sbah}(h]h ]h"]h$]h&]jjuh1jphhhKhjhhubh)}(hXNOTE: State transitions between ``SDW_STREAM_ENABLED`` and ``SDW_STREAM_DISABLED`` are only relevant when then INFO_PAUSE flag is supported at the ALSA/ASoC level. Likewise the transition between ``SDW_DISABLED_STATE`` and ``SDW_PREPARED_STATE`` depends on the INFO_RESUME flag.h](h NOTE: State transitions between }(hj4hhhNhNubhliteral)}(h``SDW_STREAM_ENABLED``h]hSDW_STREAM_ENABLED}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1j<hj4ubh and }(hj4hhhNhNubj=)}(h``SDW_STREAM_DISABLED``h]hSDW_STREAM_DISABLED}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1j<hj4ubhr are only relevant when then INFO_PAUSE flag is supported at the ALSA/ASoC level. Likewise the transition between }(hj4hhhNhNubj=)}(h``SDW_DISABLED_STATE``h]hSDW_DISABLED_STATE}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1j<hj4ubh and }(hj4hhhNhNubj=)}(h``SDW_PREPARED_STATE``h]hSDW_PREPARED_STATE}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1j<hj4ubh! depends on the INFO_RESUME flag.}(hj4hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hNOTE2: The framework implements basic state transition checks, but does not e.g. check if a transition from DISABLED to ENABLED is valid on a specific platform. Such tests need to be added at the ALSA/ASoC level.h]hNOTE2: The framework implements basic state transition checks, but does not e.g. check if a transition from DISABLED to ENABLED is valid on a specific platform. Such tests need to be added at the ALSA/ASoC level.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h]soundwire-stream-statesah ]h"]soundwire stream statesah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(hStream State Operationsh]hStream State Operations}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhM ubh)}(htBelow section explains the operations done by the Bus on Master(s) and Slave(s) as part of stream state transitions.h]htBelow section explains the operations done by the Bus on Master(s) and Slave(s) as part of stream state transitions.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjhhubh)}(hhh](h)}(hSDW_STREAM_ALLOCATEDh]hSDW_STREAM_ALLOCATED}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hwAllocation state for stream. This is the entry state of the stream. Operations performed before entering in this state:h]hwAllocation state for stream. This is the entry state of the stream. Operations performed before entering in this state:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hX(1) A stream runtime is allocated for the stream. This stream runtime is used as a reference for all the operations performed on the stream. (2) The resources required for holding stream runtime information are allocated and initialized. This holds all stream related information such as stream type (PCM/PDM) and parameters, Master and Slave interface associated with the stream, stream state etc. h]h)}(hhh](h)}(hA stream runtime is allocated for the stream. This stream runtime is used as a reference for all the operations performed on the stream. h]h)}(hA stream runtime is allocated for the stream. This stream runtime is used as a reference for all the operations performed on the stream.h]hA stream runtime is allocated for the stream. This stream runtime is used as a reference for all the operations performed on the stream.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hThe resources required for holding stream runtime information are allocated and initialized. This holds all stream related information such as stream type (PCM/PDM) and parameters, Master and Slave interface associated with the stream, stream state etc. h]h)}(hThe resources required for holding stream runtime information are allocated and initialized. This holds all stream related information such as stream type (PCM/PDM) and parameters, Master and Slave interface associated with the stream, stream state etc.h]hThe resources required for holding stream runtime information are allocated and initialized. This holds all stream related information such as stream type (PCM/PDM) and parameters, Master and Slave interface associated with the stream, stream state etc.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]j:j;j<j=j>j?uh1hhjubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(h[After all above operations are successful, stream state is set to ``SDW_STREAM_ALLOCATED``.h](hBAfter all above operations are successful, stream state is set to }(hj#hhhNhNubj=)}(h``SDW_STREAM_ALLOCATED``h]hSDW_STREAM_ALLOCATED}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1j<hj#ubh.}(hj#hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hBus implements below API for allocate a stream which needs to be called once per stream. From ASoC DPCM framework, this stream state maybe linked to .startup() operation.h]hBus implements below API for allocate a stream which needs to be called once per stream. From ASoC DPCM framework, this stream state maybe linked to .startup() operation.}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjhhubjq)}(hDint sdw_alloc_stream(char * stream_name, enum sdw_stream_type type);h]hDint sdw_alloc_stream(char * stream_name, enum sdw_stream_type type);}hjQsbah}(h]h ]h"]h$]h&]jjforcelanguagechighlight_args}uh1jphhhM$hjhhubh)}(hThe SoundWire core provides a sdw_startup_stream() helper function, typically called during a dailink .startup() callback, which performs stream allocation and sets the stream pointer for all DAIs connected to a stream.h]hThe SoundWire core provides a sdw_startup_stream() helper function, typically called during a dailink .startup() callback, which performs stream allocation and sets the stream pointer for all DAIs connected to a stream.}(hjdhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM(hjhhubeh}(h]sdw-stream-allocatedah ]h"]sdw_stream_allocatedah$]h&]uh1hhjhhhhhMubh)}(hhh](h)}(hSDW_STREAM_CONFIGUREDh]hSDW_STREAM_CONFIGURED}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjzhhhhhM.ubh)}(hRConfiguration state of stream. Operations performed before entering in this state:h]hRConfiguration state of stream. Operations performed before entering in this state:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM0hjzhhubh)}(hX(1) The resources allocated for stream information in SDW_STREAM_ALLOCATED state are updated here. This includes stream parameters, Master(s) and Slave(s) runtime information associated with current stream. (2) All the Master(s) and Slave(s) associated with current stream provide the port information to Bus which includes port numbers allocated by Master(s) and Slave(s) for current stream and their channel mask. h]h)}(hhh](h)}(hThe resources allocated for stream information in SDW_STREAM_ALLOCATED state are updated here. This includes stream parameters, Master(s) and Slave(s) runtime information associated with current stream. h]h)}(hThe resources allocated for stream information in SDW_STREAM_ALLOCATED state are updated here. This includes stream parameters, Master(s) and Slave(s) runtime information associated with current stream.h]hThe resources allocated for stream information in SDW_STREAM_ALLOCATED state are updated here. This includes stream parameters, Master(s) and Slave(s) runtime information associated with current stream.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM3hjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hAll the Master(s) and Slave(s) associated with current stream provide the port information to Bus which includes port numbers allocated by Master(s) and Slave(s) for current stream and their channel mask. h]h)}(hAll the Master(s) and Slave(s) associated with current stream provide the port information to Bus which includes port numbers allocated by Master(s) and Slave(s) for current stream and their channel mask.h]hAll the Master(s) and Slave(s) associated with current stream provide the port information to Bus which includes port numbers allocated by Master(s) and Slave(s) for current stream and their channel mask.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM7hjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]j:j;j<j=j>j?uh1hhjubah}(h]h ]h"]h$]h&]uh1hhhhM3hjzhhubh)}(h\After all above operations are successful, stream state is set to ``SDW_STREAM_CONFIGURED``.h](hBAfter all above operations are successful, stream state is set to }(hjhhhNhNubj=)}(h``SDW_STREAM_CONFIGURED``h]hSDW_STREAM_CONFIGURED}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j<hjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM;hjzhhubh)}(hXBus implements below APIs for CONFIG state which needs to be called by the respective Master(s) and Slave(s) associated with stream. These APIs can only be invoked once by respective Master(s) and Slave(s). From ASoC DPCM framework, this stream state is linked to .hw_params() operation.h]hXBus implements below APIs for CONFIG state which needs to be called by the respective Master(s) and Slave(s) associated with stream. These APIs can only be invoked once by respective Master(s) and Slave(s). From ASoC DPCM framework, this stream state is linked to .hw_params() operation.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM>hjzhhubjq)}(hXint sdw_stream_add_master(struct sdw_bus * bus, struct sdw_stream_config * stream_config, const struct sdw_ports_config * ports_config, struct sdw_stream_runtime * stream); int sdw_stream_add_slave(struct sdw_slave * slave, struct sdw_stream_config * stream_config, const struct sdw_ports_config * ports_config, struct sdw_stream_runtime * stream);h]hXint sdw_stream_add_master(struct sdw_bus * bus, struct sdw_stream_config * stream_config, const struct sdw_ports_config * ports_config, struct sdw_stream_runtime * stream); int sdw_stream_add_slave(struct sdw_slave * slave, struct sdw_stream_config * stream_config, const struct sdw_ports_config * ports_config, struct sdw_stream_runtime * stream);}hj sbah}(h]h ]h"]h$]h&]jjj_j`jajb}uh1jphhhMChjzhhubeh}(h]sdw-stream-configuredah ]h"]sdw_stream_configuredah$]h&]uh1hhjhhhhhM.ubh)}(hhh](h)}(hSDW_STREAM_PREPAREDh]hSDW_STREAM_PREPARED}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj!hhhhhMQubh)}(hLPrepare state of stream. Operations performed before entering in this state:h]hLPrepare state of stream. Operations performed before entering in this state:}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMShj!hhubh)}(hXx(0) Steps 1 and 2 are omitted in the case of a resume operation, where the bus bandwidth is known. (1) Bus parameters such as bandwidth, frame shape, clock frequency, are computed based on current stream as well as already active stream(s) on Bus. Re-computation is required to accommodate current stream on the Bus. (2) Transport and port parameters of all Master(s) and Slave(s) port(s) are computed for the current as well as already active stream based on frame shape and clock frequency computed in step 1. (3) Computed Bus and transport parameters are programmed in Master(s) and Slave(s) registers. The banked registers programming is done on the alternate bank (bank currently unused). Port(s) are enabled for the already active stream(s) on the alternate bank (bank currently unused). This is done in order to not disrupt already active stream(s). (4) Once all the values are programmed, Bus initiates switch to alternate bank where all new values programmed gets into effect. (5) Ports of Master(s) and Slave(s) for current stream are prepared by programming PrepareCtrl register. h]h)}(hhh](h)}(h_Steps 1 and 2 are omitted in the case of a resume operation, where the bus bandwidth is known. h]h)}(h^Steps 1 and 2 are omitted in the case of a resume operation, where the bus bandwidth is known.h]h^Steps 1 and 2 are omitted in the case of a resume operation, where the bus bandwidth is known.}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMUhjGubah}(h]h ]h"]h$]h&]uh1hhjDubh)}(hBus parameters such as bandwidth, frame shape, clock frequency, are computed based on current stream as well as already active stream(s) on Bus. Re-computation is required to accommodate current stream on the Bus. h]h)}(hBus parameters such as bandwidth, frame shape, clock frequency, are computed based on current stream as well as already active stream(s) on Bus. Re-computation is required to accommodate current stream on the Bus.h]hBus parameters such as bandwidth, frame shape, clock frequency, are computed based on current stream as well as already active stream(s) on Bus. Re-computation is required to accommodate current stream on the Bus.}(hjchhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMXhj_ubah}(h]h ]h"]h$]h&]uh1hhjDubh)}(hTransport and port parameters of all Master(s) and Slave(s) port(s) are computed for the current as well as already active stream based on frame shape and clock frequency computed in step 1. h]h)}(hTransport and port parameters of all Master(s) and Slave(s) port(s) are computed for the current as well as already active stream based on frame shape and clock frequency computed in step 1.h]hTransport and port parameters of all Master(s) and Slave(s) port(s) are computed for the current as well as already active stream based on frame shape and clock frequency computed in step 1.}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM]hjwubah}(h]h ]h"]h$]h&]uh1hhjDubh)}(hXUComputed Bus and transport parameters are programmed in Master(s) and Slave(s) registers. The banked registers programming is done on the alternate bank (bank currently unused). Port(s) are enabled for the already active stream(s) on the alternate bank (bank currently unused). This is done in order to not disrupt already active stream(s). h]h)}(hXTComputed Bus and transport parameters are programmed in Master(s) and Slave(s) registers. The banked registers programming is done on the alternate bank (bank currently unused). Port(s) are enabled for the already active stream(s) on the alternate bank (bank currently unused). This is done in order to not disrupt already active stream(s).h]hXTComputed Bus and transport parameters are programmed in Master(s) and Slave(s) registers. The banked registers programming is done on the alternate bank (bank currently unused). Port(s) are enabled for the already active stream(s) on the alternate bank (bank currently unused). This is done in order to not disrupt already active stream(s).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMahjubah}(h]h ]h"]h$]h&]uh1hhjDubh)}(h}Once all the values are programmed, Bus initiates switch to alternate bank where all new values programmed gets into effect. h]h)}(h|Once all the values are programmed, Bus initiates switch to alternate bank where all new values programmed gets into effect.h]h|Once all the values are programmed, Bus initiates switch to alternate bank where all new values programmed gets into effect.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMghjubah}(h]h ]h"]h$]h&]uh1hhjDubh)}(hePorts of Master(s) and Slave(s) for current stream are prepared by programming PrepareCtrl register. h]h)}(hdPorts of Master(s) and Slave(s) for current stream are prepared by programming PrepareCtrl register.h]hdPorts of Master(s) and Slave(s) for current stream are prepared by programming PrepareCtrl register.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMjhjubah}(h]h ]h"]h$]h&]uh1hhjDubeh}(h]h ]h"]h$]h&]j:j;j<j=j>j?startKuh1hhj@ubah}(h]h ]h"]h$]h&]uh1hhhhMUhj!hhubh)}(hZAfter all above operations are successful, stream state is set to ``SDW_STREAM_PREPARED``.h](hBAfter all above operations are successful, stream state is set to }(hjhhhNhNubj=)}(h``SDW_STREAM_PREPARED``h]hSDW_STREAM_PREPARED}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j<hjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMmhj!hhubh)}(hX<Bus implements below API for PREPARE state which needs to be called once per stream. From ASoC DPCM framework, this stream state is linked to .prepare() operation. Since the .trigger() operations may not follow the .prepare(), a direct transition from ``SDW_STREAM_PREPARED`` to ``SDW_STREAM_DEPREPARED`` is allowed.h](hBus implements below API for PREPARE state which needs to be called once per stream. From ASoC DPCM framework, this stream state is linked to .prepare() operation. Since the .trigger() operations may not follow the .prepare(), a direct transition from }(hjhhhNhNubj=)}(h``SDW_STREAM_PREPARED``h]hSDW_STREAM_PREPARED}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j<hjubh to }(hjhhhNhNubj=)}(h``SDW_STREAM_DEPREPARED``h]hSDW_STREAM_DEPREPARED}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j<hjubh is allowed.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMphj!hhubjq)}(h;int sdw_prepare_stream(struct sdw_stream_runtime * stream);h]h;int sdw_prepare_stream(struct sdw_stream_runtime * stream);}hj6sbah}(h]h ]h"]h$]h&]jjj_j`jajb}uh1jphhhMvhj!hhubeh}(h]sdw-stream-preparedah ]h"]sdw_stream_preparedah$]h&]uh1hhjhhhhhMQubh)}(hhh](h)}(hSDW_STREAM_ENABLEDh]hSDW_STREAM_ENABLED}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjMhhhhhM|ubh)}(hEnable state of stream. The data port(s) are enabled upon entering this state. Operations performed before entering in this state:h]hEnable state of stream. The data port(s) are enabled upon entering this state. Operations performed before entering in this state:}(hj^hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM~hjMhhubh)}(hX(1) All the values computed in SDW_STREAM_PREPARED state are programmed in alternate bank (bank currently unused). It includes programming of already active stream(s) as well. (2) All the Master(s) and Slave(s) port(s) for the current stream are enabled on alternate bank (bank currently unused) by programming ChannelEn register. (3) Once all the values are programmed, Bus initiates switch to alternate bank where all new values programmed gets into effect and port(s) associated with current stream are enabled. h]h)}(hhh](h)}(hAll the values computed in SDW_STREAM_PREPARED state are programmed in alternate bank (bank currently unused). It includes programming of already active stream(s) as well. h]h)}(hAll the values computed in SDW_STREAM_PREPARED state are programmed in alternate bank (bank currently unused). It includes programming of already active stream(s) as well.h]hAll the values computed in SDW_STREAM_PREPARED state are programmed in alternate bank (bank currently unused). It includes programming of already active stream(s) as well.}(hjwhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjsubah}(h]h ]h"]h$]h&]uh1hhjpubh)}(hAll the Master(s) and Slave(s) port(s) for the current stream are enabled on alternate bank (bank currently unused) by programming ChannelEn register. h]h)}(hAll the Master(s) and Slave(s) port(s) for the current stream are enabled on alternate bank (bank currently unused) by programming ChannelEn register.h]hAll the Master(s) and Slave(s) port(s) for the current stream are enabled on alternate bank (bank currently unused) by programming ChannelEn register.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1hhjpubh)}(hOnce all the values are programmed, Bus initiates switch to alternate bank where all new values programmed gets into effect and port(s) associated with current stream are enabled. h]h)}(hOnce all the values are programmed, Bus initiates switch to alternate bank where all new values programmed gets into effect and port(s) associated with current stream are enabled.h]hOnce all the values are programmed, Bus initiates switch to alternate bank where all new values programmed gets into effect and port(s) associated with current stream are enabled.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1hhjpubeh}(h]h ]h"]h$]h&]j:j;j<j=j>j?uh1hhjlubah}(h]h ]h"]h$]h&]uh1hhhhMhjMhhubh)}(hYAfter all above operations are successful, stream state is set to ``SDW_STREAM_ENABLED``.h](hBAfter all above operations are successful, stream state is set to }(hjhhhNhNubj=)}(h``SDW_STREAM_ENABLED``h]hSDW_STREAM_ENABLED}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j<hjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjMhhubh)}(hBus implements below API for ENABLE state which needs to be called once per stream. From ASoC DPCM framework, this stream state is linked to .trigger() start operation.h]hBus implements below API for ENABLE state which needs to be called once per stream. From ASoC DPCM framework, this stream state is linked to .trigger() start operation.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjMhhubjq)}(h:int sdw_enable_stream(struct sdw_stream_runtime * stream);h]h:int sdw_enable_stream(struct sdw_stream_runtime * stream);}hjsbah}(h]h ]h"]h$]h&]jjj_j`jajb}uh1jphhhMhjMhhubeh}(h]sdw-stream-enabledah ]h"]sdw_stream_enabledah$]h&]uh1hhjhhhhhM|ubh)}(hhh](h)}(hSDW_STREAM_DISABLEDh]hSDW_STREAM_DISABLED}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMubh)}(hDisable state of stream. The data port(s) are disabled upon exiting this state. Operations performed before entering in this state:h]hDisable state of stream. The data port(s) are disabled upon exiting this state. Operations performed before entering in this state:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hX(1) All the Master(s) and Slave(s) port(s) for the current stream are disabled on alternate bank (bank currently unused) by programming ChannelEn register. (2) All the current configuration of Bus and active stream(s) are programmed into alternate bank (bank currently unused). (3) Once all the values are programmed, Bus initiates switch to alternate bank where all new values programmed gets into effect and port(s) associated with current stream are disabled. h]h)}(hhh](h)}(hAll the Master(s) and Slave(s) port(s) for the current stream are disabled on alternate bank (bank currently unused) by programming ChannelEn register. h]h)}(hAll the Master(s) and Slave(s) port(s) for the current stream are disabled on alternate bank (bank currently unused) by programming ChannelEn register.h]hAll the Master(s) and Slave(s) port(s) for the current stream are disabled on alternate bank (bank currently unused) by programming ChannelEn register.}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj2ubah}(h]h ]h"]h$]h&]uh1hhj/ubh)}(hvAll the current configuration of Bus and active stream(s) are programmed into alternate bank (bank currently unused). h]h)}(huAll the current configuration of Bus and active stream(s) are programmed into alternate bank (bank currently unused).h]huAll the current configuration of Bus and active stream(s) are programmed into alternate bank (bank currently unused).}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjJubah}(h]h ]h"]h$]h&]uh1hhj/ubh)}(hOnce all the values are programmed, Bus initiates switch to alternate bank where all new values programmed gets into effect and port(s) associated with current stream are disabled. h]h)}(hOnce all the values are programmed, Bus initiates switch to alternate bank where all new values programmed gets into effect and port(s) associated with current stream are disabled.h]hOnce all the values are programmed, Bus initiates switch to alternate bank where all new values programmed gets into effect and port(s) associated with current stream are disabled.}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjbubah}(h]h ]h"]h$]h&]uh1hhj/ubeh}(h]h ]h"]h$]h&]j:j;j<j=j>j?uh1hhj+ubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hZAfter all above operations are successful, stream state is set to ``SDW_STREAM_DISABLED``.h](hBAfter all above operations are successful, stream state is set to }(hjhhhNhNubj=)}(h``SDW_STREAM_DISABLED``h]hSDW_STREAM_DISABLED}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j<hjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hBus implements below API for DISABLED state which needs to be called once per stream. From ASoC DPCM framework, this stream state is linked to .trigger() stop operation.h]hBus implements below API for DISABLED state which needs to be called once per stream. From ASoC DPCM framework, this stream state is linked to .trigger() stop operation.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(h`When the INFO_PAUSE flag is supported, a direct transition to ``SDW_STREAM_ENABLED`` is allowed.h](h>When the INFO_PAUSE flag is supported, a direct transition to }(hjhhhNhNubj=)}(h``SDW_STREAM_ENABLED``h]hSDW_STREAM_ENABLED}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j<hjubh is allowed.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hFor resume operations where ASoC will use the .prepare() callback, the stream can transition from ``SDW_STREAM_DISABLED`` to ``SDW_STREAM_PREPARED``, with all required settings restored but without updating the bandwidth and bit allocation.h](hbFor resume operations where ASoC will use the .prepare() callback, the stream can transition from }(hjhhhNhNubj=)}(h``SDW_STREAM_DISABLED``h]hSDW_STREAM_DISABLED}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j<hjubh to }(hjhhhNhNubj=)}(h``SDW_STREAM_PREPARED``h]hSDW_STREAM_PREPARED}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j<hjubh\, with all required settings restored but without updating the bandwidth and bit allocation.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubjq)}(h;int sdw_disable_stream(struct sdw_stream_runtime * stream);h]h;int sdw_disable_stream(struct sdw_stream_runtime * stream);}hjsbah}(h]h ]h"]h$]h&]jjj_j`jajb}uh1jphhhMhj hhubeh}(h]sdw-stream-disabledah ]h"]sdw_stream_disabledah$]h&]uh1hhjhhhhhMubh)}(hhh](h)}(hSDW_STREAM_DEPREPAREDh]hSDW_STREAM_DEPREPARED}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hODe-prepare state of stream. Operations performed before entering in this state:h]hODe-prepare state of stream. Operations performed before entering in this state:}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hX/(1) All the port(s) of Master(s) and Slave(s) for current stream are de-prepared by programming PrepareCtrl register. (2) The payload bandwidth of current stream is reduced from the total bandwidth requirement of bus and new parameters calculated and applied by performing bank switch etc. h]h)}(hhh](h)}(hrAll the port(s) of Master(s) and Slave(s) for current stream are de-prepared by programming PrepareCtrl register. h]h)}(hqAll the port(s) of Master(s) and Slave(s) for current stream are de-prepared by programming PrepareCtrl register.h]hqAll the port(s) of Master(s) and Slave(s) for current stream are de-prepared by programming PrepareCtrl register.}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjCubah}(h]h ]h"]h$]h&]uh1hhj@ubh)}(hThe payload bandwidth of current stream is reduced from the total bandwidth requirement of bus and new parameters calculated and applied by performing bank switch etc. h]h)}(hThe payload bandwidth of current stream is reduced from the total bandwidth requirement of bus and new parameters calculated and applied by performing bank switch etc.h]hThe payload bandwidth of current stream is reduced from the total bandwidth requirement of bus and new parameters calculated and applied by performing bank switch etc.}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj[ubah}(h]h ]h"]h$]h&]uh1hhj@ubeh}(h]h ]h"]h$]h&]j:j;j<j=j>j?uh1hhj<ubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(h\After all above operations are successful, stream state is set to ``SDW_STREAM_DEPREPARED``.h](hBAfter all above operations are successful, stream state is set to }(hjhhhNhNubj=)}(h``SDW_STREAM_DEPREPARED``h]hSDW_STREAM_DEPREPARED}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j<hjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hBus implements below API for DEPREPARED state which needs to be called once per stream. ALSA/ASoC do not have a concept of 'deprepare', and the mapping from this stream state to ALSA/ASoC operation may be implementation specific.h]hBus implements below API for DEPREPARED state which needs to be called once per stream. ALSA/ASoC do not have a concept of ‘deprepare’, and the mapping from this stream state to ALSA/ASoC operation may be implementation specific.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hWhen the INFO_PAUSE flag is supported, the stream state is linked to the .hw_free() operation - the stream is not deprepared on a TRIGGER_STOP.h]hWhen the INFO_PAUSE flag is supported, the stream state is linked to the .hw_free() operation - the stream is not deprepared on a TRIGGER_STOP.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hOther implementations may transition to the ``SDW_STREAM_DEPREPARED`` state on TRIGGER_STOP, should they require a transition through the ``SDW_STREAM_PREPARED`` state.h](h,Other implementations may transition to the }(hjhhhNhNubj=)}(h``SDW_STREAM_DEPREPARED``h]hSDW_STREAM_DEPREPARED&}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j<hjubhE state on TRIGGER_STOP, should they require a transition through the }(hjhhhNhNubj=)}(h``SDW_STREAM_PREPARED``h]hSDW_STREAM_PREPARED}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j<hjubh state.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubjq)}(h=int sdw_deprepare_stream(struct sdw_stream_runtime * stream);h]h=int sdw_deprepare_stream(struct sdw_stream_runtime * stream);}hjsbah}(h]h ]h"]h$]h&]jjj_j`jajb}uh1jphhhMhjhhubeh}(h]sdw-stream-depreparedah ]h"]sdw_stream_depreparedah$]h&]uh1hhjhhhhhMubh)}(hhh](h)}(hSDW_STREAM_RELEASEDh]hSDW_STREAM_RELEASED}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMubh)}(hLRelease state of stream. Operations performed before entering in this state:h]hLRelease state of stream. Operations performed before entering in this state:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hX(1) Release port resources for all Master(s) and Slave(s) port(s) associated with current stream. (2) Release Master(s) and Slave(s) runtime resources associated with current stream. (3) Release stream runtime resources associated with current stream. h]h)}(hhh](h)}(h^Release port resources for all Master(s) and Slave(s) port(s) associated with current stream. h]h)}(h]Release port resources for all Master(s) and Slave(s) port(s) associated with current stream.h]h]Release port resources for all Master(s) and Slave(s) port(s) associated with current stream.}(hj. hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj* ubah}(h]h ]h"]h$]h&]uh1hhj' ubh)}(hQRelease Master(s) and Slave(s) runtime resources associated with current stream. h]h)}(hPRelease Master(s) and Slave(s) runtime resources associated with current stream.h]hPRelease Master(s) and Slave(s) runtime resources associated with current stream.}(hjF hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjB ubah}(h]h ]h"]h$]h&]uh1hhj' ubh)}(hARelease stream runtime resources associated with current stream. h]h)}(h@Release stream runtime resources associated with current stream.h]h@Release stream runtime resources associated with current stream.}(hj^ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjZ ubah}(h]h ]h"]h$]h&]uh1hhj' ubeh}(h]h ]h"]h$]h&]j:j;j<j=j>j?uh1hhj# ubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hZAfter all above operations are successful, stream state is set to ``SDW_STREAM_RELEASED``.h](hBAfter all above operations are successful, stream state is set to }(hj~ hhhNhNubj=)}(h``SDW_STREAM_RELEASED``h]hSDW_STREAM_RELEASED}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j<hj~ ubh.}(hj~ hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hBus implements below APIs for RELEASE state which needs to be called by all the Master(s) and Slave(s) associated with stream. From ASoC DPCM framework, this stream state is linked to .hw_free() operation.h]hBus implements below APIs for RELEASE state which needs to be called by all the Master(s) and Slave(s) associated with stream. From ASoC DPCM framework, this stream state is linked to .hw_free() operation.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubjq)}(hint sdw_stream_remove_master(struct sdw_bus * bus, struct sdw_stream_runtime * stream); int sdw_stream_remove_slave(struct sdw_slave * slave, struct sdw_stream_runtime * stream);h]hint sdw_stream_remove_master(struct sdw_bus * bus, struct sdw_stream_runtime * stream); int sdw_stream_remove_slave(struct sdw_slave * slave, struct sdw_stream_runtime * stream);}hj sbah}(h]h ]h"]h$]h&]jjj_j`jajb}uh1jphhhMhj hhubh)}(hnThe .shutdown() ASoC DPCM operation calls below Bus API to release stream assigned as part of ALLOCATED state.h]hnThe .shutdown() ASoC DPCM operation calls below Bus API to release stream assigned as part of ALLOCATED state.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hHIn .shutdown() the data structure maintaining stream state are freed up.h]hHIn .shutdown() the data structure maintaining stream state are freed up.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubjq)}(h.uh1hhj hhhhhM ubeh}(h] not-supportedah ]h"] not supportedah$]h&]uh1hhhhhhhhM ubeh}(h]audio-stream-in-soundwireah ]h"]audio stream in soundwireah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjr error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(jL jI j j jjjjj j jwjtjjjJjGj jjjj jj j jD jA u nametypes}(jL j jjj jwjjJj jj j jD uh}(jI hj jjjjjj jjtjjjzjGj!jjMjj jjj j jA j u footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]hsystem_message)}(hhh]h)}(h:Enumerated list start value not ordinal-1: "0" (ordinal 0)h]h>Enumerated list start value not ordinal-1: “0” (ordinal 0)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubah}(h]h ]h"]h$]h&]levelKtypeINFOsourcehlineKuh1j hj@ubatransform_messages] transformerN include_log] decorationNhhub.