aboutsummaryrefslogtreecommitdiff
path: root/drivers/sound
AgeCommit message (Collapse)Author
2018-12-13dm: sound: Use the correct number of channels for soundSimon Glass
At present the 'beep' sound generates a waveform for only one channel even if two are being used. This means that the beep is twice the frequency it should be. Correct this by making it a parameter. The fix in a previous commit was correct for sandbox but not for other boards. Fixes: 03f11e87a8 ("sound: Correct data output in sound_create_square_wave()") Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sandbox: Allow selection of sample rate and channelsSimon Glass
At present these parameters are hard-coded in the sdl interface code. Allow them to be specified by the driver instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sound: max98095: Tidy up error codesSimon Glass
Return a valid error code instead of -1. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sound: Fix license headersSimon Glass
Fix a few files whos license headers were not converted to SPDX. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sound: Complete migration to driver modelSimon Glass
All users of sound are converted to use driver model. Drop the old code and the CONFIG_DM_SOUND option. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: exynos: sound: Convert to use driver modelSimon Glass
Update snow's device tree and config to use driver model for sound. Also update the others as best we can. Spring does not appear to have audio support in the kernel. The smdk5250 and smdk5420 boards use a wolfson codec which I cannot test with. So the only boards that is tested and known to work are snow, pit and pi. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sound: exynos: Add support for max98090Simon Glass
Add support for this new codec which is used by pit. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sound: Move common code out of maxim98095Simon Glass
The register-access code is useful for any maxim codec. Move it out into its own file. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sound: Add conversion to driver modelSimon Glass
Move the existing hardware drivers over to use driver model. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sound: Start i2c IDs from 0Simon Glass
The current ID enums start from 1 but there does not seem to be any reason that they cannot start with 0. Adjust the code to avoid the +1 in codec_init(). Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sound: Create a uclass for soundSimon Glass
The sound driver pulls together the audio codec and i2s drivers in order to actually make sounds. It supports setup() and play() methods. The sound_find_codec_i2s() function allows locating the linked codec and i2s devices. They can be referred to from uclass-private data. Add a uclass and a test for sound. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sound: Create a uclass for i2sSimon Glass
The i2s bus is commonly used with audio codecs. It provides a way to stream digital data sychronously in both directions. U-Boot only supports audio output, so this uclass is very simple, with a single tx_data() method. Add a uclass and a test for i2s. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sound: Create a uclass for audio codecsSimon Glass
An audio codec provides a way to convert digital data to sound and vice versa. Add a simple uclass which just supports setting the parameters for the codec. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sound: Rename samsung_i2s_priv to i2s_uc_privSimon Glass
This structure contains information that is likely needed by any i2s driver so it seems useful to attach it to the (forthcoming) i2c uclass. For now, just rename it. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sound: Create an option to use driver model for soundSimon Glass
The U-Boot sound system provides basic support for beeping. At present it does not use driver model, but it needs to be converted. Add an option to enable driver model for sound. For now it is not connected to anything. Future work will add drivers which use this option. It will then be removed once everything is converted. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sound: exynos: Correct codec bus addressesSimon Glass
For snow the codec is at address 0x11 on the i2c bus, in 7-bit format. The device tree and code are in 8-bit format (i.e. shifted left one bit). Fix both. Fix pit in a similar way. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sound: Fix up header orderingSimon Glass
Tidy up the ordering of header files in the sounds files. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sound: wm8994: Drop wm8994_i2c_init()Simon Glass
This function has only one line in it. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sound: max98095: Drop g_codec_info and g_max98095_infoSimon Glass
These are only used in two functions so can be made local. Also change the first argument of max98095_do_init() to suit. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sound: wm8994: Drop g_codec_info and g_wm8994_infoSimon Glass
These are only used in two functions so can be made local. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sound: max98095: Drop global i2c-address variableSimon Glass
We can put this in the private structure and avoid a global. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sound: wm8994: Drop global i2c-address variableSimon Glass
We can put this in the private structure and avoid a global. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sound: max98095: Split out interface setup codeSimon Glass
With driver model we want to do a minimal probe when the device is probed and then set up the codec interface later when a sound is actully played. Split this setup code out into its own function to help with this. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sound: wm899c: Split out interface setup codeSimon Glass
With driver model we want to do a minimal probe when the device is probed and then set up the codec interface later when a sound is actully played. Split this setup code out into its own function to help with this. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sound: wm8994: Create a new common init functionSimon Glass
With driver model we cannot pass in the global struct, but instead want to pass in the driver-private data. Split some of the code out of wm8994_init() to handle this. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sound: max98095: Pass private data to internal functionsSimon Glass
At present the driver-private data is global. To allow this code to be used with driver model, change it to pass the data down to each function. Use the name 'priv' consistently throughout. Also rename max98095_update_bits() to max98095_bic_or() which is more descriptive and shorter, thus breaking fewer lines with the parameter addition. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sound: wm8994: Pass private data to internal functionsSimon Glass
At present the driver-private data is global. To allow this code to be used with driver model, change it to pass the data down to each function. Use the name 'priv' consistently throughout. Also rename wm8994_update_bits() to wm8994_bic_or() which is more descriptive and shorter, thus breaking fewer lines with the parameter addition. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sound: Drop codec_typeSimon Glass
This field is not really used. It is always set to a known value. Drop it to simplify the code. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sound: samsung: Rename i2stx_info to samsung_i2s_privSimon Glass
This struct is only used by the Samsung I2C driver and should move into that driver. For now, rename it so it is clear that is driver-private info. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sound: Drop unused pre-device-tree codeSimon Glass
CONFIG_OF_CONTROL is enabled for all boards that use sound, so remove the dead code. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sound: samsung: Make local function staticSimon Glass
Several functions are not exported from this file. Make them static so this is clear. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-29sound: Add sample rate as a parameter for square waveSimon Glass
At present this value is hard-coded in the function that generates a square wave. Since sample rates vary between different hardware, it makes more sense to have this as a parameter. Update the function and its users. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-29sound: Correct data output in sound_create_square_wave()Simon Glass
This function currently outputs twice as much data as it should and overwrites its buffer as a result. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-03-05libfdt: move headers to <linux/libfdt.h> and <linux/libfdt_env.h>Masahiro Yamada
Thomas reported U-Boot failed to build host tools if libfdt-devel package is installed because tools include libfdt headers from /usr/include/ instead of using internal ones. This commit moves the header code: include/libfdt.h -> include/linux/libfdt.h include/libfdt_env.h -> include/linux/libfdt_env.h and replaces include directives: #include <libfdt.h> -> #include <linux/libfdt.h> #include <libfdt_env.h> -> #include <linux/libfdt_env.h> Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-06-01dm: gpio: Add live tree supportSimon Glass
Add support for requesting GPIOs with a live device tree. This involves adjusting the function signature for the legacy function gpio_request_by_name_nodev(), so fix up all callers. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes to stm32f746-disco.c: Signed-off-by: Tom Rini <trini@konsulko.com>
2015-08-18of: clean up OF_CONTROL ifdef conditionalsMasahiro Yamada
We have flipped CONFIG_SPL_DISABLE_OF_CONTROL. We have cleansing devices, $(SPL_) and CONFIG_IS_ENABLED(), so we are ready to clear away the ugly logic in include/fdtdec.h: #ifdef CONFIG_OF_CONTROL # if defined(CONFIG_SPL_BUILD) && !defined(SPL_OF_CONTROL) # define OF_CONTROL 0 # else # define OF_CONTROL 1 # endif #else # define OF_CONTROL 0 #endif Now CONFIG_IS_ENABLED(OF_CONTROL) is the substitute. It refers to CONFIG_OF_CONTROL for U-boot proper and CONFIG_SPL_OF_CONTROL for SPL. Also, we no longer have to cancel CONFIG_OF_CONTROL in include/config_uncmd_spl.h and scripts/Makefile.spl. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Linus Walleij <linus.walleij@linaro.org>
2015-08-12drivers: hierarchize drivers Kconfig menuMasahiro Yamada
The menuconfig for drivers are getting more and more cluttered and unreadable because too many entries are displayed in a single flat menu. Use hierarchic menu for each category. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org> [trini: Update to apply again in a few places, drop USB hunk] Signed-off-by: Tom Rini <trini@konsulko.com>
2015-04-18sandbox: exynos: Move CONFIG_SOUND_SANDBOX to KconfigSimon Glass
Move this over to Kconfig and tidy up. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-04-18sandbox: exynos: Move CONFIG_SOUND_WM8994 to KconfigSimon Glass
Move this over to Kconfig and tidy up. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-04-18sandbox: exynos: Move CONFIG_SOUND_MAX98095 to KconfigSimon Glass
Move this over to Kconfig and tidy up. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-04-18sandbox: exynos: Move CONFIG_I2S_SAMSUNG to KconfigSimon Glass
Move this over to Kconfig and tidy up. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-04-18sandbox: exynos: Move CONFIG_I2S to KconfigSimon Glass
Move this over to Kconfig and tidy up. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-04-18sandbox: exynos: Move CONFIG_SOUND to KconfigSimon Glass
Move this over to Kconfig and tidy up. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-24kconfig: add blank Kconfig filesMasahiro Yamada
This would be useful to start moving various config options. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
2014-07-07build: define CPU only when arch/${ARCH}/cpu/${CPU} existsMasahiro Yamada
The directory arch/${ARCH}/cpu/${CPU} does not exist in avr32, blackfin, microblaze, nios2, openrisc, sandbox, x86. These architectures have only one CPU type. Defining CPU should not be required for such architectures. This commit allows cpu field (= the 3rd field of boards.cfg) to be kept blank. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Andreas Bießmann <andreas.devel@googlemail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Sonic Zhang <sonic.zhang@analog.com> Cc: Michal Simek <michal.simek@xilinx.com> Cc: Thomas Chou <thomas@wytron.com.tw> Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
2014-03-17sound: Move Samsung-specific code into its own fileSimon Glass
The i2s code is in fact Samsung-specific, but there might be other implementation. Move this code into its own file. This makes it slightly more obviously how to adjust the code to support another SoC, when someone takes this task on. Also drop non-FDT support, since it isn't used on Exynos 5. Tested-by: Che-Liang Chiou <clchiou@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
2014-03-17sandbox: Add a simple sound driverSimon Glass
Add a sound driver for sandbox, which uses SDL. Tested-by: Che-Liang Chiou <clchiou@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
2013-10-31drivers: convert makefiles to Kbuild styleMasahiro Yamada
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2013-09-24Sound: MAX98095: Support I2S0 channelDani Krishna Mohan
This patch modifies the MAX98095 audio codec to support I2S0 channel in codec slave mode. Signed-off-by: Dani Krishna Mohan <krishna.md@samsung.com>