summaryrefslogtreecommitdiffstats
path: root/sound/soc/atmel
diff options
context:
space:
mode:
authorClaudiu Beznea <claudiu.beznea@microchip.com>2023-03-01 13:38:03 +0200
committerMark Brown <broonie@kernel.org>2023-03-05 23:37:43 +0000
commit129742576dd1b972ea1e671595a085e29012f7f3 (patch)
tree4ebb3ef06caa69389d5dd1bd21be4e1fced2e9af /sound/soc/atmel
parent2d8dad4dc4d4a12afa3c31e72b60727d4c133b99 (diff)
downloadlinux-129742576dd1b972ea1e671595a085e29012f7f3.tar.gz
linux-129742576dd1b972ea1e671595a085e29012f7f3.tar.bz2
linux-129742576dd1b972ea1e671595a085e29012f7f3.zip
ASoC: mchp-pdmc: use FIELD_PREP() where possible
Use FIELD_PREP() macro where possible instead of driver local defined macros. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Link: https://lore.kernel.org/r/20230301113807.24036-5-claudiu.beznea@microchip.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/atmel')
-rw-r--r--sound/soc/atmel/mchp-pdmc.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sound/soc/atmel/mchp-pdmc.c b/sound/soc/atmel/mchp-pdmc.c
index 1aed3baa9369..6ec5324fd65e 100644
--- a/sound/soc/atmel/mchp-pdmc.c
+++ b/sound/soc/atmel/mchp-pdmc.c
@@ -8,6 +8,7 @@
#include <dt-bindings/sound/microchip,pdmc.h>
+#include <linux/bitfield.h>
#include <linux/clk.h>
#include <linux/module.h>
#include <linux/of.h>
@@ -49,8 +50,6 @@
#define MCHP_PDMC_MR_OSR256 (3 << 16)
#define MCHP_PDMC_MR_SINCORDER_MASK GENMASK(23, 20)
-#define MCHP_PDMC_MR_SINCORDER(order) (((order) << 20) & \
- MCHP_PDMC_MR_SINCORDER_MASK)
#define MCHP_PDMC_MR_SINC_OSR_MASK GENMASK(27, 24)
#define MCHP_PDMC_MR_SINC_OSR_DIS (0 << 24)
@@ -62,8 +61,6 @@
#define MCHP_PDMC_MR_SINC_OSR_256 (6 << 24)
#define MCHP_PDMC_MR_CHUNK_MASK GENMASK(31, 28)
-#define MCHP_PDMC_MR_CHUNK(chunk) (((chunk) << 28) & \
- MCHP_PDMC_MR_CHUNK_MASK)
/*
* ---- Configuration Register (Read/Write) ----
@@ -617,10 +614,10 @@ static int mchp_pdmc_hw_params(struct snd_pcm_substream *substream,
mr_val |= mchp_pdmc_mr_set_osr(dd->audio_filter_en, osr);
- mr_val |= MCHP_PDMC_MR_SINCORDER(dd->sinc_order);
+ mr_val |= FIELD_PREP(MCHP_PDMC_MR_SINCORDER_MASK, dd->sinc_order);
dd->addr.maxburst = mchp_pdmc_period_to_maxburst(snd_pcm_lib_period_bytes(substream));
- mr_val |= MCHP_PDMC_MR_CHUNK(dd->addr.maxburst);
+ mr_val |= FIELD_PREP(MCHP_PDMC_MR_CHUNK_MASK, dd->addr.maxburst);
dev_dbg(comp->dev, "maxburst set to %d\n", dd->addr.maxburst);
snd_soc_component_update_bits(comp, MCHP_PDMC_MR,