ASoC: atmel: Mark interrupt registers as volatile
v2 cover ASoC: atmel: Mark interrupt registers as volatile
From: bui duc phuc <[email protected]>
Hi all,
This series marks the interrupt mask and status registers as volatile in the PDMC and SPDIFTX drivers to ensure they are read from hardware.
Link v1:
https://lore.kernel.org/all/[email protected]/
Change in v2:
- Update the Fixes tag based on Sashiko's review.
Compile-tested only.
Best regards,
Phuc
bui duc phuc (2):
ASoC: atmel: mchp-pdmc: Mark IMR as volatile
ASoC: atmel: mchp-spdiftx: Mark interrupt registers as volatile
sound/soc/atmel/mchp-pdmc.c | 1 + sound/soc/atmel/mchp-spdiftx.c | 12 ++++++++++++ 2 files changed, 13 insertions(+)
Signature · 1 line
2.43.0
PATCH v2 1/2 ASoC: atmel: mchp-pdmc: Mark IMR as volatile
From: bui duc phuc <[email protected]>
The interrupt handler reads ISR and IMR to determine which interrupts are pending. While ISR is marked as volatile, IMR is not, causing regmap to return its cached value instead of reading the hardware.
Add IMR to the volatile registers.
---
Change in v2:
- Update the Fixes tag based on Sashiko's review.
sound/soc/atmel/mchp-pdmc.c | 1 + 1 file changed, 1 insertion(+)
sound/soc/atmel/mchp-pdmc.c +1 -0
@@ -842,6 +842,7 @@ static bool mchp_pdmc_volatile_reg(struct device *dev, unsigned int reg) {switch (reg) {case MCHP_PDMC_ISR : +case MCHP_PDMC_IMR :case MCHP_PDMC_RHR :return true;default :
Signature · 1 line
2.43.0
PATCH v2 2/2 ASoC: atmel: mchp-spdiftx: Mark interrupt registers as volatile
In reply to [email protected]From: bui duc phuc <[email protected]>
The interrupt handler reads ISR and IMR to determine which interrupts are pending. Neither register is marked as volatile, causing regmap to return cached values instead of reading the hardware.
Add a volatile_reg callback marking IMR and ISR as volatile.
---
Change in v2:
- Update the Fixes tag based on Sashiko's review.
sound/soc/atmel/mchp-spdiftx.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
sound/soc/atmel/mchp-spdiftx.c +12 -0
@@ -165,6 +165,17 @@ static bool mchp_spdiftx_precious_reg(struct device *dev, unsigned int reg) } } +static bool mchp_spdiftx_volatile_reg (struct device *dev,unsigned int reg) +{ +switch (reg) { +case SPDIFTX_IMR : +case SPDIFTX_ISR : +return true; +default : +return false; + } +} +static const struct regmap_config mchp_spdiftx_regmap_config = { .reg_bits =32 , .reg_stride =4 ,
@@ -173,6 +184,7 @@ static const struct regmap_config mchp_spdiftx_regmap_config = { .readable_reg = mchp_spdiftx_readable_reg, .writeable_reg = mchp_spdiftx_writeable_reg, .precious_reg = mchp_spdiftx_precious_reg, + .volatile_reg = mchp_spdiftx_volatile_reg, .cache_type = REGCACHE_FLAT, };
Signature · 1 line
2.43.0