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

Configure Feed

Select the types of activity you want to include in your feed.

Add DMIC slew rate controls

Merge series from Seven Lee <wtli@nuvoton.com>:

Determine DMIC slew rate via property setup.

Change:
V3 -> V4:
- add "maximum: 7" description.

V2 -> V3:
- Update description of DMIC slew rate and remove
"selection" key words from property name
- Corrected variable name of DMIC slew rate from c file

V1 -> V2:
- Corrected description of DMIC slew rate.

Seven Lee (2):
ASoC: dt-bindings: nau8821: Add DMIC slew rate.
ASoC: nau8821: Add slew rate controls.

.../devicetree/bindings/sound/nuvoton,nau8821.yaml | 9 +++++++++
sound/soc/codecs/nau8821.c | 7 +++++++
sound/soc/codecs/nau8821.h | 3 +++
3 files changed, 19 insertions(+)

--
2.25.1

+19
+9
Documentation/devicetree/bindings/sound/nuvoton,nau8821.yaml
··· 89 89 $ref: /schemas/types.yaml#/definitions/uint32 90 90 default: 3072000 91 91 92 + nuvoton,dmic-slew-rate: 93 + description: The range 0 to 7 represents the speed of DMIC slew rate. 94 + The lowest value 0 means the slowest rate and the highest value 95 + 7 means the fastest rate. 96 + $ref: /schemas/types.yaml#/definitions/uint32 97 + maximum: 7 98 + default: 0 99 + 92 100 nuvoton,left-input-single-end: 93 101 description: Enable left input with single-ended settings if set. 94 102 For the headset mic application, the single-ended control is ··· 135 127 nuvoton,jack-insert-debounce = <7>; 136 128 nuvoton,jack-eject-debounce = <0>; 137 129 nuvoton,dmic-clk-threshold = <3072000>; 130 + nuvoton,dmic-slew-rate= <0>; 138 131 #sound-dai-cells = <0>; 139 132 }; 140 133 };
+7
sound/soc/codecs/nau8821.c
··· 1738 1738 &nau8821->dmic_clk_threshold); 1739 1739 if (ret) 1740 1740 nau8821->dmic_clk_threshold = 3072000; 1741 + ret = device_property_read_u32(dev, "nuvoton,dmic-slew-rate", 1742 + &nau8821->dmic_slew_rate); 1743 + if (ret) 1744 + nau8821->dmic_slew_rate = 0; 1741 1745 1742 1746 return 0; 1743 1747 } ··· 1801 1797 NAU8821_ADC_SYNC_DOWN_MASK, NAU8821_ADC_SYNC_DOWN_64); 1802 1798 regmap_update_bits(regmap, NAU8821_R2C_DAC_CTRL1, 1803 1799 NAU8821_DAC_OVERSAMPLE_MASK, NAU8821_DAC_OVERSAMPLE_64); 1800 + regmap_update_bits(regmap, NAU8821_R13_DMIC_CTRL, 1801 + NAU8821_DMIC_SLEW_MASK, nau8821->dmic_slew_rate << 1802 + NAU8821_DMIC_SLEW_SFT); 1804 1803 if (nau8821->left_input_single_end) { 1805 1804 regmap_update_bits(regmap, NAU8821_R6B_PGA_MUTE, 1806 1805 NAU8821_MUTE_MICNL_EN, NAU8821_MUTE_MICNL_EN);
+3
sound/soc/codecs/nau8821.h
··· 236 236 #define NAU8821_DMIC_SRC_MASK (0x3 << NAU8821_DMIC_SRC_SFT) 237 237 #define NAU8821_CLK_DMIC_SRC (0x2 << NAU8821_DMIC_SRC_SFT) 238 238 #define NAU8821_DMIC_EN_SFT 0 239 + #define NAU8821_DMIC_SLEW_SFT 8 240 + #define NAU8821_DMIC_SLEW_MASK (0x7 << NAU8821_DMIC_SLEW_SFT) 239 241 240 242 /* GPIO12_CTRL (0x1a) */ 241 243 #define NAU8821_JKDET_PULL_UP (0x1 << 11) /* 0 - pull down, 1 - pull up */ ··· 575 573 int jack_eject_debounce; 576 574 int fs; 577 575 int dmic_clk_threshold; 576 + int dmic_slew_rate; 578 577 int key_enable; 579 578 }; 580 579