summaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/boards/bytcr_rt5640.c
AgeCommit message (Collapse)AuthorFilesLines
2020-12-11Merge remote-tracking branch 'asoc/for-5.11' into asoc-nextMark Brown1-10/+20
2020-12-09ASoC: Intel: bytcr_rt5640: Add quirk for ARCHOS Cesium 140Chris Chiu1-0/+12
Tha ARCHOS Cesium 140 tablet has problem with the jack-sensing, thus the heaset functions are not working. Add quirk for this model to select the correct input map, jack-detect options and channel map to enable jack sensing and headset microphone. This device uses IN1 for its internal MIC and JD2 for jack-detect. Signed-off-by: Chris Chiu <chiu@endlessos.org> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20201208060414.27646-1-chiu@endlessos.org Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-30Merge branch 'for-5.10' of ↵Mark Brown1-3/+14
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.11
2020-11-19ASoC: Intel: byt/cht: set pm ops dynamicallyPierre-Louis Bossart1-3/+5
The Atom/SST driver does not rely on ASoC power management, but the SOF driver does. Rather than using a hard-coded build-time assignment, we can set this pm_ops dynamically depending on what the parent is. That will remove the last build-time dependency and allow for coexistence of both SST and SOF drivers for Baytrail/Cherrytrail. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Link: https://lore.kernel.org/r/20201112223825.39765-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-19ASoC: Intel: boards: byt/cht: set card and driver name at run timePierre-Louis Bossart1-7/+15
To avoid hard-coded variations between SOF and SST drivers, set the card name and driver dynamically depending on the parent type. This is the first pass required to let distributions select which drivers to use with kernel parameters instead of build-time selection. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Link: https://lore.kernel.org/r/20201112223825.39765-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-19ASoC: Intel: bytcr_rt5640: Fix HP Pavilion x2 Detachable quirksHans de Goede1-3/+14
The HP Pavilion x2 Detachable line comes in many variants: 1. Bay Trail SoC + AXP288 PMIC, Micro-USB charging (10-k010nz, ...) DMI_SYS_VENDOR: "Hewlett-Packard" DMI_PRODUCT_NAME: "HP Pavilion x2 Detachable PC 10" DMI_BOARD_NAME: "8021" 2. Bay Trail SoC + AXP288 PMIC, Type-C charging (10-n000nd, 10-n010nl, ...) DMI_SYS_VENDOR: "Hewlett-Packard" DMI_PRODUCT_NAME: "HP Pavilion x2 Detachable" DMI_BOARD_NAME: "815D" 3. Cherry Trail SoC + AXP288 PMIC, Type-C charging (10-n101ng, ...) DMI_SYS_VENDOR: "HP" DMI_PRODUCT_NAME: "HP Pavilion x2 Detachable" DMI_BOARD_NAME: "813E" 4. Cherry Trail SoC + TI PMIC, Type-C charging (10-p002nd, 10-p018wm, ...) DMI_SYS_VENDOR: "HP" DMI_PRODUCT_NAME: "HP x2 Detachable 10-p0XX" DMI_BOARD_NAME: "827C" 5. Cherry Trail SoC + TI PMIC, Type-C charging (x2-210-g2, ...) DMI_SYS_VENDOR: "HP" DMI_PRODUCT_NAME: "HP x2 210 G2" DMI_BOARD_NAME: "82F4" Variant 1 needs the exact same quirk as variant 2, so relax the DMI check for the existing quirk a bit so that it matches both variant 1 and 2 (note the other variants will still not match). Variant 2 already has an existing quirk (which now also matches variant 1) Variant 3 uses a cx2072x codec, so is not applicable here. Variant 4 almost works with the defaults, but it also needs a quirk to fix jack-detection, add a new quirk for this. Variant 5 does use a RT5640 codec (based on old dmesg output), but was otherwise not tested, keep using the defaults for this variant. Fixes: ec8e8418ff7d ("ASoC: Intel: bytcr_rt5640: Add quirks for various devices") Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20201118121515.11441-1-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-10-06ASoC: Intel: Make atom components independent of sst-dspCezary Rojewski1-1/+0
With sound/soc/intel/haswell and /baytrail gone, registers left within sst-dsp header are atom-specific. Relocate these to atom internal header to make atom truely independent of sound/soc/common processing code. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Liam Girdwood <liam.r.girdwood@intel.com> Link: https://lore.kernel.org/r/20201006064907.16277-12-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-02ASoC: Intel: bytcr_rt5640: Add quirk for MPMAN Converter9 2-in-1Hans de Goede1-0/+10
The MPMAN Converter9 2-in-1 almost fully works with out default settings. The only problem is that it has only 1 speaker so any sounds only playing on the right channel get lost. Add a quirk for this model using the default settings + MONO_SPEAKER. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200901080623.4987-1-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-27ASoC: intel/boards: use asoc_substream_to_rtd()Kuninori Morimoto1-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>
2020-06-26ASoC: Intel: boards: byt*.c: remove cast in dev_info quirk logPierre-Louis Bossart1-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>
2020-06-17ASoC: Intel: byt*: simplify card names for SOF usesPierre-Louis Bossart1-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>
2020-06-09ASoC: Intel: bytcr_rt5640: Add quirk for Toshiba Encore WT10-A tabletHans de Goede1-0/+12
The Toshiba Encore WT10-A tablet almost fully works with the default settings for Bay Trail CR devices. The only issue is that it uses a digital mic. connected the the DMIC1 input instead of an analog mic. Add a quirk for this model using the default settings with the input-map replaced with BYT_RT5640_DMIC1_MAP. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200608204634.93407-1-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-27ASoC: Intel: byt/cht: add .pm_opsPierre-Louis Bossart1-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>
2020-05-27ASoC: Intel: bytcr_rt5640/51: remove .ignore_suspendPierre-Louis Bossart1-4/+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>
2020-05-18ASoC: Intel: bytcr_rt5640: Add quirk for Toshiba Encore WT8-A tabletHans de Goede1-0/+12
The Toshiba Encore WT8-A tablet almost fully works with the default settings for non-CR Bay Trail devices. The only problem is that its jack-detect switch is not inverted (it is active high instead of the normal active low). Add a quirk for this model using the default settings + BYT_RT5640_JD_NOT_INV. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200518072416.5348-1-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-06ASoC: Intel: bytcr_rt5640: Add quirk for MPMAN MPWIN895CL tabletHans de Goede1-0/+11
The MPMAN MPWIN895CL tablet almost fully works with out default settings. The only problem is that it has only 1 speaker so any sounds only playing on the right channel get lost. Add a quirk for this model using the default settings + MONO_SPEAKER. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200405133726.24154-1-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-27ASoC: intel: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointerKuninori Morimoto1-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>
2020-01-17ASoC: Intel: bytcr_rt5640: Remove unnecessary string buffers and snprintf callsNariman Etemadi1-22/+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: Nariman Etemadi <narimantos@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20200115164619.101705-3-hdegoede@redhat.com Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-17ASoC: Intel: bytcr_rt5640: Remove code duplication in byt_rt5640_codec_fixupErik Bussing1-45/+23
The 16 and 24 bit paths in byt_rt5640_codec_fixup are mostly identical, introduce a local bits variable to address the only difference and move the common bits out of the if ... else ... . Signed-off-by: Erik Bussing <eabbussing@outlook.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20200115164619.101705-2-hdegoede@redhat.com Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-14ASoC: Intel: bytcr_rt5640: remove unused variablePierre-Louis Bossart1-8/+0
Fix GCC warning with W=1 sound/soc/intel//boards/bytcr_rt5640.c:936:40: warning: ‘byt_rt5640_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-18-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-12-10Merge branch 'for-5.5' of ↵Mark Brown1-2/+6
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.6
2019-12-09ASoC: Intel - do not describe I/O configuration in the long card nameJaroslav Kysela1-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>
2019-12-09ASoC: Intel - use control components to describe card configJaroslav Kysela1-0/+6
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>
2019-12-04ASoC: Intel: bytcr_rt5640: Update quirk for Teclast X89Hans de Goede1-2/+6
When the Teclast X89 quirk was added we did not have jack-detection support yet. Note the over-current detection limit is set to 2mA instead of the usual 1.5mA because this tablet tends to give false-positive button-presses when it is set to 1.5mA. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20191203221442.2657-1-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-11-19ASoC: Intel: bytcr_rt5640: Update quirk for Acer Switch 10 SW5-012 2-in-1Hans de Goede1-4/+6
When the Acer Switch 10 SW5-012 quirk was added we did not have jack-detection support yet; and the builtin microphone selection of the original quirk is wrong too. Fix the microphone-input quirk and add jack-detection info so that the internal-microphone and headphone/set jack on the Switch 10 work properly. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20191119145138.59162-1-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-06-26Merge tag 'v5.2-rc6' into asoc-5.3Mark Brown1-9/+1
Linux 5.2-rc6
2019-06-06ASoC: Intel: bytcr_rt5640: use modern dai_link styleKuninori Morimoto1-16/+28
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>
2019-06-05treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 285Thomas Gleixner1-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>
2019-05-30ASoC: Intel: use common helpers to detect CPUsPierre-Louis Bossart1-14/+2
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>
2019-04-25ASoC: Intel: bytcr_rt5640: align quirk override handlingPierre-Louis Bossart1-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>
2019-04-01ASoC: Intel: bytcr_rt5640: Convert to use acpi_dev_get_first_match_dev()Andy Shevchenko1-5/+5
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>
2019-01-28ASoC: Intel: bytcr_rt5640: platform name fixup supportPierre-Louis Bossart1-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>
2019-01-24ASoC: Intel: make const arrays static, reduces object code sizeColin Ian King1-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>
2019-01-04ASoC: Intel: bytcr_rt5640: Add quirks for ASUS MeMO Pad 7 (ME176C)Stephan Gerhold1-0/+12
Add quirks to select the correct input map, jack-detect options and channel map to make sound work on the ASUS MeMO Pad 7 (ME176C). Note: Although sound works out of the box, jack detection currently requires overriding the ACPI DSDT table. This is necessary because the rt5640 ACPI device (10EC5640) has the wrong GPIO listed as interrupt (one of the Bluetooth GPIOs). The correct GPIO is GPO2 0x0004 (listed as the first GPIO in the Intel(R) Audio Machine Driver - AMCR0F28 device). Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-10ASoC: Intel: bytcr_rt5640: Add quirk for the Point of View Mobii TAB-P1005W-232Hans de Goede1-0/+13
Add a quirk for the Point of View Mobii TAB-P1005W-232 v2.0 tablet, this BYTCR device uses IN1 for its MIC and JD2 for jack-detect, rather then the default IN3 and JD1. 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>
2018-12-10ASoC: Intel: bytcr_rt5640: Add quirk for the Prowise PT301 tabletHans de Goede1-0/+14
Add a quirk for the Prowise PT301 tablet, this BYTCR tablet has no CHAN package in its ACPI tables and uses SSP0-AIF1 rather then SSP0-AIF2 which is the default for BYTCR devices. Also it uses IN1 for its MIC and JD2 for jack-detect, rather then the default IN3 and JD1. 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>
2018-11-06ASoC: Intel: use standard interface for Atom machine driversPierre-Louis Bossart1-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>
2018-09-20ASoC: add for_each_card_components() macroKuninori Morimoto1-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>
2018-08-14ASoC: Intel: bytcr_rt5640: Add quirks for 2 more devicesHans de Goede1-0/+26
Add quirks to select the right input-map, jack-detect pin, etc. for: Linx Linx7 tablet Onda V975w tablet 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>
2018-07-19ASoC: Intel: bytcr_rt5640: Add quirk for the "Connect Tablet 9" tabletHans de Goede1-0/+10
Add a quirk for the "Connect Tablet 9" tablet, this tablet has a mono-speaker. Otherwise it works fine with the defaults. 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>
2018-07-10ASoC: Intel: bytcr_rt5640: Add quirk for the Lenovo Miix2 8 tabletHans de Goede1-0/+13
Add a quirk for the Lenovo Miix2 8 tablet, this tablet uses a digital mic on DMIC1 and has a mono-speaker. The jack-detect uses the default settings.. Reported-and-tested-by: russianneuromancer@ya.ru 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>
2018-06-18ASoC: Intel: bytcr_rt5640: Fix Acer Iconia 8 over-current detect thresholdHans de Goede1-1/+1
Change the over-current detect threshold on the Acer Iconia 8 from 2000ua to 1500uA, this fixes headset button presses not being detected. 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>
2018-06-18ASoC: Intel: bytcr_rt5640: Add quirk for the Nuvison/TMax TM800W560 tabletHans de Goede1-0/+14
Add a quirk for the Nuvison/TMax TM800W560 tablet, this tablet uses IN1 for the internal mic rather then the default IN3 and it uses JD2 rather then JD1 for its not-inverted jack-detect switch. 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>
2018-06-18ASoC: Intel: bytcr_rt5640: Add quirk for the Chuwi Vi10 tabletHans de Goede1-0/+16
Add a quirk for the Chuwi Vi10 tablet, this tablet uses IN1 for the internal mic rather then the default IN3 and it uses JD2 rather then JD1 for its jack-detect switch. 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>
2018-05-29ASoC: Intel: bytcr_rt5640: Add quirk for the ARCHOS 80 Cesium 8" windows tabletHans de Goede1-0/+10
Add a quirk for the ARCHOS 80 Cesium 8" windows tablet, this device mostly works with the default settings, except that it has only one speaker. So add a quirk with the default settings + the mono-speaker flag. 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>
2018-05-17ASoC: Intel: bytcr_rt5640: Set card long_name based on quirksHans de Goede1-0/+9
Many X86 devices using a BYT SoC + RT5640 codec are cheap devices with generic DMI strings, causing snd_soc_set_dmi_name() to fail to set a long_name, making it impossible for userspace to have a correct UCM profile which only uses inputs / outputs which are actually hooked up on the device. Our quirks already specify which input the internal mic is connected to and if a single (mono) speaker is used or if the device has stereo speakers. This commit sets a long_name based on the quirks so that userspace can have UCM profiles doing the right thing based on the long_name. Note that if we ever encounter the need for a special UCM profile for some device we can add a quirk to set a specific long_name for the device, 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>
2018-05-17ASoC: Intel: bytcr_rt5640: Add quirks for various devicesHans de Goede1-0/+141
Even with our recently tweaked defaults, quite a few bytcr_rt5640 devices still need quirks to be fully functional. This commits adds quirks where necessary for the 16 bytcr_rt5640 devices I have access to. The quirks are added for the following reasons: 1) Devices with only one speaker need the mono quirk to avoid driving an unused and potentially short-circuited output. 8 of my sample of 16 devs are mono, 4 of these would work with the defaults if it were not for their mono speaker. 2) Devices using a different input for the internal mic then the default, this is the case for 6 of my sample of 16 devices. 3) BYTCR devices without an ACPI channel map, which do not work with the default of SSP0-AIF2, this is the case for 2 of my sample of 16 devices. 4) Devices which need non-default jack-detect settings, this is the case for 6 of my sample of 16 devices. This commit add quirks for the following devices: Acer Iconia Tab 8 W1-810 Chuwi Vi8 HP Pavilion X2 10-n000nd HP Stream 7 I.T. Works TW891 Lamina I8270 MSI S100 Pipo W4 PoV-mobii-800w (v2.0) PoV-mobii-800w (v2.1) Toshiba Click Mini L9W-B 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>
2018-05-17ASoC: Intel: bytcr_rt5640: Use dmi_first_match() for DMI quirk handlingHans de Goede1-15/+4
Use dmi_first_match() instead of dmi_check_system() + callbacks, this avoid the need to initialize dmi_system_id.callback for each byt_rt5640_quirk_table entry. 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>
2018-05-17ASoC: Intel: bytcr_rt5640: Sort DMI quirk list alphabeticallyHans de Goede1-20/+21
As we add more quirks it is useful to have some sort of order in the quirk list, sort it alphabetically. 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>
2018-05-17ASoC: Intel: bytcr_rt5640: Add default jack-detect settingsHans de Goede1-1/+7
Out of the 11 BYTCR devices which I have access to for testing, 6 use JD1IN4P for jack-detect, 2 use JD1IN4P non-inverted and the other 3 use JD2IN4N, the ones not using JD1IN4P are all also special in other ways and need a DMI quirk regardless. All 5 BYT (non CR) devices which I have access to use JD2IN4N. 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>