mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
Sound Control: separate locking mechanism for recording and playback
with newer hardware revisions coming from Qualcomm, single register lock control isn't sufficient to cover both playback and recording usage scenarios bump to version 3.5 Signed-off-by: Paul Reioux <reioux@gmail.com> Signed-off-by: flar2 <asegaert@gmail.com>
This commit is contained in:
parent
4c89a46f4b
commit
528e70238d
1 changed files with 29 additions and 3 deletions
|
@ -23,7 +23,7 @@
|
|||
#include <linux/mfd/wcd9xxx/wcd9310_registers.h>
|
||||
|
||||
#define SOUND_CONTROL_MAJOR_VERSION 3
|
||||
#define SOUND_CONTROL_MINOR_VERSION 4
|
||||
#define SOUND_CONTROL_MINOR_VERSION 5
|
||||
|
||||
#define REG_SZ 21
|
||||
|
||||
|
@ -31,6 +31,7 @@ extern struct snd_soc_codec *fauxsound_codec_ptr;
|
|||
extern int wcd9xxx_hw_revision;
|
||||
|
||||
static int snd_ctrl_locked = 0;
|
||||
static int snd_rec_ctrl_locked = 0;
|
||||
|
||||
unsigned int tabla_read(struct snd_soc_codec *codec, unsigned int reg);
|
||||
int tabla_write(struct snd_soc_codec *codec, unsigned int reg,
|
||||
|
@ -134,7 +135,7 @@ int snd_hax_reg_access(unsigned int reg)
|
|||
case TABLA_A_RX_HPH_R_GAIN:
|
||||
case TABLA_A_RX_HPH_L_STATUS:
|
||||
case TABLA_A_RX_HPH_R_STATUS:
|
||||
if (snd_ctrl_locked > 1)
|
||||
if (snd_rec_ctrl_locked > 1)
|
||||
ret = 0;
|
||||
break;
|
||||
case TABLA_A_CDC_RX1_VOL_CTL_B2_CTL:
|
||||
|
@ -375,11 +376,29 @@ static ssize_t sound_control_locked_store(struct kobject *kobj,
|
|||
return count;
|
||||
}
|
||||
|
||||
static ssize_t sound_control_locked_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
|
||||
static ssize_t sound_control_locked_show(struct kobject *kobj,
|
||||
struct kobj_attribute *attr, char *buf)
|
||||
{
|
||||
return sprintf(buf, "%d\n", snd_ctrl_locked);
|
||||
}
|
||||
|
||||
static ssize_t sound_control_rec_locked_store(struct kobject *kobj,
|
||||
struct kobj_attribute *attr, const char *buf, size_t count)
|
||||
{
|
||||
int inp;
|
||||
|
||||
sscanf(buf, "%d", &inp);
|
||||
|
||||
snd_rec_ctrl_locked = inp;
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t sound_control_rec_locked_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
|
||||
{
|
||||
return sprintf(buf, "%d\n", snd_ctrl_locked);
|
||||
}
|
||||
|
||||
static struct kobj_attribute sound_reg_sel_attribute =
|
||||
__ATTR(sound_reg_sel,
|
||||
0222,
|
||||
|
@ -434,6 +453,12 @@ static struct kobj_attribute sound_control_locked_attribute =
|
|||
sound_control_locked_show,
|
||||
sound_control_locked_store);
|
||||
|
||||
static struct kobj_attribute sound_control_rec_locked_attribute =
|
||||
__ATTR(gpl_sound_control_rec_locked,
|
||||
0666,
|
||||
sound_control_rec_locked_show,
|
||||
sound_control_rec_locked_store);
|
||||
|
||||
static struct kobj_attribute sound_control_version_attribute =
|
||||
__ATTR(gpl_sound_control_version,
|
||||
0444,
|
||||
|
@ -452,6 +477,7 @@ static struct attribute *sound_control_attrs[] =
|
|||
&headphone_gain_attribute.attr,
|
||||
&headphone_pa_gain_attribute.attr,
|
||||
&sound_control_locked_attribute.attr,
|
||||
&sound_control_rec_locked_attribute.attr,
|
||||
&sound_reg_sel_attribute.attr,
|
||||
&sound_reg_read_attribute.attr,
|
||||
&sound_reg_write_attribute.attr,
|
||||
|
|
Loading…
Reference in a new issue