Commit graph

23622 commits

Author SHA1 Message Date
Hans de Goede
0a61bcbba8
ASoC: Intel: bytct_rt5640: Add a separate "Headset Mic 2" DAPM pin for the mic on the 2nd jack
In order to be able to do jack-detection reporting for the
mic contact on the 2nd jack found on some devices, the
DAPM topology needs to have a separate DAPM pin/input for that
microphone, instead of re-using the "Internal Mic" pin which is
normally used together with the IN1P input of the codec.

Using the "Internal Mic" dapm-pin-switch for this in a snd_soc_jack_pin to
report hotplug events causes the "Internal Mic" pin to get deactivated
when unplugging a headset from the 2nd jack, thus turning off the actual
Internal Mic (typically a pair of digital mics on devices with 2 jacks).

Fixes: 79c1123bac ("ASoC: Intel: bytcr_rt5640: Add support for a second headset mic input")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210819190543.784415-6-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-19 23:27:59 +01:00
Hans de Goede
e3f2a6603a
ASoC: rt5640: Add rt5640_set_ovcd_params() helper
Some devices don't use the builtin jack-detect but can still benefit
from the mic-bias-current over-current-detection to differentiate
between headphones vs a headset.

Move the ovcd init code from rt5640_enable_jack_detect() into a new
rt5640_set_ovcd_params() helper and export this helper as well
as a couple of related ovcd functions.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210819190543.784415-5-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-19 23:27:58 +01:00
Hans de Goede
d21213b450
ASoC: rt5640: Add optional hp_det_gpio parameter to rt5640_detect_headset()
Some devices don't use the builtin jack-detect but can still benefit
from the mic-bias-current over-current-detection headphones vs
headset detection done by rt5640_detect_headset().

In this case the jack-inserted check done by rt5640_detect_headset()
needs to be done through a GPIO rather then by using the codec's
builtin jack-detect. Add an optional hp_det_gpio parameter and export
rt5640_detect_headset() for use on machines where jack-detect is
handled outside of the codec.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210819190543.784415-4-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-19 23:27:57 +01:00
Hans de Goede
15d54840ec
ASoC: rt5640: Delay requesting IRQ until the machine-drv calls set_jack
Delay requesting the IRQ until the machine-drv calls set_jack.

The main reason for this is that the codec's IRQ is unused on some boards,
in which case we really should not call request_irq at all.

On some boards there is an IRQ listed at index 0 for the codec, but
this is not connected to the codec, but rather is directly connected
to the jack's jack-detect pin. These special setups will be handled
by the machine-driver, but the machine driver can only request the IRQ
if it is not first requested by the codec driver. Moving the request_irq
to the set_jack callback (which will not get called in this case) avoids
the codec-driver clobbering the IRQ.

Moving the request_irq also removes the need to disable the IRQ immediately
after requesting it, avoiding a small race (this could also have been fixed
by using the new IRQF_NO_AUTOEN flag when requesting the IRQ).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210819190543.784415-3-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-19 23:27:56 +01:00
Hans de Goede
5caab9f48b
ASoC: rt5640: Move rt5640_disable_jack_detect() up in the rt5640.c file
Move rt5640_disable_jack_detect() to above rt5640_enable_jack_detect().
This is a preparation patch for reworking how the IRQ gets requested.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210819190543.784415-2-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-19 23:27:55 +01:00
Colin Ian King
5d925d9823
ASoC: uniphier: make arrays mul and div static const, makes object smaller
Don't populate the arrays mul and div on the stack but instead make them
static const. Makes the object code smaller by 4 bytes.

Before:
   text    data     bss     dec     hex filename
  16226    4984      64   21274    531a ./sound/soc/uniphier/aio-cpu.o

After:
   text    data     bss     dec     hex filename
  16062    5144      64   21270    5316 ./sound/soc/uniphier/aio-cpu.o

(gcc version 10.2.0)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Link: https://lore.kernel.org/r/20210818151746.38520-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-19 18:21:23 +01:00
Biju Das
4b14f17912
ASoC: sh: rz-ssi: Improve error handling in rz_ssi_dma_request function
dma_request_chan() returns error pointer in case of failures, but
the rz_ssi_dma_request() checked for NULL pointer instead.

This patch fixes the issue by checking for ERR_PTR() instead of
NULL and sets the DMA pointers to NULL in error case so that ssi
can fallback to PIO mode.

Fixes: 26ac471c53 ("ASoC: sh: rz-ssi: Add SSI DMAC support")
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://lore.kernel.org/r/20210818101450.15948-1-biju.das.jz@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-19 18:21:22 +01:00
Shengjiu Wang
2fbbcffea5
ASoC: fsl_rpmsg: Check -EPROBE_DEFER for getting clocks
The devm_clk_get() may return -EPROBE_DEFER, then clocks
will be assigned to NULL wrongly. As the clocks are
optional so we can use devm_clk_get_optional() instead of
devm_clk_get().

Fixes: b73d9e6225 ("ASoC: fsl_rpmsg: Add CPU DAI driver for audio base on rpmsg")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1629266614-6942-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-18 13:55:18 +01:00
Mark Brown
2499ee9d90
Merge series "ASoC: tegra30: Fix use of of_device_get_match_data" from Aakash Hemadri <aakashhemadri123@gmail.com>:
Hi,
This patchset fixes my previous incorrect patches.

356b94a32a ("ASoC: tegra30: i2s: Use of_device_get_match_data")
80165bb804 ("ASoC: tegra30: ahub: Use of_device_get_match_data")

Aakash Hemadri (2):
  ASoC: tegra30: ahub: Fix incorrect usage of of_device_get_match_data
  ASoC: tegra30: i2s: Fix incorrect usage of of_device_get_match_data

 sound/soc/tegra/tegra30_ahub.c | 6 ++----
 sound/soc/tegra/tegra30_i2s.c  | 8 ++++----
 2 files changed, 6 insertions(+), 8 deletions(-)

--
2.32.0
2021-08-17 15:14:06 +01:00
Hans de Goede
f8043ef50a
ASoC: Intel: bytcr_rt5640: Use cfg-lineout:2 in the components string
Use "cfg-lineout:2" in the components string on boards with a lineout
instead of "cfg-lineout:1", this better mirrors the speaker part of
the components string where we use "cfg-spk:1" for devices with a single
speaker and "cfg-spk:2" for stereo speakers.

The lineout is stereo by default, so using ":2" makes more sense, this
way we keep ":1" reserved in case we ever encounter a device with
a mono lineout.

We can make this change without breaking userspace because no kernel
has shipped with "cfg-lineout:1" in the component-string yet; and there
also are no userspace bits (UCM profiles) checking for this yet.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210816114722.107363-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-17 13:35:02 +01:00
Biju Das
1b5d1d3a2f
ASoC: sh: rz-ssi: Fix wrong operator used issue
Fix wrong operator used issue reported by Coverity by replacing |
operator with & operator.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reported-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210816182336.29959-1-biju.das.jz@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-17 13:35:01 +01:00
Aakash Hemadri
240fdf3f42
ASoC: tegra30: i2s: Fix incorrect usage of of_device_get_match_data
const struct of_device_id incorrectly assigned "match->data" using
    of_device_get_match_data()

Instead assign `const struct tegra30_i2s_soc_data *soc_data` with
const void *of_device_get_match_data(...)

Fixes: 356b94a32a ("ASoC: tegra30: i2s: Use of_device_get_match_data")

Signed-off-by: Aakash Hemadri <aakashhemadri123@gmail.com>
Link: https://lore.kernel.org/r/4805c7fcd35c8deada63d41cb34d40de80f85a13.1629148177.git.aakashhemadri123@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-17 13:35:00 +01:00
Aakash Hemadri
ea2efedefb
ASoC: tegra30: ahub: Fix incorrect usage of of_device_get_match_data
const struct of_device_id incorrectly assigned "match->data" using
of_device_get_match_data()

Instead assign `const struct tegra30_ahub_soc_data *soc_data` with
const void *of_device_get_match_data(...)

Fixes: 80165bb804 ("ASoC: tegra30: ahub: Use of_device_get_match_data")

Signed-off-by: Aakash Hemadri <aakashhemadri123@gmail.com>
Link: https://lore.kernel.org/r/bb61c41f2ee0cf0d85fecdfea05f23a7205992e6.1629148177.git.aakashhemadri123@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-17 13:34:59 +01:00
Biju Das
d40dfb860a
ASoC: sh: rz-ssi: Fix dereference of noderef expression warning
Fix following sparse warning:
sound/soc/sh/rz-ssi.c:156:15: sparse: warning: dereference of
noderef expression

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20210816132049.28128-1-biju.das.jz@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-16 16:36:49 +01:00
Mark Brown
f75953bca7
Merge series "ASoC: soc-xxx: cleanup cppcheck warning" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
Hi Mark

Now I'm posting audio-graph-card2 patch-set, but it seems it needs longer
discussion. Thus I want to post more easy patch first, and reduce my
local patches.

These are cppcheck warning cleanup patches for soc-xxx.

Kuninori Morimoto (9):
  ASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at dmaengine_pcm_hw_params()
  ASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at dmaengine_pcm_new()
  ASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at dmaengine_copy_user()
  ASoC: soc-dai: cleanup cppcheck warning at snd_soc_dai_link_set_capabilities()
  ASoC: soc-dai: cleanup cppcheck warning at snd_soc_pcm_dai_new()
  ASoC: soc-jack: cleanup cppcheck warning at snd_soc_jack_report()
  ASoC: soc-jack: cleanup cppcheck warning for CONFIG_GPIOLIB
  ASoC: soc-component: cleanup cppcheck warning at snd_soc_pcm_component_pm_runtime_get()
  ASoC: soc-ac97: cleanup cppcheck warning

 sound/soc/soc-ac97.c                  | 14 ++++++--------
 sound/soc/soc-component.c             |  4 ++--
 sound/soc/soc-dai.c                   | 18 ++++++++----------
 sound/soc/soc-generic-dmaengine-pcm.c |  9 +++------
 sound/soc/soc-jack.c                  | 15 +++++++--------
 5 files changed, 26 insertions(+), 34 deletions(-)

--
2.25.1
2021-08-16 15:20:05 +01:00
Aakash Hemadri
356b94a32a
ASoC: tegra30: i2s: Use of_device_get_match_data
Prefer `of_device_get_match_data` over `of_match_device`

Retrieve OF match data using `of_device_get_match_data`, this is cleaner
and better expresses intent.

Signed-off-by: Aakash Hemadri <aakashhemadri123@gmail.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/f4e632e0023d90c43b2b927e752585142a9d9c26.1628971397.git.aakashhemadri123@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-16 13:30:38 +01:00
Aakash Hemadri
80165bb804
ASoC: tegra30: ahub: Use of_device_get_match_data
Prefer `of_device_get_match_data` over `of_match_device`

Retrieve OF match data using `of_device_get_match_data`, this is cleaner
and better expresses intent.

Signed-off-by: Aakash Hemadri <aakashhemadri123@gmail.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/e568d621c9c05ee23732a6a6f9e3606a780b1707.1628971397.git.aakashhemadri123@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-16 13:30:37 +01:00
Kuninori Morimoto
834a36ddc6
ASoC: soc-ac97: cleanup cppcheck warning
This patch cleanups below cppcheck warning.

sound/soc/soc-ac97.c:41:15: style: struct member 'snd_ac97_gpio_priv::gpios_set' is never used. [unusedStructMember]
 unsigned int gpios_set;
              ^
sound/soc/soc-ac97.c:42:28: style: struct member 'snd_ac97_gpio_priv::component' is never used. [unusedStructMember]
 struct snd_soc_component *component;
                           ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r1euyolk.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-16 13:29:36 +01:00
Kuninori Morimoto
500b39da62
ASoC: soc-component: cleanup cppcheck warning at snd_soc_pcm_component_pm_runtime_get()
This patch cleanups below cppcheck warning.

sound/soc/soc-component.c:1183:9: style: The scope of the variable 'ret' can be reduced. [variableScope]
 int i, ret;
        ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87sfzayolo.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-16 13:29:35 +01:00
Kuninori Morimoto
c757790686
ASoC: soc-jack: cleanup cppcheck warning for CONFIG_GPIOLIB
This patch cleanups below cppcheck warning.

sound/soc/soc-jack.c:21:6: style: struct member 'jack_gpio_tbl::count' is never used. [unusedStructMember]
 int count;
     ^
sound/soc/soc-jack.c:23:28: style: struct member 'jack_gpio_tbl::gpios' is never used. [unusedStructMember]
 struct snd_soc_jack_gpio *gpios;
                           ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87tujqyols.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-16 13:29:34 +01:00
Kuninori Morimoto
c2dea1fba2
ASoC: soc-jack: cleanup cppcheck warning at snd_soc_jack_report()
This patch cleanups below cppcheck warning.

sound/soc/soc-jack.c:45:6: style: The scope of the variable 'enable' can be reduced. [variableScope]
 int enable;
     ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87v946yolx.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-16 13:29:33 +01:00
Kuninori Morimoto
454a7422fa
ASoC: soc-dai: cleanup cppcheck warning at snd_soc_pcm_dai_new()
This patch cleanups below cppcheck warning.

sound/soc/soc-dai.c:553:13: style: Variable 'ret' is assigned a value that is never used. [unreadVariable]
 int i, ret = 0;
            ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87wnomyom1.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-16 13:29:32 +01:00
Kuninori Morimoto
d490f4e73e
ASoC: soc-dai: cleanup cppcheck warning at snd_soc_dai_link_set_capabilities()
This patch cleanups below cppcheck warning.

sound/soc/soc-dai.c:454:7: style: The scope of the variable 'supported_cpu' can be reduced. [variableScope]
 bool supported_cpu;
      ^
sound/soc/soc-dai.c:455:7: style: The scope of the variable 'supported_codec' can be reduced. [variableScope]
 bool supported_codec;
      ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87y292yom6.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-16 13:29:31 +01:00
Kuninori Morimoto
a265976889
ASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at dmaengine_copy_user()
This patch cleanups below cppcheck warning.

sound/soc/soc-generic-dmaengine-pcm.c:310:6: style: The scope of the variable 'ret' can be reduced. [variableScope]
 int ret;
     ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87zgtiyomb.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-16 13:29:30 +01:00
Kuninori Morimoto
9cec66fa70
ASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at dmaengine_pcm_new()
This patch cleanups below cppcheck warning.

sound/soc/soc-generic-dmaengine-pcm.c:233:28: style: The scope of the variable 'substream' can be reduced. [variableScope]
 struct snd_pcm_substream *substream;
                           ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/871r6u0yzs.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-16 13:29:29 +01:00
Kuninori Morimoto
0a1e5ac50d
ASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at dmaengine_pcm_hw_params()
This patch cleanups below cppcheck warning.

sound/soc/soc-generic-dmaengine-pcm.c:82:6: style: The scope of the variable 'ret' can be reduced. [variableScope]
 int ret;
     ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/8735ra0yzz.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-16 13:29:28 +01:00
Mark Brown
31e53e137c
Merge series "ASoC: Intel: boards: use software node API" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
This is an update on an earlier contribution from Heikki Krogerus

The function device_add_properties() is going to be removed.
Replacing it with software node API equivalents.

Thanks for Hans de Goede and Andy Shevchenko for their comments,
suggestions and Reviewed-by tags on GitHub. The review thread can be
found at https://github.com/thesofproject/linux/pull/3041)

v3 changes:
Fixed nit-picks from Andy: label, return value, missing commas/periods.
Added Andy's Reviewed-by tag

v2 changes: feedback from Andy and Hans
Better error handling
Codec reference is kept until the .remove callback
Remove bus search to find device

v1 changes from Heikki's patches:
Avoid the use of devm_ routines for Baytrail machine drivers.

Heikki Krogerus (1):
  ASoC: Intel: boards: use software node API in Atom boards

Pierre-Louis Bossart (7):
  ASoC: Intel: boards: harden codec property handling
  ASoC: Intel: boards: handle errors with acpi_dev_get_first_match_dev()
  ASoC: Intel: boards: get codec device with ACPI instead of bus search
  ASoC: Intel: sof_sdw: pass card information to init/exit functions
  ASoC: Intel: sof_sdw_rt711*: keep codec device reference until remove
  ASoC: Intel: use software node API in SoundWire machines
  ASoC: Intel: remove device_properties for Atom boards

 sound/soc/intel/boards/bytcht_es8316.c      | 31 ++++++++--
 sound/soc/intel/boards/bytcr_rt5640.c       | 60 +++++++++++++++-----
 sound/soc/intel/boards/bytcr_rt5651.c       | 63 ++++++++++++++-------
 sound/soc/intel/boards/sof_sdw.c            | 20 ++++---
 sound/soc/intel/boards/sof_sdw_common.h     | 37 +++++++-----
 sound/soc/intel/boards/sof_sdw_max98373.c   |  3 +-
 sound/soc/intel/boards/sof_sdw_rt1308.c     |  3 +-
 sound/soc/intel/boards/sof_sdw_rt1316.c     |  3 +-
 sound/soc/intel/boards/sof_sdw_rt5682.c     |  3 +-
 sound/soc/intel/boards/sof_sdw_rt700.c      |  3 +-
 sound/soc/intel/boards/sof_sdw_rt711.c      | 51 +++++++++--------
 sound/soc/intel/boards/sof_sdw_rt711_sdca.c | 52 +++++++++--------
 sound/soc/intel/boards/sof_sdw_rt715.c      |  3 +-
 sound/soc/intel/boards/sof_sdw_rt715_sdca.c |  3 +-
 14 files changed, 223 insertions(+), 112 deletions(-)

--
2.25.1
2021-08-13 17:49:06 +01:00
Mark Brown
f84f6ee036
Merge series "Add RZ/G2L Sound support" from Biju Das <biju.das.jz@bp.renesas.com>:
This patch series aims to add ASoC support on RZ/G2L SoC's.

It is based on the work done by Chris Brandt for RZ/A ASoC driver.

v4->v5
 * Moved validation of sample bits in hw_params
 * Removed validation of frame bits as it is redundant
 * split the rz_ssi_start_stop function into rz_ssi_start and rz_ssi_stop.
 * remove the spin_lock around rz_ssi_stream_init.
 * Updated dmas description and removed fixes as it is an enhancement
   now.
 * updated ssi_start functions with setting fifo thresholds
   and ssi_stop function with cancel all dma txn.
v3->v4:
 * Updated the subject line as per style for the subsystem.
 * Removed select SND_SIMPLE_CARD from Kconfig
 * Added C++ comments for copyright and driver description.
 * Moved validation of channels in hw_params
 * removed asm issue reported by bot as well as Mark
 * replaced master/slave macros with provider/consumer macros
 * Improved locking and added more null pointer checks.
v2->v3:
 * Fixed the dependency on KCONFIG
 * Merged the binding patch with dma feature added
 * Updated dt binding example with encoded #dma-cells value.
 * Improved Error handling in probe function
 * Removed the passing legacy channel configuration parameters from
   dmaengine_slave_config function
 * started using dma_request_chan instead of deprecated
   dma_request_slave_channel
 * Removed SoC dtsi and config patches from this series. Will send it later.
v1->v2:
 * Rebased to latest rc kernel

Biju Das (3):
  ASoC: sh: Add RZ/G2L SSIF-2 driver
  ASoC: dt-bindings: renesas,rz-ssi: Update slave dma channel
    configuration parameters
  ASoC: sh: rz-ssi: Add SSI DMAC support

 .../bindings/sound/renesas,rz-ssi.yaml        |   22 +-
 sound/soc/sh/Kconfig                          |    6 +
 sound/soc/sh/Makefile                         |    4 +
 sound/soc/sh/rz-ssi.c                         | 1063 +++++++++++++++++
 4 files changed, 1093 insertions(+), 2 deletions(-)
 create mode 100644 sound/soc/sh/rz-ssi.c

--
2.17.1
2021-08-13 17:49:04 +01:00
Mark Brown
6d9d1652de
Merge series "ASoC: SOF: Intel: DMI L1 power optimization for HDaudio platforms" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
This patchset provides an optimization that result in significant power
savings on Intel HDAudio platforms using SOF (Sound Open Firmware).

We previously prevented the Intel DSP from enabling the DMI_L1
capability to work-around issues with pause on capture streams. It
turns out that this also prevented the platform from entering high C
states in full-duplex usages such as videoconferencing - a rather
basic use case since the start of the pandemic.

The support for pause_push/release was already a bit controversial for
Intel platforms, in theory platforms should only enable PAUSE if they
can resume on the same sample, which is not the case on any Intel
platform.

With this patchset, when the user enables DMI L1 via a kernel
parameter, the PAUSE support is disabled for capture streams. A kernel
parameter is far from ideal but it's a placeholder until we have an
API to negotiate capabilities between applications and driver, and
it's far less confusing than a Kconfig option.

Changes since v1:
Removal of SPIB support since it may conflict with Takashi's memalloc
changes. These SPIB changes will be provided after rebase.
Addition of one cleanup for cppcheck warning
Move all changes to intel/ directory, no changes in shared code
Flipped the logic: the selection of DMI L1 disables PAUSE

Pierre-Louis Bossart (4):
  ASoC: SOF: Intel: Kconfig: clarify DMI L1 option description
  ASoC: SOF: Intel: hda-stream: remove always true condition
  ASoC: SOF: Intel: simplify logic for DMI_L1 handling
  ASoC: SOF: Intel: make DMI L1 selection more robust

 sound/soc/sof/intel/Kconfig      | 10 ----------
 sound/soc/sof/intel/hda-pcm.c    | 16 ++++++++++++++--
 sound/soc/sof/intel/hda-stream.c | 11 +++++------
 3 files changed, 19 insertions(+), 18 deletions(-)

--
2.25.1
2021-08-13 17:49:03 +01:00
Heikki Krogerus
0bd3c071e6
ASoC: Intel: boards: use software node API in Atom boards
The function device_add_properties() is going to be removed.
Replacing it with software node API equivalents.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Co-developed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20210813151116.23931-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13 16:50:43 +01:00
Pierre-Louis Bossart
f1f8a96154
ASoC: Intel: remove device_properties for Atom boards
Prepare the transition to the software node API by removing device
properties in the probe error handling and .remove callback.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210813151116.23931-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13 16:50:42 +01:00
Pierre-Louis Bossart
e5a292d394
ASoC: Intel: use software node API in SoundWire machines
The function device_add_properties() is going to be removed.
Replacing it with software node API equivalents.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Co-developed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210813151116.23931-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13 16:50:41 +01:00
Pierre-Louis Bossart
82027585fc
ASoC: Intel: sof_sdw_rt711*: keep codec device reference until remove
Follow the example of Intel Atom drivers and keep a reference to the
headset codec until the properties are removed.

There is no guarantee that the module for the codec driver is loaded
before the machine driver probe, the use of the deferred probe
mechanism is required.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210813151116.23931-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13 16:50:40 +01:00
Pierre-Louis Bossart
cdf99c9ab7
ASoC: Intel: sof_sdw: pass card information to init/exit functions
If we want to handle a context in init/exit function, we have to pass
the card information. This will be necessary to better deal with
device properties in the follow-up commits.

No functional change other than prototype update.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210813151116.23931-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13 16:50:40 +01:00
Pierre-Louis Bossart
d3409eb20d
ASoC: Intel: boards: get codec device with ACPI instead of bus search
We have an existing 'adev' handle from which we can find the codec
device, no need for an I2C bus search.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210813151116.23931-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13 16:50:39 +01:00
Pierre-Louis Bossart
69efe3b834
ASoC: Intel: boards: handle errors with acpi_dev_get_first_match_dev()
acpi_dev_get_first_match_dev() searches for an acpi_handle
instantiated by the ACPI table scanning done early during boot.

Two of three machine drivers using this search don't deal with errors
and the one which does (bytcr_rt5651) returns -ENODEV, which doesn't
make sense here: an alternate driver will not be probed.

Add consistent error handling and report -ENXIO.

Suggested-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210813151116.23931-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13 16:50:38 +01:00
Pierre-Louis Bossart
c50f126b3c
ASoC: Intel: boards: harden codec property handling
In current ACPI-based devices, the DSDT does not include any of the
properties required by the codec driver. This is not an ACPI
limitation proper since the _DSD method could be used, as done for
Camera and SoundWire in newer platforms. For legacy devices, there is
unfortunately no other option than using a work-around: we add
properties to the codec device from the machine driver.

To avoid any issues with the codec driver being unbound, we need to
keep a reference to the codec device until the card is removed.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Co-developed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210813151116.23931-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13 16:50:37 +01:00
Douglas Anderson
a1ea05723c
ASoC: rt5682: Remove unused variable in rt5682_i2c_remove()
In commit 772d44526e ("ASoC: rt5682: Properly turn off regulators if
wrong device ID") I deleted code but forgot to delete a variable
that's now unused. Delete it.

Fixes: 772d44526e ("ASoC: rt5682: Properly turn off regulators if wrong device ID")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20210813073402.1.Iaa9425cfab80f5233afa78b32d02b6dc23256eb3@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13 16:48:44 +01:00
Biju Das
26ac471c53
ASoC: sh: rz-ssi: Add SSI DMAC support
Add SSI DMAC support to RZ/G2L SoC.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://lore.kernel.org/r/20210813091156.10700-4-biju.das.jz@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13 13:17:18 +01:00
Biju Das
03e786bd43
ASoC: sh: Add RZ/G2L SSIF-2 driver
Add serial sound interface(SSIF-2) driver support for
RZ/G2L SoC.

Based on the work done by Chris Brandt for RZ/A SSI driver.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://lore.kernel.org/r/20210813091156.10700-2-biju.das.jz@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13 13:17:16 +01:00
Pierre-Louis Bossart
246dd4287d
ASoC: SOF: Intel: make DMI L1 selection more robust
Exposing the DMI L1 configuration as a kernel Kconfig option was in
hindsight a really bad idea. It led to several errors reported by
distributions which selected it by mistake.

The Kconfig is now replaced with a kernel parameter. Since DMI L1
entry is incompatible with pause on a capture stream, the latter is
disabled when the kernel parameter is set.

Experimental results show an increased residency in higher C states
and a significant decrease of system power consumption for "work from
home" usages such as VoIP calls.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210812231940.172547-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13 13:16:16 +01:00
Pierre-Louis Bossart
5503e938fe
ASoC: SOF: Intel: simplify logic for DMI_L1 handling
We don't need to test in multiple places if the kconfig
SND_SOC_SOF_HDA_ALWAYS_ENABLE_DMI_L1 is enabled or not, we might as
well set the existing DMI_L1_COMPATIBLE flag.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210812231940.172547-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13 13:16:16 +01:00
Pierre-Louis Bossart
d2556edadb
ASoC: SOF: Intel: hda-stream: remove always true condition
We test if (!stream) and return and later on re-test for stream.
The second test is always true.

This was detected by cppcheck but only after additional code changes.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210812231940.172547-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13 13:16:15 +01:00
Pierre-Louis Bossart
6f28c883b7
ASoC: SOF: Intel: Kconfig: clarify DMI L1 option description
This option is only valid for HDaudio platforms. This was described in
the help but not explicit in the option description.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210812231940.172547-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13 13:16:13 +01:00
Douglas Anderson
772d44526e
ASoC: rt5682: Properly turn off regulators if wrong device ID
When I booted up on a board that had a slightly different codec
stuffed on it, I got this message at bootup:

  rt5682 9-001a: Device with ID register 6749 is not rt5682

That's normal/expected, but what wasn't normal was the splat that I
got after:

  WARNING: CPU: 7 PID: 176 at drivers/regulator/core.c:2151 _regulator_put+0x150/0x158
  pc : _regulator_put+0x150/0x158
  ...
  Call trace:
   _regulator_put+0x150/0x158
   regulator_bulk_free+0x48/0x70
   devm_regulator_bulk_release+0x20/0x2c
   release_nodes+0x1cc/0x244
   devres_release_all+0x44/0x60
   really_probe+0x17c/0x378
   ...

This is because the error paths don't turn off the regulator. Let's
fix that.

Fixes: 0ddce71c21 ("ASoC: rt5682: add rt5682 codec driver")
Fixes: 87b42abae9 ("ASoC: rt5682: Implement remove callback")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20210811081751.v2.1.I4a1d9aa5d99e05aeee15c2768db600158d76cab8@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-12 12:19:17 +01:00
Jack Yu
6d0a764d41
ASoC: rt1015p: add new acpi id and comapatible id
Add new acpi id and compatible id for rt1015p.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://lore.kernel.org/r/22be83429956486f9f64b424c26be810@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-09 16:23:45 +01:00
Steve Lee
a10facb752
ASoC: max98390: Add support change dsm param name
In case of using different type of speaker, support
 using different dsm parameter bin file for each amp connected.

Signed-off-by: Steve Lee <steves.lee@maximintegrated.com>
Link: https://lore.kernel.org/r/20210809142140.9293-1-steves.lee@maximintegrated.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-09 16:06:48 +01:00
Srinivas Kandagatla
455ecc808e
ASoC: qdsp6: q6adm: fix cppcheck warnings for unnecessary initialization
cppcheck reports below warning.

q6adm.c:475]: (style) Variable 'matrix_map' is reassigned a value before the
old one has been used.

This is due to unnecessary initialization of variable matrix_map, which is
now removed as part of this patch.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210809123137.14456-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-09 13:49:13 +01:00
Srinivas Kandagatla
e05f9ee5ea
ASoC: qdsp6: q6asm: fix cppcheck warnings for unnecessary initialization
cppcheck reports below warning.
q6asm.c:1631: (style) Variable 'port' is reassigned a value before the
old one has been used.

This is due to unnecessary initialization of variable port, which is
now removed as part of this patch.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210809123137.14456-2-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-09 13:49:12 +01:00
Vincent Knecht
1e2c784542
ASoC: qcom: apq8016_sbc: Add SEC_MI2S support
This patch adds external codec support on secondary mi2s.
It is used for headphones on some devices, eg. alcatel-idol347.

Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210806114116.895473-1-vincent.knecht@mailoo.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-09 12:39:26 +01:00