summaryrefslogtreecommitdiff
path: root/sound/soc/atmel/mchp-pdmc.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2023-04-24 15:15:31 +0200
committerTakashi Iwai <tiwai@suse.de>2023-04-24 15:15:31 +0200
commitbaa6584a24494fbbd2862270d39e61b86987cc91 (patch)
tree1ad9e7b71703c57fbdfd34bb67f8838b46ac4dc8 /sound/soc/atmel/mchp-pdmc.c
parent7002cbd625467084f1ef01b6e365e10b51fc4b9f (diff)
parentdc801ea8ae37d54706e6f1cef140731ac5981c9c (diff)
downloadlwn-baa6584a24494fbbd2862270d39e61b86987cc91.tar.gz
lwn-baa6584a24494fbbd2862270d39e61b86987cc91.zip
Merge tag 'asoc-v6.4' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next
ASoC: Updates for v6.4 The bulk of the commits here are for the conversion of drivers to use void remove callbacks but there's a reasonable amount of other stuff going on, the pace of development with the SOF code continues to be high and there's a bunch of new drivers too: - More core cleanups from Morimto-san. - Update drivers to have remove() callbacks returning void, mostly mechanical with some substantial changes. - Continued feature and simplification work on SOF, including addition of a no-DSP mode for bringup, HDA MLink and extensions to the IPC4 protocol. - Hibernation support for CS35L45. - More DT binding conversions. - Support for Cirrus Logic CS35L56, Freescale QMC, Maxim MAX98363, nVidia systems with MAX9809x and RT5631, Realtek RT712, Renesas R-Car Gen4, Rockchip RK3588 and TI TAS5733.
Diffstat (limited to 'sound/soc/atmel/mchp-pdmc.c')
-rw-r--r--sound/soc/atmel/mchp-pdmc.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/sound/soc/atmel/mchp-pdmc.c b/sound/soc/atmel/mchp-pdmc.c
index 1aed3baa9369..da23855a0e40 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,
@@ -762,12 +759,10 @@ static int mchp_pdmc_pcm_new(struct snd_soc_pcm_runtime *rtd,
int ret;
ret = mchp_pdmc_add_chmap_ctls(rtd->pcm, dd);
- if (ret < 0) {
+ if (ret < 0)
dev_err(dd->dev, "failed to add channel map controls: %d\n", ret);
- return ret;
- }
- return 0;
+ return ret;
}
static struct snd_soc_dai_driver mchp_pdmc_dai = {
@@ -788,7 +783,7 @@ static struct snd_soc_dai_driver mchp_pdmc_dai = {
/* PDMC interrupt handler */
static irqreturn_t mchp_pdmc_interrupt(int irq, void *dev_id)
{
- struct mchp_pdmc *dd = (struct mchp_pdmc *)dev_id;
+ struct mchp_pdmc *dd = dev_id;
u32 isr, msr, pending;
irqreturn_t ret = IRQ_NONE;
@@ -1082,7 +1077,7 @@ static int mchp_pdmc_probe(struct platform_device *pdev)
}
ret = devm_request_irq(dev, irq, mchp_pdmc_interrupt, 0,
- dev_name(&pdev->dev), (void *)dd);
+ dev_name(&pdev->dev), dd);
if (ret < 0) {
dev_err(dev, "can't register ISR for IRQ %u (ret=%i)\n",
irq, ret);
@@ -1134,7 +1129,7 @@ pm_runtime_suspend:
return ret;
}
-static int mchp_pdmc_remove(struct platform_device *pdev)
+static void mchp_pdmc_remove(struct platform_device *pdev)
{
struct mchp_pdmc *dd = platform_get_drvdata(pdev);
@@ -1142,8 +1137,6 @@ static int mchp_pdmc_remove(struct platform_device *pdev)
mchp_pdmc_runtime_suspend(dd->dev);
pm_runtime_disable(dd->dev);
-
- return 0;
}
static const struct of_device_id mchp_pdmc_of_match[] = {
@@ -1168,7 +1161,7 @@ static struct platform_driver mchp_pdmc_driver = {
.pm = pm_ptr(&mchp_pdmc_pm_ops),
},
.probe = mchp_pdmc_probe,
- .remove = mchp_pdmc_remove,
+ .remove_new = mchp_pdmc_remove,
};
module_platform_driver(mchp_pdmc_driver);