aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/boards/bytcr_rt5640.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
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 https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.6Mark Brown1-2/+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>
2018-05-17ASoC: Intel: bytcr_rt5640: Unify BYTCR input defaultsHans de Goede1-3/+6
Currently we've 2 places with BYTCR defaults: 1. The generic catch-all DMI_SYS_VENDOR=="Insyde" DMI quirk which selects SSP0-AIF1 for generic Insyde BYTCR tablets without the ACPI channel package; and 2. the defaults in the if (is_bytcr) {} code block. Currently these are not identical, both select IN3 as the internal mic output, but the "Insyde" DMI quirk leaves out the DIFF_MIC quirk. The DIFF_MIC quirk should be enabled by default, because enabling diff. input helps a lot for devices with a differential mic, where as it is a nop on devices with a normal mic. This commit adds the DIFF_MIC quirk to the "Insyde" DMI quirk path, by adding a new BYTCR_INPUT_DEFAULTS define and using that in both code paths which set BYTCR defaults. Having a single place where the BYTCR input defaults are defined also allows defining jack-detect defaults in a single place in a follow-up commit. 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: Change BYTCR default input to IN3Hans de Goede1-1/+1
Out of the 11 BYTCR devices which I have access to for testing, 7 use IN3 for the internal mic and only 1 uses IN1 for the internal mic, the other 3 use DMIC1. So IN3 clearly is a better default, using IN3 as default avoids the need to add DMI quirks for some of these devices. 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: Enable jack detectionHans de Goede1-16/+148
Add code to support setting jack-detect parameters through quirks and extend the existing DMI quirk table entries for the Asus T100TA and the Dell Venue 8 Pro 5830 to enable jack detection. Tested-by: Hans de Goede <hdegoede@redhat.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>
2018-05-17ASoC: Intel: bytcr_rt5640: Fix Dell Venue 8 5830 Pro quirkHans de Goede1-2/+3
This fixes the following 3 issues: 1) The sys_vendor match should be for "Dell Inc." not "DellInc.", without this fixed the quirk never gets applied 2) DMIC1 is used not DMIC2, this was not a problem sofar because for regular BYT boards (rather then BYTCR) we default to DMIC1 and because of 1. the quirk was not being applied 3) The Dell Venue 8 5830 Pro only has a single speaker 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 device properties for setting up dmicHans de Goede1-28/+14
Use device-properties for setting up the dmic, based on the BYT_RT5640_MAP() value, instead of using the codec specific rt5640_dmic_enable() function for this. This also removes the need for the BYT_RT5640_DMIC_EN quirk, which was always set together with a MAP() quirk of DMIC1_MAP or DMIC2_MAP. 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-13ASoC: Intel: bytcr_rt5640: Fix compile errorHans de Goede1-2/+2
Fix the compile error introduced by: "ASoC: Intel: bytcr_rt5640: Configure PLL1 before using it". Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-11ASoC: Intel: bytcr_rt5640: Use device-property for differential micsHans de Goede1-5/+43
Set the "realtek,in1-differential" or "realtek,in3-differential" device-property when the BYT_RT5640_DIFF_MIC quirk is set instead of directly poking the codec registers. This also fixes the BYT_RT5640_DIFF_MIC quirk not working when combined with BYT_RT5640_IN3_MAP. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-11ASoC: Intel: bytcr_rt5640: Configure PLL1 before using itHans de Goede1-51/+49
When platform_clock_control() first selects PLL1 as sysclk the PLL_CTRL registers have not been setup yet and we effectively have an invalid clock configuration until byt_rt5640_aif1_hw_params() gets called. Add a new byt_rt5640_prepare_and_enable_pll1() helper and use that from both platform_clock_control() and byt_rt5640_aif1_hw_params() to fix this. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-04-16ASoC: intel: bytcr_rt5640: Replace GFP_ATOMIC with GFP_KERNEL in snd_byt_rt5640_mc_probeJia-Ju Bai1-1/+1
snd_byt_rt5640_mc_probe() is never called in atomic context. This function is only set as ".probe" in "struct platform_driver". Despite never getting called from atomic context, snd_byt_rt5640_mc_probe() calls devm_kzalloc() with GFP_ATOMIC, which waits busily for allocation. GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL, to avoid busy waiting and improve the possibility of sucessful allocation. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-02-12ASoC: rt5640: replace codec to componentKuninori Morimoto1-4/+4
Now we can replace Codec to Component. Let's do it. Note: xxx_codec_xxx() -> xxx_component_xxx() .idle_bias_off = 1 -> .idle_bias_on = 0 .ignore_pmdown_time = 0 -> .use_pmdown_time = 1 - -> .endianness = 1 - -> .non_legacy_dai_naming = 1 Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-12ASoC: Intel - Convert to use acpi_dev_get_first_match_name()Andy Shevchenko1-1/+1
Instead of home grown snd_soc_acpi_find_name_from_hid() use acpi_dev_get_first_match_name(). Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-12ASoC: acpi: remove hard-coded i2c-device name lengthPierre-Louis Bossart1-1/+1
Remove hard-codec [16] array size, replace with clearer description and dependency on ACPI_ID_LEN No functionality change Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-By: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-10-21ASoC: move ACPI common code out of Intel/sst treePierre-Louis Bossart1-5/+6
ACPI support is not specific to the Intel/SST driver. Move the enumeration and matching code which is not hardware-dependent to sound/soc and rename relevant sst_acpi_ structures and functions with snd_soc_acpi_ prefix soc-acpi.h is protected by a #ifndef __LINUX_SND_SOC_ACPI_H for consistency with all other SoC .h files: grep -L __LINUX include/sound/soc* | wc -l 0 grep __LINUX include/sound/soc* | wc -l 14 Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-10-18ASoC: Intel: boards: remove hard-coded compressed dailinksPierre-Louis Bossart1-10/+1
The hard-coded compressed dailinks are not supported using publicly-available firmwares, which creates unnecessary user confusion [1]. Even if the firmware was available, the mainline code does not have the required .dynamic=1 and .dpcm_playback=1 fields so probably never worked as is, and last and they conflict with topology-defined streams. Remove them and move on. This can be re-enabled with SOF later in a more flexible manner. [1] http://mailman.alsa-project.org/pipermail/alsa-devel/2017-August/124868.html Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-10-18ASoC: Intel: boards: fix off-by-one dailink idPierre-Louis Bossart1-1/+1
For some reason the Atom/HiFi2 machine drivers use an id=1 instead of zero as done on all other platforms. This gets in the way of topology-based matching, realign for consistency. This should not have any functional impact on existing solutions with don't rely on topology. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-10-18ASoC: Intel: boards: use helper to get codec_daiPierre-Louis Bossart1-17/+4
Remove duplicate code with a common helper in all Intel machine drivers. Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Suggested-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-10-18ASoC: Intel: bytcr_rt5640: cosmetic fixesPierre-Louis Bossart1-37/+36
Reorder variable names, change MCLK test, change quirks No functional change Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>