Skip to content

Commit 2a6c7e8

Browse files
peda-rvinodkoul
authored andcommitted
dmaengine: at_hdmac: Repair bitfield macros for peripheral ID handling
The MSB part of the peripheral IDs need to go into the ATC_SRC_PER_MSB and ATC_DST_PER_MSB fields. Not the LSB part. This fixes a severe regression for TSE-850 devices (compatible axentia,tse850v3) where output to the audio I2S codec (the main purpose of the device) simply do not work. Fixes: d8840a7 ("dmaengine: at_hdmac: Use bitfield access macros") Cc: [email protected] Signed-off-by: Peter Rosin <[email protected]> Reviewed-by: Tudor Ambarus <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent a1a5f2c commit 2a6c7e8

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

drivers/dma/at_hdmac.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,6 @@
153153
#define ATC_AUTO BIT(31) /* Auto multiple buffer tx enable */
154154

155155
/* Bitfields in CFG */
156-
#define ATC_PER_MSB(h) ((0x30U & (h)) >> 4) /* Extract most significant bits of a handshaking identifier */
157-
158156
#define ATC_SRC_PER GENMASK(3, 0) /* Channel src rq associated with periph handshaking ifc h */
159157
#define ATC_DST_PER GENMASK(7, 4) /* Channel dst rq associated with periph handshaking ifc h */
160158
#define ATC_SRC_REP BIT(8) /* Source Replay Mod */
@@ -181,10 +179,15 @@
181179
#define ATC_DPIP_HOLE GENMASK(15, 0)
182180
#define ATC_DPIP_BOUNDARY GENMASK(25, 16)
183181

184-
#define ATC_SRC_PER_ID(id) (FIELD_PREP(ATC_SRC_PER_MSB, (id)) | \
185-
FIELD_PREP(ATC_SRC_PER, (id)))
186-
#define ATC_DST_PER_ID(id) (FIELD_PREP(ATC_DST_PER_MSB, (id)) | \
187-
FIELD_PREP(ATC_DST_PER, (id)))
182+
#define ATC_PER_MSB GENMASK(5, 4) /* Extract MSBs of a handshaking identifier */
183+
#define ATC_SRC_PER_ID(id) \
184+
({ typeof(id) _id = (id); \
185+
FIELD_PREP(ATC_SRC_PER_MSB, FIELD_GET(ATC_PER_MSB, _id)) | \
186+
FIELD_PREP(ATC_SRC_PER, _id); })
187+
#define ATC_DST_PER_ID(id) \
188+
({ typeof(id) _id = (id); \
189+
FIELD_PREP(ATC_DST_PER_MSB, FIELD_GET(ATC_PER_MSB, _id)) | \
190+
FIELD_PREP(ATC_DST_PER, _id); })
188191

189192

190193

0 commit comments

Comments
 (0)