aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_ca0132.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-08-14ALSA: hda: Nuke unused reboot_notify callbackTakashi Iwai1-6/+0
As reboot_notify callback is no longer used by the codec core, let's get rid of the unused code. Conexant codec needs a slight code change as it used to call the reboot_notify at the codec removal, too. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214045 Link: https://lore.kernel.org/r/20210813081230.4268-4-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-07-12ALSA: hda/ca0132: remove redundant initialization of variable statusColin Ian King1-1/+1
The variable status is being initialized with a value that is never read, the assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20210709152938.460763-1-colin.king@canonical.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-05-27ALSA: hda/ca0132: Make a const array static, makes object smallerColin Ian King1-1/+1
Don't populate the const array dsp_dma_stream_ids the stack but instead make it static. Makes the object code smaller by 21 bytes. Before: text data bss dec hex filename 189012 70376 192 259580 3f5fc ./sound/pci/hda/patch_ca0132.o After: text data bss dec hex filename 188927 70440 192 259559 3f5e7 ./sound/pci/hda/patch_ca0132.o (gcc version 10.3.0) Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20210526160616.3764119-1-colin.king@canonical.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-03-30ALSA: HDA - remove the custom implementation for the audio LED triggerJaroslav Kysela1-2/+2
With the new snd-ctl-led module, we have a generic way to trigger audio LEDs based on the sound control changes. Remove the custom implementation from the HDA driver. Move the LED initialization before snd_hda_gen_parse_auto_config() call in all drivers to create marked controls there. Signed-off-by: Jaroslav Kysela <perex@perex.cz> Link: https://lore.kernel.org/r/20210317172945.842280-5-perex@perex.cz Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-03-09ALSA: hda/ca0132: Add Sound BlasterX AE-5 Plus supportSimeon Simeonoff1-0/+1
The new AE-5 Plus model has a different Subsystem ID compared to the non-plus model. Adding the new id to the list of quirks. Signed-off-by: Simeon Simeonoff <sim.simeonoff@gmail.com> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/998cafbe10b648f724ee33570553f2d780a38963.camel@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-03-02ALSA: hda: fix kernel-doc warningsPierre-Louis Bossart1-5/+4
v5.12-rc1 flags new warnings with make W=1, fix missing or broken function descriptors. sound/pci/hda/hda_codec.c:3492: warning: expecting prototype for snd_hda_input_mux_info_info(). Prototype was for snd_hda_input_mux_info() instead sound/pci/hda/hda_codec.c:3521: warning: expecting prototype for snd_hda_input_mux_info_put(). Prototype was for snd_hda_input_mux_put() instead sound/pci/hda/hda_codec.c:3958: warning: expecting prototype for _snd_hda_pin_ctl(). Prototype was for _snd_hda_set_pin_ctl() instead sound/pci/hda/hda_jack.c:223: warning: expecting prototype for snd_hda_set_dirty_all(). Prototype was for snd_hda_jack_set_dirty_all() instead sound/pci/hda/hda_jack.c:309: warning: expecting prototype for snd_hda_jack_detect_enable_mst(). Prototype was for snd_hda_jack_detect_enable_callback_mst() instead sound/pci/hda/hda_generic.c:3933: warning: expecting prototype for snd_dha_gen_add_mute_led_cdev(). Prototype was for snd_hda_gen_add_mute_led_cdev() instead sound/pci/hda/hda_generic.c:4093: warning: expecting prototype for snd_dha_gen_add_micmute_led_cdev(). Prototype was for snd_hda_gen_add_micmute_led_cdev() instead sound/pci/hda/patch_ca0132.c:2357: warning: expecting prototype for Prepare and send the SCP message to DSP(). Prototype was for dspio_scp() instead sound/pci/hda/patch_ca0132.c:2883: warning: expecting prototype for Allocate router ports(). Prototype was for dsp_allocate_router_ports() instead sound/pci/hda/patch_ca0132.c:3202: warning: expecting prototype for Write a block of data into DSP code or data RAM using pre(). Prototype was for dspxfr_one_seg() instead sound/pci/hda/patch_ca0132.c:3397: warning: expecting prototype for data overlay to DSP memories(). Prototype was for dspxfr_image() instead sound/hda/hdac_regmap.c:393: warning: expecting prototype for snd_hdac_regmap_init(). Prototype was for snd_hdac_regmap_exit() instead sound/hda/ext/hdac_ext_controller.c:142: warning: expecting prototype for snd_hdac_ext_bus_get_link_index(). Prototype was for snd_hdac_ext_bus_get_link() instead sound/hda/ext/hdac_ext_stream.c:140: warning: expecting prototype for snd_hdac_ext_linkstream_start(). Prototype was for snd_hdac_ext_link_stream_start() instead Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210301174617.116960-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-12ALSA: hda/ca0132 - Add ZxR surround DAC setup.Connor McAdams1-0/+40
Add pre-dsp download initialization for the DAC's used in the surround sound configuration. Fixes issues of no audio on surround channels. Fixes: 2e492b8ee5da8 ("ALSA: hda/ca0132 - Add ZxR init commands") Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20201211225504.4508-2-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-12ALSA: hda/ca0132 - Add 8051 PLL write helper functions.Connor McAdams1-80/+50
Add helper functions for the 8051 PLL PMU write verbs. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20201211225504.4508-1-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-11ALSA: hda/ca0132 - Remove now unnecessary DSP setup functions.Connor McAdams1-105/+0
Now that the DSP's audio configuration is understood, remove previous hacky methods of trying to properly configure it. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20201210160658.461739-6-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-11ALSA: hda/ca0132 - Ensure DSP is properly setup post-firmware download.Connor McAdams1-0/+119
Make sure that the DSP has no DMA channels allocated once the firmware is downloaded, and that the default audio streams in use by the DSP are setup in the correct order. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20201210160658.461739-5-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-11ALSA: hda/ca0132 - Add 8051 exram helper functions.Connor McAdams1-58/+79
Add functions for both reading and writing to the 8051's exram. Also, add a little bit of documentation on how the addresses are segmented. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20201210160658.461739-4-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-11ALSA: hda/ca0132 - Add stream port remapping function.Connor McAdams1-52/+156
Add function for remapping a ChipIO stream's ports. Also include some documentation as to how this works. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20201210160658.461739-3-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-11ALSA: hda/ca0132 - Reset codec upon initialization.Connor McAdams1-5/+16
Reset the codec upon initialization to clear out anything that may have been setup on a previous boot into Windows, or in case of an improper shutdown. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20201210160658.461739-2-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-10ALSA: hda/ca0132 - Change Input Source enum strings.Connor McAdams1-1/+1
Change the Input Source enumerated control's strings to make it play nice with pulseaudio. Fixes: 7cb9d94c05de9 ("ALSA: hda/ca0132: add alt_select_in/out for R3Di + SBZ") Cc: <stable@kernel.org> Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20201208195223.424753-2-conmanx360@gmail.com Link: https://lore.kernel.org/r/20201210173550.2968-2-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-10ALSA: hda/ca0132 - Fix AE-5 rear headphone pincfg.Connor McAdams1-1/+1
The Windows driver sets the pincfg for the AE-5's rear-headphone to report as a microphone. This causes issues with Pulseaudio mistakenly believing there is no headphone plugged in. In Linux, we should instead set it to be a headphone. Fixes: a6b0961b39896 ("ALSA: hda/ca0132 - fix AE-5 pincfg") Cc: <stable@kernel.org> Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20201208195223.424753-1-conmanx360@gmail.com Link: https://lore.kernel.org/r/20201210173550.2968-1-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-11-28ALSA: hda/ca0132: Move unsol callback setups to parserTakashi Iwai1-2/+3
The setup of unsolicited event callbacks should be done only once at the parser phase, not in the init phase that is called multiple times at each resume. This patch moves the unsol setup code in ca0132 codec driver to the more appropriate place. Reported-by: Hui Wang <hui.wang@canonical.com> Link: https://lore.kernel.org/r/20200930113008.9307-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-11-19ALSA: hda/ca0132: Fix compile warning without PCITakashi Iwai1-0/+2
CONFIG_PCI=n leads to a compile warning like: sound/pci/hda/patch_ca0132.c:8214:10: warning: no case matching constant switch condition '0' due to the missed handling of QUIRK_NONE in ca0132_mmio_init(). Fix it. Fixes: bf2aa9ccc8e5 ("ALSA: hda/ca0132 - Cleanup ca0132_mmio_init function.") Reported-by: kernel test robot <lkp@intel.com> Link: https://lore.kernel.org/r/20201119120404.16833-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-10-17ALSA: hda/ca0132: make some const arrays static, makes object smallerColin Ian King1-6/+12
Don't populate const arrays on the stack but instead make them static. Makes the object code smaller by 57 bytes. Before: text data bss dec hex filename 173256 38016 192 211464 33a08 sound/pci/hda/patch_ca0132.o After: text data bss dec hex filename 172879 38336 192 211407 339cf sound/pci/hda/patch_ca0132.o (gcc version 10.2.0) Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20201016224913.687724-1-colin.king@canonical.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-10-12ALSA: hda: use semicolons rather than commas to separate statementsJulia Lawall1-1/+1
Replace commas with semicolons. What is done is essentially described by the following Coccinelle semantic patch (http://coccinelle.lip6.fr/): // <smpl> @@ expression e1,e2; @@ e1 -, +; e2 ... when any // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr> Link: https://lore.kernel.org/r/1602407979-29038-3-git-send-email-Julia.Lawall@inria.fr Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-08-26ALSA: hda/ca0132 - Add AE-7 exit commands.Connor McAdams1-0/+29
Add exit commands for the AE-7. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20200825201040.30339-21-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-08-26ALSA: hda/ca0132 - Add AE-7 custom controls.Connor McAdams1-4/+16
Add headphone gain and DAC filter controls, which use the same commands as the AE-5. Also, change input source enumerated control item count to exclude front microphone. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20200825201040.30339-20-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-08-26ALSA: hda/ca0132 - Add AE-7 microphone selection commands.Connor McAdams1-1/+21
Add AE-7 quirk data for setting of microphone. The AE-7 has no front panel connector, so only rear-mic/line-in have new commands. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20200825201040.30339-19-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-08-26ALSA: hda/ca0132 - Add output selection for SoundBlaster AE-7.Connor McAdams1-20/+68
Add output selection quirk table information for SoundBlaster AE-7, and slightly modify the AE-5's ca0113 command table to accommodate the AE-7. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20200825201040.30339-18-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-08-26ALSA: hda/ca0132 - Add DSP setup functions for AE-7.Connor McAdams1-0/+290
Add DSP setup functions for the Sound Blaster AE-7 post DSP download. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20200825201040.30339-17-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-08-26ALSA: hda/ca0132 - Add init data for SoundBlaster AE-7.Connor McAdams1-0/+14
Add initialization data for the SoundBlaster AE-7 card. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20200825201040.30339-16-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-08-26ALSA: hda/ca0132 - Add pre-init function for SoundBlaster AE-7.Connor McAdams1-15/+55
Add pre DSP initialization function for the AE-7. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20200825201040.30339-15-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-08-26ALSA: hda/ca0132 - Add ca0132_mmio_init data for SoundBlaster AE-7.Connor McAdams1-1/+19
Modify the AE-5 ca0132_mmio_init function to add AE-7 specific writes. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20200825201040.30339-14-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-08-26ALSA: hda/ca0132 - Set AE-7 bools and select mixer.Connor McAdams1-0/+5
Set the boolean values used for desktop cards, and select the desktop mixer. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20200825201040.30339-13-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-08-26ALSA: hda/ca0132 - Add SoundBlaster AE-7 pincfg.Connor McAdams1-0/+19
Add AE-7 pincfg, based on the values set within Windows. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20200825201040.30339-12-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-08-26ALSA: hda/ca0132 - Add new quirk ID for SoundBlaster AE-7.Connor McAdams1-0/+2
Add a new PCI subsystem ID for the SoundBlaster AE-7 card. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20200825201040.30339-11-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-08-26ALSA: hda/ca0132 - Fix Recon3D Center/LFE output.Connor McAdams1-0/+6
Properly set the GPIO pin to un-mute the Center/LFE channel on the Recon3D. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20200825201040.30339-10-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-08-26ALSA: hda/ca0132 - Add quirk output selection structures.Connor McAdams1-95/+241
Add structures containing the changes that need to happen on output selection for each quirk. This should streamline the addition of new quirks. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20200825201040.30339-9-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-08-26ALSA: hda/ca0132 - Clean up ca0132_alt_out_select.Connor McAdams1-85/+57
Remove the output structures that were in use before and instead set the DSP commands line by line. Now that the commands use is known, it makes the functionality more clear this way. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20200825201040.30339-8-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-08-26ALSA: hda/ca0132 - Remove surround output selection.Connor McAdams1-105/+46
Remove the surround output selection and merge it with the speaker output selection. Now that the extra commands that were being run on surround output setting are known, there's no need to have it be separate. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20200825201040.30339-7-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-08-26ALSA: hda/ca0132 - Add bass redirection controls.Connor McAdams1-4/+126
Add bass redirection controls for surround outputs. This uses the DSP to redirect audio below the bass redirection crossover frequency to the LFE channel from the front/rear L/R speakers. This only goes into effect if the speakers aren't set as full range, and only if the surround configuration has an LFE channel. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20200825201040.30339-6-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-08-26ALSA: hda/ca0132 - Add full-range speaker selection controls.Connor McAdams1-0/+117
Add functions for setting full-range speakers and controls to enable/disable the setting. Setting a speaker to full-range means that the channels won't have their bass redirected to the LFE channel. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20200825201040.30339-5-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-08-26ALSA: hda/ca0132 - Add surround channel config control.Connor McAdams1-2/+108
Add a surround channel configuration enumeration control. Setting up different channel configurations allows the DSP to upmix stereo audio into multi-channel audio, and allows for redirection of bass to a subwoofer. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20200825201040.30339-4-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-08-26ALSA: hda/ca0132 - Add speaker tuning initialization commands.Connor McAdams1-0/+119
Add speaker tuning initialization DSP commands, and also define previously unknown DSP command values. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20200825201040.30339-3-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-08-26ALSA: hda/ca0132 - Cleanup ca0132_mmio_init function.Connor McAdams1-59/+99
Cleanup the ca0132_mmio_init function, separating into two separate functions, one for Sound Blaster Z/ZxR/Recon3D, and another for the AE-5. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20200825201040.30339-2-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-08-03ALSA: hda/ca0132 - Fix AE-5 microphone selection commands.Connor McAdams1-3/+3
The ca0113 command had the wrong group_id, 0x48 when it should've been 0x30. The front microphone selection should now work. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20200803002928.8638-3-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-08-03ALSA: hda/ca0132 - Add new quirk ID for Recon3D.Connor McAdams1-0/+1
Add a new quirk ID for the Recon3D, as tested by me. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20200803002928.8638-2-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-08-03ALSA: hda/ca0132 - Fix ZxR Headphone gain control get value.Connor McAdams1-0/+5
When the ZxR headphone gain control was added, the ca0132_switch_get function was not updated, which meant that the changes to the control state were not saved when entering/exiting alsamixer. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20200803002928.8638-1-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-07-20ALSA: Replace the word "slave" in vmaster APITakashi Iwai1-5/+5
Follow the recent inclusive terminology guidelines and replace the word "slave" in vmaster API. I chose the word "follower" at this time since it seems fitting for the purpose. Note that the word "master" is kept in API, since it refers rather to audio master volume control. Also, while we're at it, a typo in comments is corrected, too. Link: https://lore.kernel.org/r/20200717154517.27599-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-03-30Merge branch 'for-next' into for-linusTakashi Iwai1-1/+1
2020-03-19ALSA: hda/ca0132 - Add Recon3Di quirk to handle integrated sound on EVGA X99 Classified motherboardGeoffrey Allott1-0/+1
I have a system which has an EVGA X99 Classified motherboard. The pin assignments for the HD Audio controller are not correct under Linux. Windows 10 works fine and informs me that it's using the Recon3Di driver, and on Linux, `cat /sys/class/sound/card0/device/subsystem_{vendor,device}` yields 0x3842 0x1038 This patch adds a corresponding entry to the quirk list. Signed-off-by: Geoffrey Allott <geoffrey@allott.email> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/a6cd56b678c00ce2db3685e4278919f2584f8244.camel@allott.email Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-02-12ALSA: hda/ca0132 - Replace zero-length array with flexible-array memberGustavo A. R. Silva1-1/+1
The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertenly introduced[3] to the codebase from now on. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Link: https://lore.kernel.org/r/20200211194403.GA10318@embeddedor Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-01-14ALSA: hda: correct kernel-doc parameter descriptionsPierre-Louis Bossart1-0/+1
make W=1 throws warnings, provide missing documentation Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200113211405.28070-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-01-05ALSA: hda: More constificationsTakashi Iwai1-9/+9
Apply const prefix to the remaining possible places: the string tables, the rate tables, the verb tables, the index tables, etc. Just for minor optimization and no functional changes. Link: https://lore.kernel.org/r/20200105144823.29547-10-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-01-03ALSA: hda - constify and cleanup static NodeID tablesMichał Mirosław1-6/+6
Make hda_nid_t tables static const, as they are not intended to be modified by callees. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Link: https://lore.kernel.org/r/5150c94101c9534f4c8e987324f6912c16d459f6.1578043216.git.mirq-linux@rere.qmqm.pl Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-14ALSA: hda/ca0132 - Fix work handling in delayed HP detectionTakashi Iwai1-2/+14
CA0132 has the delayed HP jack detection code that is invoked from the unsol handler, but it does a few weird things: it contains the cancel of a work inside the work handler, and yet it misses the cancel-sync call at (runtime-)suspend. This patch addresses those issues. Fixes: 15c2b3cc09a3 ("ALSA: hda/ca0132 - Fix possible workqueue stall") Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20191213085111.22855-4-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>