Commit Graph

11 Commits

Author SHA1 Message Date
Seven Lee cd01b5f090
ASoC: nau8821: Implement DRC controls
This patch is support dynamic range compression controls.

Signed-off-by: Seven Lee <wtli@nuvoton.com>
Signed-off-by: Seven Lee <scott6986@gmail.com>
Link: https://lore.kernel.org/r/20230217092523.357142-1-wtli@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-03-05 23:38:35 +00:00
Takashi Iwai cf5071876b
ASoC: nau8821: Implement hw constraint for rates
nau8821 driver restricts the sample rate with over sampling rate, but
currently it barely bails out at hw_params with -EINVAL error (with a
kernel message); this doesn't help for user-space to recognize which
rate can be actually used.

This patch introduces the proper hw constraint for adjusting the
available range of the sample rate depending on the OSR setup, as well
as some code cleanup, for improving the communication with
user-space.  Now applications can know the valid rate beforehand and
reduces the rate appropriately without errors.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20220823081000.2965-2-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-23 13:04:42 +01:00
Mark Brown 2d86cef353
ASoC: nau8821: Don't unconditionally free interrupt
The remove() operation unconditionally frees the interrupt for the device
but we may not actually have an interrupt so there might be nothing to
free. Since the interrupt is requested after all other resources we don't
need the explicit free anyway, unwinding is guaranteed to be safe, so just
delete the remove() function and let devm take care of things.

Reported-by: Zheyu Ma <zheyuma97@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Tested-by: Zheyu Ma <zheyuma97@gmail.com>
Link: https://lore.kernel.org/r/20220718140405.57233-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-19 14:54:26 +01:00
Wallace Lin 0cf470c083
ASoC: nau8821: add new widget to control system clock
Add new widget to control system clock for power saving.

Signed-off-by: Wallace Lin <savagecin0@gmail.com>
Signed-off-by: Wallace Lin <sjlin0@nuvoton.com>
Link: https://lore.kernel.org/r/20220719084047.11572-1-savagecin@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-19 14:54:24 +01:00
Seven Lee 2551b6e899
ASoC: nau8821: Add headset button detection
This patch adds the function of headphone button detection,
Button detection will be enabled if the device tree
has a key_enable property.

Signed-off-by: Seven Lee <wtli@nuvoton.com>
Link: https://lore.kernel.org/r/20220627032959.3442064-1-wtli@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-11 17:18:45 +01:00
Charles Keepax c2fd88f002
ASoC: nau*: Remove now redundant non_legacy_dai_naming flag
The ASoC core has now been changed to default to the non-legacy DAI
naming, as such drivers using the new scheme no longer need to specify
the non_legacy_dai_naming flag.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220623125250.2355471-55-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-27 13:17:04 +01:00
Stephen Kitt 7325ed4d12
ASoC: nau8*: use simple i2c probe function
The i2c probe functions here don't use the id information provided in
their second argument, so the single-parameter i2c probe function
("probe_new") can be used instead.

This avoids scanning the identifier tables during probes.

Signed-off-by: Stephen Kitt <steve@sk2.org>
Link: https://lore.kernel.org/r/20220405165836.2165310-8-steve@sk2.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-04-11 19:18:14 +01:00
Vijendar Mukunda aa9753a467
ASoC: nau8821: enable no_capture_mute flag
Enable no_capture_mute_flag in nau8821 codec driver.
This will fix active playback stream mute issue when capture
stream got closed.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220223071959.13539-3-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-02-24 02:04:27 +00:00
Pierre-Louis Bossart 46ae0b3f55
ASoC: nau8821: clarify out-of-bounds check
cppcheck reports a false positive

sound/soc/codecs/nau8821.c:390:17: error: Array 'dmic_speed_sel[4]'
accessed at index 4, which is out of bounds. [arrayIndexOutOfBounds]

  dmic_speed_sel[i].param, dmic_speed_sel[i].val);
                ^
sound/soc/codecs/nau8821.c:378:2: note: After for loop, i has value 4
 for (i = 0 ; i < 4 ; i++)
 ^
sound/soc/codecs/nau8821.c:390:17: note: Array index out of bounds
  dmic_speed_sel[i].param, dmic_speed_sel[i].val);
                ^

While the code is not incorrect, we can deal with the out-of-bounds
check in a clearer way that makes static analysis happy.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211025185933.144327-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-27 11:31:11 +01:00
Pierre-Louis Bossart 765e08bdc7
ASoC: nau8821: fix kernel-doc
make W=1 reports warnings:

sound/soc/codecs/nau8821.c:1192: warning: Function parameter or member
'component' not described in 'nau8821_set_fll'

sound/soc/codecs/nau8821.c:1192: warning: Function parameter or member
'pll_id' not described in 'nau8821_set_fll'

sound/soc/codecs/nau8821.c:1192: warning: Function parameter or member
'source' not described in 'nau8821_set_fll'

sound/soc/codecs/nau8821.c:1192: warning: Excess function parameter
'codec' description in 'nau8821_set_fll'

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211025185933.144327-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-27 11:31:10 +01:00
Seven Lee aab1ad11d6
ASoC: nau8821: new driver
The driver is for codec NAU88L21 of Nuvoton Technology Corporation.
The NAU88L21 is an ultra-low power high performance audio codec that
supports both analog and digital audio functions.

Signed-off-by: Seven Lee <wtli@nuvoton.com>
Link: https://lore.kernel.org/r/20211001103108.3297848-1-wtli@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-02 01:31:58 +01:00