soundwire: cdns: Add stream routines
Add support for Cadence stream initialization and implement stream APIs. Signed-off-by: Sanyog Kale <sanyog.r.kale@intel.com> Signed-off-by: Shreyas NC <shreyas.nc@intel.com> Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
|
||||
// Copyright(c) 2015-17 Intel Corporation.
|
||||
#include <sound/soc.h>
|
||||
|
||||
#ifndef __SDW_CADENCE_H
|
||||
#define __SDW_CADENCE_H
|
||||
@@ -90,6 +91,26 @@ struct sdw_cdns_stream_config {
|
||||
unsigned int pdm_out;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct sdw_cdns_dma_data: Cadence DMA data
|
||||
*
|
||||
* @name: SoundWire stream name
|
||||
* @nr_ports: Number of ports
|
||||
* @port: Ports
|
||||
* @bus: Bus handle
|
||||
* @stream_type: Stream type
|
||||
* @link_id: Master link id
|
||||
*/
|
||||
struct sdw_cdns_dma_data {
|
||||
char *name;
|
||||
struct sdw_stream_runtime *stream;
|
||||
int nr_ports;
|
||||
struct sdw_cdns_port **port;
|
||||
struct sdw_bus *bus;
|
||||
enum sdw_stream_type stream_type;
|
||||
int link_id;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct sdw_cdns - Cadence driver context
|
||||
* @dev: Linux device
|
||||
@@ -142,6 +163,25 @@ int sdw_cdns_pdi_init(struct sdw_cdns *cdns,
|
||||
struct sdw_cdns_stream_config config);
|
||||
int sdw_cdns_enable_interrupt(struct sdw_cdns *cdns);
|
||||
|
||||
int sdw_cdns_get_stream(struct sdw_cdns *cdns,
|
||||
struct sdw_cdns_streams *stream,
|
||||
u32 ch, u32 dir);
|
||||
int sdw_cdns_alloc_stream(struct sdw_cdns *cdns,
|
||||
struct sdw_cdns_streams *stream,
|
||||
struct sdw_cdns_port *port, u32 ch, u32 dir);
|
||||
void sdw_cdns_config_stream(struct sdw_cdns *cdns, struct sdw_cdns_port *port,
|
||||
u32 ch, u32 dir, struct sdw_cdns_pdi *pdi);
|
||||
|
||||
void sdw_cdns_shutdown(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_dai *dai);
|
||||
int sdw_cdns_pcm_set_stream(struct snd_soc_dai *dai,
|
||||
void *stream, int direction);
|
||||
int sdw_cdns_pdm_set_stream(struct snd_soc_dai *dai,
|
||||
void *stream, int direction);
|
||||
|
||||
enum sdw_command_response
|
||||
cdns_reset_page_addr(struct sdw_bus *bus, unsigned int dev_num);
|
||||
|
||||
enum sdw_command_response
|
||||
cdns_xfer_msg(struct sdw_bus *bus, struct sdw_msg *msg);
|
||||
|
||||
@@ -153,4 +193,7 @@ enum sdw_command_response
|
||||
cdns_reset_page_addr(struct sdw_bus *bus, unsigned int dev_num);
|
||||
|
||||
int cdns_bus_conf(struct sdw_bus *bus, struct sdw_bus_params *params);
|
||||
|
||||
int cdns_set_sdw_stream(struct snd_soc_dai *dai,
|
||||
void *stream, bool pcm, int direction);
|
||||
#endif /* __SDW_CADENCE_H */
|
||||
|
Reference in New Issue
Block a user