aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/vc04_services/bcm2835-audio (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-04-05staging: bcm2835-pcm: Allow up to 8 channels and 192kHz data rateDom Cobley1-5/+5
The firmware driver can support this, so allow it to be selected Increase the buffer sizes to handle the higher data rates. Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org> Signed-off-by: Dom Cobley <popcornmix@gmail.com> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Link: https://lore.kernel.org/r/1617373688-8715-1-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-11staging: Replace lkml.org links with loreKees Cook1-1/+1
As started by commit 05a5f51ca566 ("Documentation: Replace lkml.org links with lore"), replace lkml.org links with lore to better use a single source that's more likely to stay available long-term. Signed-off-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20210210233231.1664896-1-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-06staging: bcm2835-audio: Replace unsafe strcpy() with strscpy()Juerg Haefliger3-7/+7
Replace strcpy() with strscpy() in bcm2835-audio/bcm2835.c to prevent the following when loading snd-bcm2835: [ 58.480634] ------------[ cut here ]------------ [ 58.485321] kernel BUG at lib/string.c:1149! [ 58.489650] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP [ 58.495214] Modules linked in: snd_bcm2835(COE+) snd_pcm snd_timer snd dm_multipath scsi_dh_rdac scsi_dh_emc scsi_dh_alua btsdio bluetooth ecdh_generic ecc bcm2835_v4l2(CE) bcm2835_codec(CE) brcmfmac bcm2835_isp(CE) bcm2835_mmal_vchiq(CE) brcmutil cfg80211 v4l2_mem2mem videobuf2_vmalloc videobuf2_dma_contig videobuf2_memops raspberrypi_hwmon videobuf2_v4l2 videobuf2_common videodev bcm2835_gpiomem mc vc_sm_cma(CE) rpivid_mem uio_pdrv_genirq uio sch_fq_codel drm ip_tables x_tables autofs4 btrfs blake2b_generic raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor xor_neon raid6_pq libcrc32c raid1 raid0 multipath linear dwc2 roles spidev udc_core crct10dif_ce xhci_pci xhci_pci_renesas phy_generic aes_neon_bs aes_neon_blk crypto_simd cryptd [ 58.563787] CPU: 3 PID: 1959 Comm: insmod Tainted: G C OE 5.11.0-1001-raspi #1 [ 58.572172] Hardware name: Raspberry Pi 4 Model B Rev 1.2 (DT) [ 58.578086] pstate: 60400005 (nZCv daif +PAN -UAO -TCO BTYPE=--) [ 58.584178] pc : fortify_panic+0x20/0x24 [ 58.588161] lr : fortify_panic+0x20/0x24 [ 58.592136] sp : ffff800010a83990 [ 58.595491] x29: ffff800010a83990 x28: 0000000000000002 [ 58.600879] x27: ffffb0b07cb72928 x26: 0000000000000000 [ 58.606268] x25: ffff39e884973838 x24: ffffb0b07cb74190 [ 58.611655] x23: ffffb0b07cb72030 x22: 0000000000000000 [ 58.617042] x21: ffff39e884973014 x20: ffff39e88b793010 [ 58.622428] x19: ffffb0b07cb72670 x18: 0000000000000030 [ 58.627814] x17: 0000000000000000 x16: ffffb0b092ce2c1c [ 58.633200] x15: ffff39e88b901500 x14: 0720072007200720 [ 58.638588] x13: 0720072007200720 x12: 0720072007200720 [ 58.643979] x11: ffffb0b0936cbdf0 x10: 00000000fffff000 [ 58.649366] x9 : ffffb0b09220cfa8 x8 : 0000000000000000 [ 58.654752] x7 : ffffb0b093673df0 x6 : ffffb0b09364e000 [ 58.660140] x5 : 0000000000000000 x4 : ffff39e93b7db948 [ 58.665526] x3 : ffff39e93b7ebcf0 x2 : 0000000000000000 [ 58.670913] x1 : 0000000000000000 x0 : 0000000000000022 [ 58.676299] Call trace: [ 58.678775] fortify_panic+0x20/0x24 [ 58.682402] snd_bcm2835_alsa_probe+0x5b8/0x7d8 [snd_bcm2835] [ 58.688247] platform_probe+0x74/0xe4 [ 58.691963] really_probe+0xf0/0x510 [ 58.695585] driver_probe_device+0xe0/0x100 [ 58.699826] device_driver_attach+0xcc/0xd4 [ 58.704068] __driver_attach+0xb0/0x17c [ 58.707956] bus_for_each_dev+0x7c/0xd4 [ 58.711843] driver_attach+0x30/0x40 [ 58.715467] bus_add_driver+0x154/0x250 [ 58.719354] driver_register+0x84/0x140 [ 58.723242] __platform_driver_register+0x34/0x40 [ 58.728013] bcm2835_alsa_driver_init+0x30/0x1000 [snd_bcm2835] [ 58.734024] do_one_initcall+0x54/0x300 [ 58.737914] do_init_module+0x60/0x280 [ 58.741719] load_module+0x680/0x770 [ 58.745344] __do_sys_finit_module+0xbc/0x130 [ 58.749761] __arm64_sys_finit_module+0x2c/0x40 [ 58.754356] el0_svc_common.constprop.0+0x88/0x220 [ 58.759216] do_el0_svc+0x30/0xa0 [ 58.762575] el0_svc+0x28/0x70 [ 58.765669] el0_sync_handler+0x1a4/0x1b0 [ 58.769732] el0_sync+0x178/0x180 [ 58.773095] Code: aa0003e1 91366040 910003fd 97ffee21 (d4210000) [ 58.779275] ---[ end trace 29be5b17497bd898 ]--- [ 58.783955] note: insmod[1959] exited with preempt_count 1 [ 58.791921] ------------[ cut here ]------------ For the sake of it, replace all the other occurences of strcpy() under bcm2835-audio/ as well. Signed-off-by: Juerg Haefliger <juergh@canonical.com> Link: https://lore.kernel.org/r/20210205072502.10907-1-juergh@canonical.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-29staging: vc4_services: bcm2835-audio: Add SNDRV_PCM_INFO_BATCH flagDylan Van Assche1-2/+2
Playing audio with PulseAudio and the bcm2835-pcm driver results in distorted sound. Timer-based scheduling does not properly work with bcm2835-pcm since configuring PulseAudio with tsched=0 avoids this problem. Setting the SNDRV_PCM_INFO_BATCH flag prevents PulseAudio to use timer-based scheduling by default. Settings this flag makes audio works out of the box. Based on: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7f2430cda819a9ecb1df5a0f3ef4f1c20db3f811 Signed-off-by: Dylan Van Assche <me@dylanvanassche.be> Link: https://lore.kernel.org/r/20210127174348.10192-1-me@dylanvanassche.be Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-25staging: vchiq: fix __user annotationsArnd Bergmann1-1/+1
My earlier patches caused some new sparse warnings, but it turns out that a number of those are actual bugs, or at least suspicous code. Adding __user annotations to the data structures that are defined in uapi headers helps avoid the new warnings, but that causes a different set of warnings to show up, as some of these structures are used both inside of the kernel and at the user interface but storing pointers to different things there. Duplicating the vchiq_service_params and vchiq_completion_data structures in turn takes care of most of those, and then it turns out that there is a 'data' pointer that can be any of a __user address, a dmd_addr_t and a kernel pointer in vmalloc space at times. I'm trying to annotate these as best I can without changing behavior, but there still seems to be a serious bug when user space passes a valid vmalloc space address instead of a user pointer. Adding comments in the code there, and leaving the warnings in place that seem to correspond to actual bugs. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20200925114424.2647144-1-arnd@arndb.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-15Staging: vc04_services: Fix unsigned int warningsBaidyanath Kundu1-2/+2
This patch fixes the checkpatch.pl warning: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' Signed-off-by: Baidyanath Kundu <kundubaidya99@gmail.com> Link: https://lore.kernel.org/r/20200713143653.32332-1-kundubaidya99@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01staging: vchiq: Move vchiq.h into include directoryNicolas Saenz Julienne2-2/+2
To make the separation clear between vchiq's header files and vchiq.h, which is to be used by services and is the 'public' API, move it into a dedicated includes directory. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-48-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01staging: vchiq: Use vchiq.h as the main header file for servicesNicolas Saenz Julienne1-1/+1
This used to be vchiq_if.h but vchiq.h is more concise for an include file that will hopefully be in the future in the includes directory. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-46-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01staging: vchiq: Get rid of vchiNicolas Saenz Julienne2-13/+12
All the functions that vchi currently provides are a 1:1 mapping to its vchiq counterparts. Get rid of vchi altogether and use vchiq's on all services. In the process also get rid of the vchi directory, as the only remaining file was a TODO file, which now lives in the parent directory. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-44-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01staging: vchi: Move vchi_queue_kernel_message() into vchiqNicolas Saenz Julienne1-4/+4
We can't really merge it with vchiq_queue_message() as it has internal users that will not benefit from the retry mechanism vchiq_queue_kernel_message() uses. So, for the sake of getting rid of vchi, move it into vchiq. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-43-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01staging: vchi: Get rid of vchi_bulk_queue_transmit()Nicolas Saenz Julienne1-4/+3
Its vchiq counterpart, vchiq_bulk_transmit() is only used by vchi. We can then merge both functions by moving vchi_bulk_queue_transmit()'s retry mechanism into vchiq_bulk_transmit() and let services call the later. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-42-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01staging: vchiq: Unify fourcc definition mechanismsNicolas Saenz Julienne2-4/+3
There is already enough duplication with regard to fourcc generation in the kernel. Let's at least use the same macro all over the vchiq ecosystem. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-35-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01staging: vchi: Get rid of struct vchi_serviceNicolas Saenz Julienne1-11/+12
The structure only contains a single parameter, which is the underlying vchiq handle. Get rid of the struct and directly pass the handle around. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-32-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01staging: vchi: Use struct vchiq_service_paramsNicolas Saenz Julienne1-4/+5
For initialization, vchi has its own params structure, which is then translated to vchiq's params structure. They are essentially the same, so lets directly use vchiq's. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-31-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01staging: vchi: Get rid of vchiq_shim's message callbackNicolas Saenz Julienne1-12/+8
As vchiq_shim's callback does nothing aside from pushing messages into the service's queue, let's bypass it and jump directly to the service's callbacks, letting them choose whether to use the message queue. It turns out most services don't need to use the message queue, which makes for simpler code in the end. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-29-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01staging: vchi: Use vchiq's enum vchiq_reasonNicolas Saenz Julienne1-3/+2
enum vchi_callback_reason maps 1:1 to enum vchiq_reason, in an effort to simplify things, let's use the later, and get rid of the extra indirection. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-21-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01staging: vchi: Use enum vchiq_bulk_mode instead of vchi's transmission flagsNicolas Saenz Julienne2-1/+2
vchi has a set of transfer flags which almost map 1:1 to vchiq's own transfer modes. For the sake of simplicity let's use the later and delete vchi's. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-20-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01staging: vchi: Get rid of flags argument in vchi_msg_hold()Nicolas Saenz Julienne1-2/+1
All users are ignoring the flags argument. So for the sake of simplicity delete it. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-19-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01staging: vc04_services: bcm2835-audio: Use vchi_msg_hold()Nicolas Saenz Julienne1-11/+14
vchi_msg_dequeue() provides the same functionality as vchi_msg_hold() except it copies the message data as opposed to the later which provides the data in place. The copying is done on a local variable, so there is no need to keep the message out the function's bounds, so use vchi_msg_hold() instead. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-14-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01staging: vchi: Unify struct shim_service and struct vchi_service_handleNicolas Saenz Julienne1-12/+12
The idea behind struct vchi_service_handle is to create an opaque handle to struct shim_service. This can be achieved by doing a forward declaration of struct shim_service, which will avoid unwarranted casts and pointer play. Ultimately as a rename is due all over the vchi user space, rename struct shim_service into struvt vchi_service, which is more consistent with the rest of the exposed API. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-13-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01staging: vchi: Get rid of struct vchi_instance_handleNicolas Saenz Julienne2-11/+11
The idea behind this was to create an opaque handle to struct vchiq_instance. This can be achieved without creating a new type by means of a forward declaration of struct vchiq_instance. This saves us from a lot of useless casting and overall simplifies code. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-12-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16staging: vc04_services: bcm2835-audio: Make function arguments alignment match open parenthesisR Veera Kumar1-2/+2
Make function arguments alignment match open parenthesis. Found using checkpatch.pl. Signed-off-by: R Veera Kumar <vkor@vkten.in> Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200413165905.6081-1-vkor@vkten.in Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-10staging: bcm2835-audio: Drop superfluous ioctl PCM opsTakashi Iwai1-2/+0
PCM core deals the empty ioctl field now as default. Let's kill the redundant lines. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20191210141356.18074-5-tiwai@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-10staging: bcm2835-audio: Use managed buffer allocationTakashi Iwai1-16/+1
Clean up the driver with the new managed buffer allocation API. The hw_params and hw_free callbacks became superfluous and dropped. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20191210141356.18074-3-tiwai@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-20staging: vc04: Fix Kconfig indentationKrzysztof Kozlowski1-6/+6
Adjust indentation from spaces to tab (+optional two spaces) as in coding style with command like: $ sed -e 's/^ /\t/' -i */Kconfig Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20191120133848.13250-1-krzk@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-07staging: vc04_services: Replace VCHI_SERVICE_HANDLE_T typedef with struct vchi_service_handleJamal Shareef1-1/+1
Replaces VCHI_SERVICE_HANDLE_T typedef with vchi_service_handle struct to match kernel code style. Issue found by checkpatch. Signed-off-by: Jamal Shareef <jamal.k.shareef@gmail.com> Link: https://lore.kernel.org/r/ec9a1a4bdd87ff008e48835cf7c39847d999b147.1572994235.git.jamal.k.shareef@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-07staging: vc04_services: Replace VCHI_INSTANCE_T with struct vhci_instance_handleJamal Shareef2-2/+2
Replaces VCHI_INSTANCE_T typedef with struct vchi_instance_handle to match kernel code style. Issue found by checkpatch. Signed-off-by: Jamal Shareef <jamal.k.shareef@gmail.com> Link: https://lore.kernel.org/r/0b481a90b8a2b9cd6718e972dab681854ff312d7.1572994235.git.jamal.k.shareef@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-02staging: vc04_services: Remove enum typedefs in vchiJamal Shareef1-1/+1
Remove enum typedefs from header files and files which include them in vchi. Issue found by checkpatch. Signed-off-by: Jamal Shareef <jamal.k.shareef@gmail.com> Link: https://lore.kernel.org/r/4afc7d28ef9ad249cac3bf7c3dd453bb64b13657.1572652827.git.jamal.k.shareef@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-14Merge 5.4-rc3 into staging-nextGreg Kroah-Hartman2-2/+3
We want the staging driver fixes in here as well to build on and test with. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-08staging: bcm2835-audio: Need to judge the return value of vchi_msg_dequeue in audio_vchi_callbackzhengbin1-0/+3
If vchi_msg_dequeue return -1, variable m is not assigined, need to return. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: zhengbin <zhengbin13@huawei.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/1570520515-2186-2-git-send-email-zhengbin13@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-01staging: bcm2835-audio: Fix draining behavior regressionTakashi Iwai2-2/+3
The PCM draining behavior got broken since the recent refactoring, and this turned out to be the incorrect expectation of the firmware behavior regarding "draining". While I expected the "drain" flag at the stop operation would do processing the queued samples, it seems rather dropping the samples. As a quick fix, just drop the SNDRV_PCM_INFO_DRAIN_TRIGGER flag, so that the driver uses the normal PCM draining procedure. Also, put some caution comment to the function for future readers not to fall into the same pitfall. Fixes: d7ca3a71545b ("staging: bcm2835-audio: Operate non-atomic PCM ops") BugLink: https://github.com/raspberrypi/linux/issues/2983 Cc: stable@vger.kernel.org Signed-off-by: Takashi Iwai <tiwai@suse.de> Acked-by: Stefan Wahren <wahrenst@gmx.net> Link: https://lore.kernel.org/r/20190914152405.7416-1-tiwai@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-03staging: add missing SPDX lines to Makefile filesGreg Kroah-Hartman1-0/+1
There are a few remaining drivers/staging/*/Makefile files that do not have SPDX identifiers in them. Add the correct GPL-2.0 identifier to them to make scanning tools happy. Reviewed-by: Mukesh Ojha <mojha@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-03staging: add missing SPDX lines to Kconfig filesGreg Kroah-Hartman1-0/+1
There are a few remaining drivers/staging/*/Kconfig files that do not have SPDX identifiers in them. Add the correct GPL-2.0 identifier to them to make scanning tools happy. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: vc04-services: bcm2835-audio: Fix alignment issuesDaniela Mormocea1-6/+6
Fix all the alignment with open parenthesis issues detected by checkpatch Signed-off-by: Daniela Mormocea <daniela.mormocea@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-04staging: prefix header search paths with $(srctree)/Masahiro Yamada1-2/+1
Currently, the Kbuild core manipulates header search paths in a crazy way [1]. To fix this mess, I want all Makefiles to add explicit $(srctree)/ to the search paths in the srctree. Some Makefiles are already written in that way, but not all. The goal of this work is to make the notation consistent, and finally get rid of the gross hacks. Having whitespaces after -I does not matter since commit 48f6e3cf5bc6 ("kbuild: do not drop -I without parameter"). [1]: https://patchwork.kernel.org/patch/9632347/ Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-17staging: vc04_services: Remove SERVICE_CREATION_T typedefDominic Braun1-1/+1
Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun <inf.braun@fau.de> Signed-off-by: Tobias Büttner <tobias.buettner@fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-17staging: bcm2835-audio: double free in init error pathDan Carpenter1-1/+0
We free instance here and in the caller. It should be only the caller which handles it. Fixes: d7ca3a71545b ("staging: bcm2835-audio: Operate non-atomic PCM ops") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-12staging: bcm2835-audio: Drop DT dependencyStefan Wahren1-22/+9
Just like the bcm2835-video make this a platform driver which is probed by vchiq. In order to change the number of channels use a module parameter instead, but use the maximum as default. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-12staging: bcm2835-audio: use module_platform_driver() macroStefan Wahren1-19/+1
There is not much value behind this boilerplate, so use module_platform_driver() instead. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-12staging: bcm2835-audio: Enable compile testStefan Wahren1-1/+1
Enable the compilation test for bcm2835-audio to gain more build coverage. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-08staging: bcm2835-audio: interpolate audio delayMike Brady2-0/+21
When the BCM2835 audio output is used, userspace sees a jitter up to 10ms in the audio position, aka "delay" -- the number of frames that must be output before a new frame would be played. Make this a bit nicer for userspace by interpolating the position using the CPU clock. The overhead is small -- an extra ktime_get() every time a GPU message is sent -- and another call and a few calculations whenever the delay is sought from userland. At 48,000 frames per second, i.e. approximately 20 microseconds per frame, it would take a clock inaccuracy of 20 microseconds in 10 milliseconds -- 2,000 parts per million -- to result in an inaccurate estimate, whereas crystal- or resonator-based clocks typically have an inaccuracy of 10s to 100s of parts per million. Signed-off-by: Mike Brady <mikebrady@eircom.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-07staging: bcm2835-audio: update TODONicolas Saenz Julienne1-22/+3
The following tasks were completed or not the right solution: 1/2- Not the proper solution, we should register a platform device in vchiq the same way it's done with bcm2835-camera as commented here: https://lkml.org/lkml/2018/10/16/1131 2/3- Fixed by Takashi Iwai here: https://lkml.org/lkml/2018/9/4/587 Also, adds a new task as per mailing list conversation. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Acked-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-07staging: bcm2835-audio: rename platform_driver structureNicolas Saenz Julienne1-3/+3
It was called bcm2835_alsa0_driver, that "0" didn't mean much. Suggested-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Acked-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-07staging: bcm2835-audio: more generic probe function nameNicolas Saenz Julienne1-2/+2
There will only be one probe function, there is no use for appendig "_dt" the end of the name. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Reviewed-by: Takashi Iwai <tiwai@suse.de> Acked-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-07staging: bcm2835-audio: use anonymous union in struct vc_audio_msgNicolas Saenz Julienne2-16/+16
In this case explicitly naming the union doesn't help overall code comprehension and clutters it. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Reviewed-by: Takashi Iwai <tiwai@suse.de> Acked-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-07staging: bcm2835-audio: reorder variable declarations & remove trivial commentsNicolas Saenz Julienne3-17/+11
When it comes to declaring variables it's preferred, when possible, to use an inverted tree organization scheme. Also, removes some comments that were useless. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Reviewed-by: Takashi Iwai <tiwai@suse.de> Acked-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-07staging: bcm2835-audio: don't initialize memory twiceNicolas Saenz Julienne1-2/+0
The memory is being allocated with devres_alloc(), wich ultimately uses __GFP_ZERO to call kmalloc. We don't need to zero the memory area again in bcm2835-audio. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Reviewed-by: Takashi Iwai <tiwai@suse.de> Acked-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-07staging: bcm2835-audio: unify FOURCC command definitionsNicolas Saenz Julienne2-10/+7
The device communicates with the audio core using FOURCC codes. The driver was generating them using different macros/expressions. We now use the same macro to create them and centralize all the definitions. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Reviewed-by: Takashi Iwai <tiwai@suse.de> Acked-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-09staging: vc04_services: Drop unused parameters from vchi_connect()Tuomas Tynkkynen1-1/+1
Remove two parameters which are never used and all where all callers just pass in dummy values anyway. Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> Acked-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-09staging: vc04_services: Drop trivially unused fields from SERVICE_CREATION_TTuomas Tynkkynen1-5/+0
These fields are only initialized with constants and never read. Drop them. Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> Acked-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>