Thread (91 messages) 91 messages, 15 authors, 2023-11-13

Re: [PATCH v3 07/42] soc: Add SoC driver for Cirrus ep93xx

From: Andy Shevchenko <hidden>
Date: 2023-11-13 10:20:39
Also in: alsa-devel, dmaengine, linux-clk, linux-devicetree, linux-gpio, linux-ide, linux-input, linux-pm, linux-pwm, linux-rtc, linux-spi, linux-watchdog, lkml

On Sat, Nov 11, 2023 at 11:33 PM Alexander Sverdlin
[off-list ref] wrote:
On Fri, 2023-07-21 at 17:13 +0300, Andy Shevchenko wrote:
...
quoted
quoted
+       spin_lock_irqsave(&ep93xx_swlock, flags);
+
+       regmap_read(map, EP93XX_SYSCON_DEVCFG, &val);
+       val &= ~clear_bits;
+       val |= set_bits;
+       regmap_write(map, EP93XX_SYSCON_SWLOCK, EP93XX_SWLOCK_MAGICK);
+       regmap_write(map, EP93XX_SYSCON_DEVCFG, val);
Is this sequence a must?
I.o.w. can you first supply magic and then update devcfg?
quoted
+       spin_unlock_irqrestore(&ep93xx_swlock, flags);
...
quoted
quoted
+void ep93xx_swlocked_update_bits(struct regmap *map, unsigned int reg,
+                                unsigned int mask, unsigned int val)
quoted
Same Q as above.
EP93xx User Manual [1] has most verbose description of SWLock for ADC
block:
"Writing 0xAA to this register will unlock all locked registers until the
next block access. The ARM lock instruction prefix should be used for the
two consequtive write cycles when writing to locked chip registers."

One may conclude that RmW (two accesses to the particular block) sequence
is not appropriate.
It's not obvious to me. The terms "block access" and "block cycle"
occur only once in the very same section that describes ADCSWLock. The
meaning of these terms is not fully understandable. So, assuming that
you have tried it differently and it indeed doesn't work, let's go
with this one.
[1] https://cdn.embeddedts.com/resource-attachments/ts-7000_ep9301-ug.pdf


--
With Best Regards,
Andy Shevchenko
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help