Commit cbb9f8cc authored by John Hsu's avatar John Hsu Committed by Mark Brown

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: default avatarJohn Hsu <KCHSU0@nuvoton.com>
Tested-by: default avatarCheng-Yi Chiang <cychiang@chromium.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 3da428ff
......@@ -1881,6 +1881,10 @@ static void nau8825_init_regs(struct nau8825 *nau8825)
NAU8825_JACK_EJECT_DEBOUNCE_MASK,
nau8825->jack_eject_debounce << NAU8825_JACK_EJECT_DEBOUNCE_SFT);
/* Pull up IRQ pin */
regmap_update_bits(regmap, NAU8825_REG_INTERRUPT_MASK,
NAU8825_IRQ_PIN_PULLUP | NAU8825_IRQ_PIN_PULL_EN,
NAU8825_IRQ_PIN_PULLUP | NAU8825_IRQ_PIN_PULL_EN);
/* Mask unneeded IRQs: 1 - disable, 0 - enable */
regmap_update_bits(regmap, NAU8825_REG_INTERRUPT_MASK, 0x7ff, 0x7ff);
......
......@@ -171,6 +171,8 @@
#define NAU8825_JACK_POLARITY (1 << 1) /* 0 - active low, 1 - active high */
/* INTERRUPT_MASK (0xf) */
#define NAU8825_IRQ_PIN_PULLUP (1 << 14)
#define NAU8825_IRQ_PIN_PULL_EN (1 << 13)
#define NAU8825_IRQ_OUTPUT_EN (1 << 11)
#define NAU8825_IRQ_HEADSET_COMPLETE_EN (1 << 10)
#define NAU8825_IRQ_RMS_EN (1 << 8)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment