diff options
author | Daniel Mack <zonque@gmail.com> | 2012-04-24 13:31:24 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-04-24 14:16:18 -0400 |
commit | 07a5e9d4fd0218e9243875c87f85287a2a3b38c0 (patch) | |
tree | 9e929a0663e0d72801b22f3f9c2a24c42016b97a /sound | |
parent | e9f66d9b9ce03f74a52894cebedf12b67f65dd24 (diff) |
ALSA: snd-usb: fix some typos in endpoint.c documentation
Also be more specific about some details while at it.
Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/usb/endpoint.c | 58 |
1 files changed, 33 insertions, 25 deletions
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index 83a36d0d2a2d..e6906901debb 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c | |||
@@ -40,25 +40,26 @@ | |||
40 | * USB endpoint and its streaming. | 40 | * USB endpoint and its streaming. |
41 | * | 41 | * |
42 | * There are functions to activate and deactivate the streaming URBs and | 42 | * There are functions to activate and deactivate the streaming URBs and |
43 | * optinal callbacks to let the pcm logic handle the actual content of the | 43 | * optional callbacks to let the pcm logic handle the actual content of the |
44 | * packets for playback and record. Thus, the bus streaming and the audio | 44 | * packets for playback and record. Thus, the bus streaming and the audio |
45 | * handlers are fully decoupled. | 45 | * handlers are fully decoupled. |
46 | * | 46 | * |
47 | * There are two different types of endpoints in for audio applications. | 47 | * There are two different types of endpoints in audio applications. |
48 | * | 48 | * |
49 | * SND_USB_ENDPOINT_TYPE_DATA handles full audio data payload for both | 49 | * SND_USB_ENDPOINT_TYPE_DATA handles full audio data payload for both |
50 | * inbound and outbound traffic. | 50 | * inbound and outbound traffic. |
51 | * | 51 | * |
52 | * SND_USB_ENDPOINT_TYPE_SYNC are for inbound traffic only and expect the | 52 | * SND_USB_ENDPOINT_TYPE_SYNC endpoints are for inbound traffic only and |
53 | * payload to carry Q16.16 formatted sync information (3 or 4 bytes). | 53 | * expect the payload to carry Q10.14 / Q16.16 formatted sync information |
54 | * (3 or 4 bytes). | ||
54 | * | 55 | * |
55 | * Each endpoint has to be configured (by calling | 56 | * Each endpoint has to be configured prior to being used by calling |
56 | * snd_usb_endpoint_set_params()) before it can be used. | 57 | * snd_usb_endpoint_set_params(). |
57 | * | 58 | * |
58 | * The model incorporates a reference counting, so that multiple users | 59 | * The model incorporates a reference counting, so that multiple users |
59 | * can call snd_usb_endpoint_start() and snd_usb_endpoint_stop(), and | 60 | * can call snd_usb_endpoint_start() and snd_usb_endpoint_stop(), and |
60 | * only the first user will effectively start the URBs, and only the last | 61 | * only the first user will effectively start the URBs, and only the last |
61 | * one will tear them down again. | 62 | * one to stop it will tear the URBs down again. |
62 | */ | 63 | */ |
63 | 64 | ||
64 | /* | 65 | /* |
@@ -120,7 +121,7 @@ static const char *usb_error_string(int err) | |||
120 | /** | 121 | /** |
121 | * snd_usb_endpoint_implicit_feedback_sink: Report endpoint usage type | 122 | * snd_usb_endpoint_implicit_feedback_sink: Report endpoint usage type |
122 | * | 123 | * |
123 | * @ep: The endpoint | 124 | * @ep: The snd_usb_endpoint |
124 | * | 125 | * |
125 | * Determine whether an endpoint is driven by an implicit feedback | 126 | * Determine whether an endpoint is driven by an implicit feedback |
126 | * data endpoint source. | 127 | * data endpoint source. |
@@ -278,17 +279,18 @@ static inline void prepare_inbound_urb(struct snd_usb_endpoint *ep, | |||
278 | } | 279 | } |
279 | 280 | ||
280 | /* | 281 | /* |
281 | * Send output urbs that have been prepared previously. Urbs are dequeued | 282 | * Send output urbs that have been prepared previously. URBs are dequeued |
282 | * from ep->ready_playback_urbs and in case there there aren't any available | 283 | * from ep->ready_playback_urbs and in case there there aren't any available |
283 | * or there are no packets that have been prepared, this function does | 284 | * or there are no packets that have been prepared, this function does |
284 | * nothing. | 285 | * nothing. |
285 | * | 286 | * |
286 | * The reason why the functionality of sending and preparing urbs is separated | 287 | * The reason why the functionality of sending and preparing URBs is separated |
287 | * is that host controllers don't guarantee an ordering in returing inbound | 288 | * is that host controllers don't guarantee the order in which they return |
288 | * and outbound packets to their submitters. | 289 | * inbound and outbound packets to their submitters. |
289 | * | 290 | * |
290 | * This function is only used for implicit feedback endpoints. For endpoints | 291 | * This function is only used for implicit feedback endpoints. For endpoints |
291 | * driven by sync endpoints, urbs are submitted from their completion handler. | 292 | * driven by dedicated sync endpoints, URBs are immediately re-submitted |
293 | * from their completion handler. | ||
292 | */ | 294 | */ |
293 | static void queue_pending_output_urbs(struct snd_usb_endpoint *ep) | 295 | static void queue_pending_output_urbs(struct snd_usb_endpoint *ep) |
294 | { | 296 | { |
@@ -391,7 +393,7 @@ exit_clear: | |||
391 | } | 393 | } |
392 | 394 | ||
393 | /** | 395 | /** |
394 | * snd_usb_add_endpoint: Add an endpoint to an audio chip | 396 | * snd_usb_add_endpoint: Add an endpoint to an USB audio chip |
395 | * | 397 | * |
396 | * @chip: The chip | 398 | * @chip: The chip |
397 | * @alts: The USB host interface | 399 | * @alts: The USB host interface |
@@ -745,11 +747,14 @@ out_of_memory: | |||
745 | } | 747 | } |
746 | 748 | ||
747 | /** | 749 | /** |
748 | * snd_usb_endpoint_set_params: configure an snd_endpoint | 750 | * snd_usb_endpoint_set_params: configure an snd_usb_endpoint |
749 | * | 751 | * |
750 | * @ep: the endpoint to configure | 752 | * @ep: the snd_usb_endpoint to configure |
753 | * @hw_params: the hardware parameters | ||
754 | * @fmt: the USB audio format information | ||
755 | * @sync_ep: the sync endpoint to use, if any | ||
751 | * | 756 | * |
752 | * Determine the number of of URBs to be used on this endpoint. | 757 | * Determine the number of URBs to be used on this endpoint. |
753 | * An endpoint must be configured before it can be started. | 758 | * An endpoint must be configured before it can be started. |
754 | * An endpoint that is already running can not be reconfigured. | 759 | * An endpoint that is already running can not be reconfigured. |
755 | */ | 760 | */ |
@@ -807,7 +812,7 @@ int snd_usb_endpoint_set_params(struct snd_usb_endpoint *ep, | |||
807 | * @ep: the endpoint to start | 812 | * @ep: the endpoint to start |
808 | * | 813 | * |
809 | * A call to this function will increment the use count of the endpoint. | 814 | * A call to this function will increment the use count of the endpoint. |
810 | * In case this not already running, the URBs for this endpoint will be | 815 | * In case it is not already running, the URBs for this endpoint will be |
811 | * submitted. Otherwise, this function does nothing. | 816 | * submitted. Otherwise, this function does nothing. |
812 | * | 817 | * |
813 | * Must be balanced to calls of snd_usb_endpoint_stop(). | 818 | * Must be balanced to calls of snd_usb_endpoint_stop(). |
@@ -840,7 +845,8 @@ int snd_usb_endpoint_start(struct snd_usb_endpoint *ep) | |||
840 | /* | 845 | /* |
841 | * If this endpoint has a data endpoint as implicit feedback source, | 846 | * If this endpoint has a data endpoint as implicit feedback source, |
842 | * don't start the urbs here. Instead, mark them all as available, | 847 | * don't start the urbs here. Instead, mark them all as available, |
843 | * wait for the record urbs to arrive and queue from that context. | 848 | * wait for the record urbs to return and queue the playback urbs |
849 | * from that context. | ||
844 | */ | 850 | */ |
845 | 851 | ||
846 | set_bit(EP_FLAG_RUNNING, &ep->flags); | 852 | set_bit(EP_FLAG_RUNNING, &ep->flags); |
@@ -892,7 +898,7 @@ __error: | |||
892 | * | 898 | * |
893 | * A call to this function will decrement the use count of the endpoint. | 899 | * A call to this function will decrement the use count of the endpoint. |
894 | * In case the last user has requested the endpoint stop, the URBs will | 900 | * In case the last user has requested the endpoint stop, the URBs will |
895 | * actually deactivated. | 901 | * actually be deactivated. |
896 | * | 902 | * |
897 | * Must be balanced to calls of snd_usb_endpoint_start(). | 903 | * Must be balanced to calls of snd_usb_endpoint_start(). |
898 | */ | 904 | */ |
@@ -994,7 +1000,8 @@ int snd_usb_endpoint_deactivate(struct snd_usb_endpoint *ep) | |||
994 | return -EBUSY; | 1000 | return -EBUSY; |
995 | } | 1001 | } |
996 | 1002 | ||
997 | /** snd_usb_endpoint_free: Free the resources of an snd_usb_endpoint | 1003 | /** |
1004 | * snd_usb_endpoint_free: Free the resources of an snd_usb_endpoint | ||
998 | * | 1005 | * |
999 | * @ep: the list header of the endpoint to free | 1006 | * @ep: the list header of the endpoint to free |
1000 | * | 1007 | * |
@@ -1032,8 +1039,9 @@ void snd_usb_handle_sync_urb(struct snd_usb_endpoint *ep, | |||
1032 | 1039 | ||
1033 | /* | 1040 | /* |
1034 | * In case the endpoint is operating in implicit feedback mode, prepare | 1041 | * In case the endpoint is operating in implicit feedback mode, prepare |
1035 | * and a new outbound URB that has the same layout as the received | 1042 | * a new outbound URB that has the same layout as the received packet |
1036 | * packet and add it to the list of pending urbs. | 1043 | * and add it to the list of pending urbs. queue_pending_output_urbs() |
1044 | * will take care of them later. | ||
1037 | */ | 1045 | */ |
1038 | if (snd_usb_endpoint_implict_feedback_sink(ep) && | 1046 | if (snd_usb_endpoint_implict_feedback_sink(ep) && |
1039 | ep->use_count != 0) { | 1047 | ep->use_count != 0) { |
@@ -1063,8 +1071,8 @@ void snd_usb_handle_sync_urb(struct snd_usb_endpoint *ep, | |||
1063 | /* | 1071 | /* |
1064 | * Iterate through the inbound packet and prepare the lengths | 1072 | * Iterate through the inbound packet and prepare the lengths |
1065 | * for the output packet. The OUT packet we are about to send | 1073 | * for the output packet. The OUT packet we are about to send |
1066 | * will have the same amount of payload than the IN packet we | 1074 | * will have the same amount of payload bytes than the IN |
1067 | * just received. | 1075 | * packet we just received. |
1068 | */ | 1076 | */ |
1069 | 1077 | ||
1070 | out_packet->packets = in_ctx->packets; | 1078 | out_packet->packets = in_ctx->packets; |