summaryrefslogtreecommitdiffstats
path: root/sound/soc/sunxi
Commit message (Collapse)AuthorAgeFilesLines
...
* | ASoC: sunxi: make snd_soc_codec_driver structures as constBhumika Goyal2017-08-072-4/+4
| | | | | | | | | | | | | | | | | | | | | | Declare snd_soc_codec_driver structures as const as they are either passed as an argument to the function snd_soc_register_codec or stored as reference in field codec of type sun4i_codec_quirks. Both the fucntion argument and the codec field are of type const, so declare the structures with this property as const. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: sun4i-i2s: Extend quirks scopeMarcus Cooper2017-08-011-8/+14
| | | | | | | | | | | | | | | | | | In preparation for the changes required to support newer SoCs then quirks has been moved and also added to the device structure. Signed-off-by: Marcus Cooper <codekipper@gmail.com> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: sun4i-spdif: Handle return value of clk_prepare_enable.Arvind Yadav2017-07-261-3/+8
| | | | | | | | | | | | | | clk_prepare_enable() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: sun4i: explicitly request exclusive reset controlPhilipp Zabel2017-07-193-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting reset lines") started to transition the reset control request API calls to explicitly state whether the driver needs exclusive or shared reset control behavior. Convert all drivers requesting exclusive resets to the explicit API call so the temporary transition helpers can be removed. No functional changes. Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Cc: Chen-Yu Tsai <wens@csie.org> Cc: alsa-devel@alsa-project.org Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: sun8i-codec: constify snd_soc_dai_ops structureGustavo A. R. Silva2017-07-171-1/+1
| | | | | | | | | | | | | | | | | | | | This structure is only stored in the ops field of a snd_soc_dai_driver structure. That field is declared const, so snd_soc_dai_ops structures that have this property can be declared as const also. Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: sun4i-codec: Remove unneeded gpiod NULL checkFabio Estevam2017-07-171-3/+2
|/ | | | | | | | The gpiod API checks for NULL descriptors, so there is no need to duplicate the check in the driver. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-codec: Add support for V3s codecIcenowy Zheng2017-06-061-0/+63
| | | | | | | | | | | | | | | The codec in the V3s is similar to the one found on the A31. One key difference is the analog path controls are routed through the PRCM block. This is supported by the sun8i-codec-analog driver, and tied into this codec driver with the audio card's aux_dev. In addition, the V3s does not have LINEIN, LINEOUT, MBIAS and MIC2, MIC3, and the FIFO related registers are like H3. Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun8i-codec-analog: add support for V3s SoCIcenowy Zheng2017-06-061-0/+9
| | | | | | | | | | | | The V3s SoC features an analog codec with headphone support but without mic2 and linein. Add support for it. Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun8i-codec-analog: prepare a mixer control/widget/route set for V3sIcenowy Zheng2017-06-061-1/+100
| | | | | | | | | | | | Allwinner V3s has an analog codec without MIC2 and Line In, which will need a special set of mixer controls/widgets/routes, otherwise meaningless controls will be exported to userspace and confuse the user. Add the special set, and use it when the SoC has no MIC2 and Line In. Signed-off-by: Icenowy Zheng <icenowy@aosc.io> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun8i-codec-analog: split out mbiasIcenowy Zheng2017-05-241-5/+30
| | | | | | | | | | Allwinner V3s features an analog codec without MBIAS pin. Split out this part, in order to prepare for the V3s analog codec. Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun8i-codec: Convert to use SND_SOC_DAPM_AIF_INMylène Josserand2017-03-151-9/+11
| | | | | | | | | | Update the driver to use SND_SOC_DAPM_AIF_IN instead of SND_SOC_DAPM_DAC. Rename the interface's widgets to be more precise on which slot the interface is connected. Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun8i-codec: Fix space on audio-routing widgetMylène Josserand2017-03-151-1/+1
| | | | | | | | | | | An unwanted space is present in an audio widget's name on the dapm routing. It causes an error on the recognition of this widget (error: ("no dapm match for AIF1 Slot 0 Right"). Remove the space fixes it. Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun8i-codec-analog: split out line inIcenowy Zheng2017-03-151-11/+65
| | | | | | | | | | Allwinner V3s features an analog codec without LINEIN. Split out this part, in order to prepare for the V3s analog codec. Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun8i-codec-analog: split out mic2Icenowy Zheng2017-03-151-16/+76
| | | | | | | | | | Allwinner V3s features an analog codec without MIC2. Split out this part, in order to prepare for the V3s analog codec. Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun8i-codec: Convert to SOC_MIXER_ARRAYMylène Josserand2017-03-081-6/+4
| | | | | | | | | | | SOC_MIXER_ARRAY is a simplified function of SND_SOC_DAPM_MIXER which handles automatically the ARRAY_SIZE of controls. Update the driver to use SOC_MIXER_ARRAY. Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun8i-codec: Update mixer to use SOC_DAPM_DOUBLEMylène Josserand2017-03-081-24/+21
| | | | | | | | | | | Update the driver to use the new SOC_DAPM_DOUBLE definition on the digital DAC mixer. Update the names accordingly as, when they are shared, the controls are not prefixed with the widget's name anymore. Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun8i-codec: Remove analog "HP" widgetMylène Josserand2017-03-081-6/+0
| | | | | | | | | | | The "HP" widget is already present and take part to the analog part (sun8i-codec-analog). Remove it from the digital part as it is unnecessary. Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
*-. Merge remote-tracking branches 'asoc/topic/rt5665', 'asoc/topic/rt5677', ↵Mark Brown2017-02-197-24/+636
|\ \ | | | | | | | | | 'asoc/topic/samsung', 'asoc/topic/simple' and 'asoc/topic/sunxi' into asoc-next
| | * ASoC: sun4i-spdif: drop unnessary snd_soc_unregister_component()Wei Yongjun2017-02-191-10/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's not necessary to unregister a component registered with devm_snd_soc_register_component(). Also removed pointness clk_disable_unprepare() from error path and snd_soc_unregister_platform() from the remove. Fixes: f8260afa444b ("ASoC: sunxi: Add support for the SPDIF block") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: sunxi: allow the analog codec driver to be built on ARM64Icenowy Zheng2017-02-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As the 64-bit Allwinner H5 SoC has the same analog codec part (also the same digital part) as H3, enable the driver to be built on ARM64 Allwinner platform, so that it can be used on H5. Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: sun4i-i2s: Add quirks to handle a31 compatibleMylène Josserand2017-02-031-2/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some SoCs have a reset line that must be asserted/deasserted. This patch adds a quirk to handle the new compatible "allwinner,sun6i-a31-i2s" which will deassert the reset line on probe function and assert it on remove's one. This new compatible is useful in case of A33 codec driver, for example. Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: Add sun8i digital audio codecMylène Josserand2017-02-033-0/+510
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the sun8i audio codec which handles the digital register of A33 codec. The driver handles only the basic playback from the DAC to headphones. All other features (microphone, capture, etc) will be added later. Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: sun8i-codec-analog: Add amplifier event to fix first delayMylène Josserand2017-02-031-2/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When playing a sound for the first time, a short delay, where the audio file is not played, can be noticed. On a second play (right after), the sound is played correctly. If we wait a short time (~5 sec which corresponds to the aplay timeout), the delay is back. This patch fixes it by using an event on headphone amplifier. It allows to keep the amplifier enable while playing a sound. A delay of 700ms allows to wait that the amplifier is powered-up before playing the sound. Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: sun4i-spdif: Add support for the H3 SoCMarcus Cooper2017-01-201-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | The H3 SoC uses the same SPDIF block as found in earlier SoCs, but its TXFIFO is mapped to another address. Signed-off-by: Marcus Cooper <codekipper@gmail.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: sun4i-codec: Add "Right Mixer" to "Line Out Mono Diff." routeChen-Yu Tsai2017-01-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The mono differential output for "Line Out" downmixes the stereo audio from the mixer, instead of just taking the left channel. Add a route from the "Right Mixer" to "Line Out Source Playback Route" through the "Mono Differential" path, so DAPM doesn't shut down everything if the left channel is muted. Fixes: 0f909f98d7cb ("ASoC: sun4i-codec: Add support for A31 Line Out playback") Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: sun4i-spdif: Add quirks to the spdif driverMarcus Cooper2016-12-311-5/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It has been seen that some newer SoCs have a different TX FIFO address and we already have the difference with the A31 requiring a reset. Add a quirks structure so that these can be managed easily. Signed-off-by: Marcus Cooper <codekipper@gmail.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: sun4i-spdif: remove legacy dapm componentsMarcus Cooper2016-12-311-8/+0
| |/ | | | | | | | | | | | | | | | | The dapm components are now handled by the ALSA SoC SPDIF DIT driver so can be removed. Signed-off-by: Marcus Cooper <codekipper@gmail.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* / ASoC: sun4i-i2s: Increase DMA max burst to 8Mylène Josserand2017-01-171-2/+2
|/ | | | | | | | | | | | | | | | As done previously for sun4i-codec, the DMA maxburst of 4 is not supported by every SoCs so the DMA controller engine returns "unsupported value". As a maxburst of 8 is supported by all variants, this patch increases it to 8. For more details, see commit from Chen-Yu Tsai: commit 730e2dd0cbc7 ("ASoC: sun4i-codec: Increase DMA max burst to 8") Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-codec: Add support for H3 codecChen-Yu Tsai2016-11-301-0/+71
| | | | | | | | | | | | | | | The codec on the H3 is similar to the one found on the A31. One key difference is the analog path controls are routed through the PRCM block. This is supported by the sun8i-codec-analog driver, and tied into this codec driver with the audio card's aux_dev. In addition, the H3 has no HP (headphone) and HBIAS support, and no MIC3 input. The FIFO related registers are slightly rearranged. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Rob Herring <robh@kernel.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-codec: Add support for A23 codecChen-Yu Tsai2016-11-301-0/+108
| | | | | | | | | | | | | | | The codec in the A23 is similar to the one found on the A31. One key difference is the analog path controls are routed through the PRCM block. This is supported by the sun8i-codec-analog driver, and tied into this codec driver with the audio card's aux_dev. In addition, the A23 does not have LINEOUT, and it does not support headset jack detection or buttons. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Rob Herring <robh@kernel.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sunxi: Uninitialized variable in probe()Dan Carpenter2016-11-241-1/+1
| | | | | | | | | | Oddly enough, my version of GCC misses this uninitialized variable. Fixes: ba2ff3027b5a ("ASoC: sunxi: Add support for A23/A33/H3 codec's analog path controls") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sunxi: Add support for A23/A33/H3 codec's analog path controlsChen-Yu Tsai2016-11-223-0/+674
| | | | | | | | | | | | | | | | | | | | | | | | | | The internal codec on A23/A33/H3 is split into 2 parts. The analog path controls are routed through an embedded custom register bus accessed through the PRCM block. The SoCs share a common set of inputs, outputs, and audio paths. The following table lists the differences. ---------------------------------------- | Feature \ SoC | A23 | A33 | H3 | ---------------------------------------- | Headphone | v | v | | ---------------------------------------- | Line Out | | | v | ---------------------------------------- | Phone In/Out | v | v | | ---------------------------------------- Add an ASoC component driver for it. This should be tied to the codec audio card as an auxiliary device. This patch adds the commont paths and controls, and variant specific headphone out and line out. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-codec: fix semicolon.cocci warningskbuild test robot2016-11-101-1/+1
| | | | | | | | | | | | sound/soc/sunxi/sun4i-codec.c:1339:2-3: Unneeded semicolon Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-codec: Add support for optional reset control to quirksChen-Yu Tsai2016-11-091-1/+27
| | | | | | | | | | | | The later Allwinner SoCs have a dedicated reset controller, and peripherals have dedicated reset controls which need to be deasserted before the associated peripheral can be used. Add support for this to the quirks structure and probe/remove functions. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-codec: Add support for A31 ADC capture pathChen-Yu Tsai2016-11-091-0/+65
| | | | | | | | | | | | | The A31's internal codec capture path has a mixer in front of the ADC for each channel, capable of selecting various inputs, including microphones, line in, phone in, and the main output mixer. This patch adds the various controls, widgets and routes needed for audio capture from the already supported inputs on the A31. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sunxi: i2s: Implement set_sysclkMaxime Ripard2016-11-091-15/+38
| | | | | | | | | | | | | | | In our i2s driver, we were previously trying to guess which oversample the user wanted to use by looking at the rate and trying to max it. However, the cards, and especially simple-card with its mclk-fs property will already provide the expected oversample ratio by using the set_sysclk callback. We can thus implement it and remove the logic to deal with the runtime guess. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-codec: Add support for A31 board level audio routingChen-Yu Tsai2016-11-041-2/+19
| | | | | | | | | | | | | | | | | | | The A31 SoC's codec has various inputs, outputs and microphone bias supplies. These can be routed on the board in different ways, such as: - HPCOM may be connected to have the headphone DC coupled. - Microphones all use the MBIAS main microphone supply or one mic may use the HBIAS supply, which supports headset detection and buttons. - Line Out may be routed to an audio jack, or an onboard speaker amp with power controls. Add support for specifying the audio routes in the device tree. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-codec: Add support for A31 analog microphone inputsChen-Yu Tsai2016-11-041-0/+70
| | | | | | | | | | | | | | | | | The A31 internal codec has 3 microphone outputs, of which MIC2 and MIC3 are muxed internally. The resulting two microphone inputs have separate gain controls and mixer inputs. The codec also has 2 microphone bias pins. HBIAS is specifically for the headphone jack, which also supports headphone detection and control buttons. These extra functions are not supported yet. The other, MBIAS, is for all other analog microphones. There is also mention of digital microphone support, but documentation is scarce, and no hardware with it is available. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-codec: Add support for A31 Line Out playbackChen-Yu Tsai2016-11-041-0/+39
| | | | | | | | | | | | | The A31 integrated codec has a second "Line Out" output which does not include an integrated amplifier in its path. This path does have a separate volume control. This patch adds support for the playback path from the DAC to the Line Out pins. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-codec: Add support for A31 Line In playbackChen-Yu Tsai2016-11-031-0/+15
| | | | | | | | | The A31 integrated codec has a stereo "Line In" input. Add support for it to the playback paths. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-codec: Add support for A31 playback through headphone outputChen-Yu Tsai2016-11-031-4/+267
| | | | | | | | | | | | | | | The A31 has a similar codec to the A10/A20. The PCM parts are very similar, with different register offsets. The analog paths are very different. There are more inputs and outputs. The ADC mux has been replaced with a proper mixer. This patch adds support for the basic playback path of the A31 codec, from the DAC to the headphones. Headphone detection, microphone, signaling, other inputs/outputs and capture will be added later. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-codec: Increase DMA max burst to 8Chen-Yu Tsai2016-11-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the DMA engine API documentation, maxburst denotes the largest possible size of a single transfer, so as not to overflow destination FIFOs as explained in this excerpt from dmaengine.h * @src_maxburst: the maximum number of words (note: words, as in * units of the src_addr_width member, not bytes) that can be sent * in one burst to the device. Typically something like half the * FIFO depth on I/O peripherals so you don't overflow it. This * may or may not be applicable on memory sources. * @dst_maxburst: same as src_maxburst but for destination target * mutatis mutandis. The TX FIFO is 64 samples deep for stereo, and the RX FIFO is 16 samples deep. So maxburst could be 32 and 8 for TX and RX respectively. Unfortunately the sunxi DMA controller driver takes maxburst as the requested burst size, rather than a limit, and returns an error for unsupported values. The original value was 4, but some later SoCs do not officially support this burst size. This patch increases maxburst on the TX side to 8, which is supported by all variants of the sunxi DMA controller. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-codec: Expand quirks to handle register offsets and card creationChen-Yu Tsai2016-11-031-27/+60
| | | | | | | | | | | | | | | | | | | | | The A31 has a similar codec to the A10/A20. The PCM parts are very similar, with just different register offsets. The analog paths are very different. There are more inputs and outputs. The A31s, A23, and H3 have a similar PCM interface, again with register offsets slightly rearranged. The analog path controls, while very similar between them and the A31, have been moved a separate bus which is accessed through a message box like interface in the PRCM address range. This would be handled by a separate auxiliary device tied in through the device tree in its supporting create_card function. The quirks structure is expanded to include different register offsets and separate callbacks for creating the ASoC card. The regmap_config, quirks, and of_device_match tables have been moved to facilitate this. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* Merge branch 'fix/sunxi' of ↵Mark Brown2016-11-031-6/+6
|\ | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-sunxi
| * ASoC: sun4i-codec: Enable bus clock after getting GPIOChen-Yu Tsai2016-11-011-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In the current probe function the GPIO is acquired after the codec's bus clock is enabled. However if it fails to acquire the GPIO due to a deferred probe, it does not disable the bus clock before bailing out. This would result in the clock being enabled multiple times. Move the code that enables the bus clock after the part that gets the GPIO, maintaining a separation between resource acquisition and device enablement in the probe function. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: sun4i-codec: Revise comments for register definition macrosChen-Yu Tsai2016-11-031-3/+11
| | | | | | | | | | | | | | | | | | | | This revises existing comments in the register definition macros section, and adds a few more, so that readers can clearly identify the types of control registers. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: sun4i-codec: Move data structures to add create_card call to quirksChen-Yu Tsai2016-11-031-39/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The audio codec on later Allwinner SoCs have a different layout and audio path compared to the A10/A20. However the PCM parts are still the same. The different layout and audio paths mean we need a different create_card function for different families, so they can create DAPM endpoint widgets and routes. This patch moves the regmap configs, quirks and of_device_id structures to just before the probe function, so we can, among other things, include a pointer for the create_card function. None of the lines of code were changed. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: sun4i-i2s: Implement capture supportMaxime Ripard2016-11-031-3/+49
|/ | | | | | | | The i2s driver was only implementing playback for now. Implement capture to make sure that's not a limitation anymore. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-codec: return error code instead of NULL when create_card failsChen-Yu Tsai2016-10-311-3/+4
| | | | | | | | | | | | | | | | When sun4i_codec_create_card fails, we do not assign a proper error code to the return value. The return value would be 0 from the previous function call, or we would have bailed out sooner. This would confuse the driver core into thinking the device probe succeeded, when in fact it didn't, leaving various devres based resources lingering. Make the create_card function pass back a meaningful error code, and assign it to the return value. Fixes: 45fb6b6f2aa3 ("ASoC: sunxi: add support for the on-chip codec on early Allwinner SoCs") Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-codec: Rename sun4i_codec_widgets for consistencyDanny Milosavljevic2016-09-261-3/+3
| | | | | | | | | Rename "sun4i_codec_widgets" to "sun4i_codec_controls" for consistency with the struct field name. Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>