ASoC: nau8822: add speaker Bridge Tied Output configuration

Allow configuring the two loudspeaker outputs as a
single Bridge Tied Load output getting higher output power.

Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Link: https://lore.kernel.org/r/20230104140412.35575-4-francesco@dolcini.it
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Emanuele Ghidoli 2023-01-04 15:04:12 +01:00 коммит произвёл Mark Brown
Родитель 76fa6279ef
Коммит 968b42069f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 24D68B725D5487D0
2 изменённых файлов: 18 добавлений и 0 удалений

Просмотреть файл

@ -1056,6 +1056,7 @@ static const int update_reg[] = {
static int nau8822_probe(struct snd_soc_component *component) static int nau8822_probe(struct snd_soc_component *component)
{ {
int i; int i;
struct device_node *of_node = component->dev->of_node;
/* /*
* Set the update bit in all registers, that have one. This way all * Set the update bit in all registers, that have one. This way all
@ -1066,6 +1067,14 @@ static int nau8822_probe(struct snd_soc_component *component)
snd_soc_component_update_bits(component, snd_soc_component_update_bits(component,
update_reg[i], 0x100, 0x100); update_reg[i], 0x100, 0x100);
/* Check property to configure the two loudspeaker outputs as
* a single Bridge Tied Load output
*/
if (of_property_read_bool(of_node, "nuvoton,spk-btl"))
snd_soc_component_update_bits(component,
NAU8822_REG_RIGHT_SPEAKER_CONTROL,
NAU8822_RSUBBYP, NAU8822_RSUBBYP);
return 0; return 0;
} }

Просмотреть файл

@ -187,6 +187,15 @@
/* NAU8822_REG_PLL_K3 (0x27) */ /* NAU8822_REG_PLL_K3 (0x27) */
#define NAU8822_PLLK3_MASK 0x1FF #define NAU8822_PLLK3_MASK 0x1FF
/* NAU8822_REG_RIGHT_SPEAKER_CONTROL (0x2B) */
#define NAU8822_RMIXMUT 0x20
#define NAU8822_RSUBBYP 0x10
#define NAU8822_RAUXRSUBG_SFT 1
#define NAU8822_RAUXRSUBG_MASK 0x0E
#define NAU8822_RAUXSMUT 0x01
/* System Clock Source */ /* System Clock Source */
enum { enum {
NAU8822_CLK_MCLK, NAU8822_CLK_MCLK,