diff options
author | Mark Brown <broonie@kernel.org> | 2023-11-01 17:02:32 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-11-01 17:02:32 +0000 |
commit | 5c81f752c95313e0d7e7ab148b61c7152d1a824c (patch) | |
tree | 31d2510ba478bdcbbe96df00bdedb4006db2c1c3 /sound | |
parent | ab5201e20c181563774631258f737caeefed2364 (diff) | |
parent | b729598c1747576bb9a4c997190be3f7c2915726 (diff) | |
download | lwn-5c81f752c95313e0d7e7ab148b61c7152d1a824c.tar.gz lwn-5c81f752c95313e0d7e7ab148b61c7152d1a824c.zip |
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.
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/aw88395/aw88395.c | 2 | ||||
-rw-r--r-- | sound/soc/codecs/aw88399.c | 6 | ||||
-rw-r--r-- | sound/soc/codecs/aw88399.h | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/sound/soc/codecs/aw88395/aw88395.c b/sound/soc/codecs/aw88395/aw88395.c index 77227c8f01f6..3c459a67ad0c 100644 --- a/sound/soc/codecs/aw88395/aw88395.c +++ b/sound/soc/codecs/aw88395/aw88395.c @@ -356,7 +356,7 @@ static const struct snd_kcontrol_new aw88395_controls[] = { aw88395_get_fade_in_time, aw88395_set_fade_in_time), SOC_SINGLE_EXT("Volume Ramp Down Step", 0, 0, FADE_TIME_MAX, FADE_TIME_MIN, aw88395_get_fade_out_time, aw88395_set_fade_out_time), - SOC_SINGLE_EXT("Calib", 0, 0, 100, 0, + SOC_SINGLE_EXT("Calib", 0, 0, AW88395_CALI_RE_MAX, 0, aw88395_re_get, aw88395_re_set), AW88395_PROFILE_EXT("Profile Set", aw88395_profile_info, aw88395_profile_get, aw88395_profile_set), diff --git a/sound/soc/codecs/aw88399.c b/sound/soc/codecs/aw88399.c index 47fe38d0def5..54f8457e8497 100644 --- a/sound/soc/codecs/aw88399.c +++ b/sound/soc/codecs/aw88399.c @@ -486,8 +486,8 @@ static int aw_dev_update_cali_re(struct aw_cali_desc *cali_desc) u32 cali_re; int ret; - if ((aw_dev->cali_desc.cali_re <= AW88399_CALI_RE_MAX) || - (aw_dev->cali_desc.cali_re >= AW88399_CALI_RE_MIN)) + if ((aw_dev->cali_desc.cali_re >= AW88399_CALI_RE_MAX) || + (aw_dev->cali_desc.cali_re <= AW88399_CALI_RE_MIN)) return -EINVAL; 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[] = { aw88399_get_fade_in_time, aw88399_set_fade_in_time), SOC_SINGLE_EXT("Volume Ramp Down Step", 0, 0, FADE_TIME_MAX, FADE_TIME_MIN, aw88399_get_fade_out_time, aw88399_set_fade_out_time), - SOC_SINGLE_EXT("Calib", 0, 0, 100, 0, + SOC_SINGLE_EXT("Calib", 0, 0, AW88399_CALI_RE_MAX, 0, aw88399_re_get, aw88399_re_set), AW88399_PROFILE_EXT("AW88399 Profile Set", aw88399_profile_info, aw88399_profile_get, aw88399_profile_set), diff --git a/sound/soc/codecs/aw88399.h b/sound/soc/codecs/aw88399.h index 8b3f1e101985..4f391099d0f2 100644 --- a/sound/soc/codecs/aw88399.h +++ b/sound/soc/codecs/aw88399.h @@ -522,7 +522,7 @@ enum { enum { AW88399_DEV_VDSEL_DAC = 0, - AW88399_DEV_VDSEL_VSENSE = 1, + AW88399_DEV_VDSEL_VSENSE = 32, }; enum { |