summaryrefslogtreecommitdiff
path: root/drivers/sound
Commit message (Collapse)AuthorAgeFilesLines
* sound: Add an ACPI driver for Maxim MAX98357acSimon Glass2020-07-173-0/+171
| | | | | | | | | | This chip is used on coral and we need to generate ACPI tables for sound to make it work. Add a driver that does just this (i.e. at present does not actually support playing sound). Signed-off-by: Simon Glass <sjg@chromium.org> [bmeng: Use the correct acpi_irq_polarity enum number] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
* sound: Add an ACPI driver for Dialog Semicondutor da7219Simon Glass2020-07-173-0/+200
| | | | | | | | This chip is used on coral and we need to generate ACPI tables for sound to make it work. Add a driver that does just this (i.e. at present does not actually support playing sound). Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Drop linux/bitops.h from common headerWIP/2020-05-18-reduce-size-of-common.hSimon Glass2020-05-184-0/+4
| | | | | | Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Drop linux/delay.h from common headerSimon Glass2020-05-183-0/+3
| | | | | | Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Drop log.h from common headerSimon Glass2020-05-1819-0/+19
| | | | | | Move this header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: core: Create a new header file for 'compat' featuresSimon Glass2020-02-051-0/+1
| | | | | | | | | | | | At present dm/device.h includes the linux-compatible features. This requires including linux/compat.h which in turn includes a lot of headers. One of these is malloc.h which we thus end up including in every file in U-Boot. Apart from the inefficiency of this, it is problematic for sandbox which needs to use the system malloc() in some files. Move the compatibility features into a separate header file. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: sound: Handle errors better in sound_beep()Simon Glass2020-02-051-1/+4
| | | | | | | At present an error does not stop the sound-output loop. This is incorrect since nothing can be gained by trying to continue. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
* sound: Add a new stop_play() methodSimon Glass2020-02-052-1/+31
| | | | | | | | | | | At present there is no positive indication that U-Boot has finished sending sound data. This means that it is not possible to power down an audio codec, for example. Add a new method that is called once all sound data has been sent. Add a new method for this, called when the sound_play() call is done. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Move get_ticks() function out of common.hSimon Glass2019-12-021-0/+1
| | | | | | | This function belongs in time.h so move it over and add a comment. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* sound: tegra: Add a sound driverSimon Glass2019-05-242-1/+101
| | | | | | | | Add a sound driver for tegra devices. This connects the audio hub, I2S controller and audio codec to allow sound output. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
* tegra: sound: Add an I2S driverSimon Glass2019-05-243-1/+153
| | | | | | | | | | Add a driver which supports transmitting digital sound to an audio codec. This uses fixed parameters as a device-tree binding is not currently defined. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Tom Warren <twarren@nvidia.com>
* tegra: sound: Add an audio hub driverSimon Glass2019-05-243-0/+266
| | | | | | | | | Add a driver for the audio hub. This is modelled as a misc device which supports writing audio data from I2S. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Tom Warren <twarren@nvidia.com>
* rockchip: use 'arch-rockchip' as header file pathKever Yang2019-05-011-1/+1
| | | | | | | | Rockchip use 'arch-rockchip' instead of arch-$(SOC) as common header file path, so that we can get the correct path directly. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
* x86: Add sound support for samusSimon Glass2019-02-201-1/+1
| | | | | | | Enable sound on samus using the broadwell I2S and an RT5677 audio codec. Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Simon Glass <sjg@chromium.org>
* x86: sound: Add sound support for samus (broadwell)Simon Glass2019-02-202-1/+66
| | | | | | | | | | | Add a sound driver for samus which ties together the audio codec and I2S controller. For now broadwell_sound is commented out in the makefile since we cannot compile it without sound support enabled. The next commit fixes this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* sound: Add a driver for RealTek RT5677Simon Glass2019-02-204-0/+1772
| | | | | | | This audio codec is used on samus. Add a driver for it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: sound: Add support for broadwell I2SSimon Glass2019-02-203-0/+608
| | | | | | | | I2S is used to send digital audio data to an audio codec. Add support for this on broadwell. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* sound: Add a driver for the i8254 beepSimon Glass2019-02-203-0/+51
| | | | | | | Add a sound driver which can output simple beeps using this legacy timer. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* sound: x86: link: Add sound supportSimon Glass2019-02-203-0/+148
| | | | | | | Add sound support for link, using the HDA codec implementation. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* sandbox: sound: Silence sound for testingSimon Glass2019-02-201-3/+22
| | | | | | | | | When testing the sound system we don't need the hear the beeps. The testing works by checking the data that would be emitted. Add a device-tree property to silence the sound, and enable it for testing. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* sound: Add support for Intel HDASimon Glass2019-02-203-0/+566
| | | | | | | | | | | | The Intel High-definition Audio is a newer-generation audio system which provides for transfer of a large number of audio stream, each containing up to 16 channels. Add support for HDA as a library which can be used by other drivers. U-Boot currently uses only two channels (stereo). Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* sound: Add uclass operations for beepingSimon Glass2019-02-202-4/+76
| | | | | | | | | | Some audio codecs such as Intel HDA do not need to use digital data to play sounds, but instead have a way to emit beeps. Add this interface as an option. If the beep interface is not supported, then the sound uclass falls back to the I2S interface. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* sound: Mark sound_setup() as optionalSimon Glass2019-02-201-1/+1
| | | | | | | | This method in the sound API is optional since some drivers can do this when probing or as part of SoC init. Mark it as such. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* sound: Allow audio codecs to be used by other SoCsSimon Glass2019-02-096-28/+8
| | | | | | | 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>
* sound: samsung: Fix 'regiter' typoSimon Glass2019-02-091-8/+8
| | | | | | Fix a typo that appears many times in this file. Signed-off-by: Simon Glass <sjg@chromium.org>
* sound: Add a driver for max98088Simon Glass2019-02-095-1/+633
| | | | | | | 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>
* rockchip: Add a sound driverSimon Glass2019-02-012-1/+133
| | | | | | | | 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>
* rockchip: Add an I2S driverSimon Glass2019-02-013-0/+159
| | | | | | | | | 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>
* dm: sound: Use the correct number of channels for soundSimon Glass2018-12-132-5/+8
| | | | | | | | | | | | 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>
* dm: sandbox: Allow selection of sample rate and channelsSimon Glass2018-12-131-1/+1
| | | | | | | 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>
* dm: sound: max98095: Tidy up error codesSimon Glass2018-12-131-24/+23
| | | | | | Return a valid error code instead of -1. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sound: Fix license headersSimon Glass2018-12-132-9/+3
| | | | | | Fix a few files whos license headers were not converted to SPDX. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sound: Complete migration to driver modelSimon Glass2018-12-136-410/+4
| | | | | | | 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>
* dm: exynos: sound: Convert to use driver modelSimon Glass2018-12-131-0/+3
| | | | | | | | | | | 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>
* dm: sound: exynos: Add support for max98090Simon Glass2018-12-134-0/+1049
| | | | | | Add support for this new codec which is used by pit. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sound: Move common code out of maxim98095Simon Glass2018-12-135-135/+204
| | | | | | | 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>
* dm: sound: Add conversion to driver modelSimon Glass2018-12-136-17/+318
| | | | | | Move the existing hardware drivers over to use driver model. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sound: Start i2c IDs from 0Simon Glass2018-12-133-6/+4
| | | | | | | | 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>
* dm: sound: Create a uclass for soundSimon Glass2018-12-133-0/+195
| | | | | | | | | | | 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>
* dm: sound: Create a uclass for i2sSimon Glass2018-12-133-1/+85
| | | | | | | | | | | 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>
* dm: sound: Create a uclass for audio codecsSimon Glass2018-12-133-0/+82
| | | | | | | | 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>
* dm: sound: Rename samsung_i2s_priv to i2s_uc_privSimon Glass2018-12-132-7/+7
| | | | | | | | 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>
* dm: sound: Create an option to use driver model for soundSimon Glass2018-12-131-0/+6
| | | | | | | | | | 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>
* dm: sound: exynos: Correct codec bus addressesSimon Glass2018-12-131-2/+1
| | | | | | | | 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>
* dm: sound: Fix up header orderingSimon Glass2018-12-133-28/+27
| | | | | | Tidy up the ordering of header files in the sounds files. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sound: wm8994: Drop wm8994_i2c_init()Simon Glass2018-12-131-11/+1
| | | | | | This function has only one line in it. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sound: max98095: Drop g_codec_info and g_max98095_infoSimon Glass2018-12-131-15/+12
| | | | | | | | 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>
* dm: sound: wm8994: Drop g_codec_info and g_wm8994_infoSimon Glass2018-12-131-9/+7
| | | | | | These are only used in two functions so can be made local. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sound: max98095: Drop global i2c-address variableSimon Glass2018-12-131-4/+4
| | | | | | We can put this in the private structure and avoid a global. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sound: wm8994: Drop global i2c-address variableSimon Glass2018-12-131-4/+4
| | | | | | We can put this in the private structure and avoid a global. Signed-off-by: Simon Glass <sjg@chromium.org>