summaryrefslogtreecommitdiff
path: root/drivers/sound
AgeCommit message (Collapse)Author
2019-02-09sound: Allow audio codecs to be used by other SoCsSimon Glass
At present there is still some samsung-specific code in the audio codecs. Remove it so that these can be used by other SoCs. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-02-09sound: samsung: Fix 'regiter' typoSimon Glass
Fix a typo that appears many times in this file. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-02-09sound: Add a driver for max98088Simon Glass
This chip is used by spring. Add a driver for it and update the samsung_sound driver to pick it up. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-02-01rockchip: Add a sound driverSimon Glass
Add a sound driver for rk3288 supporting chromebook_jerry. This uses the I2S driver, and existing audio codec and the clock/pinmux support. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2019-02-01rockchip: Add an I2S driverSimon Glass
Add a driver for I2S which allows audio data to be sent from the SoC to the audio codec. The sample rate and other settings are hard-coded for now as there is no suitable device-tree binding available. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
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>