diff options
| author | Mark Brown <broonie@kernel.org> | 2024-06-15 16:24:35 +0100 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2024-06-15 16:24:35 +0100 |
| commit | c8d0930a047849cc816475b58656201e5a531adc (patch) | |
| tree | c617af6cca234956921a042392b36181e1b85f2e /include/linux/ksm.h | |
| parent | 7fbc4f5e633cbc23576c32ff9773faa1788afc2d (diff) | |
| parent | 432e5074f805d0f976c7430af376a0dd07f1c6d7 (diff) | |
ASoC: codecs: lpass: add support for v2.5 rx macro
Merge series from Srinivas Kandagatla <srinivas.kandagatla@linaro.org>:
This patchset adds support to reading codec version and also adds
support for v2.5 codec version in rx macro.
LPASS 2.5 and up versions have changes in some of the rx blocks which
are required to get headset functional correctly.
Tested this on SM8450, X13s and x1e80100 crd.
This changes also fixes issue with sm8450, sm8550, sm8660 and x1e80100.
Diffstat (limited to 'include/linux/ksm.h')
| -rw-r--r-- | include/linux/ksm.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/include/linux/ksm.h b/include/linux/ksm.h index 52c63a9c5a9c..11690dacd986 100644 --- a/include/linux/ksm.h +++ b/include/linux/ksm.h @@ -33,16 +33,27 @@ void __ksm_exit(struct mm_struct *mm); */ #define is_ksm_zero_pte(pte) (is_zero_pfn(pte_pfn(pte)) && pte_dirty(pte)) -extern unsigned long ksm_zero_pages; +extern atomic_long_t ksm_zero_pages; + +static inline void ksm_map_zero_page(struct mm_struct *mm) +{ + atomic_long_inc(&ksm_zero_pages); + atomic_long_inc(&mm->ksm_zero_pages); +} static inline void ksm_might_unmap_zero_page(struct mm_struct *mm, pte_t pte) { if (is_ksm_zero_pte(pte)) { - ksm_zero_pages--; - mm->ksm_zero_pages--; + atomic_long_dec(&ksm_zero_pages); + atomic_long_dec(&mm->ksm_zero_pages); } } +static inline long mm_ksm_zero_pages(struct mm_struct *mm) +{ + return atomic_long_read(&mm->ksm_zero_pages); +} + static inline int ksm_fork(struct mm_struct *mm, struct mm_struct *oldmm) { if (test_bit(MMF_VM_MERGEABLE, &oldmm->flags)) |
