Lines Matching +full:abs +full:- +full:flat
1 // SPDX-License-Identifier: GPL-2.0-only
136 if (tvc->reg == tvc->rreg) in tda7419_vol_is_stereo()
146 (struct tda7419_vol_control *)kcontrol->private_value; in tda7419_vol_info()
148 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in tda7419_vol_info()
149 uinfo->count = tda7419_vol_is_stereo(tvc) ? 2 : 1; in tda7419_vol_info()
150 uinfo->value.integer.min = tvc->min; in tda7419_vol_info()
151 uinfo->value.integer.max = tvc->max; in tda7419_vol_info()
163 val = 0 - val; in tda7419_vol_get_value()
166 val = val - thresh; in tda7419_vol_get_value()
168 val = thresh - val; in tda7419_vol_get_value()
182 (struct tda7419_vol_control *)kcontrol->private_value; in tda7419_vol_get()
183 unsigned int reg = tvc->reg; in tda7419_vol_get()
184 unsigned int rreg = tvc->rreg; in tda7419_vol_get()
185 unsigned int mask = tvc->mask; in tda7419_vol_get()
186 int min = tvc->min; in tda7419_vol_get()
187 int thresh = tvc->thresh; in tda7419_vol_get()
188 unsigned int invert = tvc->invert; in tda7419_vol_get()
192 ucontrol->value.integer.value[0] = in tda7419_vol_get()
197 ucontrol->value.integer.value[1] = in tda7419_vol_get()
209 val = abs(val); in tda7419_vol_put_value()
211 val = thresh - val; in tda7419_vol_put_value()
225 (struct tda7419_vol_control *)kcontrol->private_value; in tda7419_vol_put()
226 unsigned int reg = tvc->reg; in tda7419_vol_put()
227 unsigned int rreg = tvc->rreg; in tda7419_vol_put()
228 unsigned int mask = tvc->mask; in tda7419_vol_put()
229 int thresh = tvc->thresh; in tda7419_vol_put()
230 unsigned int invert = tvc->invert; in tda7419_vol_put()
234 val = tda7419_vol_put_value(ucontrol->value.integer.value[0], in tda7419_vol_put()
242 val = tda7419_vol_put_value(ucontrol->value.integer.value[1], in tda7419_vol_put()
298 static DECLARE_TLV_DB_SCALE(tlv_loudness_atten, -1500, 100, 0);
300 "Flat", "400 Hz", "800 Hz", "2400 Hz"};
317 static DECLARE_TLV_DB_SCALE(tlv_volume, -8000, 100, 1);
320 static DECLARE_TLV_DB_SCALE(tlv_filter, -1500, 100, 0);
347 "Flat", "80 Hz", "120 Hz", "160 Hz"};
403 0x7f, -80, 15, 0x10, 0, tlv_volume),
407 0x1f, -15, 15, 0x10, 1, tlv_filter),
411 0x1f, -15, 15, 0x10, 1, tlv_filter),
416 0x1f, -15, 15, 0x10, 1, tlv_filter),
422 SOC_ENUM("Subwoofer Cut-off Frequency", soc_enum_sub_cut_off_freq),
430 TDA7419_ATTENUATOR_RF_REG, 0x7f, -80, 15, 0x10, 0,
437 TDA7419_ATTENUATOR_RR_REG, 0x7f, -80, 15, 0x10, 0,
444 0x7f, -80, 15, 0x10, 0, tlv_volume),
448 0x7f, -80, 15, 0x10, 0, tlv_volume),
579 tda7419 = devm_kzalloc(&i2c->dev, in tda7419_probe()
583 return -ENOMEM; in tda7419_probe()
587 tda7419->regmap = devm_regmap_init_i2c(i2c, &tda7419_regmap_config); in tda7419_probe()
588 if (IS_ERR(tda7419->regmap)) { in tda7419_probe()
589 ret = PTR_ERR(tda7419->regmap); in tda7419_probe()
590 dev_err(&i2c->dev, "error initializing regmap: %d\n", in tda7419_probe()
596 * Reset registers to power-on defaults. The part does not provide a in tda7419_probe()
597 * soft-reset function and the registers are not readable. This ensures in tda7419_probe()
602 regmap_write(tda7419->regmap, in tda7419_probe()
606 ret = devm_snd_soc_register_component(&i2c->dev, in tda7419_probe()
609 dev_err(&i2c->dev, "error registering component: %d\n", in tda7419_probe()