@@ -758,8 +758,7 @@ bool snd_usb_endpoint_compatible(struct snd_usb_audio *chip,
758
758
* The endpoint needs to be closed via snd_usb_endpoint_close() later.
759
759
*
760
760
* Note that this function doesn't configure the endpoint. The substream
761
- * needs to set it up later via snd_usb_endpoint_set_params() and
762
- * snd_usb_endpoint_prepare().
761
+ * needs to set it up later via snd_usb_endpoint_configure().
763
762
*/
764
763
struct snd_usb_endpoint *
765
764
snd_usb_endpoint_open (struct snd_usb_audio * chip ,
@@ -1293,13 +1292,12 @@ static int sync_ep_set_params(struct snd_usb_endpoint *ep)
1293
1292
/*
1294
1293
* snd_usb_endpoint_set_params: configure an snd_usb_endpoint
1295
1294
*
1296
- * It's called either from hw_params callback.
1297
1295
* Determine the number of URBs to be used on this endpoint.
1298
1296
* An endpoint must be configured before it can be started.
1299
1297
* An endpoint that is already running can not be reconfigured.
1300
1298
*/
1301
- int snd_usb_endpoint_set_params (struct snd_usb_audio * chip ,
1302
- struct snd_usb_endpoint * ep )
1299
+ static int snd_usb_endpoint_set_params (struct snd_usb_audio * chip ,
1300
+ struct snd_usb_endpoint * ep )
1303
1301
{
1304
1302
const struct audioformat * fmt = ep -> cur_audiofmt ;
1305
1303
int err ;
@@ -1382,18 +1380,18 @@ static int init_sample_rate(struct snd_usb_audio *chip,
1382
1380
}
1383
1381
1384
1382
/*
1385
- * snd_usb_endpoint_prepare: Prepare the endpoint
1383
+ * snd_usb_endpoint_configure: Configure the endpoint
1386
1384
*
1387
1385
* This function sets up the EP to be fully usable state.
1388
- * It's called either from prepare callback.
1386
+ * It's called either from hw_params or prepare callback.
1389
1387
* The function checks need_setup flag, and performs nothing unless needed,
1390
1388
* so it's safe to call this multiple times.
1391
1389
*
1392
1390
* This returns zero if unchanged, 1 if the configuration has changed,
1393
1391
* or a negative error code.
1394
1392
*/
1395
- int snd_usb_endpoint_prepare (struct snd_usb_audio * chip ,
1396
- struct snd_usb_endpoint * ep )
1393
+ int snd_usb_endpoint_configure (struct snd_usb_audio * chip ,
1394
+ struct snd_usb_endpoint * ep )
1397
1395
{
1398
1396
bool iface_first ;
1399
1397
int err = 0 ;
@@ -1414,6 +1412,9 @@ int snd_usb_endpoint_prepare(struct snd_usb_audio *chip,
1414
1412
if (err < 0 )
1415
1413
goto unlock ;
1416
1414
}
1415
+ err = snd_usb_endpoint_set_params (chip , ep );
1416
+ if (err < 0 )
1417
+ goto unlock ;
1417
1418
goto done ;
1418
1419
}
1419
1420
@@ -1441,6 +1442,10 @@ int snd_usb_endpoint_prepare(struct snd_usb_audio *chip,
1441
1442
if (err < 0 )
1442
1443
goto unlock ;
1443
1444
1445
+ err = snd_usb_endpoint_set_params (chip , ep );
1446
+ if (err < 0 )
1447
+ goto unlock ;
1448
+
1444
1449
err = snd_usb_select_mode_quirk (chip , ep -> cur_audiofmt );
1445
1450
if (err < 0 )
1446
1451
goto unlock ;
0 commit comments