.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Nuvoton NAU8825 audio codec driver |
---|
3 | 4 | * |
---|
.. | .. |
---|
5 | 6 | * Author: Anatol Pomozov <anatol@chromium.org> |
---|
6 | 7 | * Copyright 2015 Nuvoton Technology Corp. |
---|
7 | 8 | * Co-author: Meng-Huang Kuo <mhkuo@nuvoton.com> |
---|
8 | | - * |
---|
9 | | - * Licensed under the GPL-2. |
---|
10 | 9 | */ |
---|
11 | 10 | |
---|
12 | 11 | #include <linux/module.h> |
---|
.. | .. |
---|
252 | 251 | * |
---|
253 | 252 | * Acquires the semaphore without jiffies. Try to acquire the semaphore |
---|
254 | 253 | * atomically. Returns 0 if the semaphore has been acquired successfully |
---|
255 | | - * or 1 if it it cannot be acquired. |
---|
| 254 | + * or 1 if it cannot be acquired. |
---|
256 | 255 | */ |
---|
257 | 256 | static int nau8825_sema_acquire(struct nau8825 *nau8825, long timeout) |
---|
258 | 257 | { |
---|
.. | .. |
---|
351 | 350 | * Computes log10 of a value; the result is round off to 3 decimal. This func- |
---|
352 | 351 | * tion takes reference to dvb-math. The source code locates as the following. |
---|
353 | 352 | * Linux/drivers/media/dvb-core/dvb_math.c |
---|
| 353 | + * @value: input for log10 |
---|
354 | 354 | * |
---|
355 | 355 | * return log10(value) * 1000 |
---|
356 | 356 | */ |
---|
.. | .. |
---|
424 | 424 | { |
---|
425 | 425 | u32 gain, sidetone; |
---|
426 | 426 | |
---|
427 | | - if (unlikely(sig_org == 0) || unlikely(sig_cros == 0)) { |
---|
428 | | - WARN_ON(1); |
---|
| 427 | + if (WARN_ON(sig_org == 0 || sig_cros == 0)) |
---|
429 | 428 | return 0; |
---|
430 | | - } |
---|
431 | 429 | |
---|
432 | 430 | sig_org = nau8825_intlog10_dec3(sig_org); |
---|
433 | 431 | sig_cros = nau8825_intlog10_dec3(sig_cros); |
---|
.. | .. |
---|
1882 | 1880 | NAU8825_JACK_EJECT_DEBOUNCE_MASK, |
---|
1883 | 1881 | nau8825->jack_eject_debounce << NAU8825_JACK_EJECT_DEBOUNCE_SFT); |
---|
1884 | 1882 | |
---|
| 1883 | + /* Pull up IRQ pin */ |
---|
| 1884 | + regmap_update_bits(regmap, NAU8825_REG_INTERRUPT_MASK, |
---|
| 1885 | + NAU8825_IRQ_PIN_PULLUP | NAU8825_IRQ_PIN_PULL_EN, |
---|
| 1886 | + NAU8825_IRQ_PIN_PULLUP | NAU8825_IRQ_PIN_PULL_EN); |
---|
1885 | 1887 | /* Mask unneeded IRQs: 1 - disable, 0 - enable */ |
---|
1886 | 1888 | regmap_update_bits(regmap, NAU8825_REG_INTERRUPT_MASK, 0x7ff, 0x7ff); |
---|
1887 | 1889 | |
---|