Skip to content

Commit 5c81f75

Browse files
committed
ASoC: codecs: Modify some error codes
Merge series from wangweidong.a@awinic.com: The maximum value that calib can set should be consistent with the maximum value of re. An error code should be return when the re is greater than the maximum value or less than the minimum value The value of vsense_select should be either 32 or 0 in both cases, so modify the AW88399_DEV_VDSEL_VSENSE macro to 32.
2 parents ab5201e + b729598 commit 5c81f75

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

sound/soc/codecs/aw88395/aw88395.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ static const struct snd_kcontrol_new aw88395_controls[] = {
356356
aw88395_get_fade_in_time, aw88395_set_fade_in_time),
357357
SOC_SINGLE_EXT("Volume Ramp Down Step", 0, 0, FADE_TIME_MAX, FADE_TIME_MIN,
358358
aw88395_get_fade_out_time, aw88395_set_fade_out_time),
359-
SOC_SINGLE_EXT("Calib", 0, 0, 100, 0,
359+
SOC_SINGLE_EXT("Calib", 0, 0, AW88395_CALI_RE_MAX, 0,
360360
aw88395_re_get, aw88395_re_set),
361361
AW88395_PROFILE_EXT("Profile Set", aw88395_profile_info,
362362
aw88395_profile_get, aw88395_profile_set),

sound/soc/codecs/aw88399.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,8 @@ static int aw_dev_update_cali_re(struct aw_cali_desc *cali_desc)
486486
u32 cali_re;
487487
int ret;
488488

489-
if ((aw_dev->cali_desc.cali_re <= AW88399_CALI_RE_MAX) ||
490-
(aw_dev->cali_desc.cali_re >= AW88399_CALI_RE_MIN))
489+
if ((aw_dev->cali_desc.cali_re >= AW88399_CALI_RE_MAX) ||
490+
(aw_dev->cali_desc.cali_re <= AW88399_CALI_RE_MIN))
491491
return -EINVAL;
492492

493493
cali_re = AW88399_SHOW_RE_TO_DSP_RE((aw_dev->cali_desc.cali_re +
@@ -1710,7 +1710,7 @@ static const struct snd_kcontrol_new aw88399_controls[] = {
17101710
aw88399_get_fade_in_time, aw88399_set_fade_in_time),
17111711
SOC_SINGLE_EXT("Volume Ramp Down Step", 0, 0, FADE_TIME_MAX, FADE_TIME_MIN,
17121712
aw88399_get_fade_out_time, aw88399_set_fade_out_time),
1713-
SOC_SINGLE_EXT("Calib", 0, 0, 100, 0,
1713+
SOC_SINGLE_EXT("Calib", 0, 0, AW88399_CALI_RE_MAX, 0,
17141714
aw88399_re_get, aw88399_re_set),
17151715
AW88399_PROFILE_EXT("AW88399 Profile Set", aw88399_profile_info,
17161716
aw88399_profile_get, aw88399_profile_set),

sound/soc/codecs/aw88399.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ enum {
522522

523523
enum {
524524
AW88399_DEV_VDSEL_DAC = 0,
525-
AW88399_DEV_VDSEL_VSENSE = 1,
525+
AW88399_DEV_VDSEL_VSENSE = 32,
526526
};
527527

528528
enum {

0 commit comments

Comments
 (0)