Loading sound/soc/codecs/msm8x16-wcd.c +28 −0 Original line number Diff line number Diff line Loading @@ -5852,8 +5852,36 @@ static struct kobj_attribute headphone_gain_attribute = headphone_gain_show, headphone_gain_store); static ssize_t mic_gain_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { return snprintf(buf, PAGE_SIZE, "%d\n", snd_soc_read(sound_control_codec_ptr, MSM8X16_WCD_A_CDC_TX1_VOL_CTL_GAIN)); } static ssize_t mic_gain_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count) { int input; sscanf(buf, "%d", &input); if (input < -10 || input > 20) input = 0; snd_soc_write(sound_control_codec_ptr, MSM8X16_WCD_A_CDC_TX1_VOL_CTL_GAIN, input); return count; } static struct kobj_attribute mic_gain_attribute = __ATTR(mic_gain, 0664, mic_gain_show, mic_gain_store); static struct attribute *sound_control_attrs[] = { &headphone_gain_attribute.attr, &mic_gain_attribute.attr, NULL, }; Loading Loading
sound/soc/codecs/msm8x16-wcd.c +28 −0 Original line number Diff line number Diff line Loading @@ -5852,8 +5852,36 @@ static struct kobj_attribute headphone_gain_attribute = headphone_gain_show, headphone_gain_store); static ssize_t mic_gain_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { return snprintf(buf, PAGE_SIZE, "%d\n", snd_soc_read(sound_control_codec_ptr, MSM8X16_WCD_A_CDC_TX1_VOL_CTL_GAIN)); } static ssize_t mic_gain_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count) { int input; sscanf(buf, "%d", &input); if (input < -10 || input > 20) input = 0; snd_soc_write(sound_control_codec_ptr, MSM8X16_WCD_A_CDC_TX1_VOL_CTL_GAIN, input); return count; } static struct kobj_attribute mic_gain_attribute = __ATTR(mic_gain, 0664, mic_gain_show, mic_gain_store); static struct attribute *sound_control_attrs[] = { &headphone_gain_attribute.attr, &mic_gain_attribute.attr, NULL, }; Loading