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>
This commit is contained in:
Claudiu Beznea 2023-03-01 13:38:03 +02:00 committed by Mark Brown
parent 2d8dad4dc4
commit 129742576d
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -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,