Skip to content

Commit b0ad957

Browse files
bkokoszxlgirdwood
authored andcommitted
driver: dai: add get_hw_params() function to dai ops
Add generic get_hw_params() function in order to fetch hardware dai parameters set during ipc_dai_config() incovation. Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
1 parent b206b7a commit b0ad957

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎src/include/sof/lib/dai.h‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
struct dai;
3131
struct sof_ipc_dai_config;
32+
struct sof_ipc_stream_params;
3233

3334
/** \addtogroup sof_dai_drivers DAI Drivers
3435
* DAI Drivers API specification.
@@ -65,6 +66,8 @@ struct dai_ops {
6566
int (*trigger)(struct dai *dai, int cmd, int direction);
6667
int (*pm_context_restore)(struct dai *dai);
6768
int (*pm_context_store)(struct dai *dai);
69+
int (*get_hw_params)(struct dai *dai,
70+
struct sof_ipc_stream_params *params);
6871
int (*get_handshake)(struct dai *dai, int direction, int stream_id);
6972
int (*get_fifo)(struct dai *dai, int direction, int stream_id);
7073
int (*probe)(struct dai *dai);
@@ -268,6 +271,19 @@ static inline int dai_pm_context_restore(struct dai *dai)
268271
return ret;
269272
}
270273

274+
/**
275+
* \brief Get Digital Audio interface stream parameters
276+
*/
277+
static inline int dai_get_hw_params(struct dai *dai,
278+
struct sof_ipc_stream_params *params)
279+
{
280+
int ret = dai->drv->ops.get_hw_params(dai, params);
281+
282+
platform_shared_commit(dai, sizeof(*dai));
283+
284+
return ret;
285+
}
286+
271287
/**
272288
* \brief Get Digital Audio interface DMA Handshake
273289
*/

0 commit comments

Comments
 (0)