linux/drivers/staging/greybus/audio_codec.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Greybus audio driver
 * Copyright 2015 Google Inc.
 * Copyright 2015 Linaro Ltd.
 */

#ifndef __LINUX_GBAUDIO_CODEC_H
#define __LINUX_GBAUDIO_CODEC_H

#include <linux/greybus.h>
#include <sound/soc.h>
#include <sound/jack.h>

#define NAME_SIZE
#define MAX_DAIS

enum {};

/*
 * device_type should be same as defined in audio.h
 * (Android media layer)
 */
enum {};

#define GBCODEC_JACK_MASK
#define GBCODEC_JACK_BUTTON_MASK

enum gbaudio_codec_state {};

struct gbaudio_stream_params {};

struct gbaudio_codec_dai {};

struct gbaudio_codec_info {};

struct gbaudio_widget {};

struct gbaudio_control {};

struct gbaudio_data_connection {};

/* stream direction */
#define GB_PLAYBACK
#define GB_CAPTURE

enum gbaudio_module_state {};

struct gbaudio_jack {};

struct gbaudio_module_info {};

int gbaudio_tplg_parse_data(struct gbaudio_module_info *module,
			    struct gb_audio_topology *tplg_data);
void gbaudio_tplg_release(struct gbaudio_module_info *module);

int gbaudio_module_update(struct gbaudio_codec_info *codec,
			  struct snd_soc_dapm_widget *w,
			  struct gbaudio_module_info *module,
			  int enable);
int gbaudio_register_module(struct gbaudio_module_info *module);
void gbaudio_unregister_module(struct gbaudio_module_info *module);

/* protocol related */
int gb_audio_gb_get_topology(struct gb_connection *connection,
			     struct gb_audio_topology **topology);
int gb_audio_gb_get_control(struct gb_connection *connection,
			    u8 control_id, u8 index,
			    struct gb_audio_ctl_elem_value *value);
int gb_audio_gb_set_control(struct gb_connection *connection,
			    u8 control_id, u8 index,
			    struct gb_audio_ctl_elem_value *value);
int gb_audio_gb_enable_widget(struct gb_connection *connection,
			      u8 widget_id);
int gb_audio_gb_disable_widget(struct gb_connection *connection,
			       u8 widget_id);
int gb_audio_gb_get_pcm(struct gb_connection *connection,
			u16 data_cport, u32 *format,
			u32 *rate, u8 *channels,
			u8 *sig_bits);
int gb_audio_gb_set_pcm(struct gb_connection *connection,
			u16 data_cport, u32 format,
			u32 rate, u8 channels,
			u8 sig_bits);
int gb_audio_gb_set_tx_data_size(struct gb_connection *connection,
				 u16 data_cport, u16 size);
int gb_audio_gb_activate_tx(struct gb_connection *connection,
			    u16 data_cport);
int gb_audio_gb_deactivate_tx(struct gb_connection *connection,
			      u16 data_cport);
int gb_audio_gb_set_rx_data_size(struct gb_connection *connection,
				 u16 data_cport, u16 size);
int gb_audio_gb_activate_rx(struct gb_connection *connection,
			    u16 data_cport);
int gb_audio_gb_deactivate_rx(struct gb_connection *connection,
			      u16 data_cport);
int gb_audio_apbridgea_set_config(struct gb_connection *connection,
				  __u16 i2s_port, __u32 format,
				  __u32 rate, __u32 mclk_freq);
int gb_audio_apbridgea_register_cport(struct gb_connection *connection,
				      __u16 i2s_port, __u16 cportid,
				      __u8 direction);
int gb_audio_apbridgea_unregister_cport(struct gb_connection *connection,
					__u16 i2s_port, __u16 cportid,
					__u8 direction);
int gb_audio_apbridgea_set_tx_data_size(struct gb_connection *connection,
					__u16 i2s_port, __u16 size);
int gb_audio_apbridgea_prepare_tx(struct gb_connection *connection,
				  __u16 i2s_port);
int gb_audio_apbridgea_start_tx(struct gb_connection *connection,
				__u16 i2s_port, __u64 timestamp);
int gb_audio_apbridgea_stop_tx(struct gb_connection *connection,
			       __u16 i2s_port);
int gb_audio_apbridgea_shutdown_tx(struct gb_connection *connection,
				   __u16 i2s_port);
int gb_audio_apbridgea_set_rx_data_size(struct gb_connection *connection,
					__u16 i2s_port, __u16 size);
int gb_audio_apbridgea_prepare_rx(struct gb_connection *connection,
				  __u16 i2s_port);
int gb_audio_apbridgea_start_rx(struct gb_connection *connection,
				__u16 i2s_port);
int gb_audio_apbridgea_stop_rx(struct gb_connection *connection,
			       __u16 i2s_port);
int gb_audio_apbridgea_shutdown_rx(struct gb_connection *connection,
				   __u16 i2s_port);

#endif /* __LINUX_GBAUDIO_CODEC_H */