@@ -1236,7 +1236,7 @@ EXPORT_SYMBOL(sdw_cdns_enable_interrupt);
1236
1236
1237
1237
static int cdns_allocate_pdi (struct sdw_cdns * cdns ,
1238
1238
struct sdw_cdns_pdi * * stream ,
1239
- u32 num , u32 pdi_offset )
1239
+ u32 num )
1240
1240
{
1241
1241
struct sdw_cdns_pdi * pdi ;
1242
1242
int i ;
@@ -1249,7 +1249,7 @@ static int cdns_allocate_pdi(struct sdw_cdns *cdns,
1249
1249
return - ENOMEM ;
1250
1250
1251
1251
for (i = 0 ; i < num ; i ++ ) {
1252
- pdi [i ].num = i + pdi_offset ;
1252
+ pdi [i ].num = i ;
1253
1253
}
1254
1254
1255
1255
* stream = pdi ;
@@ -1266,7 +1266,6 @@ int sdw_cdns_pdi_init(struct sdw_cdns *cdns,
1266
1266
struct sdw_cdns_stream_config config )
1267
1267
{
1268
1268
struct sdw_cdns_streams * stream ;
1269
- int offset ;
1270
1269
int ret ;
1271
1270
1272
1271
cdns -> pcm .num_bd = config .pcm_bd ;
@@ -1277,24 +1276,15 @@ int sdw_cdns_pdi_init(struct sdw_cdns *cdns,
1277
1276
stream = & cdns -> pcm ;
1278
1277
1279
1278
/* we allocate PDI0 and PDI1 which are used for Bulk */
1280
- offset = 0 ;
1281
-
1282
- ret = cdns_allocate_pdi (cdns , & stream -> bd ,
1283
- stream -> num_bd , offset );
1279
+ ret = cdns_allocate_pdi (cdns , & stream -> bd , stream -> num_bd );
1284
1280
if (ret )
1285
1281
return ret ;
1286
1282
1287
- offset += stream -> num_bd ;
1288
-
1289
- ret = cdns_allocate_pdi (cdns , & stream -> in ,
1290
- stream -> num_in , offset );
1283
+ ret = cdns_allocate_pdi (cdns , & stream -> in , stream -> num_in );
1291
1284
if (ret )
1292
1285
return ret ;
1293
1286
1294
- offset += stream -> num_in ;
1295
-
1296
- ret = cdns_allocate_pdi (cdns , & stream -> out ,
1297
- stream -> num_out , offset );
1287
+ ret = cdns_allocate_pdi (cdns , & stream -> out , stream -> num_out );
1298
1288
if (ret )
1299
1289
return ret ;
1300
1290
@@ -1802,7 +1792,6 @@ EXPORT_SYMBOL(cdns_set_sdw_stream);
1802
1792
* cdns_find_pdi() - Find a free PDI
1803
1793
*
1804
1794
* @cdns: Cadence instance
1805
- * @offset: Starting offset
1806
1795
* @num: Number of PDIs
1807
1796
* @pdi: PDI instances
1808
1797
* @dai_id: DAI id
@@ -1811,14 +1800,13 @@ EXPORT_SYMBOL(cdns_set_sdw_stream);
1811
1800
* expected to match, return NULL otherwise.
1812
1801
*/
1813
1802
static struct sdw_cdns_pdi * cdns_find_pdi (struct sdw_cdns * cdns ,
1814
- unsigned int offset ,
1815
1803
unsigned int num ,
1816
1804
struct sdw_cdns_pdi * pdi ,
1817
1805
int dai_id )
1818
1806
{
1819
1807
int i ;
1820
1808
1821
- for (i = offset ; i < offset + num ; i ++ )
1809
+ for (i = 0 ; i < num ; i ++ )
1822
1810
if (pdi [i ].num == dai_id )
1823
1811
return & pdi [i ];
1824
1812
@@ -1872,15 +1860,15 @@ struct sdw_cdns_pdi *sdw_cdns_alloc_pdi(struct sdw_cdns *cdns,
1872
1860
struct sdw_cdns_pdi * pdi = NULL ;
1873
1861
1874
1862
if (dir == SDW_DATA_DIR_RX )
1875
- pdi = cdns_find_pdi (cdns , 0 , stream -> num_in , stream -> in ,
1863
+ pdi = cdns_find_pdi (cdns , stream -> num_in , stream -> in ,
1876
1864
dai_id );
1877
1865
else
1878
- pdi = cdns_find_pdi (cdns , 0 , stream -> num_out , stream -> out ,
1866
+ pdi = cdns_find_pdi (cdns , stream -> num_out , stream -> out ,
1879
1867
dai_id );
1880
1868
1881
1869
/* check if we found a PDI, else find in bi-directional */
1882
1870
if (!pdi )
1883
- pdi = cdns_find_pdi (cdns , 0 , stream -> num_bd , stream -> bd ,
1871
+ pdi = cdns_find_pdi (cdns , stream -> num_bd , stream -> bd ,
1884
1872
dai_id );
1885
1873
1886
1874
if (pdi ) {
0 commit comments