Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: nau8825: fix fake interruption when booting

There is no pull-up resistor at IRQ line where it connects from
the codec to SoC. When booting, the signal of IRQ pin will keep low
which makes the SoC invoke the ISR repeatedly because the IRQ is
registered trigger low. It will not stop until the codec sets up
the interruption and pulls the signal high. In the patch,
nau8825 will internally pull the signal to high at booting in case
the fake interrupts happen.

Signed-off-by: John Hsu <KCHSU0@nuvoton.com>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

John Hsu and committed by
Mark Brown
cbb9f8cc 3da428ff

+6
+4
sound/soc/codecs/nau8825.c
··· 1881 1881 NAU8825_JACK_EJECT_DEBOUNCE_MASK, 1882 1882 nau8825->jack_eject_debounce << NAU8825_JACK_EJECT_DEBOUNCE_SFT); 1883 1883 1884 + /* Pull up IRQ pin */ 1885 + regmap_update_bits(regmap, NAU8825_REG_INTERRUPT_MASK, 1886 + NAU8825_IRQ_PIN_PULLUP | NAU8825_IRQ_PIN_PULL_EN, 1887 + NAU8825_IRQ_PIN_PULLUP | NAU8825_IRQ_PIN_PULL_EN); 1884 1888 /* Mask unneeded IRQs: 1 - disable, 0 - enable */ 1885 1889 regmap_update_bits(regmap, NAU8825_REG_INTERRUPT_MASK, 0x7ff, 0x7ff); 1886 1890
+2
sound/soc/codecs/nau8825.h
··· 171 171 #define NAU8825_JACK_POLARITY (1 << 1) /* 0 - active low, 1 - active high */ 172 172 173 173 /* INTERRUPT_MASK (0xf) */ 174 + #define NAU8825_IRQ_PIN_PULLUP (1 << 14) 175 + #define NAU8825_IRQ_PIN_PULL_EN (1 << 13) 174 176 #define NAU8825_IRQ_OUTPUT_EN (1 << 11) 175 177 #define NAU8825_IRQ_HEADSET_COMPLETE_EN (1 << 10) 176 178 #define NAU8825_IRQ_RMS_EN (1 << 8)