Commit graph

19 commits

Author SHA1 Message Date
Mark Brown
aefe7a8e26
GPIO inclusion fixes to misc sound drivers
Merge series from Linus Walleij <linus.walleij@linaro.org>:

Mostly dropping unused headers, and a single driver rewrite.
2023-12-19 16:45:42 +00:00
Krzysztof Kozlowski
bb3392453d
ASoC: qcom: Fix trivial code style issues
Fix few trivial code style issues, pointed out by checkpatch, so they do
not get copied to new code (when old code is used as template):

  WARNING: Prefer "GPL" over "GPL v2" - see commit bf7fbeeae6 ("module: Cure the MODULE_LICENSE "GPL" vs. "GPL v2" bogosity")
  WARNING: function definition argument 'struct platform_device *' should also have an identifier name
  ERROR: code indent should use tabs where possible
  WARNING: please, no spaces at the start of a line
  WARNING: Missing a blank line after declarations
  WARNING: unnecessary whitespace before a quoted newline

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20231204100048.211800-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-12-18 14:04:25 +00:00
Linus Walleij
809fc84b37
ASoC: qcom: sc7180: Drop GPIO include
This driver is including the legacy GPIO header <linux/gpio.h>
but not using any symbols from it. Drop the include.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://msgid.link/r/20231214-gpio-descriptors-sound-misc-v1-2-e3004176bd8b@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-12-18 14:03:30 +00:00
Nikita Travkin
4531f512e3
ASoC: qcom: sc7180: Add support for qdsp6 baked sound
Some sc7180 devices use audio adsp to play sound. The setup for this
adsp is similar to the dirrect lpass usage but requires the use of
different link ids and clocks.

This commit adds support for the qdsp based audio, reusing the common
parts like audio codec setup and jack creation.

Since the setup is mostly generic and codec specific setup is guarded
behind a check, a generic compatible is added, similar to other
platforms. Even though those changes target Acer Aspire 1 as the only
user of the adsp audio on this platform present upstream at the moment
of the commit, those changes should be either dirrectly compatible or
trivially expandable to the other devices that will be added in the
future.

Signed-off-by: Nikita Travkin <nikita@trvn.ru>
Link: https://lore.kernel.org/r/20231020-sc7180-qdsp-sndcard-v1-2-157706b7d06f@trvn.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-10-25 17:21:38 +01:00
Mark Brown
a7ec043e60
ASoC: DT matching and header cleanups
Merge series from Rob Herring <robh@kernel.org>:

This is a series is part of ongoing clean-ups related to device
matching and DT related implicit includes. Essentially of_device.h has
a bunch of implicit includes and generally isn't needed any nore except
for of_match_device(). As we also generally want to get rid of
of_match_device() as well, I've done that so we're not updating the
includes twice.
2023-10-09 23:14:18 +01:00
Krzysztof Kozlowski
528a4a0bb0
ASoC: qcom: reduce number of binding headers includes
Move the includes of binding headers from Qualcomm SoC sound drivers
headers to unit files actually using these bindings.  This reduces the
amount of work for C preprocessor and makes usage of bindings easier to
follow.  No impact expected on the final binaries.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20231005075250.88159-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-10-09 13:14:19 +01:00
Rob Herring
340d79a14d
ASoC: Explicitly include correct DT includes
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it was merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev> # for at91
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20231006-dt-asoc-header-cleanups-v3-1-13a4f0f7fee6@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-10-09 13:13:56 +01:00
Kuninori Morimoto
9b1a2dfa8a
ASoC: qcom: convert not to use asoc_xxx()
ASoC is now unified asoc_xxx() into snd_soc_xxx().
This patch convert asoc_xxx() to snd_soc_xxx().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87v8cgqnjc.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-25 14:16:25 +02:00
Alper Nebi Yasak
883bfefca4
ASoC: qcom: sc7180: Map missing jack kcontrols
This driver does not properly map jack pins to kcontrols that PulseAudio
and PipeWire need to handle jack detection events. The RT5682 and
RT5682s codecs used here can detect Headphone and Headset Mic
connections. Expose each to userspace as a kcontrol.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-21-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:33:00 +01:00
Charles Keepax
1148e16b33
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.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220519154318.2153729-18-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06 12:33:42 +01:00
Akihiko Odaki
19aed2d6cd
ASoC: soc-card: Create jack kcontrol without pins
snd_soc_card_jack_new() allowed to create jack kcontrol without pins,
but did not create kcontrols. The jack would not have kcontrols if pins
were not going to be added.

This renames the old snd_soc_card_jack_new() to
snd_soc_card_jack_new_pins() for use when pins are provided or will be
added later. The new snd_soc_card_jack_new() appropriately creates a
jack for use without pins and adds a kcontrol.

Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Link: https://lore.kernel.org/r/20220408041114.6024-1-akihiko.odaki@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-04-14 17:37:21 +01:00
Judy Hsiao
833a94aac5
ASoC: qcom: Distinguish headset codec by codec_dai->name
Distinguish which headset codec is on the board by codec_dai->name
instead of card->name.

It fixes the crash of being unable to handle kernel paging requests
at virtual address ADDR by initializing the correct audio codec on
the board.

Call stack of the crash:
```
 Unable to handle kernel paging request at virtual address ...
 ...
 Call trace:
  rt5682_set_component_pll+0xcc/0xb78 [snd_soc_rt5682]
  snd_soc_component_set_pll+0x90/0x154
  snd_soc_dai_set_pll+0xf4/0x1ac
  sc7180_snd_startup+0x268/0x3c0 [snd_soc_sc7180]
  snd_soc_link_startup+0xa4/0x180
  soc_pcm_open+0x35c/0x15c8
  snd_pcm_open_substream+0xa90/0x13b0
  snd_pcm_open+0x1a4/0x55c
  snd_pcm_capture_open+0x7c/0xe8
  snd_open+0x2b8/0x2e4
  chrdev_open+0x364/0x3d4
  do_dentry_open+0x66c/0xc58
  vfs_open+0x7c/0x8c
  path_openat+0x108c/0x2bbc
  do_filp_open+0x15c/0x258
  do_sys_open+0x278/0x62c
  __arm64_compat_sys_openat+0x9c/0xb0
  ...
```

Fixes: 425c5fce8a ("ASoC: qcom: Add support for ALC5682I-VS codec")
Signed-off-by: Judy Hsiao <judyhsiao@chromium.org>
Link: https://lore.kernel.org/r/20211214022509.1288245-1-judyhsiao@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-12-14 17:15:51 +00:00
lvzhaoxiong
425c5fce8a
ASoC: qcom: Add support for ALC5682I-VS codec
Qcom machine driver adds rt5682s support in this patch.
Card name can be specified from dts by model property, and driver makes
use of the name to distinguish which headset codec is on the board.

Signed-off-by: lvzhaoxiong <lvzhaoxiong@huaqin.corp-partner.google.com>
Link: https://lore.kernel.org/r/20211123024329.21998-1-lvzhaoxiong@huaqin.corp-partner.google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-29 12:19:48 +00:00
xuyuqing
7f2c63d6ae
ASoC: qcom: sc7180: fix 32 bit format for adau7002
the microphone is attached to external codec(adau7002)
instead of rt5682.We need to always use 32 bit format on sc7180
to meet the clock requirement of adau7002:
The ADAU7002 requires a BCLK rate
that is a minimum of 64× the LRCLK sample rate

Signed-off-by: xuyuqing <xuyuqing@huaqin.corp-partner.google.com>
Link: https://lore.kernel.org/r/20201118005858.123013-2-xuyuqing@huaqin.corp-partner.google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-27 14:50:17 +00:00
Dan Carpenter
7141f25f14
ASoC: qcom: sc7180: initialize the "no_headphone" variable
The "no_headphone" variable is never set to "false" so it could be
uninitialized.

Fixes: e936619b7c ("ASoC: qcom: sc7180: Modify machine driver for sound card")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20201116125950.GA44063@mwanda
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-16 20:03:33 +00:00
xuyuqing
e936619b7c
ASoC: qcom: sc7180: Modify machine driver for sound card
Bypass set jack because there is no jack on coachz.
Create route for dmic.

Signed-off-by: xuyuqing <xuyuqing@huaqin.corp-partner.google.com>
Link: https://lore.kernel.org/r/20201112014328.695232-3-xuyuqing@huaqin.corp-partner.google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-12 15:15:13 +00:00
Ajye Huang
3cfbf07c6d
ASoC: qcom: sc7180: Modify machine driver for 2mic
In addition, having mixer control to switch between DMICs by
using "dmic-gpios" property.

Refer to this one as an example,
commit b7a742cff3 ("ASoC: AMD: Use mixer control to switch between DMICs")

Signed-off-by: Ajye Huang <ajye_huang@compal.corp-partner.google.com>
Reviewed-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20201106061433.1483129-3-ajye_huang@compal.corp-partner.google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-10 14:25:23 +00:00
Cheng-Yi Chiang
b2fc302930
ASoC: qcom: sc7180: Add missing PM ops
Use PM ops snd_soc_pm_ops to handle suspend/resume like other machine
drivers.

Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
Link: https://lore.kernel.org/r/20201109103415.607495-1-cychiang@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-09 17:43:15 +00:00
Ajit Pandey
9e3ecb5b16
ASoC: qcom: sc7180: Add machine driver for sound card registration
Add new driver to register sound card on sc7180 trogdor board and
do the required configuration for lpass cpu dai and external codecs
connected over MI2S interfaces.

Signed-off-by: Ajit Pandey <ajitp@codeaurora.org>
Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20201027032234.1705835-3-cychiang@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-10-27 14:05:46 +00:00