summaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/boards/bytcr_rt5651.c
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: intel/boards: use asoc_substream_to_rtd()Kuninori Morimoto2020-07-271-1/+1
| | | | | | | | | | Now we can use asoc_substream_to_rtd() macro, let's use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/87v9i9yddc.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: boards: byt*.c: remove cast in dev_info quirk logPierre-Louis Bossart2020-06-261-2/+2
| | | | | | | | | | | | We don't need an explicit cast, using the right format is simple enough. Suggested-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200625191308.3322-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: byt*: simplify card names for SOF usesPierre-Louis Bossart2020-06-171-1/+11
| | | | | | | | | | | | | | | | | | Blindly adding an sof- prefix to the card name is not user friendly and causes UCM issues with a driver name truncated to 16 characters. Simplify to use "sof-bytcht <codec_name>" pattern for all byt* machine drivers. The sof- prefix is added by the core. A generic "SOF" driver name is used, and UCMv2 will detect the configuration for this driver by testing the card name. Legacy uses are unmodified. Suggested-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20200617165616.18511-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: byt/cht: add .pm_opsPierre-Louis Bossart2020-05-271-0/+3
| | | | | | | | | | | | | | Add required .pm_ops to support suspend/resume on baytrail/cherrytrail machines. This .pm_ops is conditionally-added to avoid impacting the legacy driver where power management is handled differently. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20200526203640.25980-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: bytcr_rt5640/51: remove .ignore_suspendPierre-Louis Bossart2020-05-271-3/+0
| | | | | | | | | | | Low-power playback was never enabled on Baytrail devices, remove what looks like copy/paste from other machine drivers which were never submitted upstream. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20200526203640.25980-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: intel: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointerKuninori Morimoto2020-03-271-4/+4
| | | | | | | Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/87r1xjir7a.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: bytcr_rt5651: Remove unnecessary string buffers and snprintf callsJordy Ubink2020-01-171-20/+4
| | | | | | | | | | | | | | The snprintf calls filling byt_rt56*_codec_aif_name/byt_rt56*_cpu_dai_name always fill them with the same string ("rt56*-aif2" resp. ssp0-port"). So instead of keeping these buffers around and making codecs->dai_name / cpus->dai_name point to them, simply update the *->dai_name pointers to directly point to a string constant containing the desired string. Signed-off-by: Jordy Ubink <jordyubink@hotmail.nl> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20200115164619.101705-4-hdegoede@redhat.com Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: bytcr_rt5651: switch to using devm_fwnode_gpiod_get()Dmitry Torokhov2020-01-141-8/+10
| | | | | | | | | devm_fwnode_get_index_gpiod_from_child() is going away as the name is too unwieldy, let's switch to using the new devm_fwnode_gpiod_get(). Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Link: https://lore.kernel.org/r/20200103011754.GA260926@dtor-ws Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: bytcr_rt5651: remove unused variablePierre-Louis Bossart2020-01-141-8/+0
| | | | | | | | | | | | Fix GCC warning with W=1 sound/soc/intel//boards/bytcr_rt5651.c:659:40: warning: ‘byt_rt5651_dai_params’ defined but not used [-Wunused-const-variable=] Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200113210428.27457-19-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel - do not describe I/O configuration in the long card nameJaroslav Kysela2019-12-091-0/+4
| | | | | | | | | | | | The long card name might be used in GUI. This information should be hidden. Add CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES configuration option. Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Cc: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20191204211556.12671-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel - use control components to describe card configJaroslav Kysela2019-12-091-7/+11
| | | | | | | | | | | | Use the control interface (field 'components' in the info structure) to pass the I/O configuration details. The goal is to replace the card long name with this. Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Cc: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20191204211556.12671-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* Merge tag 'v5.2-rc6' into asoc-5.3Mark Brown2019-06-261-9/+1
|\ | | | | | | Linux 5.2-rc6
| * treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 285Thomas Gleixner2019-06-051-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation version 2 of the license this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 100 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190529141900.918357685@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | ASoC: Intel: bytcr_rt5651: use modern dai_link styleKuninori Morimoto2019-06-061-16/+25
| | | | | | | | | | | | | | | | | | | | ASoC is now supporting modern style dai_link (= snd_soc_dai_link_component) for CPU/Codec/Platform. This patch switches to use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: Intel: use common helpers to detect CPUsPierre-Louis Bossart2019-05-301-14/+3
|/ | | | | | | | | | | | | | | We have duplicated code in multiple locations (atom, machine drivers, SOF) to detect Baytrail, Cherrytrail and other SOCs. This is not very elegant, and introduces dependencies on CONFIG_X86 that prevent COMPILE_TEST from working. Add common helpers to provide same functionality in a cleaner way. This will also help support the DMI-based quirks being introduced to handle SOF/SST autodetection. Reviewed-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: bytcr_rt5651: align quirk override handlingPierre-Louis Bossart2019-04-251-3/+3
| | | | | | | | | | As discussed on alsa-devel, a zero value is useful to get rid of all quirks. Set default to -1 and align types as done in other machine drivers. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* Merge branch 'acpi-utils' of ↵Mark Brown2019-04-021-6/+8
|\ | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm into asoc-5.2
| * ASoC: Intel: bytcr_rt5651: Convert to use acpi_dev_get_first_match_dev()Andy Shevchenko2019-04-011-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | acpi_dev_get_first_match_name() is deprecated and going to be removed because it leaks a reference. Convert the driver to use acpi_dev_get_first_match_dev() instead. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* | ASoC: Intel: bytcr_rt5651: Add BYT_RT5651_JD_NOT_INV quirkHans de Goede2019-03-181-2/+20
|/ | | | | | | | | | | Add BYT_RT5651_JD_NOT_INV quirk for devices with an inverted (active-high instead of the normal active-low) jack-detect switch. And add a quirk for the Complet Electro Serv MY8307 tablet which has an inverted jack-detect switch (and a mono-speaker). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* gpiolib: acpi: Introduce ACPI_GPIO_QUIRK_ONLY_GPIOIOAndy Shevchenko2019-02-081-65/+9
| | | | | | | | | | | New quirk enforces search for GPIO based on its type, i.e. iterate over GpioIo resources only. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Tested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: bytcr_rt5651: platform name fixup supportPierre-Louis Bossart2019-01-281-0/+9
| | | | | | | Add helper to override dailink platform name, if passed as parameter Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: make const arrays static, reduces object code sizeColin Ian King2019-01-241-1/+1
| | | | | | | | | | | | | | | | | | | Don't populate the const arrays on the stack but instead make it static. Makes the object code smaller, for example: Before: text data bss dec hex filename 14107 8832 224 23163 5a7b bytcht_es8316.o After: text data bss dec hex filename 14015 8896 224 23135 5a5f bytcht_es8316.o (gcc version 8.2.0 x86_64) Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: bytcr_rt5651: Add quirk for PoV TAB-P1006W-232 (v1.0) tabletHans de Goede2019-01-071-5/+43
| | | | | | | | | | | | | | | | | | | | | | | Add a DMI quirk for the Point of View TAB-P1006W-232 (v1.0) tablet, this tablet is special in a number of ways: 1) It uses the 2nd GPIO resource in the ACPI tables for jack-detect rather then using the rt5651 codec's builtin jack-detect functionality 2) It uses the 3th GPIO resource in the ACPI tables to control the external amplifier rather then the usual first non GpioInt resource and the GPIO is active-low. 3) It is a BYTCR device, without a CHAN package and it uses SSP0-AIF1 rather then the default SSP0-AIF2. 4) Its internal mic is a digital mic (the first x86 rt5651 device that I'm aware of which does this), combined with having its headset-mic connected to IN2. Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: bytcr_rt5651: Add support for jack-detect using an external GPIOHans de Goede2019-01-071-7/+36
| | | | | | | | | Some board designs hook the jack-detect up to an external GPIO, rather then to one of the codec pins, add support for this. Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: bytcr_rt5651: Add quirks module parameterHans de Goede2019-01-071-0/+10
| | | | | | | | | Add quirks module parameter to allow manually specifying quirks from the kernel commandline (or modprobe.conf). Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: bytcr_rt5651: Revert "Fix DMIC map headsetmic mapping"Hans de Goede2019-01-071-1/+1
| | | | | | | | | | | | | | | | | | | Commit 37c7401e8c1f ("ASoC: Intel: bytcr_rt5651: Fix DMIC map headsetmic mapping"), changed the headsetmic mapping from IN3P to IN2P, this was based on the observation that all bytcr_rt5651 devices I have access to (7 devices) where all using IN3P for the headsetmic. This was an attempt to unifify / simplify the mapping, but it was wrong. None of those devices was actually using a digital internal mic. Now I've access to a Point of View TAB-P1006W-232 (v1.0) tabler, which does use a DMIC and it does have its headsetmic connected to IN2P, showing that the original mapping was correct, so this commit reverts the change changing the mapping back to IN2P. Fixes: 37c7401e8c1f ("ASoC: Intel: bytcr_rt5651: Fix DMIC map ... mapping") Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: use standard interface for Atom machine driversPierre-Louis Bossart2018-11-061-5/+1
| | | | | | | | | | | Don't rely on internal Atom/SST-specific data structures, use generic interface to let other drivers use the same machine drivers as is, e.g. SOF to support BYT-CR devices Tested-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* Merge tag 'sound-4.20-rc1' of ↵Linus Torvalds2018-10-251-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound updates from Takashi Iwai: "There have been little changes in ALSA core stuff, but ASoC core still kept rolling for the continued restructuring. The rest are lots of small driver-specific changes and some minor API updates. Here are highlights: General: - Appropriate fall-through annotations everywhere - Some code cleanup in memalloc code, handling non-cacahed pages more commonly in the helper - Deployment of SNDRV_PCM_INFO_SYNC_APPLPTR flag consistently Drivers: - More HD-audio CA0132 codec improvement for supporting other Creative boards - Plumbing legacy HD-audio codecs as ASoC BE on Intel SST; this will give move support of existing HD-audio devices with DSP - A few device-specific HD-audio quirks as usual - New quirk for RME CC devices and correction for B&W PX for USB-audio - FireWire: code refactoring including devres usages ASoC Core: - Continued componentization works; it's almost done! - A bunch of new for_each_foo macros - Cleanups and fixes in DAPM code ASoC Drivers: - MCLK support for several different devices, including CS42L51, STM32 SAI, and MAX98373 - Support for Allwinner A64 CODEC analog, Intel boards with DA7219 and MAX98927, Meson AXG PDM inputs, Nuvoton NAU8822, Renesas R8A7744 and TI PCM3060" * tag 'sound-4.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (299 commits) ASoC: stm32: sai: fix master clock naming ASoC: stm32: add clock dependency for sai ALSA: hda/ca0132 - Actually fix microphone issue ASoC: sun4i-i2s: move code from startup/shutdown hooks into pm_runtime hooks ASoC: wm2000: Remove wm2000_read helper function ASoC: cs42l51: fix mclk support ASoC: wm_adsp: Log addresses as 8 digits in wm_adsp_buffer_populate ASoC: wm_adsp: Rename memory fields in wm_adsp_buffer ASoC: cs42l51: add mclk support ASoC: stm32: sai: set sai as mclk clock provider ASoC: dt-bindings: add mclk support to cs42l51 ASoC: dt-bindings: add mclk provider support to stm32 sai ASoC: soc-core: fix trivial checkpatch issues ASoC: dapm: Add support for hw_free on CODEC to CODEC links ASoC: Intel: kbl_da7219_max98927: minor white space clean up ALSA: i2c/cs8427: Fix int to char conversion ALSA: doc: Brush up the old writing-an-alsa-driver ASoC: rsnd: tidyup SSICR::SWSP for TDM ASoC: rsnd: enable TDM settings for SSI parent ASoC: pcm3168a: add hw constraint for capture channel ...
| * ASoC: add for_each_card_components() macroKuninori Morimoto2018-09-201-2/+2
| | | | | | | | | | | | | | | | To be more readable code, this patch adds new for_each_card_components() macro, and replace existing code to it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | x86/cpu: Sanitize FAM6_ATOM namingPeter Zijlstra2018-10-021-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Going primarily by: https://en.wikipedia.org/wiki/List_of_Intel_Atom_microprocessors with additional information gleaned from other related pages; notably: - Bonnell shrink was called Saltwell - Moorefield is the Merriefield refresh which makes it Airmont The general naming scheme is: FAM6_ATOM_UARCH_SOCTYPE for i in `git grep -l FAM6_ATOM` ; do sed -i -e 's/ATOM_PINEVIEW/ATOM_BONNELL/g' \ -e 's/ATOM_LINCROFT/ATOM_BONNELL_MID/' \ -e 's/ATOM_PENWELL/ATOM_SALTWELL_MID/g' \ -e 's/ATOM_CLOVERVIEW/ATOM_SALTWELL_TABLET/g' \ -e 's/ATOM_CEDARVIEW/ATOM_SALTWELL/g' \ -e 's/ATOM_SILVERMONT1/ATOM_SILVERMONT/g' \ -e 's/ATOM_SILVERMONT2/ATOM_SILVERMONT_X/g' \ -e 's/ATOM_MERRIFIELD/ATOM_SILVERMONT_MID/g' \ -e 's/ATOM_MOOREFIELD/ATOM_AIRMONT_MID/g' \ -e 's/ATOM_DENVERTON/ATOM_GOLDMONT_X/g' \ -e 's/ATOM_GEMINI_LAKE/ATOM_GOLDMONT_PLUS/g' ${i} done Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Vince Weaver <vincent.weaver@maine.edu> Cc: dave.hansen@linux.intel.com Cc: len.brown@intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
* ASoC: Intel: bytcr_rt5651: Add quirk table entries for various devicesHans de Goede2018-07-191-0/+28
| | | | | | | | | | | | | | | | Add quirk table entries for the following tablets: ITWorks TW701 Ployer Momo7w Trekstor win7 Yours 8" These all use the default settings, except that they only have a single speaker and thus need the mono-speaker quirk. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: bytcr_rt5651: Add mono speaker quirkHans de Goede2018-07-191-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During my initial round of bytcr_rt5651 long-name patches I did not include a difference for mono vs stereo speaker setups in the longname because it seems that all 5651 devices with only a single speaker do some mixing of left + right on the PCB. However further testing has shown that while this works great when only playing audio on the left or right channel, the output becomes garbled when using both channels at once. Something which does not happen when using the Stereo DAC MIXL / MIXR switches to mix the channels together inside the codec and then only outputting on a single channel. So we need to have separate UCM profiles and thus separate long-names for devices with a mono speaker vs stereo speakers. Just as we already have for the bytcr_rt5640 case. This commit adds a new BYT_RT5651_MONO_SPEAKER quirk and adds "stereo-spk" or "mono-spk" to the long-name based on this and enables this mapping on devices with a mono speaker. Changing the long-name like this is ok for now, since I'm still working on the UCM profiles, so they are not in upstream alsa-lib yet. This brings the long-name naming scheme fully in sync with the bytcr_rt5640 case, which is good from a consistency pov. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: bytcr_rt5651: Add IN2 input mappingHans de Goede2018-07-191-5/+18
| | | | | | | | | | | | | | | | | | | | | During the recent cleanup series 3 of the 6 input mappings where removed from the bytcr_rt5651 machine driver because testing showed that none of them were used. However some devices do actually have their internal mic on IN2 (and only IN2, not IN1 and IN2), this did not show during previous tests due to a bug in the userspace UCM input device switching code. This commit re-adds the IN2 mapping for devices with the internal mic. on IN2 and the headser mic on IN3 and enables this mapping on devices with their internal mic on IN2. This commit also changes the default internal mic input to IN2, because all my 7 test devices have their mic there. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: bytcr_rt5651: Set OVCD limit for VIOS LTH17 to 2000uAHans de Goede2018-07-191-2/+5
| | | | | | | | | | | With the default over current detect limit of 1500uA headsets on often get detected as headphones on the VIOS LTH17 and even when detected as headset the OVCD current triggers often while plugged in, resulting in false-positive button press detection. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: bytcr_rt5651: Fix using the wrong GPIO for the ext-amp on some ↵Hans de Goede2018-07-191-4/+65
| | | | | | | | | | | | | | | | | | boards Some boards have I2cSerialBusV2, GpioIo, GpioInt as ACPI resources, other boards may have I2cSerialBusV2, GpioInt, GpioIo instead. We want the GpioIo one for the ext-amp-enable-gpio. So far we've been assuming that the GpioIo one always comes first, this commit adds code to detect which one comes first and to add the right gpio-mapping. This fixes sound not working on the Vios LTH17 laptop. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: bytcr_rt5651: Reporting button pressesHans de Goede2018-07-101-2/+7
| | | | | | | | | Enable reporting of button presses now that the codec driver recently has gotten support for this. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: bytcr_rt5651: Disable jack-detect over suspend/resumeHans de Goede2018-07-101-5/+44
| | | | | | | | Disable jack-detection and thus the codec IRQ over suspend/resume. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: bytcr_rt5651: Add support for externar amplifier enable GPIOHans de Goede2018-07-101-3/+62
| | | | | | | | | | | | | | | The rt5651 does not have a built-in speaker amplifier, so it is often used together with an external amplifier. On Cherry Trail boards this external amplifier's enable pin is driven through a GPIO, which is given as the first GPIO in the ACPI resources of the codec fwnode. This commit adds support to the bytcr_rt5651 for this GPIO, fixing the speaker not working on CHT devices with a rt5651 codec. Cc: Carlo Caione <carlo@endlessm.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: bytcr_rt5651: Move getting of codec_dev into probe()Hans de Goede2018-07-101-12/+11
| | | | | | | | | | | | | Move the getting of the codec_dev, to add device-props to it, out of byt_rt5651_add_codec_device_props() and into its caller, snd_byt_rt5651_mc_probe(). This is a preparation patch for adding support for an external amplifier enable GPIO, which requires further accesses to the codec_dev. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: bytcr_rt5651: Remove is_valleyview helperHans de Goede2018-07-101-12/+6
| | | | | | | | | Remove is_valleyview helper, this is not necessary, we can simply call x86_match_cpu() directly instead. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: bytcr_rt5651: Sort DMI table entries alphabeticallyHans de Goede2018-06-271-19/+22
| | | | | | | | | As we get more entries in the DMI quirk table it is nice to have some sort of ordering in the table, sort it alphabetically. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: bytcr_rt5651: Add BYT_RT5651_HP_LR_SWAPPED quirkHans de Goede2018-06-271-4/+23
| | | | | | | | | | | | | | | | | | | One some models (Chuwi Vi8 Plus, Chuwi Hi8 Pro) the headphone output has left and right swapped. This can be fixed in with special mixer settings in the UCM profile, bit this requires these devices loading a different UCM profile. This commit adds a BYT_RT5651_HP_LR_SWAPPED quirk for this and postfixes the longname with "-hp-swapped" if set, so that a different UCM profile will be loaded. We can safely do this without causing regressions (UCM profile not found due to the longname change) as the UCM profiles are not in upstream alsa-lib yet. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: bytcr_rt5651: Simplify card long-nameHans de Goede2018-06-271-6/+4
| | | | | | | | | | | | | | | Now that the headset-mic is always IN3 there is no reason to have the headset-mic mapping in the long-name. This commit simplifies the long name to "bytcr-rt5651-<intmic-map>-mic". We can safely do this without causing regressions (UCM profile not found due to the longname change) as the UCM profiles are not in upstream alsa-lib yet. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: bytcr_rt5651: Fix DMIC map headsetmic mappingHans de Goede2018-06-271-2/+2
| | | | | | | | | | | | | The initial bytcr_rt5651 machine driver commit mapped IN2 as the headset mic. In retrospect this is not correct as all known boards have the headset mic on IN3. This commit fixes the original DMIC mapping to correctly have the headset mic on IN3. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: bytcr_rt5651: Fix IN1 map headsetmic mappingHans de Goede2018-06-271-22/+7
| | | | | | | | | | | | | | The initial bytcr_rt5651 machine driver commit mapped IN2 as the headset mic. In retrospect this is not correct as all known boards have the headset mic on IN3. To workaround this special IN?_HS_IN3 mappings were added. This commit fixes the original IN1 mapping to correctly have the headset mic on IN3, moves all users of the IN1_HS_IN3 mapping over to the fixed IN1_MAP and drops the now no longer needed IN1_HS_IN3 mapping. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: bytcr_rt5651: Remove IN2 input mappingsHans de Goede2018-06-271-28/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | BYT_RT5651_IN2_MAP was introduced in commit 39712db878a4 ("SoC: intel: byt: Introduce new custom IN2 map"), uses in commit 2fe30129b0a6 ("ASoC: intel: byt: Enable IN2 map quirk for a KIANO laptop"), only to be replaced by a new BYT_RT5651_IN1_IN2_MAP quirk in commit ea261bd02a67 ("ASoC: intel: byt: Introduce new map for dual mics") quickly afterwards, because the KIANO laptop has 2 internal mics on IN1 and IN2 and the headset mic is not in IN1 where the BYT_RT5651_IN2_MAP maps it, but on IN3. Now that the KIANO quirk entry uses BYT_RT5651_IN1_IN2_MAP, there are no users of BYT_RT5651_IN2_MAP left. This makes sense since the headset mic seems to always be connected to IN3, so BYT_RT5651_IN2_MAP is not useful. To deal with BYT_RT5651_IN2_MAP wrongly mapping the headset mic to IN1, BYT_RT5651_IN2_HS_IN3_MAP was added in commit f026e0631780 ("ASoC: Intel: bytcr_rt5651: Add new IN2_HS_IN3 input map and a quirk using it"). This was based on the assumption then some devices have the internal mic connected to IN2 only. Further testing has shown that this is wrong and the internal mic is always connected to IN1 and sometimes to both IN1 and IN2. TL;DR: Both BYT_RT5651_IN2_MAP and BYT_RT5651_IN2_HS_IN3_MAP are based on on wrong assumptions from the past and are no longer useful now, so they can both be removed. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: bytcr_rt5651: Fix IN1_IN2_MAP quirk not being loggedHans de Goede2018-06-271-0/+2
| | | | | | | | Fix the quirk logging code not logging the IN1_IN2_MAP quirk. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: bytcr_rt5651: Change default input map from in2 to in1Hans de Goede2018-06-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | Further testing on all 6 model x86 tablets with a rt5651 which I have access to for testing has shown that their single (mono) microphone is connected to both IN1 *and* IN2. The previous default mapping of IN2 was based on testing on the same 6 tablets, where the internal mic works fine with a mapping of IN2. But it works fine too with a mapping of IN1. This commit changes the default input mapping to to use IN1 instead of IN2, to match the mapping used for the other mono devices in the DMI quirk table. So that we need less different mappings. The same change is made to the Chuwi Vi8 Plus quirks, which is one of the 6 models tested. This is a preparation patch for simplifying the maps in a follow-up commit. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: bytcr_rt5651: Add BYT_RT5651_DEFAULT_QUIRKS defineHans de Goede2018-06-271-16/+9
| | | | | | | | | | | | Almost all boards use the mclk and use the same jack-detect settings, add a BYT_RT5651_DEFAULT_QUIRKS define for this. This shaves of some lines and makes it easier to see which settings are unique to a certain model. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* Merge branch 'asoc-4.17' into asoc-4.18 merge windowMark Brown2018-06-051-2/+3
|\