summaryrefslogtreecommitdiff
path: root/drivers/sound
AgeCommit message (Collapse)AuthorFilesLines
2020-07-17sound: Add an ACPI driver for Maxim MAX98357acSimon Glass3-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>
2020-07-17sound: Add an ACPI driver for Dialog Semicondutor da7219Simon Glass3-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>
2020-05-19common: Drop linux/bitops.h from common headerSimon Glass4-0/+4
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-19common: Drop linux/delay.h from common headerSimon Glass3-0/+3
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-19common: Drop log.h from common headerSimon Glass19-0/+19
Move this header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-06dm: core: Create a new header file for 'compat' featuresSimon Glass1-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>
2020-02-06sandbox: sound: Handle errors better in sound_beep()Simon Glass1-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>
2020-02-06sound: Add a new stop_play() methodSimon Glass2-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>
2019-12-03common: Move get_ticks() function out of common.hSimon Glass1-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>
2019-05-24sound: tegra: Add a sound driverSimon Glass2-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>
2019-05-24tegra: sound: Add an I2S driverSimon Glass3-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>
2019-05-24tegra: sound: Add an audio hub driverSimon Glass3-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>
2019-05-01rockchip: use 'arch-rockchip' as header file pathKever Yang1-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>
2019-02-20x86: Add sound support for samusSimon Glass1-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>
2019-02-20x86: sound: Add sound support for samus (broadwell)Simon Glass2-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>
2019-02-20sound: Add a driver for RealTek RT5677Simon Glass4-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>
2019-02-20x86: sound: Add support for broadwell I2SSimon Glass3-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>
2019-02-20sound: Add a driver for the i8254 beepSimon Glass3-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>
2019-02-20sound: x86: link: Add sound supportSimon Glass3-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>
2019-02-20sandbox: sound: Silence sound for testingSimon Glass1-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>
2019-02-20sound: Add support for Intel HDASimon Glass3-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>
2019-02-20sound: Add uclass operations for beepingSimon Glass2-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>
2019-02-20sound: Mark sound_setup() as optionalSimon Glass1-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>
2019-02-09sound: Allow audio codecs to be used by other SoCsSimon Glass6-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>
2019-02-09sound: samsung: Fix 'regiter' typoSimon Glass1-8/+8
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 Glass5-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>
2019-02-01rockchip: Add a sound driverSimon Glass2-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>
2019-02-01rockchip: Add an I2S driverSimon Glass3-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>
2018-12-14dm: sound: Use the correct number of channels for soundSimon Glass2-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>
2018-12-14dm: sandbox: Allow selection of sample rate and channelsSimon Glass1-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>
2018-12-14dm: sound: max98095: Tidy up error codesSimon Glass1-24/+23
Return a valid error code instead of -1. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-14dm: sound: Fix license headersSimon Glass2-9/+3
Fix a few files whos license headers were not converted to SPDX. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-14dm: sound: Complete migration to driver modelSimon Glass6-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>
2018-12-14dm: exynos: sound: Convert to use driver modelSimon Glass1-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>
2018-12-14dm: sound: exynos: Add support for max98090Simon Glass4-0/+1049
Add support for this new codec which is used by pit. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-14dm: sound: Move common code out of maxim98095Simon Glass5-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>
2018-12-14dm: sound: Add conversion to driver modelSimon Glass6-17/+318
Move the existing hardware drivers over to use driver model. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-14dm: sound: Start i2c IDs from 0Simon Glass3-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>
2018-12-14dm: sound: Create a uclass for soundSimon Glass3-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>
2018-12-14dm: sound: Create a uclass for i2sSimon Glass3-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>
2018-12-14dm: sound: Create a uclass for audio codecsSimon Glass3-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>
2018-12-14dm: sound: Rename samsung_i2s_priv to i2s_uc_privSimon Glass2-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>
2018-12-14dm: sound: Create an option to use driver model for soundSimon Glass1-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>
2018-12-14dm: sound: exynos: Correct codec bus addressesSimon Glass1-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>
2018-12-14dm: sound: Fix up header orderingSimon Glass3-28/+27
Tidy up the ordering of header files in the sounds files. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-14dm: sound: wm8994: Drop wm8994_i2c_init()Simon Glass1-11/+1
This function has only one line in it. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-14dm: sound: max98095: Drop g_codec_info and g_max98095_infoSimon Glass1-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>
2018-12-14dm: sound: wm8994: Drop g_codec_info and g_wm8994_infoSimon Glass1-9/+7
These are only used in two functions so can be made local. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-14dm: sound: max98095: Drop global i2c-address variableSimon Glass1-4/+4
We can put this in the private structure and avoid a global. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-14dm: sound: wm8994: Drop global i2c-address variableSimon Glass1-4/+4
We can put this in the private structure and avoid a global. Signed-off-by: Simon Glass <sjg@chromium.org>