aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/samsung/i2s.c
AgeCommit message (Collapse)Author
2017-08-15ASoC: samsung: i2s: Null pointer dereference on samsung_i2s_removeAnton Vasilyev
If (quirks & QUIRK_SEC_DAI == 0) then samsung_i2s_probe() doesn't allocate sec_dai and pri_dai->sec_dai remains Null, but samsung_i2s_remove() performs pri_dai->sec_dai dereference in any case. The patch removes useless reinitialization of sec_dai at samsung_i2s_remove(), because resources are under devm control. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev <vasilyev@ispras.ru> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-26ASoC: samsung: i2s: Handle return value of clk_prepare_enable.Arvind Yadav
clk_prepare_enable() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-17ASoC: samsung: i2s: Support more resolution ratesJaechul Lee
This driver can support more frequencies over 96KHz. There are no reasons to limit the frequency range below 96KHz. If codecs/amps or something else can't support higher resolution rates, the constraints would be set rates properly because each drivers have its own limits. I added the 'pcm_rates' field to the dai_data to be set rates by the compatibilities. As a result, rates will be set each devices respectively. For example of exynos5433, rates will be set from 8KHz to 192KHz. Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07ASoC: samsung: Remove extra blank linesCalin Cruceru
This was reported by checkpatch.pl Signed-off-by: Calin Cruceru <calin@rosedu.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-19Merge remote-tracking branches 'asoc/topic/rt5665', 'asoc/topic/rt5677', ↵Mark Brown
'asoc/topic/samsung', 'asoc/topic/simple' and 'asoc/topic/sunxi' into asoc-next
2017-01-23ASoC: Revert "samsung: Remove unneeded initialization of chan_name"Sylwester Nawrocki
This reverts commit cdaf9af1eaeb539e32bfd6da6310b41ad6c3ba23 which breaks I2S support on the non-DT Samsung SoC platforms, since the default "tx", "rx" DMA channel names for playback and capture streams or custom channel names in struct snd_dmaengine_pcm_config are supported in the ASoC dmaengine module only for devicetree booting case. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-12-31ASoC: samsung: i2s: Provide I2S device for registered clocksMarek Szyprowski
This patch adds pointer to I2S device to clk_register_* functions. This in the future allow clock framework to ensure proper runtime state of the I2S device during all operations on the clocks provided by I2S module. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-12-31ASoC: samsung: i2s: Let runtime PM operations to control op_clk tooMarek Szyprowski
This patch adds handling of parent operational clock to runtime PM callbacks. This way it is ensured that when I2S module is in runtime suspended state, all its parent clocks are disabled and unprepared. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-12-31ASoC: samsung: i2s: Move saving and restoring regs to runtime pm operationsMarek Szyprowski
This patch moves saving and restoring I2S registers to runtime PM operations, what prepares the driver to operate with audio power domain. When support for audio power domain is enabled and the domain is being turned off, the I2S module will loose its context (registers), so runtime callbacks have to handle it. System sleep suspend/resume operation are implemented on top of runtime PM operations with generic pm_runtime_force_suspend/resume helpers. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-12-31ASoC: samsung: i2s: Ensure proper runtime PM state of I2S deviceMarek Szyprowski
This patch adds calls to pm_runtime_get/put to ensure that any access to I2S registers is done with proper (active) runtime PM state of I2S device. Till now the driver enabled runtime PM, but didn't manage the state during driver operation. The driver worked fine only because the runtime PM callbacks managed device clock, which was enabled all the time because of the additional enable call in the driver's probe function. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-12-31ASoC: samsung: i2s: Remove virtual device for secondary DAIMarek Szyprowski
For some unknown (maybe historical?) reasons support for secondary I2S DAI was implemented by adding additional virtual platform device, which was then probed again with the main I2S driver. This pattern is really hard to follow and provides no benefits, so lets remove this hack and register both DAIs during linear probe of Exynos I2S controller driver. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-12-15ASoC: samsung: Remove tests of member addressKrzysztof Kozlowski
The driver was checking for non-NULL address of struct's members: - s3c_audio_pdata->type (union), - s3c_audio_pdata->type.i2s (embedded struct). This is pointless as these will be always non-NULL. The 's3c_audio_pdata' is always initialized in static memory so it will be zeroed. Additionally the 'type' member was an union with only one member. It is safe to reorganize the structures to get rid of useless union and checks for addresses to fix the coccinelle warning: >> sound/soc/samsung/i2s.c:1270:2-4: ERROR: test of a variable/field address Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-10-28Merge branch 'fix/samsung' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-samsung
2016-10-28ASoC: samsung: get access to DMA engine early to defer probe properlyMarek Szyprowski
ASoC Samsung sub-drivers tried to get access to their DMA engine controllers as a last step in driver probe. If a DMA engine was not available yet, samsung_asoc_dma_platform_register() function ended in -EPROBE_DEFER, but the driver already registered its component to ASoC core. This patch moves samsung_asoc_dma_platform_register() call before registering any components, to the common place, where driver was gathering all needed resources. In case of Samsung Exynos i2s driver the issue was even worse. The driver managed already to register its secondary DAI platform device before even getting the DMA engine access. That together with -EPROBE_DEFER error code from samsung_i2s_probe() immediately triggered another round of deferred probe retry and in turn endless loop of driver probing. This patch fixes broken boot on Odroid XU3 and other Exynos5422-based boards. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-10-25Merge branch 'topic/dmaengine' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-samsung
2016-10-25ASoC: samsung: Remove unneeded initialization of chan_nameSylwester Nawrocki
This patch updates the I2S drivers to always use chan_names[] field of struct snd_dmaengine_pcm_config for specifying DMA channel names, rather than using struct snd_dmaengine_dai_dma_data. This allows us to subsequently drop the SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME flag, now when the last use of that flag is removed. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-10-24ASoC: samsung: i2s: Fixup last IRQ unsafe spin lock callCharles Keepax
Unfortunately, I seem to have missed a case where an IRQ safe spinlock was required, in samsung_i2s_dai_remove, when I fixed up the other calls in this patch: 316fa9e09ad7 ("ASoC: samsung: Use IRQ safe spin lock calls") This causes a lockdep warning when unbinding and rebinding the audio card: [ 104.357664] CPU0 CPU1 [ 104.362174] ---- ---- [ 104.366692] lock(&(&pri_dai->spinlock)->rlock); [ 104.371372] local_irq_disable(); [ 104.377283] lock(&(&substream->self_group.lock)->rlock); [ 104.385259] lock(&(&pri_dai->spinlock)->rlock); [ 104.392469] <Interrupt> [ 104.395072] lock(&(&substream->self_group.lock)->rlock); [ 104.400710] [ 104.400710] *** DEADLOCK *** Fixes: ce8bcdbb61d9 ("ASoC: samsung: i2s: Protect more registers with a spinlock") Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-24ASoC: samsung: i2s: Add missing clk_disable_unprepare() on error in ↵Wei Yongjun
samsung_i2s_probe() Add the missing clk_disable_unprepare() before return from samsung_i2s_probe() in the error handling case. Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-08ASoC: samsung: Drop usage of struct s3c_dma_params from i2s.cSylwester Nawrocki
struct s3c_dma_params already includes struct snd_dmaengine_dai_dma_data, there is no need for such an indirection so switch to using struct snd_dmaengine_dai_dma_data instead of struct s3c_dma_params. This also allows us to use snd_soc_dai_init_dma_data() function instead of the platform specific samsung_asoc_init_dma_data helper. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-07-21ASoC: samsung: Specify DMA channels through struct snd_dmaengine_pcm_configSylwester Nawrocki
The DMA channel names are specified through struct snd_dmaengine_pcm_config rather than using SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME flag when booting with devicetree in order to properly support deferred probing. Without this change the sound machine driver initialization can complete successfully with unavailable DMA resources. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-07-21ASoC: samsung: Fix error paths in the I2S driver's probe()Sylwester Nawrocki
Ensure they secondary DAI device is freed properly when asoc_dma_platform registration fails. This change is needed for proper deferred probe support and will help preventing situations when the CPU DAI's initialization completes without required DMA resources. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30ASoC: samsung: Use of_device_get_match_data() helperSylwester Nawrocki
Simplify the code a little by using a standard function for getting the match data. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30ASoC: samsung: Remove definition of an unused data structureSylwester Nawrocki
samsung_dai_type_pri is not referenced anywhere so remove it. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30ASoC: samsung: Remove unused "samsung-i2sv4" platform_device_id entrySylwester Nawrocki
"samsung-i2sv4" identifier was previously used for the I2S device of the S5PV210 SoCs, it can be removed now when s5pv210 is a dt-only platform. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-20ASoC: samsung: Use IRQ safe spin lock callsCharles Keepax
Lockdep warns of a potential lock inversion, i2s->lock is held numerous times whilst we are under the substream lock (snd_pcm_stream_lock). If we use the IRQ unsafe spin lock calls, you can also end up locking snd_pcm_stream_lock whilst under i2s->lock (if an IRQ happens whilst we are holding i2s->lock). This could result in deadlock. [ 18.147001] CPU0 CPU1 [ 18.151509] ---- ---- [ 18.156022] lock(&(&pri_dai->spinlock)->rlock); [ 18.160701] local_irq_disable(); [ 18.166622] lock(&(&substream->self_group.lock)->rlock); [ 18.174595] lock(&(&pri_dai->spinlock)->rlock); [ 18.181806] <Interrupt> [ 18.184408] lock(&(&substream->self_group.lock)->rlock); [ 18.190045] [ 18.190045] *** DEADLOCK *** This patch changes to using the irq safe spinlock calls, to avoid this issue. Fixes: ce8bcdbb61d9 ("ASoC: samsung: i2s: Protect more registers with a spinlock") Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Tested-by: Anand Moon <linux.amoon@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2015-11-21ASoC: samsung: pass filter function as pointerArnd Bergmann
As we are now passing the filter data as pointers to the drivers, we can take the final step and also pass the filter function the same way. I'm keeping this change separate, as there it's less obvious that this is a net win. Upsides of this are: - The ASoC drivers are completely independent from the DMA engine implementation, which simplifies the Kconfig logic and in theory allows the same sound drivers to be built in a kernel that supports different kinds of dmaengine drivers. - Consistency with other subsystems and drivers On the other hand, we have a few downsides: - The s3c24xx-dma driver now needs to be built-in for the ac97 platform device to be instantiated on s3c2440. - samsung_dmaengine_pcm_config cannot be marked 'const' any more because the filter function pointer needs to be set at runtime. This is safe as long we don't have multiple different DMA engines in thet same system at runtime, but is nonetheless ugly. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-18ASoC: samsung: pass DMA channels as pointersArnd Bergmann
ARM64 allmodconfig produces a bunch of warnings when building the samsung ASoC code: sound/soc/samsung/dmaengine.c: In function 'samsung_asoc_init_dma_data': sound/soc/samsung/dmaengine.c:53:32: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] playback_data->filter_data = (void *)playback->channel; sound/soc/samsung/dmaengine.c:60:31: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] capture_data->filter_data = (void *)capture->channel; We could easily shut up the warning by adding an intermediate cast, but there is a bigger underlying problem: The use of IORESOURCE_DMA to pass data from platform code to device drivers is dubious to start with, as what we really want is a pointer that can be passed into a filter function. Note that on s3c64xx, the pl08x DMA data is already a pointer, but gets cast to resource_size_t so we can pass it as a resource, and it then gets converted back to a pointer. In contrast, the data we pass for s3c24xx is an index into a device specific table, and we artificially convert that into a pointer for the filter function. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-01ASoC: samsung: Constify platform_device_idKrzysztof Kozlowski
The platform_device_id is not modified by the driver and core uses it as const. Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-14ASoC: samsung: i2s: Add clock provider for the I2S internal clocksSylwester Nawrocki
This patch adds clock provider (currently only for DT platforms) for the CODECLKO (CDCLK) gate, RCLKSRC mux and RCLK pre-scaler divider divider clock. Those all tree clock are only available in the IIS Multi Audio Interface (I2S0), the regular IIS Bus Interface has only CDCLK gate clock. The motivation behind this patch is to expose the I2S internal clocks which are currently controlled through set_sysclk() through the clk API, so dedicated sound machine driver per each board can be avoided. The intention is also to fix the CDCLK gating issue reported by Daniel Drake: http://mailman.alsa-project.org/pipermail/alsa-devel/2014-September/081753.html This patch also reverts commit b97c60abf9a561f86ae71bd741add02673cc1 ("ASoC: samsung-i2s: Maintain CDCLK settings across i2s_{shutdown/ startup}") The problem that commit attempted to solve only affects the Odroid X2/U3, which doesn't configure the CDCLK clock in struct snd_soc_dai_ops hw_params callback and the issue should be now resolved by using clk API, i.e. having the codec enabling/ disabling the CDCLK clock as required. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-14ASoC: samsung: i2s: Protect more registers with a spinlockSylwester Nawrocki
Ensure the I2SMOD, I2SPSR registers, which are also exposed through clk API are only accessed with the i2s->spinlock spinlock held. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-14ASoC: samsung: i2s: Add spinlock in place of local_irq_* callsSylwester Nawrocki
It seems this driver hasn't been updated for SMP, as local_irq_save/ local_irq_restore don't provide proper protection of read/modify/write of the device's registers on such systems. Introduce a spinlock serializing access to the register region, it will be helpful later when I2SMOD, I2SPSR registers are made also accessible through the clk API. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-14ASoC: samsung: i2s: Remove an unneeded goto usageSylwester Nawrocki
The usage of this goto seems unjustified, use if/else statement instead. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-14ASoC: samsung: i2s: Add get_other_dai helper functionSylwester Nawrocki
The code to get pointer to the other DAI is repeated multiple times. Add a helper function and use it instead. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-14ASoC: samsung: i2s: Move clk enable to the platform driver probe()Sylwester Nawrocki
The clk_prepare_enable() call on the "iis" clock is moved to happen earlier in the DAI platform device driver's probe() callback, so the I2S registers can be safely accessed through the clk API, after the clk supplier is registered in the platform device probe(). After this patch the "iis" clock is kept enabled since the (primary) I2S platform device probe() and until the platform device driver remove() call. This is similar to gating the clock in the snd_soc_dai probe() and remove() callbacks. Normally, in addition to that we should mark the device as PM runtime active, so if runtime PM is enabled it can idle the device by turning off the clock. Correcting this issue is left for a separate patch series, as we need to ensure the BUSCLK clock is always enabled when required. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-14ASoC: samsung: i2s: Move clk_get() to platform driver probe()Sylwester Nawrocki
Acquire the I2S interface clock in driver probe() callback as it's a per-device not a per-DAI clock. While at it switch to the resource managed clk_get(). Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-14ASoC: samsung: i2s: Request memory region in driver probe()Sylwester Nawrocki
The memory mapped registers region is common for both DAIs so request it in the I2S platform device driver's probe for the platform device corresponding to the primary DAI, rather than in the ASoC DAI's probe callback. While at it switch to devm_ioremap_resource(). This also drops the hard coded (0x100) register region size in the driver. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-14ASoC: samsung: i2s: Add return value checks in probe()Sylwester Nawrocki
These functions may fail so let's properly report any errors. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-14ASoC: samsung: i2s: samsung_i2s_get_driver_data() cleanupSylwester Nawrocki
Tidy up the samsung_i2s_get_driver_data() function by using IS_ENABLE() instead of #ifdef and add missing braces for the 'else' part. Also ensure we are not dereferencing NULL 'match' pointer. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-06ASoC: samsung: i2s: Remove unused gpios field from struct i2sSylwester Nawrocki
The 'gpios' field in 'struct i2s' is now unused, this change seems to be missing in commit 0429ffeff460c4302bd1520e6 ("ASoC: samsung: Remove obsolete GPIO based DT pinmuxing"). Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-12-19Merge tag 'sound-fix-3.19-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "Here are a few fixes that have landed after the previous pull request. All are driver specific fixes including: - error/int value fixes in OXFW, - Intel Skylake HD-audio HDMI codec support, - Additional HD-audio Realtek codecs and AD1986A codec fixes/quirks, - a few more DSD support and a quirk for Arcam rPAC in usb-audio, - a typo fix for Scarlett 6i6, - fixes for new ASIHPI firmware, - ASoC Exynos7 cleanups, - Intel ACPI support, and - a fix for PCM512 register cache sync" * tag 'sound-fix-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (24 commits) ALSA: usb-audio: extend KEF X300A FU 10 tweak to Arcam rPAC ALSA: hda/realtek - New codec support for ALC298 ALSA: asihpi: update to HPI version 4.14 ALSA: asihpi: increase tuner pad cache size ALSA: asihpi: relax firmware version check ALSA: usb-audio: Fix Scarlett 6i6 initialization typo ALSA: hda - Add quirk for Packard Bell EasyNote MX65 ALSA: usb-audio: add native DSD support for Matrix Audio DACs ALSA: hda/realtek - New codec support for ALC256 ALSA: hda/realtek - Add new Dell desktop for ALC3234 headset mode ASoC: Intel: fix possible acpi enumeration panic ALSA: hda/hdmi - apply Haswell fix-ups to Skylake display codec ASoC: Intel: fix return value check in sst_acpi_probe() ALSA: hda - Make add_stereo_mix_input flag tristate ALSA: hda - Create capture source ctls when stereo mix input is added ALSA: hda - Fix typos in snd_hda_get_int_hint() kerneldoc comments ALSA: hda - add codec ID for Skylake display audio codec ALSA: oxfw: some signedness bugs ALSA: oxfw: fix detect_loud_models() return value ASoC: rt5677: add REGMAP_I2C and REGMAP_IRQ dependency ...
2014-12-18Merge tag 'pm+acpi-3.19-rc1-2' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull more ACPI and power management updates from Rafael Wysocki: "These are regression fixes (leds-gpio, ACPI backlight driver, operating performance points library, ACPI device enumeration messages, cpupower tool), other bug fixes (ACPI EC driver, ACPI device PM), some cleanups in the operating performance points (OPP) framework, continuation of CONFIG_PM_RUNTIME elimination, a couple of minor intel_pstate driver changes, a new MAINTAINERS entry for it and an ACPI fan driver change needed for better support of thermal management in user space. Specifics: - Fix a regression in leds-gpio introduced by a recent commit that inadvertently changed the name of one of the properties used by the driver (Fabio Estevam). - Fix a regression in the ACPI backlight driver introduced by a recent fix that missed one special case that had to be taken into account (Aaron Lu). - Drop the level of some new kernel messages from the ACPI core introduced by a recent commit to KERN_DEBUG which they should have used from the start and drop some other unuseful KERN_ERR messages printed by ACPI (Rafael J Wysocki). - Revert an incorrect commit modifying the cpupower tool (Prarit Bhargava). - Fix two regressions introduced by recent commits in the OPP library and clean up some existing minor issues in that code (Viresh Kumar). - Continue to replace CONFIG_PM_RUNTIME with CONFIG_PM throughout the tree (or drop it where that can be done) in order to make it possible to eliminate CONFIG_PM_RUNTIME (Rafael J Wysocki, Ulf Hansson, Ludovic Desroches). There will be one more "CONFIG_PM_RUNTIME removal" batch after this one, because some new uses of it have been introduced during the current merge window, but that should be sufficient to finally get rid of it. - Make the ACPI EC driver more robust against race conditions related to GPE handler installation failures (Lv Zheng). - Prevent the ACPI device PM core code from attempting to disable GPEs that it has not enabled which confuses ACPICA and makes it report errors unnecessarily (Rafael J Wysocki). - Add a "force" command line switch to the intel_pstate driver to make it possible to override the blacklisting of some systems in that driver if needed (Ethan Zhao). - Improve intel_pstate code documentation and add a MAINTAINERS entry for it (Kristen Carlson Accardi). - Make the ACPI fan driver create cooling device interfaces witn names that reflect the IDs of the ACPI device objects they are associated with, except for "generic" ACPI fans (PNP ID "PNP0C0B"). That's necessary for user space thermal management tools to be able to connect the fans with the parts of the system they are supposed to be cooling properly. From Srinivas Pandruvada" * tag 'pm+acpi-3.19-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (32 commits) MAINTAINERS: add entry for intel_pstate ACPI / video: update the skip case for acpi_video_device_in_dod() power / PM: Eliminate CONFIG_PM_RUNTIME NFC / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM SCSI / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM ACPI / EC: Fix unexpected ec_remove_handlers() invocations Revert "tools: cpupower: fix return checks for sysfs_get_idlestate_count()" tracing / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM x86 / PM: Replace CONFIG_PM_RUNTIME in io_apic.c PM: Remove the SET_PM_RUNTIME_PM_OPS() macro mmc: atmel-mci: use SET_RUNTIME_PM_OPS() macro PM / Kconfig: Replace PM_RUNTIME with PM in dependencies ARM / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM sound / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM phy / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM video / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM tty / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM spi: Replace CONFIG_PM_RUNTIME with CONFIG_PM ACPI / PM: Do not disable wakeup GPEs that have not been enabled ACPI / utils: Drop error messages from acpi_evaluate_reference() ...
2014-12-16Merge remote-tracking branches 'asoc/fix/atmel', 'asoc/fix/intel', ↵Mark Brown
'asoc/fix/rt5645', 'asoc/fix/rt5677' and 'asoc/fix/samsung' into asoc-linus
2014-12-14Merge tag 'driver-core-3.19-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core update from Greg KH: "Here's the set of driver core patches for 3.19-rc1. They are dominated by the removal of the .owner field in platform drivers. They touch a lot of files, but they are "simple" changes, just removing a line in a structure. Other than that, a few minor driver core and debugfs changes. There are some ath9k patches coming in through this tree that have been acked by the wireless maintainers as they relied on the debugfs changes. Everything has been in linux-next for a while" * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits) Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries" fs: debugfs: add forward declaration for struct device type firmware class: Deletion of an unnecessary check before the function call "vunmap" firmware loader: fix hung task warning dump devcoredump: provide a one-way disable function device: Add dev_<level>_once variants ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries ath: use seq_file api for ath9k debugfs files debugfs: add helper function to create device related seq_file drivers/base: cacheinfo: remove noisy error boot message Revert "core: platform: add warning if driver has no owner" drivers: base: support cpu cache information interface to userspace via sysfs drivers: base: add cpu_device_create to support per-cpu devices topology: replace custom attribute macros with standard DEVICE_ATTR* cpumask: factor out show_cpumap into separate helper function driver core: Fix unbalanced device reference in drivers_probe driver core: fix race with userland in device_add() sysfs/kernfs: make read requests on pre-alloc files use the buffer. sysfs/kernfs: allow attributes to request write buffer be pre-allocated. fs: sysfs: return EGBIG on write if offset is larger than file size ...
2014-12-13sound / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PMRafael J. Wysocki
After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks depending on CONFIG_PM_RUNTIME may now be changed to depend on CONFIG_PM. Replace CONFIG_PM_RUNTIME with CONFIG_PM everywhere under sound/. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Takashi Iwai <tiwai@suse.de> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Acked-by: Brian Austin <brian.austin@cirrus.com> Acked-by: Mark Brown <broonie@kernel.org>
2014-12-08ASoC: samsung: i2s: Add missing assignment of variant_regsSylwester Nawrocki
Add assignment of the variant_regs field which is missing in commit a5a56871f804edac93a53b5e871c0e9818fb9033 ("ASoC: samsung: add support for exynos7 I2S controller"). Without this attempting to probe the secondary DAI fails with an error like: [ 1.763026] Unable to handle kernel NULL pointer dereference at virtual address 0000000c [ 1.780895] pgd = c0004000 [ 1.783606] [0000000c] *pgd=00000000 [ 1.838255] Internal error: Oops: 5 [#1] PREEMPT SMP ARM [ 1.843514] Modules linked in: [ 1.846558] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.18.0-rc1-00009-g5dcb01e-dirty #1521 [ 1.854887] task: ee00a800 ti: ee088000 task.ti: ee088000 [ 1.860284] PC is at i2s_txctrl+0x40/0x2d4 [ 1.864350] LR is at i2s_txctrl+0x28/0x2d4 [ 1.868428] pc : [<c036ffd4>] lr : [<c036ffbc>] psr: 60000153 [ 1.868428] sp : ee089dc0 ip : 00000000 fp : ee21f000 [ 1.879883] r10: 00000000 r9 : ee21fb00 r8 : c06406c4 [ 1.885091] r7 : ee21fb00 r6 : 00000000 r5 : f00f6000 r4 : ed943410 [ 1.891601] r3 : 0000016c r2 : c0464550 r1 : c055cef8 r0 : ed943610 [ 1.898113] Flags: nZCv IRQs on FIQs off Mode SVC_32 ISA ARM Segment kernel [ 1.905490] Control: 10c5387d Table: 4000404a DAC: 00000015 [ 1.911218] Process swapper/0 (pid: 1, stack limit = 0xee088240) [ 1.917208] Stack: (0xee089dc0 to 0xee08a000) ... [ 2.068431] [<c036ffd4>] (i2s_txctrl) from [<c03719fc>] (samsung_i2s_dai_probe+0xb8/0x450) [ 2.076676] [<c03719fc>] (samsung_i2s_dai_probe) from [<c03607e0>] (snd_soc_register_card+0xd98/0x1348) [ 2.086044] [<c03607e0>] (snd_soc_register_card) from [<c03726e4>] (odroidx2_audio_probe+0xa8/0x11c) [ 2.095160] [<c03726e4>] (odroidx2_audio_probe) from [<c0249dd0>] (platform_drv_probe+0x48/0xa4) [ 2.103922] [<c0249dd0>] (platform_drv_probe) from [<c0248988>] (driver_probe_device+0x10c/0x22c) [ 2.112773] [<c0248988>] (driver_probe_device) from [<c0248b34>] (__driver_attach+0x8c/0x90) [ 2.121192] [<c0248b34>] (__driver_attach) from [<c02471c8>] (bus_for_each_dev+0x54/0x88) [ 2.129352] [<c02471c8>] (bus_for_each_dev) from [<c0248188>] (bus_add_driver+0xd4/0x1d0) [ 2.137510] [<c0248188>] (bus_add_driver) from [<c024915c>] (driver_register+0x78/0xf4) [ 2.145499] [<c024915c>] (driver_register) from [<c0008924>] (do_one_initcall+0x80/0x1b8) [ 2.153670] [<c0008924>] (do_one_initcall) from [<c05b7d40>] (kernel_init_freeable+0xfc/0x1c8) [ 2.162260] [<c05b7d40>] (kernel_init_freeable) from [<c04146c0>] (kernel_init+0x8/0xec) [ 2.170330] [<c04146c0>] (kernel_init) from [<c000e7f8>] (ret_from_fork+0x14/0x3c) [ 2.177873] Code: e5940000 e59f128c e59f228c e2800010 (e59c700c) Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-12-08ASoC: samsung: Fix non-DT use of I2S controllerMark Brown
The changes in commit a5a56871f804e (ASoC: samsung: add support for exynos7 I2S controller) introduce a new variant_regs structure in the driver data which is now mandatory for accessing registers. Unfortunately this is only hooked up for DT platforms so non-DT platforms like my primary development platform for audio are broken by this change and crash on boot. Since the only non-DT user of these device is s3c64xx fix this by making the standard samsung-i2s device be of type I2Sv3 and add a new I2Sv4 name to the platform data section, currently using the I2Sv5 information which should be about right. Signed-off-by: Mark Brown <broonie@kernel.org>
2014-12-06ASoC: samsung: Fix error handling for clock lookupMark Brown
Return the error code we got from clk_get() and check to make sure that clk_prepare_enable() worked. Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-21ASoC: samsung: ASoC: samsung: Fix IISMOD setting in i2s_set_sysclk()Padmavathi Venna
In the i2s_set_sysclk() callback we are currently clearing all bits of the IISMOD register in i2s_set_sysclk. It's due to an incorrect mask used for the AND operation which is introduced in commit a5a56871f804edac93a53b5e871c0e9818fb9033 (ASoC: samsung: add support for exynos7 I2S controller) and also adds the missing break statement. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Padmavathi Venna <padma.v@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-07ASoC: samsung: add support for exynos7 I2S controllerPadmavathi Venna
Exynos7 I2S controller has no internal dma, supports more no. of root clock sampling frequencies and has more no.of Rx fifos to support 7.1CH recording in TDM mode. Due to more no. of root clock frequency values some of the bit offsets got shifted up by one. Also I2S1 on previous Samsung platforms uses v3 dai type but on Exynos7 it is upgraded to v5 with slightly modified register offsets for supporting more no.of RFS values. Due to the above changes, the driver has to be modified to handle all versions of I2S controller. For this I introduced a new structure to hold modified bit offsets and masks which is passed as dai data. Signed-off-by: Padmavathi Venna <padma.v@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-07ASoC: Samsung: Add quirk for internal DMAPadmavathi Venna
Internal DMA is available only on some of Samsung platforms. So added a quirk for the same and made it optional. Signed-off-by: Padmavathi Venna <padma.v@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>