summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/imx-audmux.c
AgeCommit message (Collapse)Author
2019-08-20Merge branch 'asoc-5.3' into asoc-5.4Mark Brown
2019-08-16ASoC: imx-audmux: Add driver suspend and resume to support MEGA FastShengjiu Wang
For i.MX6 SoloX, there is a mode of the SoC to shutdown all power source of modules during system suspend and resume procedure. Thus, AUDMUX needs to save all the values of registers before the system suspend and restore them after the system resume. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1565931794-7218-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-07-31ASoC: imx-audmux: use devm_platform_ioremap_resource() to simplify codeYueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20190727150738.54764-8-yuehaibing@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-06-14ASoC: fsl: no need to check return value of debugfs_create functionsGreg Kroah-Hartman
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-08ASoC: imx-audmux: Switch to SPDX identifierAndra Danciu
Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Andra Danciu <andradanciu1997@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-15ASoC: imx-audmux: change snprintf to scnprintf for possible overflowSilvio Cesare
Change snprintf to scnprintf. There are generally two cases where using snprintf causes problems. 1) Uses of size += snprintf(buf, SIZE - size, fmt, ...) In this case, if snprintf would have written more characters than what the buffer size (SIZE) is, then size will end up larger than SIZE. In later uses of snprintf, SIZE - size will result in a negative number, leading to problems. Note that size might already be too large by using size = snprintf before the code reaches a case of size += snprintf. 2) If size is ultimately used as a length parameter for a copy back to user space, then it will potentially allow for a buffer overflow and information disclosure when size is greater than SIZE. When the size is used to index the buffer directly, we can have memory corruption. This also means when size = snprintf... is used, it may also cause problems since size may become large. Copying to userspace is mitigated by the HARDENED_USERCOPY kernel configuration. The solution to these issues is to use scnprintf which returns the number of characters actually written to the buffer, so the size variable will never exceed SIZE. Signed-off-by: Silvio Cesare <silvio.cesare@gmail.com> Cc: Timur Tabi <timur@kernel.org> Cc: Nicolin Chen <nicoleotsuka@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: Xiubo Li <Xiubo.Lee@gmail.com> Cc: Fabio Estevam <fabio.estevam@nxp.com> Cc: Dan Carpenter <dan.carpenter@oracle.com> Cc: Kees Cook <keescook@chromium.org> Cc: Will Deacon <will.deacon@arm.com> Cc: Greg KH <greg@kroah.com> Signed-off-by: Willy Tarreau <w@1wt.eu> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-08ASoC: fsl: Convert to using %pOF instead of full_nameRob Herring
Now that we have a custom printf format specifier, convert users of full_name to use %pOF instead. This is preparation to remove storing of the full path string for each node. Signed-off-by: Rob Herring <robh@kernel.org> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-01ASoC: fsl: 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>
2014-10-20ASoC: fsl: drop owner assignment from platform_driversWolfram Sang
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-08-04ASoC: imx-audmux: Use uintptr_t for port numbersMark Brown
Since we pass the port number through file private data for debugfs we cast it to and from a pointer so use uintptr_t in order to ensure that the types are compatible, avoiding warnings on 64 bit platforms where pointers are 64 bit and unsigned integers 32 bit. Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-24ASoC: imx-audmux: Fix section mismatchLars-Peter Clausen
audmux_debugfs_init() is marked as __init, but is called from imx_audmux_probe() which is not marked as __init. This creates a section mismatch and a potential runtime crash (if imx_audmux_probe() is called after the .init section was dropped). This patch removes the __init annotation from audmux_debugfs_init(), which fixes the following warning: WARNING: sound/soc/built-in.o(.text+0x86960): Section mismatch in reference from the function imx_audmux_probe() to the function .init.text:audmux_debugfs_init() Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-10-14ASoC: fsl: Fix memory leak in imx-audmux.cFelipe Pena
When audmux_clk is used and clk_prepare_enable function succeed, the memory alloc'd to buf variable is leaked Signed-off-by: Felipe Pena <felipensp@gmail.com> Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-04ASoC: fsl: imx-audmux: Do not call imx_audmux_parse_dt_defaults() on non-dt ↵Fabio Estevam
kernel Booting a mx51babbage board with a non-dt kernel leads to the following crash: Unable to handle kernel NULL pointer dereference at virtual address 0000001c pgd = 80004000 [0000001c] *pgd=00000000 Internal error: Oops: 5 [#1] SMP ARM Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.11.0-next-20130903 #287 task: 9f860000 ti: 9f862000 task.ti: 9f862000 PC is at of_get_next_available_child+0x5c/0x68 LR is at of_get_next_available_child+0x1c/0x68 pc : [<8043ea58>] lr : [<8043ea18>] psr: 60000193 sp : 9f863d58 ip : 00000000 fp : 9f863d74 r10: 9f89a010 r9 : 9f862000 r8 : 807bb26c r7 : 80615d5c r6 : 00000000 r5 : 60000113 r4 : 00000000 r3 : 00000000 r2 : 808770a4 r1 : 00000011 r0 : 60000113 Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel Control: 10c5387d Table: 90004019 DAC: 00000017 Process swapper/0 (pid: 1, stack limit = 0x9f862240) Stack: (0x9f863d58 to 0x9f864000) This is caused by commit 8548a464b9 (ASoC: imx-audmux: Read default configuration from devicetree). In order to fix this, add a check for 'of_id' so that imx_audmux_parse_dt_defaults() only gets called when a dt kernel is running. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-11ASoC: imx-audmux: default configuration parser fixupsMarkus Pargmann
Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-06ASoC: imx-audmux: Read default configuration from devicetreeMarkus Pargmann
Adds a function to parse a default port configuration from devicetree. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-22ASoC: fsl: imx-audmux: Check the return value from clk_prepare_enable()Fabio Estevam
clk_prepare_enable() may fail, so let's check its return value and propagate it in the case of error. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-05-12ASoC: fsl: imx-audmux: Let device core handle pinctrlFabio Estevam
Since commit ab78029 (drivers/pinctrl: grab default handles from device core), we can rely on device core for handling pinctrl. So remove devm_pinctrl_get_select_default() from the driver. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-13ASoC: fsl: imx-audmux: Use devm_clk_get()Fabio Estevam
By using devm_clk_get() we can save a call to clk_put(). Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-02-21Merge tag 'driver-core-3.9-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core patches from Greg Kroah-Hartman: "Here is the big driver core merge for 3.9-rc1 There are two major series here, both of which touch lots of drivers all over the kernel, and will cause you some merge conflicts: - add a new function called devm_ioremap_resource() to properly be able to check return values. - remove CONFIG_EXPERIMENTAL Other than those patches, there's not much here, some minor fixes and updates" Fix up trivial conflicts * tag 'driver-core-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (221 commits) base: memory: fix soft/hard_offline_page permissions drivercore: Fix ordering between deferred_probe and exiting initcalls backlight: fix class_find_device() arguments TTY: mark tty_get_device call with the proper const values driver-core: constify data for class_find_device() firmware: Ignore abort check when no user-helper is used firmware: Reduce ifdef CONFIG_FW_LOADER_USER_HELPER firmware: Make user-mode helper optional firmware: Refactoring for splitting user-mode helper code Driver core: treat unregistered bus_types as having no devices watchdog: Convert to devm_ioremap_resource() thermal: Convert to devm_ioremap_resource() spi: Convert to devm_ioremap_resource() power: Convert to devm_ioremap_resource() mtd: Convert to devm_ioremap_resource() mmc: Convert to devm_ioremap_resource() mfd: Convert to devm_ioremap_resource() media: Convert to devm_ioremap_resource() iommu: Convert to devm_ioremap_resource() drm: Convert to devm_ioremap_resource() ...
2013-02-11ASoC: fsl: imx-audmux: Fix sparse warningFabio Estevam
Fix the following sparse warning: sound/soc/fsl/imx-audmux.c:182:3: warning: symbol 'audmux_type' was not declared. Should it be static? Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-22ASoC: Convert to devm_ioremap_resource()Thierry Reding
Convert all uses of devm_request_and_ioremap() to the newly introduced devm_ioremap_resource() which provides more consistent error handling. devm_ioremap_resource() provides its own error messages so all explicit error messages can be removed from the failure code paths. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: Liam Girdwood <lrg@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-12-10ASoC: fsl: remove __dev* attributesBill Pemberton
CONFIG_HOTPLUG is going away as an option. As result the __dev* markings will be going away. Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-18ASoC: imx-audmux: remove null check of audmux_base in audmux_read_fileRichard Zhao
When audmux_read_file is called, it means the driver is already initialised successfully, so we don't need to check audmux_base. It also fix smatch warning: sound/soc/fsl/imx-audmux.c:78 audmux_read_file() warn: possible memory leak of 'buf' Signed-off-by: Richard Zhao <richard.zhao@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-18ASoC imx-audmux: add MX31_AUDMUX_PORT7_SSI_PINS_7 defineTorben Hohn
The MX31 Audmux also has 7 Ports. This patch adds the missing define, and makes the debugfs code iterate over that port too. Signed-off-by: Torben Hohn <torbenh@linutronix.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-04ASoC: imx-audmux: add pinctrl supportRichard Zhao
Signed-off-by: Richard Zhao <richard.zhao@freescale.com> Acked-by: Dong Aisheng <dong.aisheng@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-16ASoC: Merge tag 'v3.4-rc3' into for-3.5Mark Brown
Linux 3.4-rc3 contains a bunch of Tegra changes which are conflicting annoyingly with the new development that's going on for Tegra so merge it up to resolve those conflicts. Conflicts: sound/soc/soc-core.c sound/soc/tegra/tegra_i2s.c sound/soc/tegra/tegra_spdif.c
2012-04-09Merge tag 'v3.4-rc2' into for-3.5Mark Brown
Linux 3.4-rc2 contains some bug fixes we need, including the addition of an export for regcache_sync_region().
2012-04-01ASoC: imx: merge sound/soc/imx into sound/soc/fslShawn Guo
Freescale PowerPC and ARM/IMX families share the same SSI IP block. The patch merges sound/soc/imx into sound/soc/fsl, so that the possible code sharing and consolidation can happen. This is a plain merge, except that menuconfig SND_POWERPC_SOC is added in Kconfig for PowerPC platform as a correspondence to SND_IMX_SOC for IMX platform. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Timur Tabi <timur@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>