Files
android_kernel_samsung_sm86…/btfmcodec/include/btfm_codec_hw_interface.h
Balakrishna Godavarthi 4a2649332e btfmcodec: Add btadv audio support
This change adds below support for BT advance audio
* Add support for codec type mixer control
* Update slim driver to read master id, channel number.
* Update slim driver to support HW EP.
* Add support for transport switch based on the request

CRs-Fixed: 3298745
Change-Id: Ica349cb6f3615f4dc51bbc3070c90d43eeba1cdd
2023-01-17 10:20:36 +05:30

104 lines
2.6 KiB
C

// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#ifndef __LINUX_BTFM_CODEC_HW_INTERFACE_H
#define __LINUX_BTFM_CODEC_HW_INTERFACE_H
#include <linux/kernel.h>
#include <linux/bitops.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h>
#include <sound/tlv.h>
/* This flag is set to indicate btfm codec driver is
* responsible to configure master.
*/
#define BTADV_AUDIO_MASTER_CONFIG 0
#define DEVICE_NAME_MAX_LEN 64
struct hwep_configurations {
void *btfmcodec;
uint8_t stream_id;
uint32_t sample_rate;
uint8_t bit_width;
uint8_t codectype;
uint32_t direction;
struct list_head dai_list;
};
struct master_hwep_configurations {
uint8_t stream_id;
uint32_t device_id;
uint32_t sample_rate;
uint8_t bit_width;
uint8_t num_channels;
uint8_t chan_num;
uint8_t codectype;
uint16_t direction;
};
struct hwep_comp_drv {
int (*hwep_probe) (struct snd_soc_component *);
void (*hwep_remove) (struct snd_soc_component *);
unsigned int (*hwep_read)(struct snd_soc_component *, unsigned int );
int (*hwep_write)(struct snd_soc_component *, unsigned int,
unsigned int);
};
struct hwep_dai_ops {
int (*hwep_startup)(void *);
void (*hwep_shutdown)(void *, int);
int (*hwep_hw_params)(void *, uint32_t, uint32_t);
int (*hwep_prepare)(void *, uint32_t, uint32_t, int);
int (*hwep_set_channel_map)(void *, unsigned int, unsigned int *,
unsigned int, unsigned int *);
int (*hwep_get_channel_map)(void *, unsigned int *, unsigned int *,
unsigned int *, unsigned int *, int);
int (*hwep_get_configs)(void *, struct master_hwep_configurations *,
uint8_t);
uint8_t *hwep_codectype;
};
struct hwep_dai_driver {
const char *dai_name;
unsigned int id;
struct snd_soc_pcm_stream capture;
struct snd_soc_pcm_stream playback;
struct hwep_dai_ops *dai_ops;
};
struct hwep_data {
struct device *dev;
char driver_name [DEVICE_NAME_MAX_LEN];
struct hwep_comp_drv *drv;
struct hwep_dai_driver *dai_drv;
struct snd_kcontrol_new *mixer_ctrl;
int num_dai;
int num_mixer_ctrl;
unsigned long flags;
};
int btfmcodec_register_hw_ep(struct hwep_data *);
int btfmcodec_unregister_hw_ep(char *);
// ToDo below.
/*
#if IS_ENABLED(CONFIG_SLIM_BTFM_CODEC_DRV)
int btfmcodec_register_hw_ep(struct hwep_data *);
int btfmcodec_unregister_hw_ep(char *);
#else
static inline int btfmcodec_register_hw_ep(struct hwep_data *hwep_info)
{
return -EOPNOTSUPP;
}
static inline int btfmcodec_unregister_hw_ep(char *dev_name)
{
return -EOPNOTSUPP;
}
#endif
*/
#endif /*__LINUX_BTFM_CODEC_HW_INTERFACE_H */