Charles Keepax [Thu, 19 May 2022 15:42:50 +0000 (16:42 +0100)]
ASoC: core: Always send the CPU DAI a direct clock specifier
All CPU drivers are now updated to accept a direct indication of
whether they are clock provider or consumer, rather than being told
if the CODEC is clock provider. As such update the core to always
pass this direct indication rather than only if the new set_fmt_new
callback is defined. Note this makes no difference to the CODEC
side of the DAI link as it was already being directly told if it
was clock provider under the old system.
Charles Keepax [Thu, 19 May 2022 15:42:49 +0000 (16:42 +0100)]
ASoC: xtensa: Update to use set_fmt_new callback
As part of updating the core to directly tell drivers if they are clock
provider or consumer update this CPU side driver to use the new direct
callback.
Charles Keepax [Thu, 19 May 2022 15:42:48 +0000 (16:42 +0100)]
ASoC: ux500: Update to use set_fmt_new callback
As part of updating the core to directly tell drivers if they are clock
provider or consumer update this CPU side driver to use the new direct
callback.
Charles Keepax [Thu, 19 May 2022 15:42:47 +0000 (16:42 +0100)]
ASoC: ti: Update to use set_fmt_new callback
As part of updating the core to directly tell drivers if they are clock
provider or consumer update these CPU side drivers to use the new direct
callback.
Charles Keepax [Thu, 19 May 2022 15:42:46 +0000 (16:42 +0100)]
ASoC: test-component: Update to use set_fmt_new callback
As part of updating the core to directly tell drivers if they are clock
provider or consumer update this CPU side driver to use the new direct
callback.
Charles Keepax [Thu, 19 May 2022 15:42:45 +0000 (16:42 +0100)]
ASoC: tegra: Update to use set_fmt_new callback
As part of updating the core to directly tell drivers if they are clock
provider or consumer update these CPU side drivers to use the new direct
callback.
Charles Keepax [Thu, 19 May 2022 15:42:44 +0000 (16:42 +0100)]
ASoC: sunxi: Update to use set_fmt_new callback
As part of updating the core to directly tell drivers if they are clock
provider or consumer update these CPU side drivers to use the new direct
callback.
Charles Keepax [Thu, 19 May 2022 15:42:43 +0000 (16:42 +0100)]
ASoC: stm: Update to use set_fmt_new callback
As part of updating the core to directly tell drivers if they are clock
provider or consumer update these CPU side drivers to use the new direct
callback.
Charles Keepax [Thu, 19 May 2022 15:42:42 +0000 (16:42 +0100)]
ASoC: sh: Update to use set_fmt_new callback
As part of updating the core to directly tell drivers if they are clock
provider or consumer update these CPU side drivers to use the new direct
callback.
Charles Keepax [Thu, 19 May 2022 15:42:41 +0000 (16:42 +0100)]
ASoC: samsung: Update to use set_fmt_new callback
As part of updating the core to directly tell drivers if they are clock
provider or consumer update these CPU side drivers to use the new direct
callback.
Charles Keepax [Thu, 19 May 2022 15:42:40 +0000 (16:42 +0100)]
ASoC: rockchip: Update to use set_fmt_new callback
As part of updating the core to directly tell drivers if they are clock
provider or consumer update these CPU side drivers to use the new direct
callback.
Charles Keepax [Thu, 19 May 2022 15:42:39 +0000 (16:42 +0100)]
ASoC: qcom: Update to use set_fmt_new callback
As part of updating the core to directly tell drivers if they are clock
provider or consumer update these CPU side drivers to use the new direct
callback.
Charles Keepax [Thu, 19 May 2022 15:42:38 +0000 (16:42 +0100)]
ASoC: pxa: Update to use set_fmt_new callback
As part of updating the core to directly tell drivers if they are clock
provider or consumer update these CPU side drivers to use the new direct
callback.
Charles Keepax [Thu, 19 May 2022 15:42:37 +0000 (16:42 +0100)]
ASoC: mxs-saif: Update to use set_fmt_new callback
As part of updating the core to directly tell drivers if they are clock
provider or consumer update this CPU side driver to use the new direct
callback.
Charles Keepax [Thu, 19 May 2022 15:42:36 +0000 (16:42 +0100)]
ASoC: meson: Update to use set_fmt_new callback
As part of updating the core to directly tell drivers if they are clock
provider or consumer update these CPU side drivers to use the new direct
callback.
Charles Keepax [Thu, 19 May 2022 15:42:35 +0000 (16:42 +0100)]
ASoC: mediatek: Update to use set_fmt_new callback
As part of updating the core to directly tell drivers if they are clock
provider or consumer update these CPU side drivers to use the new direct
callback.
Charles Keepax [Thu, 19 May 2022 15:42:34 +0000 (16:42 +0100)]
ASoC: js4740-i2s: Update to use set_fmt_new callback
As part of updating the core to directly tell drivers if they are clock
provider or consumer update this CPU side driver to use the new direct
callback.
Charles Keepax [Thu, 19 May 2022 15:42:33 +0000 (16:42 +0100)]
ASoC: Intel: Update to use set_fmt_new callback
As part of updating the core to directly tell drivers if they are clock
provider or consumer update these CPU side drivers to use the new direct
callback.
Charles Keepax [Thu, 19 May 2022 15:42:32 +0000 (16:42 +0100)]
ASoC: img: Update to use set_fmt_new callback
As part of updating the core to directly tell drivers if they are clock
provider or consumer update these CPU side drivers to use the new direct
callback.
Charles Keepax [Thu, 19 May 2022 15:42:31 +0000 (16:42 +0100)]
ASoC: hisilicon: Update to use set_fmt_new callback
As part of updating the core to directly tell drivers if they are clock
provider or consumer update this CPU side driver to use the new direct
callback.
Charles Keepax [Thu, 19 May 2022 15:42:30 +0000 (16:42 +0100)]
ASoC: fsl: Update to use set_fmt_new callback
As part of updating the core to directly tell drivers if they are clock
provider or consumer update these CPU side drivers to use the new direct
callback.
Charles Keepax [Thu, 19 May 2022 15:42:29 +0000 (16:42 +0100)]
ASoC: dwc: Update to use set_fmt_new callback
As part of updating the core to directly tell drivers if they are clock
provider or consumer update this CPU side driver to use the new direct
callback.
Charles Keepax [Thu, 19 May 2022 15:42:28 +0000 (16:42 +0100)]
ASoC: ep93xx: Update to use set_fmt_new callback
As part of updating the core to directly tell drivers if they are clock
provider or consumer update this CPU side driver to use the new direct
callback.
Charles Keepax [Thu, 19 May 2022 15:42:27 +0000 (16:42 +0100)]
ASoC: bcm: Update to use set_fmt_new callback
As part of updating the core to directly tell drivers if they are clock
provider or consumer update these CPU side drivers to use the new direct
callback.
Charles Keepax [Thu, 19 May 2022 15:42:26 +0000 (16:42 +0100)]
ASoC: au1x: Update to use set_fmt_new callback
As part of updating the core to directly tell drivers if they are clock
provider or consumer update these CPU side drivers to use the new direct
callback.
Charles Keepax [Thu, 19 May 2022 15:42:25 +0000 (16:42 +0100)]
ASoC: atmel: Update to use set_fmt_new callback
As part of updating the core to directly tell drivers if they are clock
provider or consumer update these CPU side drivers to use the new direct
callback.
Charles Keepax [Thu, 19 May 2022 15:42:24 +0000 (16:42 +0100)]
ASoC: amd: vangogh: Update to use set_fmt_new callback
As part of updating the core to directly tell drivers if they are clock
provider or consumer update this CPU side driver to use the new direct
callback.
Charles Keepax [Thu, 19 May 2022 15:42:23 +0000 (16:42 +0100)]
ASoC: core: Add set_fmt_new callback that directly specifies provider
The original set_fmt callback always passes clock provider/consumer
with respect to the CODEC. This made sense when the framework was
directly broken down into platforms and CODECs. Now everything is
componentised it simplifies things if each side of the link is
just told if it is provider or consumer of the clocks. To start
this migration add a new callback that can be used to receive a
direct specification of clocking. As there are more CODEC drivers
than platform drivers, we make the new flags identical to the old
CODEC flags meaning CODEC drivers will not require an update.
Cezary Rojewski [Wed, 11 May 2022 16:23:54 +0000 (18:23 +0200)]
ASoC: Intel: avs: Add I2S-test machine board
Allow for testing audio streaming over I2S interface through SSP
loopback. No actual codec is needed here as board is intended for SSP
loopback scenarios only. One playback and one capture endpoint is
exposed per SSP port.
Cezary Rojewski [Wed, 11 May 2022 16:23:52 +0000 (18:23 +0200)]
ASoC: Intel: avs: Add HDAudio machine board
Connect AVS driver with ASoC HDAudio codec with help of this machine
board. Similarly to its platform and codec components, DAI links and
routes are being created dynamically so single board can be used across
all HDAudio codec types.
Card makes use of "binder" BE DAI Link so HDAudio codec driver can be
listed as one of its components. This allows for BE DAIs to be created
dynamically, based on HDAudio codec capabilities.
Cezary Rojewski [Wed, 11 May 2022 16:23:51 +0000 (18:23 +0200)]
ASoC: codecs: Add HD-Audio codec driver
Add generic ASoC equivalent of ALSA HD-Audio codec. This codec is
designed to follow HDA_DEV_LEGACY convention. Driver wrapps existing
hda_codec.c handlers to prevent code duplication within the newly added
code. Number of DAIs created is dependent on capabilities exposed by the
codec itself. Because of this, single solution can be applied to support
every single HD-Audio codec type.
At the same time, through the ASoC topology, platform drivers may limit
the number of endpoints available to the userspace as codec driver
exposes BE DAIs only.
Both hda_codec_probe() and hda_codec_remove() declare their expectations
on device's usage_count and suspended-status. This is to catch any
unexpected behavior as PM-related code for HD-Audio has been changing
quite a bit throughout the years.
In order for codec DAI list to reflect its actual PCM capabilities, PCMs
need to be built and that can only happen once codec device is
constructed. To do that, a valid component->card->snd_card pointer is
needed. Said pointer will be provided by the framework once all card
components are accounted for and their probing can begin. Usage of
"binder" BE DAI solves the problem - codec can be listed as one of
HD-Audio card components without declaring any actual BE DAIs
statically.
Relation with hdac_hda:
Addition of parallel solution is motivated by behavioral differences
between hdac_hda.c and its legacy equivalent found in sound/pci/hda
e.g.: lack of dynamic, based on codec capabilities, resource allocation
and high cost of removing such differences on actively used targets.
Major goal of codec driver presented here is to follow HD-Audio legacy
behavior in 1:1 fashion by becoming a wrapper. Doing so increases code
coverage of the legacy code and reduces the maintenance cost for both
solutions.
Sameer Pujar [Fri, 3 Jun 2022 06:36:09 +0000 (12:06 +0530)]
ASoC: tegra: AHUB routes for OPE module
Add AHUB routes for OPE module. The OPE module can be plugged into audio
path as per the need. The routing controls can be used to setup the audio
path with OPE similar to the already existing routes. The support is added
on Tegra210 and later Tegra SoCs where OPE module is present.
Sameer Pujar [Fri, 3 Jun 2022 06:36:08 +0000 (12:06 +0530)]
ASoC: tegra: Add Tegra210 based OPE driver
The Output Processing Engine (OPE) is one of the AHUB client. It has
PEQ (Parametric Equalizer) and MBDRC (Multi Band Dynamic Range Compressor)
sub blocks for data processing. The PEQ block gets samples from the MBDRC
block.
This patch registers OPE driver with ASoC framework. The component driver
exposes DAPM widgets, routes and kcontrols for the device. The DAI driver
exposes OPE interfaces, which can be used to connect different components
in the ASoC layer. Makefile and Kconfig support is added to allow build
the driver.
Sameer Pujar [Fri, 3 Jun 2022 06:36:07 +0000 (12:06 +0530)]
ASoC: tegra: Add binding doc for OPE module
This patch adds YAML schema for DT bindings of Output Processing
Engine (OPE) module. It consists of Parametric Equalizer (PEQ)
and Multi Band Dynamic Range Compressor (MBDRC) sub blocks and
binding doc for these blocks are added as well. The OPE will be
registered as an ASoC component and can be plugged into an audio
path as per need via ALSA mixer controls. The DT bindings are
applicable on Tegra210 and later SoCs where OPE module is present.
Hui Wang [Mon, 30 May 2022 04:01:51 +0000 (12:01 +0800)]
ASoC: nau8822: Disable internal PLL if freq_out is zero
After finishing the playback or recording, the machine driver might
call snd_soc_dai_set_pll(codec, pll_id, 0, 0, 0) to stop the internal
PLL, but with the codec driver nau8822, it will print error as below:
nau8822 0-001a: Unsupported input clock 0
fsl-asoc-card sound-nau8822: failed to stop FLL: -22
Refer to the function wm8962_set_fll() in the codec driver wm8962, if
the freq_out is zero, turn off the internal PLL and return 0.
Rob Herring [Thu, 26 May 2022 01:41:41 +0000 (20:41 -0500)]
spi: dt-bindings: Fix unevaluatedProperties warnings in examples
The 'unevaluatedProperties' schema checks is not fully working and doesn't
catch some cases where there's a $ref to another schema. A fix is pending,
but results in new warnings in examples.
'spi-max-frequency' is supposed to be a per SPI peripheral device property,
not a SPI controller property, so drop it.
Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20220526014141.2872567-1-robh@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
Patrice Chotard [Thu, 2 Jun 2022 09:10:22 +0000 (11:10 +0200)]
spi: spi-mem: Fix spi_mem_poll_status()
In spi_mem_exec_op(), in case cs_gpiod descriptor is set, exec_op()
callback can't be used.
The same must be applied in spi_mem_poll_status(), poll_status()
callback can't be used, we must use the legacy path using
read_poll_timeout().
Tested on STM32mp257c-ev1 specific evaluation board on which a
spi-nand was mounted instead of a spi-nor.
The depth of the transmit FIFO for the Cadence SPI controller is currently
hardcoded to 128. But the depth is a synthesis configuration parameter of
the core and can vary between different SoCs.
If the configured FIFO size is less than 128 the driver will busy loop in
the cdns_spi_fill_tx_fifo() function waiting for FIFO space to become
available.
Depending on the length and speed of the transfer it can spin for a
significant amount of time. The cdns_spi_fill_tx_fifo() function is called
from the drivers interrupt handler, so it can leave interrupts disabled for
a prolonged amount of time.
In addition the read FIFO will also overflow and data will be discarded.
To avoid this detect the actual size of the FIFO and use that rather than
the hardcoded value.
To detect the FIFO size the FIFO threshold register is used. The register
is sized so that it can hold FIFO size - 1 as its maximum value. Bits that
are not needed to hold the threshold value will always read 0. By writing
0xffff to the register and then reading back the value in the register we
get the FIFO size.
As part of unprepare_transfer_hardware, SPI controller will be disabled
which will indirectly deassert the CS line. This will create a problem
in some of the devices where message will be transferred with
cs_change flag set(CS should not be deasserted).
As per SPI controller implementation, if SPI controller is disabled then
all output enables are inactive and all pins are set to input mode which
means CS will go to default state high(deassert). This leads to an issue
when core explicitly ask not to deassert the CS (cs_change = 1). This
patch fix the above issue by checking the Slave select status bits from
configuration register before disabling the SPI.
Mark Brown [Fri, 3 Jun 2022 11:50:03 +0000 (13:50 +0200)]
ASoC: wm_adsp: Fix event generation for wm_adsp_fw_put()
Currently wm_adsp_fw_put() returns 0 rather than 1 when updating the value
of the control, meaning that no event is generated to userspace. Fix this
by setting the default return value to 1, the code already exits early with
a return value of 0 if the value is unchanged.
Mark Brown [Fri, 3 Jun 2022 12:39:37 +0000 (14:39 +0200)]
ASoC: es8328: Fix event generation for deemphasis control
Currently the put() method for the deemphasis control returns 0 when a new
value is written to the control even if the value changed, meaning events
are not generated. Fix this, skip the work of updating the value when it is
unchanged and then return 1 after having done so.
Dan Carpenter [Thu, 2 Jun 2022 09:09:35 +0000 (12:09 +0300)]
ASoC: SOF: ipc-msg-injector: Fix reversed if statement
This if statement is reversed. In fact, the condition can just be
deleted because writing zero bytes is a no-op.
Fixes: 066c67624d8c ("ASoC: SOF: ipc-msg-injector: Add support for IPC4 messages") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/Yph+T3PpGCdPsEDj@kili Signed-off-by: Mark Brown <broonie@kernel.org>
This code is supposed to propagate errors from simple_write_to_buffer()
or return -EFAULT if "size != count". However "size" needs to be signed
for the code to work correctly and the case where "size == 0" is not
handled correctly.
Fixes: 066c67624d8c ("ASoC: SOF: ipc-msg-injector: Add support for IPC4 messages") Fixes: 2f0b1b013bbc ("ASoC: SOF: debug: Add support for IPC message injection") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/Yph+Cd+JrfOH0i7z@kili Signed-off-by: Mark Brown <broonie@kernel.org>
Cleanup path for sof_prepare_widgets_in_path() should check if unprepare
callback exists before calling it, instead it checks if it does not
exist. Fix the check.
Andy Shevchenko [Mon, 30 May 2022 11:57:50 +0000 (14:57 +0300)]
MAINTAINERS: Update Intel pin control to Supported
The actual status of the code is Supported.
Reported-by: dave.hansen@linux.intel.com Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
George D Sworo [Wed, 1 Jun 2022 22:41:02 +0000 (15:41 -0700)]
thunderbolt: Add support for Intel Raptor Lake
Intel Raptor Lake has the same integrated Thunderbolt/USB4 controller as
Intel Alder Lake. By default it is still using firmware based connection
manager so we can use most of the Alder Lake flows.
Signed-off-by: George D Sworo <george.d.sworo@intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Yang Li [Thu, 26 May 2022 13:01:54 +0000 (21:01 +0800)]
thunderbolt: Fix some kernel-doc comments
Remove some warnings found by running scripts/kernel-doc,
which is caused by using 'make W=1'.
drivers/thunderbolt/ctl.c:701: warning: expecting prototype for tb_cfg_start().
Prototype was for tb_ctl_start() instead
drivers/thunderbolt/ctl.c:722: warning: expecting prototype for tb_ctrl_stop().
Prototype was for tb_ctl_stop() instead
drivers/thunderbolt/ctl.c:930: warning: expecting prototype for tb_cfg_write().
Prototype was for tb_cfg_write_raw() instead
Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Gil Fine [Thu, 26 May 2022 10:59:21 +0000 (13:59 +0300)]
thunderbolt: Change TMU mode to HiFi uni-directional once DisplayPort tunneled
Here we configure TMU mode to HiFi uni-directional once DP tunnel
is created. This is due to accuracy requirement for DP tunneling
as appears in CM guide 1.0, section 7.3.2.
Due to Intel hardware limitation, once we changed the TMU mode to HiFi
uni-directional (when DP tunnel exists), we don't change TMU mode back to
normal uni-directional, even if DP tunnel is torn down later.
Signed-off-by: Gil Fine <gil.fine@intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Gil Fine [Thu, 26 May 2022 10:59:20 +0000 (13:59 +0300)]
thunderbolt: Add CL1 support for USB4 and Titan Ridge routers
In this patch we add support for a second low power state of the link: CL1.
Low power states (called collectively CLx) are used to reduce
transmitter and receiver power when a high-speed lane is idle.
We enable it, if both sides of the link support it,
and only for the first hop router (i.e. the first device that connected
to the host router). This is needed for better thermal management.
Signed-off-by: Gil Fine <gil.fine@intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Gil Fine [Thu, 26 May 2022 10:59:19 +0000 (13:59 +0300)]
thunderbolt: Change downstream router's TMU rate in both TMU uni/bidir mode
In case of uni-directional time sync, TMU handshake is
initiated by upstream router. In case of bi-directional
time sync, TMU handshake is initiated by downstream router.
In order to handle correctly the case of uni-directional mode,
we avoid changing the upstream router's rate to off,
because it might have another downstream router plugged that is set to
uni-directional mode (and we don't want to change its mode).
Instead, we always change downstream router's rate.
Signed-off-by: Gil Fine <gil.fine@intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Gil Fine [Thu, 26 May 2022 10:59:16 +0000 (13:59 +0300)]
thunderbolt: Silently ignore CLx enabling in case CLx is not supported
We can't enable CLx if it is not supported either by the host or device,
or by the USB4/TBT link (e.g. when an optical cable is used).
We silently ignore CLx enabling in this case.
Signed-off-by: Gil Fine <gil.fine@intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Miaoqian Lin [Thu, 2 Jun 2022 04:17:21 +0000 (08:17 +0400)]
memory: samsung: exynos5422-dmc: Fix refcount leak in of_get_dram_timings
of_parse_phandle() returns a node pointer with refcount
incremented, we should use of_node_put() on it when not need anymore.
This function doesn't call of_node_put() in some error paths.
To unify the structure, Add put_node label and goto it on errors.
Fixes: 6e7674c3c6df ("memory: Add DMC driver for Exynos5422") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Link: https://lore.kernel.org/r/20220602041721.64348-1-linmq006@gmail.com Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Miaoqian Lin [Wed, 1 Jun 2022 12:01:18 +0000 (16:01 +0400)]
memory: mtk-smi: add missing put_device() call in mtk_smi_device_link_common
The reference taken by 'of_find_device_by_node()' must be released when
not needed anymore.
Add the corresponding 'put_device()' in the error handling paths.
Ralph Siemsen [Wed, 18 May 2022 18:25:27 +0000 (14:25 -0400)]
clk: renesas: r9a06g032: Fix UART clkgrp bitsel
There are two UART clock groups, each having a mux to select its
upstream clock source. The register/bit definitions for accessing these
two muxes appear to have been reversed since introduction. Correct them
so as to match the hardware manual.