static ssize_t headphone_pa_gain_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count) { unsigned int lval, rval, chksum; unsigned int gain, status; unsigned int out; sscanf(buf, "%u %u %u", &lval, &rval, &chksum); if (calc_checksum(lval, rval, chksum)) { gain = tabla_read(fauxsound_codec_ptr, TABLA_A_RX_HPH_L_GAIN); out = (gain & 0xf0) | lval; tabla_write(fauxsound_codec_ptr, TABLA_A_RX_HPH_L_GAIN, out); status = tabla_read(fauxsound_codec_ptr, TABLA_A_RX_HPH_L_STATUS); out = (status & 0x0f) | (lval << 4); tabla_write(fauxsound_codec_ptr, TABLA_A_RX_HPH_L_STATUS, out); gain = tabla_read(fauxsound_codec_ptr, TABLA_A_RX_HPH_R_GAIN); out = (gain & 0xf0) | rval; tabla_write(fauxsound_codec_ptr, TABLA_A_RX_HPH_R_GAIN, out); status = tabla_read(fauxsound_codec_ptr, TABLA_A_RX_HPH_R_STATUS); out = (status & 0x0f) | (rval << 4); tabla_write(fauxsound_codec_ptr, TABLA_A_RX_HPH_R_STATUS, out); } return count; }
static ssize_t headphone_pa_gain_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { return sprintf(buf, "%u %u", tabla_read(fauxsound_codec_ptr, TABLA_A_RX_HPH_L_GAIN), tabla_read(fauxsound_codec_ptr, TABLA_A_RX_HPH_R_GAIN)); }
static ssize_t headphone_gain_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { return sprintf(buf, "%u %u", tabla_read(fauxsound_codec_ptr, TABLA_A_CDC_RX1_VOL_CTL_B2_CTL), tabla_read(fauxsound_codec_ptr, TABLA_A_CDC_RX2_VOL_CTL_B2_CTL)); }
static ssize_t speaker_gain_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { return sprintf(buf, "%u %u\n", tabla_read(fauxsound_codec_ptr, TABLA_A_CDC_RX3_VOL_CTL_B2_CTL), tabla_read(fauxsound_codec_ptr, TABLA_A_CDC_RX4_VOL_CTL_B2_CTL)); }
static ssize_t mic_gain_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { return sprintf(buf, "%u", tabla_read(fauxsound_codec_ptr, TABLA_A_CDC_TX7_VOL_CTL_GAIN)); }
static ssize_t sound_reg_read_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { if (selected_reg == 0xdeadbeef) return -1; else return sprintf(buf, "%u\n", tabla_read(fauxsound_codec_ptr, selected_reg)); }