Merge "btfm: provide a way to query wcn3990 status"
This commit is contained in:
commit
e965ee5226
1 changed files with 31 additions and 0 deletions
|
@ -26,6 +26,9 @@
|
||||||
#include <sound/tlv.h>
|
#include <sound/tlv.h>
|
||||||
#include <btfm_slim.h>
|
#include <btfm_slim.h>
|
||||||
|
|
||||||
|
static int bt_soc_enable_status;
|
||||||
|
|
||||||
|
|
||||||
static int btfm_slim_codec_write(struct snd_soc_codec *codec, unsigned int reg,
|
static int btfm_slim_codec_write(struct snd_soc_codec *codec, unsigned int reg,
|
||||||
unsigned int value)
|
unsigned int value)
|
||||||
{
|
{
|
||||||
|
@ -38,8 +41,31 @@ static unsigned int btfm_slim_codec_read(struct snd_soc_codec *codec,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int bt_soc_status_get(struct snd_kcontrol *kcontrol,
|
||||||
|
struct snd_ctl_elem_value *ucontrol)
|
||||||
|
{
|
||||||
|
ucontrol->value.integer.value[0] = bt_soc_enable_status;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int bt_soc_status_put(struct snd_kcontrol *kcontrol,
|
||||||
|
struct snd_ctl_elem_value *ucontrol)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const struct snd_kcontrol_new status_controls[] = {
|
||||||
|
SOC_SINGLE_EXT("BT SOC status", 0, 0, 1, 0,
|
||||||
|
bt_soc_status_get,
|
||||||
|
bt_soc_status_put)
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
static int btfm_slim_codec_probe(struct snd_soc_codec *codec)
|
static int btfm_slim_codec_probe(struct snd_soc_codec *codec)
|
||||||
{
|
{
|
||||||
|
snd_soc_add_codec_controls(codec, status_controls,
|
||||||
|
ARRAY_SIZE(status_controls));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,6 +156,7 @@ int btfm_slim_dai_prepare(struct snd_pcm_substream *substream,
|
||||||
struct btfmslim *btfmslim = dai->dev->platform_data;
|
struct btfmslim *btfmslim = dai->dev->platform_data;
|
||||||
struct btfmslim_ch *ch;
|
struct btfmslim_ch *ch;
|
||||||
uint8_t rxport, grp = false, nchan = 1;
|
uint8_t rxport, grp = false, nchan = 1;
|
||||||
|
bt_soc_enable_status = 0;
|
||||||
|
|
||||||
BTFMSLIM_DBG("dai->name: %s, dai->id: %d, dai->rate: %d", dai->name,
|
BTFMSLIM_DBG("dai->name: %s, dai->id: %d, dai->rate: %d", dai->name,
|
||||||
dai->id, dai->rate);
|
dai->id, dai->rate);
|
||||||
|
@ -171,6 +198,10 @@ int btfm_slim_dai_prepare(struct snd_pcm_substream *substream,
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = btfm_slim_enable_ch(btfmslim, ch, rxport, dai->rate, grp, nchan);
|
ret = btfm_slim_enable_ch(btfmslim, ch, rxport, dai->rate, grp, nchan);
|
||||||
|
|
||||||
|
/* save the enable channel status */
|
||||||
|
if (ret == 0)
|
||||||
|
bt_soc_enable_status = 1;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue