<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/usb/gadget/function/f_uac2.c, branch linux-4.0.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.0.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.0.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2015-02-23T15:21:28Z</updated>
<entry>
<title>usb: gadget: function: f_uac2: fix sparse warnings</title>
<updated>2015-02-23T15:21:28Z</updated>
<author>
<name>Lad, Prabhakar</name>
</author>
<published>2015-02-04T18:01:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ef16e7c8ba9cee07d2295de01bbdf921d20c4902'/>
<id>urn:sha1:ef16e7c8ba9cee07d2295de01bbdf921d20c4902</id>
<content type='text'>
this patch fixes following sparse warnings:
f_uac2.c:57:12: warning: symbol 'uac2_name' was not declared. Should it be static?
f_uac2.c:637:36: warning: symbol 'in_clk_src_desc' was not declared. Should it be static?
f_uac2.c:649:36: warning: symbol 'out_clk_src_desc' was not declared. Should it be static?
f_uac2.c:661:39: warning: symbol 'usb_out_it_desc' was not declared. Should it be static?
f_uac2.c:675:39: warning: symbol 'io_in_it_desc' was not declared. Should it be static?
f_uac2.c:689:40: warning: symbol 'usb_in_ot_desc' was not declared. Should it be static?
f_uac2.c:703:40: warning: symbol 'io_out_ot_desc' was not declared. Should it be static?
f_uac2.c:716:34: warning: symbol 'ac_hdr_desc' was not declared. Should it be static?
f_uac2.c:754:34: warning: symbol 'as_out_hdr_desc' was not declared. Should it be static?
f_uac2.c:767:38: warning: symbol 'as_out_fmt1_desc' was not declared. Should it be static?
f_uac2.c:775:32: warning: symbol 'fs_epout_desc' was not declared. Should it be static?
f_uac2.c:785:32: warning: symbol 'hs_epout_desc' was not declared. Should it be static?
f_uac2.c:831:34: warning: symbol 'as_in_hdr_desc' was not declared. Should it be static?
f_uac2.c:844:38: warning: symbol 'as_in_fmt1_desc' was not declared. Should it be static?
f_uac2.c:852:32: warning: symbol 'fs_epin_desc' was not declared. Should it be static?
f_uac2.c:862:32: warning: symbol 'hs_epin_desc' was not declared. Should it be static?
f_uac2.c:1566:21: warning: symbol 'afunc_alloc' was not declared. Should it be static?

Signed-off-by: Lad, Prabhakar &lt;prabhakar.csengg@gmail.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: function: Remove redundant usb_free_all_descriptors</title>
<updated>2014-10-23T18:57:24Z</updated>
<author>
<name>Pavitrakumar Managutte</name>
</author>
<published>2014-10-22T13:54:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d12a8727171c770990c246f0682f0af7859bb245'/>
<id>urn:sha1:d12a8727171c770990c246f0682f0af7859bb245</id>
<content type='text'>
Removed usb_free_all_descriptors in the bind functions, which
results in double-free corruption of the descriptors on error path.
The usb descriptors are allocated by usb_assign_descriptors.

Signed-off-by: Pavitrakumar Managutte &lt;pavitra1729@gmail.com&gt;
Reviewed-by: Robert Baldyga &lt;r.baldyga@samsung.com&gt;
Reviewed-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: function: uac2: add a release method</title>
<updated>2014-10-20T20:58:49Z</updated>
<author>
<name>Felipe Balbi</name>
</author>
<published>2014-09-29T19:24:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=de1e6e799fc4e6f0452737e454267c0bfdf88c62'/>
<id>urn:sha1:de1e6e799fc4e6f0452737e454267c0bfdf88c62</id>
<content type='text'>
devices are required to provide a release method. This
patch fixes the following WARN():

[   42.611159] ------------[ cut here ]------------
[   42.616025] WARNING: CPU: 0 PID: 1453 at drivers/base/core.c:250 device_release+0x94/0xa0()
[   42.624820] Device 'snd_uac2.0' does not have a release() function, it is broken and must be fixed.
[   42.634328] Modules linked in: usb_f_uac2 g_audio(-) libcomposite configfs xhci_hcd snd_soc_davinci_mcasp snd_soc_edma snd_soc_tlv320aic3x snd_soc_omap snd_soc_evm snd_soc_core dwc3 snd_compress omapdrm snd_pcm_dmaengine snd_pcm snd_timer snd fb_sys_fops lis3lv02d_i2c matrix_keypad dwc3_omap lis3lv02d panel_dpi input_polldev soundcore
[   42.665687] CPU: 0 PID: 1453 Comm: modprobe Tainted: G      D        3.17.0-rc6-00448-g9f3d0ec-dirty #188
[   42.675756] [&lt;c0017338&gt;] (unwind_backtrace) from [&lt;c0012fdc&gt;] (show_stack+0x20/0x24)
[   42.683911] [&lt;c0012fdc&gt;] (show_stack) from [&lt;c0647fbc&gt;] (dump_stack+0x8c/0xa4)
[   42.691526] [&lt;c0647fbc&gt;] (dump_stack) from [&lt;c0049950&gt;] (warn_slowpath_common+0x7c/0xa0)
[   42.700004] [&lt;c0049950&gt;] (warn_slowpath_common) from [&lt;c00499b4&gt;] (warn_slowpath_fmt+0x40/0x48)
[   42.709194] [&lt;c00499b4&gt;] (warn_slowpath_fmt) from [&lt;c0405f7c&gt;] (device_release+0x94/0xa0)
[   42.717794] [&lt;c0405f7c&gt;] (device_release) from [&lt;c032e8e8&gt;] (kobject_cleanup+0x4c/0x7c)
[   42.726189] [&lt;c032e8e8&gt;] (kobject_cleanup) from [&lt;c032e7c8&gt;] (kobject_put+0x60/0x90)
[   42.734316] [&lt;c032e7c8&gt;] (kobject_put) from [&lt;c0406320&gt;] (put_device+0x24/0x28)
[   42.741995] [&lt;c0406320&gt;] (put_device) from [&lt;c040c008&gt;] (platform_device_unregister+0x2c/0x30)
[   42.751061] [&lt;c040c008&gt;] (platform_device_unregister) from [&lt;bf2b6b70&gt;] (afunc_unbind+0x2c/0x68 [usb_f_uac2])
[   42.761523] [&lt;bf2b6b70&gt;] (afunc_unbind [usb_f_uac2]) from [&lt;bf29dbec&gt;] (remove_config.isra.8+0xe8/0x100 [libcomposite])
[   42.772868] [&lt;bf29dbec&gt;] (remove_config.isra.8 [libcomposite]) from [&lt;bf29f9a4&gt;] (__composite_unbind+0x48/0xb0 [libcomposite])
[   42.784855] [&lt;bf29f9a4&gt;] (__composite_unbind [libcomposite]) from [&lt;bf29fa28&gt;] (composite_unbind+0x1c/0x20 [libcomposite])
[   42.796446] [&lt;bf29fa28&gt;] (composite_unbind [libcomposite]) from [&lt;c04d229c&gt;] (usb_gadget_remove_driver+0x78/0xb0)
[   42.807224] [&lt;c04d229c&gt;] (usb_gadget_remove_driver) from [&lt;c04d2348&gt;] (usb_gadget_unregister_driver+0x74/0xb8)
[   42.817742] [&lt;c04d2348&gt;] (usb_gadget_unregister_driver) from [&lt;bf29db00&gt;] (usb_composite_unregister+0x1c/0x20 [libcomposite])
[   42.829632] [&lt;bf29db00&gt;] (usb_composite_unregister [libcomposite]) from [&lt;bf2b1084&gt;] (audio_driver_exit+0x14/0x1c [g_audio])
[   42.841430] [&lt;bf2b1084&gt;] (audio_driver_exit [g_audio]) from [&lt;c00c0fe0&gt;] (SyS_delete_module+0x120/0x1b0)
[   42.851415] [&lt;c00c0fe0&gt;] (SyS_delete_module) from [&lt;c000ed40&gt;] (ret_fast_syscall+0x0/0x48)
[   42.860075] ---[ end trace bb22e678d8d6db7b ]---
root@saruman:~#

Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: function: uac2: prevent double ep disable</title>
<updated>2014-10-20T20:58:49Z</updated>
<author>
<name>Felipe Balbi</name>
</author>
<published>2014-09-29T19:23:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f3bb7b298120df8a9b7354e4f6d07e3185c15db7'/>
<id>urn:sha1:f3bb7b298120df8a9b7354e4f6d07e3185c15db7</id>
<content type='text'>
without this check, f_uac2 would try to disable
the same endpoint twice. Fix that.

Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: function: uac2: add wMaxPacketSize to ep desc</title>
<updated>2014-10-20T20:58:49Z</updated>
<author>
<name>Felipe Balbi</name>
</author>
<published>2014-09-29T19:18:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=703a303c187ef7e3c8daf8a1be343576c9579eaf'/>
<id>urn:sha1:703a303c187ef7e3c8daf8a1be343576c9579eaf</id>
<content type='text'>
Endpoint descriptors should pass wMaxPacketSize. Note
that this also fixes USB20CV Other Speed Endpoint
Descriptor Tests.

Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_uac2: send reasonably sized packets</title>
<updated>2014-09-02T14:28:00Z</updated>
<author>
<name>Daniel Mack</name>
</author>
<published>2014-08-27T17:09:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9bb87f168931cf55738ed2fbda3639575cede886'/>
<id>urn:sha1:9bb87f168931cf55738ed2fbda3639575cede886</id>
<content type='text'>
The UAC2 function driver currently responds to all packets at all times
with wMaxPacketSize packets. That results in way too fast audio
playback as the function driver (which is in fact supposed to define
the audio stream pace) delivers as fast as it can.

Fix this by sizing each packet correctly with the following steps:

 a) Set the packet's size by dividing the nominal data rate by the
    playback endpoint's interval.

 b) If there is a residual value from the calculation in a), add
    it to a accumulator to keep track of it across packets.

 c) If the accumulator has gathered at least the number of bytes
    that are needed for one sample frame, increase the packet size.

This way, the packet size calculation will get rid of any kind of
imprecision that would otherwise occur with a simple division over
time.

Some of the variables that are needed while processing each packet
are pre-computed for performance reasons.

Signed-off-by: Daniel Mack &lt;zonque@gmail.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_uac2: handle partial dma area wrap</title>
<updated>2014-09-02T14:17:07Z</updated>
<author>
<name>Daniel Mack</name>
</author>
<published>2014-08-27T17:09:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ec9e43138f1219966850477e056f6eb7fbcc4fa4'/>
<id>urn:sha1:ec9e43138f1219966850477e056f6eb7fbcc4fa4</id>
<content type='text'>
With packet sizes other than 512, payloads in the packets may wrap
around the ALSA dma buffer partially, which leads to memory corruption
and audible clicks and pops in the audio stream at the moment, because
there is no boundary check before the memcpy().

In preparation to an implementation for smaller and dynamically sized
packets, we have to address such cases, and copy the payload in two
steps conditionally.

The 'src' and 'dst' approach doesn't work here anymore, as different
behavior is necessary in playback and capture cases. Thus, this patch
open-codes the routine now.

Signed-off-by: Daniel Mack &lt;zonque@gmail.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_uac2: introduce agdev_to_uac2_opts</title>
<updated>2014-09-02T14:17:06Z</updated>
<author>
<name>Daniel Mack</name>
</author>
<published>2014-08-27T17:09:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=254b3bf68b65ac8f82da1c7e0c1a2bb17012aa7d'/>
<id>urn:sha1:254b3bf68b65ac8f82da1c7e0c1a2bb17012aa7d</id>
<content type='text'>
Add a simple container_of() wrapper to get a struct f_uac2_opts from a
struct struct audio_dev. Use it in two places where it is currently
open-coded.

Signed-off-by: Daniel Mack &lt;zonque@gmail.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_uac2: add short-hand for 'dev'</title>
<updated>2014-09-02T14:17:05Z</updated>
<author>
<name>Daniel Mack</name>
</author>
<published>2014-08-27T17:09:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a8147dabe56f7e7a4975e60abb613f7e62277577'/>
<id>urn:sha1:a8147dabe56f7e7a4975e60abb613f7e62277577</id>
<content type='text'>
In afunc_bind() and afunc_set_alt(), &amp;uac2-&gt;pdev.dev are used multiple
times. Adding a short-hand for them makes lines shorter so we can
remove some line wraps.

No functional change.

Signed-off-by: Daniel Mack &lt;zonque@gmail.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_uac2: restructure some code in afunc_set_alt()</title>
<updated>2014-09-02T14:17:04Z</updated>
<author>
<name>Daniel Mack</name>
</author>
<published>2014-08-27T17:09:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=430fdbd3b7ea4a820d4c1aa936ede77433cfa818'/>
<id>urn:sha1:430fdbd3b7ea4a820d4c1aa936ede77433cfa818</id>
<content type='text'>
Restructure some code to make it easier to read.

While at it, return -ENOMEM instead of -EINVAL if
usb_ep_alloc_request() fails, and omit the logging in such cases
(the mm core will complain loud enough).

Signed-off-by: Daniel Mack &lt;zonque@gmail.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
</feed>
