mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Francesco Dolcini <francesco@dolcini.it>
To: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Saravana Kannan <saravanak@google.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	patches@opensource.cirrus.com
Cc: Francesco Dolcini <francesco.dolcini@toradex.com>,
	linux-sound@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v3 0/5] ASoC: wm8904: Add DMIC and DRC support
Date: Fri,  7 Mar 2025 14:52:39 +0100	[thread overview]
Message-ID: <20250307135244.100443-1-francesco@dolcini.it> (raw)

From: Francesco Dolcini <francesco.dolcini@toradex.com>

This patch series adds DMIC and DRC support to the WM8904 driver, a new
of_ helper is added to simplify the driver code.

DRC functionality is added in the same patch series to provide the
necessary dynamic range control to make DMIC support useful.

The WM8904 supports digital microphones on two of its inputs:
IN1L/DMICDAT1 and IN1R/DMICDAT2. These two inputs can either be
connected to an ADC or to the DMIC system. There is an ADC for each
line, and only one DMIC block. This DMIC block is either connected to
DMICDAT1 or to DMICDAT2. One DMIC data line supports two digital
microphones via time multiplexing.

The pin's functionality is decided during hardware design (IN1L vs
DMICDAT1 and IN1R vs DMICDAT2). This is reflected in the Device Tree.

If one line is analog and one is DMIC, we need to be able to switch
between ADC and DMIC at runtime. The DMIC source is known from the
Device Tree. If both are DMIC inputs, we need to be able to switch the
DMIC source. There is no need to switch between ADC and DMIC at runtime.

Therefore, kcontrols are dynamically added by the driver depending on
its Device Tree configuration.

This is a heavy rework of a previous patch series provided by Alifer
Moraes and Pierluigi Passaro,
https://lore.kernel.org/lkml/20220307141041.27538-1-alifer.m@variscite.com.

v3:
 * Fixed DT binding to conform to the DT schema properly.
 * Renamed "wlf,retune-mobile-cfg-rates" to "wlf,retune-mobile-cfg-hz", it is now a standard unit suffix property.

v2: https://lore.kernel.org/all/20250224155500.52462-1-francesco@dolcini.it/
 * Fixed a bug in wm8904_parse_retune_cfg_from_of()
 * Added full usage example of the three ReTune Mobile config properties in the
   DT binding.
 * Improved the DAPM routing:
   * Only add IN1L/IN1R routes to ADCL/ADCR conditionally depending on which
     DMIC is in use.
   * Do not connect PGAs to ADC when they are not needed.
   * Keep the mux between ADC/DMIC even when two DMICs are used, as the IN1
     pins share a mux with IN2 and IN3 and the ADC could still be used for
     them.

v1: https://lore.kernel.org/all/20250206163152.423199-1-francesco@dolcini.it/

Ernest Van Hoecke (5):
  of: Add of_property_read_u16_index
  ASoC: wm8904: Don't touch GPIO configs set to 0xFFFF
  ASoC: dt-bindings: wm8904: Add DMIC, GPIO, MIC and EQ support
  ASoC: wm8904: get platform data from DT
  ASoC: wm8904: add DMIC support

 .../devicetree/bindings/sound/wlf,wm8904.yaml | 116 +++++++
 drivers/of/property.c                         |  33 ++
 include/linux/of.h                            |   9 +
 include/sound/wm8904.h                        |   3 +
 sound/soc/codecs/wm8904.c                     | 317 +++++++++++++++++-
 5 files changed, 471 insertions(+), 7 deletions(-)

-- 
2.39.5


             reply	other threads:[~2025-03-07 13:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-07 13:52 Francesco Dolcini [this message]
2025-03-07 13:52 ` [PATCH v3 1/5] of: Add of_property_read_u16_index Francesco Dolcini
2025-03-07 13:52 ` [PATCH v3 2/5] ASoC: wm8904: Don't touch GPIO configs set to 0xFFFF Francesco Dolcini
2025-03-07 13:52 ` [PATCH v3 3/5] ASoC: dt-bindings: wm8904: Add DMIC, GPIO, MIC and EQ support Francesco Dolcini
2025-03-11  8:42   ` Krzysztof Kozlowski
2025-03-11 13:46     ` Mark Brown
2025-03-11 17:59     ` Rob Herring
2025-03-12  8:39       ` Krzysztof Kozlowski
2025-03-12  8:48         ` Ernest Van Hoecke
2025-03-12  8:41   ` Krzysztof Kozlowski
2025-03-07 13:52 ` [PATCH v3 4/5] ASoC: wm8904: get platform data from DT Francesco Dolcini
2025-03-07 13:52 ` [PATCH v3 5/5] ASoC: wm8904: add DMIC support Francesco Dolcini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250307135244.100443-1-francesco@dolcini.it \
    --to=francesco@dolcini.it \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=francesco.dolcini@toradex.com \
    --cc=krzk+dt@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=perex@perex.cz \
    --cc=robh@kernel.org \
    --cc=saravanak@google.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®