162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci#ifndef __ATMEL_PDMIC_H_
362306a36Sopenharmony_ci#define __ATMEL_PDMIC_H_
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci#include <linux/bitops.h>
662306a36Sopenharmony_ci
762306a36Sopenharmony_ci#define PDMIC_CR	0x00000000
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci#define PDMIC_CR_SWRST		0x1
1062306a36Sopenharmony_ci#define PDMIC_CR_SWRST_MASK	BIT(0)
1162306a36Sopenharmony_ci#define PDMIC_CR_SWRST_SHIFT	(0)
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ci#define PDMIC_CR_ENPDM_DIS	0x0
1462306a36Sopenharmony_ci#define PDMIC_CR_ENPDM_EN	0x1
1562306a36Sopenharmony_ci#define PDMIC_CR_ENPDM_MASK	BIT(4)
1662306a36Sopenharmony_ci#define PDMIC_CR_ENPDM_SHIFT	(4)
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci#define PDMIC_MR	0x00000004
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_ci#define PDMIC_MR_CLKS_PCK	0x0
2162306a36Sopenharmony_ci#define PDMIC_MR_CLKS_GCK	0x1
2262306a36Sopenharmony_ci#define PDMIC_MR_CLKS_MASK	BIT(4)
2362306a36Sopenharmony_ci#define PDMIC_MR_CLKS_SHIFT	(4)
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_ci#define PDMIC_MR_PRESCAL_MASK	GENMASK(14, 8)
2662306a36Sopenharmony_ci#define PDMIC_MR_PRESCAL_SHIFT	(8)
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci#define PDMIC_CDR	0x00000014
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ci#define PDMIC_IER	0x00000018
3162306a36Sopenharmony_ci#define PDMIC_IER_OVRE			BIT(25)
3262306a36Sopenharmony_ci
3362306a36Sopenharmony_ci#define PDMIC_IDR	0x0000001c
3462306a36Sopenharmony_ci#define PDMIC_IDR_OVRE			BIT(25)
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_ci#define PDMIC_IMR	0x00000020
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_ci#define PDMIC_ISR	0x00000024
3962306a36Sopenharmony_ci#define PDMIC_ISR_OVRE			BIT(25)
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci#define PDMIC_DSPR0	0x00000058
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ci#define PDMIC_DSPR0_HPFBYP_DIS		0x1
4462306a36Sopenharmony_ci#define PDMIC_DSPR0_HPFBYP_EN		0x0
4562306a36Sopenharmony_ci#define PDMIC_DSPR0_HPFBYP_MASK		BIT(1)
4662306a36Sopenharmony_ci#define PDMIC_DSPR0_HPFBYP_SHIFT	(1)
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_ci#define PDMIC_DSPR0_SINBYP_DIS		0x1
4962306a36Sopenharmony_ci#define PDMIC_DSPR0_SINBYP_EN		0x0
5062306a36Sopenharmony_ci#define PDMIC_DSPR0_SINBYP_MASK		BIT(2)
5162306a36Sopenharmony_ci#define PDMIC_DSPR0_SINBYP_SHIFT	(2)
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ci#define PDMIC_DSPR0_SIZE_16_BITS	0x0
5462306a36Sopenharmony_ci#define PDMIC_DSPR0_SIZE_32_BITS	0x1
5562306a36Sopenharmony_ci#define PDMIC_DSPR0_SIZE_MASK		BIT(3)
5662306a36Sopenharmony_ci#define PDMIC_DSPR0_SIZE_SHIFT		(3)
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_ci#define PDMIC_DSPR0_OSR_128		0x0
5962306a36Sopenharmony_ci#define PDMIC_DSPR0_OSR_64		0x1
6062306a36Sopenharmony_ci#define PDMIC_DSPR0_OSR_MASK		GENMASK(6, 4)
6162306a36Sopenharmony_ci#define PDMIC_DSPR0_OSR_SHIFT		(4)
6262306a36Sopenharmony_ci
6362306a36Sopenharmony_ci#define PDMIC_DSPR0_SCALE_MASK		GENMASK(11, 8)
6462306a36Sopenharmony_ci#define PDMIC_DSPR0_SCALE_SHIFT		(8)
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ci#define PDMIC_DSPR0_SHIFT_MASK		GENMASK(15, 12)
6762306a36Sopenharmony_ci#define PDMIC_DSPR0_SHIFT_SHIFT		(12)
6862306a36Sopenharmony_ci
6962306a36Sopenharmony_ci#define PDMIC_DSPR1	0x0000005c
7062306a36Sopenharmony_ci
7162306a36Sopenharmony_ci#define PDMIC_DSPR1_DGAIN_MASK		GENMASK(14, 0)
7262306a36Sopenharmony_ci#define PDMIC_DSPR1_DGAIN_SHIFT		(0)
7362306a36Sopenharmony_ci
7462306a36Sopenharmony_ci#define PDMIC_DSPR1_OFFSET_MASK		GENMASK(31, 16)
7562306a36Sopenharmony_ci#define PDMIC_DSPR1_OFFSET_SHIFT	(16)
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_ci#define PDMIC_WPMR	0x000000e4
7862306a36Sopenharmony_ci
7962306a36Sopenharmony_ci#define PDMIC_WPSR	0x000000e8
8062306a36Sopenharmony_ci
8162306a36Sopenharmony_ci#endif
82