@@ -45,7 +45,7 @@ struct dma_siwx91x_data {
45
45
*/
46
46
};
47
47
48
- static inline int siwx91x_dma_is_peripheral_request (uint32_t dir )
48
+ static int siwx91x_is_peripheral_request (uint32_t dir )
49
49
{
50
50
if (dir == MEMORY_TO_MEMORY ) {
51
51
return 0 ;
@@ -58,7 +58,7 @@ static inline int siwx91x_dma_is_peripheral_request(uint32_t dir)
58
58
return -1 ;
59
59
}
60
60
61
- static inline int siwx91x_dma_data_width (uint32_t data_width )
61
+ static int siwx91x_data_width (uint32_t data_width )
62
62
{
63
63
switch (data_width ) {
64
64
case 1 :
@@ -72,7 +72,7 @@ static inline int siwx91x_dma_data_width(uint32_t data_width)
72
72
}
73
73
}
74
74
75
- static inline int siwx91x_dma_burst_length (uint32_t blen )
75
+ static int siwx91x_burst_length (uint32_t blen )
76
76
{
77
77
switch (blen / 8 ) {
78
78
case 1 :
@@ -82,7 +82,7 @@ static inline int siwx91x_dma_burst_length(uint32_t blen)
82
82
}
83
83
}
84
84
85
- static inline int siwx91x_dma_addr_adjustment (uint32_t adjustment )
85
+ static int siwx91x_addr_adjustment (uint32_t adjustment )
86
86
{
87
87
switch (adjustment ) {
88
88
case 0 :
@@ -94,9 +94,9 @@ static inline int siwx91x_dma_addr_adjustment(uint32_t adjustment)
94
94
}
95
95
}
96
96
97
- static int dma_channel_config (const struct device * dev , RSI_UDMA_HANDLE_T udma_handle ,
98
- uint32_t channel , const struct dma_config * config ,
99
- UDMA_Channel_Info * channel_info )
97
+ static int siwx91x_channel_config (const struct device * dev , RSI_UDMA_HANDLE_T udma_handle ,
98
+ uint32_t channel , const struct dma_config * config ,
99
+ UDMA_Channel_Info * channel_info )
100
100
{
101
101
uint32_t dma_transfer_num = config -> head_block -> block_size / config -> source_data_size ;
102
102
const struct dma_siwx91x_config * cfg = dev -> config ;
@@ -112,12 +112,12 @@ static int dma_channel_config(const struct device *dev, RSI_UDMA_HANDLE_T udma_h
112
112
RSI_UDMA_CHA_CFG_T channel_config = {};
113
113
int status ;
114
114
115
- if (siwx91x_dma_is_peripheral_request (config -> channel_direction ) < 0 ) {
115
+ if (siwx91x_is_peripheral_request (config -> channel_direction ) < 0 ) {
116
116
return - EINVAL ;
117
117
}
118
118
119
119
channel_config .channelPrioHigh = config -> channel_priority ;
120
- channel_config .periphReq = siwx91x_dma_is_peripheral_request (config -> channel_direction );
120
+ channel_config .periphReq = siwx91x_is_peripheral_request (config -> channel_direction );
121
121
channel_config .dmaCh = channel ;
122
122
123
123
if (channel_config .periphReq ) {
@@ -136,29 +136,29 @@ static int dma_channel_config(const struct device *dev, RSI_UDMA_HANDLE_T udma_h
136
136
channel_control .totalNumOfDMATrans = dma_transfer_num ;
137
137
}
138
138
139
- if (siwx91x_dma_data_width (config -> source_data_size ) < 0 ||
140
- siwx91x_dma_data_width (config -> dest_data_size ) < 0 ) {
139
+ if (siwx91x_data_width (config -> source_data_size ) < 0 ||
140
+ siwx91x_data_width (config -> dest_data_size ) < 0 ) {
141
141
return - EINVAL ;
142
142
}
143
- if (siwx91x_dma_burst_length (config -> source_burst_length ) < 0 ||
144
- siwx91x_dma_burst_length (config -> dest_burst_length ) < 0 ) {
143
+ if (siwx91x_burst_length (config -> source_burst_length ) < 0 ||
144
+ siwx91x_burst_length (config -> dest_burst_length ) < 0 ) {
145
145
return - EINVAL ;
146
146
}
147
147
148
- channel_control .srcSize = siwx91x_dma_data_width (config -> source_data_size );
149
- channel_control .dstSize = siwx91x_dma_data_width (config -> dest_data_size );
150
- if (siwx91x_dma_addr_adjustment (config -> head_block -> source_addr_adj ) < 0 ||
151
- siwx91x_dma_addr_adjustment (config -> head_block -> dest_addr_adj ) < 0 ) {
148
+ channel_control .srcSize = siwx91x_data_width (config -> source_data_size );
149
+ channel_control .dstSize = siwx91x_data_width (config -> dest_data_size );
150
+ if (siwx91x_addr_adjustment (config -> head_block -> source_addr_adj ) < 0 ||
151
+ siwx91x_addr_adjustment (config -> head_block -> dest_addr_adj ) < 0 ) {
152
152
return - EINVAL ;
153
153
}
154
154
155
- if (siwx91x_dma_addr_adjustment (config -> head_block -> source_addr_adj ) == 0 ) {
155
+ if (siwx91x_addr_adjustment (config -> head_block -> source_addr_adj ) == 0 ) {
156
156
channel_control .srcInc = channel_control .srcSize ;
157
157
} else {
158
158
channel_control .srcInc = UDMA_SRC_INC_NONE ;
159
159
}
160
160
161
- if (siwx91x_dma_addr_adjustment (config -> head_block -> dest_addr_adj ) == 0 ) {
161
+ if (siwx91x_addr_adjustment (config -> head_block -> dest_addr_adj ) == 0 ) {
162
162
channel_control .dstInc = channel_control .dstSize ;
163
163
} else {
164
164
channel_control .dstInc = UDMA_DST_INC_NONE ;
@@ -178,7 +178,7 @@ static int dma_channel_config(const struct device *dev, RSI_UDMA_HANDLE_T udma_h
178
178
}
179
179
180
180
/* Function to configure UDMA channel for transfer */
181
- static int dma_siwx91x_configure (const struct device * dev , uint32_t channel ,
181
+ static int siwx91x_dma_configure (const struct device * dev , uint32_t channel ,
182
182
struct dma_config * config )
183
183
{
184
184
const struct dma_siwx91x_config * cfg = dev -> config ;
@@ -202,7 +202,7 @@ static int dma_siwx91x_configure(const struct device *dev, uint32_t channel,
202
202
}
203
203
204
204
/* Configure dma channel for transfer */
205
- status = dma_channel_config (dev , udma_handle , channel , config , data -> chan_info );
205
+ status = siwx91x_channel_config (dev , udma_handle , channel , config , data -> chan_info );
206
206
if (status ) {
207
207
return status ;
208
208
}
@@ -214,7 +214,7 @@ static int dma_siwx91x_configure(const struct device *dev, uint32_t channel,
214
214
}
215
215
216
216
/* Function to reload UDMA channel for new transfer */
217
- static int dma_siwx91x_reload (const struct device * dev , uint32_t channel , uint32_t src ,
217
+ static int siwx91x_dma_reload (const struct device * dev , uint32_t channel , uint32_t src ,
218
218
uint32_t dst , size_t size )
219
219
{
220
220
const struct dma_siwx91x_config * cfg = dev -> config ;
@@ -269,7 +269,7 @@ static int dma_siwx91x_reload(const struct device *dev, uint32_t channel, uint32
269
269
}
270
270
271
271
/* Function to start a DMA transfer */
272
- static int dma_siwx91x_start (const struct device * dev , uint32_t channel )
272
+ static int siwx91x_dma_start (const struct device * dev , uint32_t channel )
273
273
{
274
274
const struct dma_siwx91x_config * cfg = dev -> config ;
275
275
RSI_UDMA_DESC_T * udma_table = cfg -> sram_desc_addr ;
@@ -296,7 +296,7 @@ static int dma_siwx91x_start(const struct device *dev, uint32_t channel)
296
296
}
297
297
298
298
/* Function to stop a DMA transfer */
299
- static int dma_siwx91x_stop (const struct device * dev , uint32_t channel )
299
+ static int siwx91x_dma_stop (const struct device * dev , uint32_t channel )
300
300
{
301
301
const struct dma_siwx91x_config * cfg = dev -> config ;
302
302
struct dma_siwx91x_data * data = dev -> data ;
@@ -315,7 +315,7 @@ static int dma_siwx91x_stop(const struct device *dev, uint32_t channel)
315
315
}
316
316
317
317
/* Function to fetch DMA channel status */
318
- static int dma_siwx91x_get_status (const struct device * dev , uint32_t channel ,
318
+ static int siwx91x_dma_get_status (const struct device * dev , uint32_t channel ,
319
319
struct dma_status * stat )
320
320
{
321
321
const struct dma_siwx91x_config * cfg = dev -> config ;
@@ -342,7 +342,7 @@ static int dma_siwx91x_get_status(const struct device *dev, uint32_t channel,
342
342
}
343
343
344
344
/* Function to initialize DMA peripheral */
345
- static int dma_siwx91x_init (const struct device * dev )
345
+ static int siwx91x_dma_init (const struct device * dev )
346
346
{
347
347
const struct dma_siwx91x_config * cfg = dev -> config ;
348
348
struct dma_siwx91x_data * data = dev -> data ;
@@ -375,7 +375,7 @@ static int dma_siwx91x_init(const struct device *dev)
375
375
return 0 ;
376
376
}
377
377
378
- static void dma_siwx91x_isr (const struct device * dev )
378
+ static void siwx91x_dma_isr (const struct device * dev )
379
379
{
380
380
const struct dma_siwx91x_config * cfg = dev -> config ;
381
381
struct dma_siwx91x_data * data = dev -> data ;
@@ -424,11 +424,11 @@ static void dma_siwx91x_isr(const struct device *dev)
424
424
425
425
/* Store the Si91x DMA APIs */
426
426
static DEVICE_API (dma , siwx91x_dma_api ) = {
427
- .config = dma_siwx91x_configure ,
428
- .reload = dma_siwx91x_reload ,
429
- .start = dma_siwx91x_start ,
430
- .stop = dma_siwx91x_stop ,
431
- .get_status = dma_siwx91x_get_status ,
427
+ .config = siwx91x_dma_configure ,
428
+ .reload = siwx91x_dma_reload ,
429
+ .start = siwx91x_dma_start ,
430
+ .stop = siwx91x_dma_stop ,
431
+ .get_status = siwx91x_dma_get_status ,
432
432
};
433
433
434
434
#define SIWX91X_DMA_INIT (inst ) \
@@ -438,7 +438,7 @@ static DEVICE_API(dma, siwx91x_dma_api) = {
438
438
}; \
439
439
static void siwx91x_dma##inst##_irq_configure(void) \
440
440
{ \
441
- IRQ_CONNECT(DT_INST_IRQ(inst, irq), DT_INST_IRQ(inst, priority), dma_siwx91x_isr , \
441
+ IRQ_CONNECT(DT_INST_IRQ(inst, irq), DT_INST_IRQ(inst, priority), siwx91x_dma_isr , \
442
442
DEVICE_DT_INST_GET(inst), 0); \
443
443
irq_enable(DT_INST_IRQ(inst, irq)); \
444
444
} \
@@ -451,7 +451,7 @@ static DEVICE_API(dma, siwx91x_dma_api) = {
451
451
.sram_desc_addr = (RSI_UDMA_DESC_T *)DT_INST_PROP(inst, silabs_sram_desc_addr), \
452
452
.irq_configure = siwx91x_dma##inst##_irq_configure, \
453
453
}; \
454
- DEVICE_DT_INST_DEFINE(inst, &dma_siwx91x_init , NULL, &dma##inst##_data, &dma##inst##_cfg, \
454
+ DEVICE_DT_INST_DEFINE(inst, &siwx91x_dma_init , NULL, &dma##inst##_data, &dma##inst##_cfg, \
455
455
PRE_KERNEL_1, CONFIG_DMA_INIT_PRIORITY, &siwx91x_dma_api);
456
456
457
457
DT_INST_FOREACH_STATUS_OKAY (SIWX91X_DMA_INIT )
0 commit comments