Commit Graph

40116 Commits

Author SHA1 Message Date
Greg Kroah-Hartman
8c61951b37 soundwire updates for 5.15-rc1
- Core has updates to support SoundWire mockup device (includes tag from
   asoc), improved error handling and slave status.
 
 - Drivers has update on Intel driver for new quriks and better handling of
   errors and suspend routines
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE+vs47OPLdNbVcHzyfBQHDyUjg0cFAmEkgJ8ACgkQfBQHDyUj
 g0eXEw/+MLJeThhmORvTeHuvo6MsuXAP2g88ZGaQdXG1QQ32nObnpjdgReSSVWRs
 77UcGnoy45TNq6HnjJ8AH8hjPlnOwOEVxwCdJO55gcP8UTJYgxlSsHrANidngDge
 Gal6Ch25AQptdLAtoP9otsCb146NQvi3FXA9s9ManrUO2zORR1/FmVb9sTMUf6JL
 AkrKspStsnAGjziDwRBkTjmV1Oe0YMUgI4EAaNpQryJjT5NgVWYlsgovsazbc/GI
 JUvuactLum/8QCPxFo5NzdXN3n0BJpT7qJ0Phl7qy7lX5bZA05ZdsxLBeb3Ked2z
 YesZqfZhjBJlada439VdN1enThqs13FLBmkWRy1otbBovr+DPYmIqi48A1eSRENS
 3MYVlOtPyuzHbVFmyngJ5yvpUyCPCj3HxEE88Srz2XDxhbGpQv4ecK2w/RUvO4Yu
 7wrRHpRlHU9yLl92dyq0kRY9Owm9n1drmrspxoBKj53qWuZIr2LyBiyGrAOp7mao
 7JUoBwhA089b/31Glc1ykYcTVIwt60uuewNY4lXh0EAZzfjKd4ZJOdiWf/sjsnWM
 /qj4BZxWBg4HodNS5dE/pCGagVOpFyqMGYWcROliZ+jXLl5x/JNuJrM9M3hRfXu5
 NB2hf8s+Bhvvpwop7i6/C0ZlzViUNmbLBF0gOeO6mM/8IOgSr0s=
 =TCAF
 -----END PGP SIGNATURE-----

Merge tag 'soundwire-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire into char-misc-next

Vinod writes:

soundwire updates for 5.15-rc1

- Core has updates to support SoundWire mockup device (includes tag from
  asoc), improved error handling and slave status.

- Drivers has update on Intel driver for new quriks and better handling of
  errors and suspend routines

* tag 'soundwire-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire:
  soundwire: cadence: do not extend reset delay
  soundwire: intel: conditionally exit clock stop mode on system suspend
  soundwire: intel: skip suspend/resume/wake when link was not started
  soundwire: intel: fix potential race condition during power down
  soundwire: cadence: override PDI configurations to create loopback
  soundwire: cadence: add debugfs interface for PDI loopbacks
  soundwire: stream: don't program mockup device ports
  soundwire: bus: squelch error returned by mockup devices
  soundwire: add flag to ignore all command/control for mockup devices
  soundwire: stream: don't abort bank switch on Command_Ignored/-ENODATA
  soundwire: cadence: add paranoid check on self-clearing bits
  soundwire: dmi-quirks: add quirk for Intel 'Bishop County' NUC M15
  soundwire: bus: update Slave status in sdw_clear_slave_status
  soundwire: cadence: Remove ret variable from sdw_cdns_irq()
  soundwire: bus: filter out more -EDATA errors on clock stop
  soundwire: dmi-quirks: add ull suffix for SoundWire _ADR values
  ASoC: Intel: boards: sof_sdw: add SoundWire mockup codecs for tests
  ASoC: soc-acpi: tgl: add table for SoundWire mockup devices
  ASoC: soc-acpi: cnl: add table for SoundWire mockup devices
  ASoC: codecs: add SoundWire mockup device support
2021-08-24 15:39:01 +02:00
Takashi Iwai
6e41340994 ALSA: usb-audio: Move set-interface-first workaround into common quirk
The recent quirk for WALKMAN (commit 7af5a14371c1: "ALSA: usb-audio:
Fix regression on Sony WALKMAN NW-A45 DAC") may be required for other
devices and is worth to be put into the common quirk flags.
This patch adds a new quirk flag bit QUIRK_FLAG_SET_IFACE_FIRST and a
quirk table entry for the device.

Link: https://lore.kernel.org/r/20210824055720.9240-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-24 07:58:16 +02:00
Takashi Iwai
1a10d5b0f6 Merge branch 'for-linus' into for-next 2021-08-24 07:52:41 +02:00
Johnathon Clark
93ab3eafb0 ALSA: hda/realtek: Quirk for HP Spectre x360 14 amp setup
This patch extends support for the HP Spectre x360 14
amp enable quirk to support a model of the device with
an additional subdevice ID.

Signed-off-by: Johnathon Clark <john.clark@cantab.net>
Link: https://lore.kernel.org/r/20210823162110.8870-1-john.clark@cantab.net
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-24 07:51:13 +02:00
Takashi Iwai
7af5a14371 ALSA: usb-audio: Fix regression on Sony WALKMAN NW-A45 DAC
We've got a regression report for USB-audio with Sony WALKMAN NW-A45
DAC device where no sound is audible on recent kernel.  The bisection
resulted in the code change wrt endpoint management, and the further
debug session revealed that it was caused by the order of the USB
audio interface.  In the earlier code, we always set up the USB
interface at first before other setups, but it was changed to be done
at the last for UAC2/3, which is more standard way, while keeping the
old way for UAC1.  OTOH, this device seems requiring the setup of the
interface at first just like UAC1.

This patch works around the regression by applying the interface setup
specifically for the WALKMAN at the beginning of the endpoint setup
procedure.  This change is written straightforwardly to be easily
backported in old kernels.  A further cleanup to move the workaround
into a generic quirk section will follow in a later patch.

Fixes: bf6313a0ff ("ALSA: usb-audio: Refactor endpoint management")
Cc: <stable@vger.kernel.org>
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214105
Link: https://lore.kernel.org/r/20210824054700.8236-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-24 07:50:46 +02:00
Mark Brown
6f02c08949
Merge series "ASoC: Intel: Skylake: Fix and support complex" from Cezary Rojewski <cezary.rojewski@intel.com>:
Existing skylake-driver supports very basic scenarios with limited range
of modules and their control. Attached changes first fix code as several
advanced configurations are 'mentioned' throughout the files but are not
actually functional. Follow up are changes adding missing support for
said configurations.

Cezary Rojewski (5):
  ASoC: Intel: kbl_da7219_max98927: Fix format selection for max98373
  ASoC: Intel: Skylake: Leave data as is when invoking TLV IPCs
  ASoC: Intel: Skylake: Fix module resource and format selection
  ASoC: Intel: Skylake: Fix module configuration for KPB and MIXER
  ASoC: Intel: Skylake: Select first entry for singular pipe config
    arrays

Gustaw Lewandowski (2):
  ASoC: Intel: Skylake: Fix passing loadable flag for module
  ASoC: Intel: Skylake: Simplify m_state for loadable modules

Kareem Shaik (1):
  ASoC: Intel: Skylake: Support multiple format configs

Pawel Harlozinski (1):
  ASoC: Intel: Skylake: Properly configure modules with generic
    extension

Piotr Maziarz (1):
  ASoC: Intel: Skylake: Select proper format for NHLT blob

Szymon Mielczarek (1):
  ASoC: Intel: Skylake: Support modules with generic extension

 include/uapi/sound/snd_sst_tokens.h          |   6 +-
 sound/soc/intel/boards/kbl_da7219_max98927.c |  55 +------
 sound/soc/intel/skylake/skl-messages.c       | 155 ++++++++++++-------
 sound/soc/intel/skylake/skl-pcm.c            |  25 ++-
 sound/soc/intel/skylake/skl-topology.c       | 155 +++++++++++--------
 sound/soc/intel/skylake/skl-topology.h       |  26 +++-
 6 files changed, 231 insertions(+), 191 deletions(-)

--
2.25.1
2021-08-23 18:26:22 +01:00
Tzung-Bi Shih
d019403a77
ASoC: rt1015: remove possible unused variable `bclk_ms'
bclk_ms is possible unused by using the given config (see [1]).

sound/soc/codecs/rt1015.c:724:2: warning: Value stored to 'bclk_ms' is
never read [clang-analyzer-deadcode.DeadStores]
           bclk_ms = frame_size > 32;
           ^         ~~~~~~~~~~~~~~~

In addition, bclk_ms is meaningless and confusing after applying commit
a5db2ca513 ("ASoC: rt1015: remove unneeded variables in rt1015_priv").
The "> 32" in the expression looks like a typo but it was not.

Let's remove the confusing variable bclk_ms.

[1]: https://lkml.org/lkml/2021/8/23/305

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20210823153323.1297723-1-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-23 16:41:06 +01:00
Hans de Goede
a5ec377133
ASoC: Intel: bytcr_rt5640: Mark hp_elitepad_1000g2_jack?_check functions static
The byt_rt5640_hp_elitepad_1000g2_jack?_check functions are only
used inside bytcr_rt5640.c, mark them as static.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210823110432.64860-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-23 16:41:05 +01:00
Angelo Dureghello
43d2c4982f
ASoC: ics43432: add CMM-4030D-261 support
Despite minimal datasheet differences, the driver seems
perfectly compatible with CMM-4030D-261.

Tested CMM-4030D-261 to work with this changes:

/ {
        cmm4030d: cmm4030d {
                #sound-dai-cells = <0>;
                compatible = "cui,cmm-4030d-261";
        };

        sound_mic {
                compatible = "simple-audio-card";
                simple-audio-card,name = "i2s mem mic";
                simple-audio-card,format = "i2s";
                simple-audio-card,bitclock-master = <&sound_master>;
                simple-audio-card,frame-master = <&sound_master>;
                sound_master: simple-audio-card,cpu {
                        sound-dai = <&ssi2>;
                        system-clock-frequency = <2822400>;
                };
                simple-audio-card,codec {
                        sound-dai = <&cmm4030d>;
                };
        };
};

Audio has been captured and tested successfully by:

arecord -D "hw:1,0" -f S24_LE > test.wav
aplay test.wav

Signed-off-by: Angelo Dureghello <angelo.dureghello@timesys.com>
Link: https://lore.kernel.org/r/20210821082658.4147595-1-angelo.dureghello@timesys.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-23 16:41:01 +01:00
Cezary Rojewski
b947d2b467
ASoC: Intel: Skylake: Select first entry for singular pipe config arrays
When pipe does not expose multiple configuration options, always select
the first entry without searching for matching one.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-12-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-23 16:40:05 +01:00
Pawel Harlozinski
5b27a71cbb
ASoC: Intel: Skylake: Properly configure modules with generic extension
Make use of struct skl_base_cfg_ext and its format setter to configure
modules which are described with said structure.

Signed-off-by: Gustaw Lewandowski <gustaw.lewandowski@linux.intel.com>
Signed-off-by: Pawel Harlozinski <pawel.harlozinski@linux.intel.com>
Signed-off-by: Szymon Mielczarek <szymonx.mielczarek@intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-11-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-23 16:40:04 +01:00
Szymon Mielczarek
db5a3f83a2
ASoC: Intel: Skylake: Support modules with generic extension
Some DSP modules require, besides the module base configuration, a
generic extension containing audio format for all module's pins that are
in use.

Signed-off-by: Gustaw Lewandowski <gustaw.lewandowski@linux.intel.com>
Signed-off-by: Szymon Mielczarek <szymonx.mielczarek@intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-10-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-23 16:40:03 +01:00
Kareem Shaik
a4ad42d286
ASoC: Intel: Skylake: Support multiple format configs
A module can have two kinds of set params, as per topology requirements.
For example, one pre-init and one post-init. But currently, there is
support for just one type, as the format_config.

This patch extends the format_configs to 4, so as to be able to support
pre-init, post-init and post-bind type of set params, for the same
module, simultaneously.

Signed-off-by: Kareem Shaik <kareem.m.shaik@intel.com>
Signed-off-by: Gustaw Lewandowski <gustaw.lewandowski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-9-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-23 16:40:02 +01:00
Gustaw Lewandowski
e4e95d8291
ASoC: Intel: Skylake: Simplify m_state for loadable modules
States SKL_MODULE_LOADED and SKL_MODULE_UNLOADED are redundant with
'loadable' flag in struct skl_module. Additionally
skl_tplg_mixer_dapm_post_pmd_event() sets m_state always to
SKL_MODULE_UNINIT so next unload function isn't called for such modules.

Signed-off-by: Gustaw Lewandowski <gustaw.lewandowski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-8-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-23 16:40:01 +01:00
Gustaw Lewandowski
c5ed9c547c
ASoC: Intel: Skylake: Fix passing loadable flag for module
skl_get_module_info() tries to set mconfig->module->loadable before
mconfig->module has been assigned thus flag was always set to false
and driver did not try to load module binaries.

Signed-off-by: Gustaw Lewandowski <gustaw.lewandowski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-7-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-23 16:40:00 +01:00
Cezary Rojewski
e4e0633bca
ASoC: Intel: Skylake: Fix module configuration for KPB and MIXER
KeyPhrasebuffer, Mixin and Mixout modules configuration is described by
firmware's basic module configuration structure. There are no extended
parameters required. Update functions taking part in building
INIT_INSTANCE IPC payload to reflect that.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-6-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-23 16:39:59 +01:00
Cezary Rojewski
e8b374b649
ASoC: Intel: Skylake: Fix module resource and format selection
Module configuration may differ between its instances depending on
resources required and input and output audio format. Available
parameters to select from are stored in module resource and interface
(format) lists. These come from topology, together with description of
each of pipe's modules.

Ignoring index value provided by topology and relying always on 0th
entry leads to unexpected module behavior due to under/overbudged
resources assigned or impropper format selection. Fix by taking entry at
index specified by topology.

Fixes: f6fa56e225 ("ASoC: Intel: Skylake: Parse and update module config structure")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-5-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-23 16:39:58 +01:00
Piotr Maziarz
87b2652600
ASoC: Intel: Skylake: Select proper format for NHLT blob
Use actual pipeline format, not PCM format for blob selection. Otherwise
selected blobs are not correct in pipelines with format conversion
e.g.: SRC module.

Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com>
Signed-off-by: Lewandowski, Gustaw <gustaw.lewandowski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-4-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-23 16:39:57 +01:00
Cezary Rojewski
126b3422ad
ASoC: Intel: Skylake: Leave data as is when invoking TLV IPCs
Advancing pointer initially fixed issue for some users but caused
regression for others. Leave data as it to make it easier for end users
to adjust their topology files if needed.

Fixes: a8cd7066f0 ("ASoC: Intel: Skylake: Strip T and L from TLV IPCs")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-3-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-23 16:39:56 +01:00
Cezary Rojewski
6d41bbf2fd
ASoC: Intel: kbl_da7219_max98927: Fix format selection for max98373
Contrary to what is said in board's file, topology targeting
kbl_da7219_max98373 expects format 16b, not 24/32b. Partially revert
changes added in 'ASoC: Intel: Boards: Add Maxim98373 support' to bring
old behavior back, aligning with topology expectations.

Fixes: 716d53cc78 ("ASoC: Intel: Boards: Add Maxim98373 support")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-2-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-23 16:39:55 +01:00
Takashi Iwai
e28ac04a70 ASoC: intel: atom: Revert PCM buffer address setup workaround again
We worked around the breakage of PCM buffer setup by the commit
65ca89c2b1 ("ASoC: intel: atom: Fix breakage for PCM buffer address
setup"), but this isn't necessary since the CONTINUOUS buffer type
also sets runtime->dma_addr since commit f84ba106a0 ("ALSA:
memalloc: Store snd_dma_buffer.addr for continuous pages, too").
Let's revert the change again.

Link: https://lore.kernel.org/r/20210822072127.9786-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-23 13:36:31 +02:00
Takashi Iwai
539a5093e7 Merge branch 'for-linus' into for-next 2021-08-23 13:36:20 +02:00
Takashi Iwai
a235d5b8e5 ALSA: hda: Allow model option to specify PCI SSID alias
There are tons of quirks for HD-audio and many of them are without
model string, hence it's not trivial to apply the same quirk for a new
device.  This patch makes it easier: namely, the model string accepts
a form as "XXXX:YYYY" (a pair of hex numbers of the subsystem-vendor
and subsystem-device IDs), to specify the alias of PCI (or codec)
SSID.  e.g. passing model=1234:abcd would apply the quirk that matches
with the given SSID 1234:abcd instead of the actual SSID.

Link: https://lore.kernel.org/r/20210823073722.14873-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-23 10:59:13 +02:00
Takashi Iwai
73355ddd87 ALSA: hda: Code refactoring snd_hda_pick_fixup()
This contains a slight code refactoring of snd_hda_pick_fixup():
- Unify the ID setup
- Unify the debug print message
- Use snd_pci_quirk_lookup_id() for the codec SSID matching

Mostly for simplifying the code flow but also it makes easier to add
the codec alias handling in the upcoming patch.

Link: https://lore.kernel.org/r/20210823073722.14873-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-23 10:59:01 +02:00
Takashi Sakamoto
23c671be97 ALSA: firewire-motu: add support for MOTU 896HD
Mark of the Unicorn (MOTU) shipped 896HD 2003 as one of models in second
generation of its FireWire series, and already discontinued it. The model
consists of below ICs:

 * Texas Instruments TSB41AB2
 * Phillips Semiconductors PDI1394L40
 * Altera cyclone EP1C3
 * Texas Instruments TMS320VC5402

It supports sampling transmission frequency up to 192.0 kHz. The packet
format differs depending on both of sampling transfer frequency and enabling
ADAT channels. The model doesn't support MIDI message transmission.

This commit adds support for it.

$ python3 crpp < /sys/bus/firewire/devices/fw1/config_rom
               ROM header and bus information block
               -----------------------------------------------------------------
400  04101b66  bus_info_length 4, crc_length 16, crc 7014
404  31333934  bus_name "1394"
408  20001000  irmc 0, cmc 0, isc 1, bmc 0, cyc_clk_acc 0, max_rec 1 (4)
40c  0001f200  company_id 0001f2     |
410  0001dbce  device_id 000001dbce  | EUI-64 0001f2000001dbce

               root directory
               -----------------------------------------------------------------
414  0004c65c  directory_length 4, crc 50780
418  030001f2  vendor
41c  0c0083c0  node capabilities per IEEE 1394
420  8d000006  --> eui-64 leaf at 438
424  d1000001  --> unit directory at 428

               unit directory at 428
               -----------------------------------------------------------------
428  0003dcc1  directory_length 3, crc 56513
42c  120001f2  specifier id
430  13000005  version
434  17102800  model

               eui-64 leaf at 438
               -----------------------------------------------------------------
438  000264f2  leaf_length 2, crc 25842
43c  0001f200  company_id 0001f2     |
440  0001dbce  device_id 000001dbce  | EUI-64 0001f2000001dbce

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210823085741.33864-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-23 10:58:40 +02:00
Takashi Iwai
13d9c6b998 ALSA: hda/realtek: Workaround for conflicting SSID on ASUS ROG Strix G17
ASUS ROG Strix G17 has the very same PCI and codec SSID (1043:103f) as
ASUS TX300, and unfortunately, the existing quirk for TX300 is broken
on ASUS ROG.  Actually the device works without the quirk, so we'll
need to clear the quirk before applying for this device.
Since ASUS ROG has a different codec (ALC294 - while TX300 has
ALC282), this patch adds a workaround for the device, just clearing
the codec->fixup_id by checking the codec vendor_id.

It's a bit ugly to add such a workaround there, but it seems to be the
simplest way.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214101
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210820143214.3654-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-23 08:39:20 +02:00
Linus Torvalds
43a6473e47 another sound-fixes for 5.14-rc7
This is a quick follow up for 5.14: a fix for a very recently
 introduced regression on ASoC Intel Atom driver, and another
 trivial HD-audio quirk for HP laptops.
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmEfYhcOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE+stw//fgVv0pqPXLBRB/6mZY4nzyP+4+s2PCAFpnKk
 iW0c5ATJC9tf77S8iVWWUVExEURIOoqBcoNupRNkf5hmI/snzSMN/NvBvJy0oeJA
 qK3e0a3KSIdOofSEFl1Xvek5iOYY1Zjt9F+SAnZuAF2pGZ6uxbPg2t4vwHIBEu7f
 CBxixyvjoGvJpro4BdDqIpKJ0QOkI9yiCN9SlUxmcg3bCzfLI2eklrGrR0NUWkkk
 BIUQElKIJ6/b7/J1/LhW8bK2XiNj6fls4NoblTW93dzoSiqu40fZVJeum+9T3V9s
 pNHegqKO8T4nznr4zzam/8u6+6CVnZj295g8FWX3Vn9SMefeD/MfZV/1sRldBjyX
 tXMEVt0b/0+L90AyMnoH0xedqpT+ETcz8PYuWb3d14dStHI+op+IvzaCNd8WQ/8I
 2zbNXwEvUZ4wVWxHJQqNEn3k3CRdlZg82WPdCR074gsUMKPgMCM5J9WQ2fNxtwZM
 u1nalKcUAoBjbPl8kFxYb/mcWgXIP+zvB8MvRDVIl88k+scW6GsrIrBaOfYwvX3U
 omlAdRpHyjkjxfbxA/bKrgdIhU31/ZcfuF59+Ert1mNb9WsEMMTePBXvrxmjZL9L
 UoNFD811bVzkZBMO3sMjSTLe3bEYnpzei2FYkLGFiGFq5xRm+k/FFeyVaENpwO6E
 b5Y4mmg=
 =QNEK
 -----END PGP SIGNATURE-----

Merge tag 'sound-5.14-rc7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull more sound fixes from Takashi Iwai:
 "This is a quick follow up for 5.14: a fix for a very recently
  introduced regression on ASoC Intel Atom driver, and another trivial
  HD-audio quirk for HP laptops"

* tag 'sound-5.14-rc7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ASoC: intel: atom: Fix breakage for PCM buffer address setup
  ALSA: hda/realtek: Limit mic boost on HP ProBook 445 G8
2021-08-20 12:31:10 -07:00
Mark Brown
77eca00f83
Merge series "ASoC: Intel/rt5640: Add support for HP Elite Pad 1000G2 jack-detect" from Hans de Goede <hdegoede@redhat.com>:
Changes in v2:
- Rebase on asoc/for-next
- New patch: "ASoC: Intel: bytct_rt5640: Add a separate "Headset Mic 2"
  DAPM pin for the mic on the 2nd jack"
- Addressed Pierre-Louis' comments about calling
  acpi_dev_add_driver_gpios() twice

Original cover-letter:

The HP Elitepad 1000 G2 tablet has 2 headset jacks:

1. on the dock which uses the output of the codecs built-in HP-amp +
the standard IN2 input which is always used with the headset-jack.

2. on the tablet itself, this uses the line-out of the codec + an external
HP-amp, which gets enabled by the ALC5642 codec's GPIO1 pin; and IN1 for
the headset-mic.

The codec's GPIO1 is also its only IRQ output pin, so this means that
the codec's IRQ cannot be used on this tablet. Instead the jack-detect
is connected directly to GPIOs on the main SoC. The dock has a helper
chip which also detects if a headset-mic is present or not, so there
are 2 GPIOs for the jack-detect status of the dock. The tablet jack
uses a single GPIO which indicates if a jack is present or not.

Differentiating between between headphones vs a headset on the tablet jack
is done by using the usual mic-bias over-current-detection mechanism.

Regards,

Hans

Hans de Goede (6):
  ASoC: rt5640: Move rt5640_disable_jack_detect() up in the rt5640.c
    file
  ASoC: rt5640: Delay requesting IRQ until the machine-drv calls
    set_jack
  ASoC: rt5640: Add optional hp_det_gpio parameter to
    rt5640_detect_headset()
  ASoC: rt5640: Add rt5640_set_ovcd_params() helper
  ASoC: Intel: bytct_rt5640: Add a separate "Headset Mic 2" DAPM pin for
    the mic on the 2nd jack
  ASoC: Intel: bytcr_rt5640: Add support for HP Elite Pad 1000G2
    jack-detect

 sound/soc/codecs/rt5640.c             | 136 ++++++++++++----------
 sound/soc/codecs/rt5640.h             |   6 +
 sound/soc/intel/boards/bytcr_rt5640.c | 158 +++++++++++++++++++++++++-
 3 files changed, 234 insertions(+), 66 deletions(-)

--
2.31.1
2021-08-20 15:32:26 +01:00
Kuninori Morimoto
cc64c390b2
ASoC: rsnd: adg: clearly handle clock error / NULL case
This driver is assuming that all adg->clk[i] is not NULL.
Because of this prerequisites, for_each_rsnd_clk() is possible to work
for all clk without checking NULL. In other words, all adg->clk[i]
should not NULL.

Some SoC might doesn't have clk_a/b/c/i. devm_clk_get() returns error in
such case. This driver calls rsnd_adg_null_clk_get() and use null_clk
instead of NULL in such cases.

But devm_clk_get() might returns NULL even though such clocks exist, but
it doesn't mean error (user deliberately chose to disable the feature).
NULL clk itself is not error from clk point of view, but is error from
this driver point of view because it is not assuming such case.

But current code is using IS_ERR() which doesn't care NULL.
This driver uses IS_ERR_OR_NULL() instead of IS_ERR() for clk check.
And it uses ERR_CAST() to clarify null_clk error.

One concern here is that it unconditionally uses null_clk if clk_a/b/c/i
was error. It is correct if it doesn't exist, but is not correct if it
returns error even though it exist.
It needs to check "clock-names" from DT before calling devm_clk_get() to
handling such case. But let's assume it is overkill so far.

Link: https://lore.kernel.org/r/YMCmhfQUimHCSH/n@mwanda
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87v940wyf9.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-20 13:07:26 +01:00
Kuninori Morimoto
28889de643
ASoC: rsnd: core: make some arrays static const, makes object smaller
Don't populate arrays on the stack but instead them static const.
Makes the object code smaller by 48 bytes.

Before:
   text    data     bss     dec     hex filename
  20938     916     104   21958    55c6 ./sound/soc/sh/rcar/core.o

After:
   text    data     bss     dec     hex filename
  20890     916     104   21910    5596 ./sound/soc/sh/rcar/core.o

gcc version 11.1.0)

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87tujkwydx.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-20 13:07:25 +01:00
Hans de Goede
9ba0085668
ASoC: Intel: bytcr_rt5640: Add support for HP Elite Pad 1000G2 jack-detect
The HP Elitepad 1000 G2 tablet has 2 headset jacks:

1. on the dock which uses the output of the codecs built-in HP-amp +
the standard IN2 input which is always used with the headset-jack.

2. on the tablet itself, this uses the line-out of the codec + an external
HP-amp, which gets enabled by the ALC5642 codec's GPIO1 pin; and IN1 for
the headset-mic.

The codec's GPIO1 is also its only IRQ output pin, so this means that
the codec's IRQ cannot be used on this tablet. Instead the jack-detect
is connected directly to GPIOs on the main SoC. The dock has a helper
chip which also detects if a headset-mic is present or not, so there
are 2 GPIOs for the jack-detect status of the dock. The tablet jack
uses a single GPIO which indicates if a jack is present or not.

Differentiating between headphones vs a headset on the tablet jack
is done by using the usual mic-bias over-current-detection mechanism.

Add support for this unique setup, this support gets enabled on this
tablet through a new BYT_RT5640_JD_HP_ELITEP_1000G2 quirk.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=213415
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-7-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-19 23:28:00 +01:00
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
Takashi Iwai
65ca89c2b1 ASoC: intel: atom: Fix breakage for PCM buffer address setup
The commit 2e6b836312 ("ASoC: intel: atom: Fix reference to PCM
buffer address") changed the reference of PCM buffer address to
substream->runtime->dma_addr as the buffer address may change
dynamically.  However, I forgot that the dma_addr field is still not
set up for the CONTINUOUS buffer type (that this driver uses) yet in
5.14 and earlier kernels, and it resulted in garbage I/O.  The problem
will be fixed in 5.15, but we need to address it quickly for now.

The fix is to deduce the address again from the DMA pointer with
virt_to_phys(), but from the right one, substream->runtime->dma_area.

Fixes: 2e6b836312 ("ASoC: intel: atom: Fix reference to PCM buffer address")
Reported-and-tested-by: Hans de Goede <hdegoede@redhat.com>
Cc: <stable@vger.kernel.org>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/2048c6aa-2187-46bd-6772-36a4fb3c5aeb@redhat.com
Link: https://lore.kernel.org/r/20210819152945.8510-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-19 17:57:51 +02:00
Kai-Heng Feng
8903376dc6 ALSA: hda/realtek: Limit mic boost on HP ProBook 445 G8
The mic has lots of noises if mic boost is enabled. So disable mic boost
to get crystal clear audio capture.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210818144119.121738-1-kai.heng.feng@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-19 17:52:25 +02:00
Alexey Dobriyan
39f75da7bc isystem: trim/fixup stdarg.h and other headers
Delete/fixup few includes in anticipation of global -isystem compile
option removal.

Note: crypto/aegis128-neon-inner.c keeps <stddef.h> due to redefinition
of uintptr_t error (one definition comes from <stddef.h>, another from
<linux/types.h>).

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-08-19 09:02:55 +09:00
Linus Torvalds
01f15f3773 sound fixes for 5.14-rc7
Hopefully the last PR for 5.14: here includes only a few regression
 fixes and trivial device quirks.
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmEc96sOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE8U+xAAhOr64zl3oUAOMIU9znZeF9sRlEDqZC6UJdnX
 H6+a8nZnaW6HhvakYvvwoHIa8hwTRzhpG3PF7p1+He1AGMaOIpAAOZlUTkJ1Ja9x
 TeXnsfEVhWKnIIBtMSkp7hWtmTsaH033AvJfstKNg6lw+ott7uYmeHS+IhOY/1W9
 ASduIOmWe8I7ZbhaLLnZL47CS8o5V1BjDqpig2/hrH0gcVPRda10n9b0VTHUJWrE
 RaFtMzqLuYzxi7TJzGqSJP0XjcHvGalvDSlJ11ny5s/vQJEqjg+8RmPJuTwKcp1j
 gTkG4OLY/kSFXihVGLfSfzAVn4OPK55npaex0uiynGwzYGvAoT65FFAMXalLSKjw
 r37GsUt8kzw9OrMl0LGJC7fYP8aOYCE+KGuSeQpcR3zg+16rG2H5T2wM9rqWOFnS
 N3DllB2GVNtW1T2jFgEyN388F/zPGG3J/Ep1/RU+Nwydzk1UHvePV4aCRc3eaXTF
 y6ewrGOLIl+LQIN8EiurWDDQPFQuknkQ+77dQqn28aJzqdD5CbpPJgJ5DmkdbviU
 dOMzN36DdHBr88EL+kFSu+LR9B0b6ODVadKm08tW44OLrKC0CvBbvRg6DBsNUIal
 E3ZgL9ePzvV4HGA6P8riyfwTMHmVpRt6NGMeP28nw0Q4fimrgdJgrA4367wGSRfb
 EL640Ww=
 =ZKV7
 -----END PGP SIGNATURE-----

Merge tag 'sound-5.14-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "Only a few regression fixes and trivial device quirks"

* tag 'sound-5.14-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda/via: Apply runtime PM workaround for ASUS B23E
  ALSA: hda: Fix hang during shutdown due to link reset
  ALSA: hda/realtek: Enable 4-speaker output for Dell XPS 15 9510 laptop
  ALSA: oxfw: fix functioal regression for silence in Apogee Duet FireWire
  ALSA: hda - fix the 'Capture Switch' value change notifications
2021-08-18 12:00:27 -07: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
Nathan Chancellor
d2d8375637 ALSA: hda/analog - Sink ad198x_shutup() and shuffle CONFIG_PM guards
When CONFIG_PM is not set, there is an unused function warning:

sound/pci/hda/patch_analog.c:115:13: warning: unused function
'ad198x_shutup' [-Wunused-function]
static void ad198x_shutup(struct hda_codec *codec)
            ^
1 warning generated.

Sink ad198x_shutup() into ad198x_suspend(), as it is only called in that
one space. Move the CONFIG_PM guards above ad198x_power_eapd_write() as
it is only called in ad198x_power_eapd(), which is in turn only called
in ad198x_power_eapd(). Those two functions are large enough that they
are left alone.

Fixes: 327b34f2a9 ("ALSA: hda: Nuke unused reboot_notify callback")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20210818012705.311963-2-nathan@kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-18 07:51:09 +02:00
Nathan Chancellor
f8b32a6daf ALSA: hda/sigmatel - Sink stac_shutup() into stac_suspend()
When CONFIG_PM is not set, there is an unused function warning:

sound/pci/hda/patch_sigmatel.c:4383:13: warning: unused function
'stac_shutup' [-Wunused-function]
static void stac_shutup(struct hda_codec *codec)
            ^
1 warning generated.

Sink the contents of stac_shutup() into stac_suspend() since
stac_shutup() is only called in that one location now.

Fixes: 327b34f2a9 ("ALSA: hda: Nuke unused reboot_notify callback")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20210818012705.311963-1-nathan@kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-18 07:51:02 +02: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
Takashi Iwai
8fc8e90315 ALSA: hda: Drop workaround for a hang at shutdown again
The commit 0165c4e19f ("ALSA: hda: Fix hang during shutdown due to
link reset") modified the shutdown callback of the HD-audio controller
for working around a hang.  Meanwhile, the actual culprit of the hang
was identified to be the leftover active codecs that may interfere
with the powered down controller somehow, but we took a minimal fix
approach for 5.14, and that was the commit above.

Now, since the codec drivers go runtime-suspend at shutdown for 5.15,
we can revert the change and make sure that the full runtime-suspend
is performed at shutdown of HD-audio controller again.  This patch
essentially reverts the commit above to restore the behavior.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214045
Link: https://lore.kernel.org/r/20210817075630.7115-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-17 09:56:55 +02:00
Takashi Iwai
c0a7f9372c Merge branch 'for-linus' into for-next 2021-08-17 09:46:27 +02:00
Takashi Iwai
4bf61ad5f0 ALSA: hda/via: Apply runtime PM workaround for ASUS B23E
ASUS B23E requires the same workaround like other machines with
VT1802, otherwise it looses the codec power on a few nodes and the
sound kept silence.

Fixes: a0645daf16 ("ALSA: HDA: Early Forbid of runtime PM")
Link: https://lore.kernel.org/r/ac2232f142efcd67fe6ac38897f704f7176bd200.camel@gmail.com
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210817052432.14751-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-17 08:02:44 +02:00
Imre Deak
0165c4e19f ALSA: hda: Fix hang during shutdown due to link reset
During system shutdown codecs may be still active, and resetting the
controller->codec HW link in this state - based on the bug reporter's
tests - leads to the shutdown sequence to get stuck. This happens at
least on the reporter's KBL system with an ALC662 codec.

For now fix the issue by skipping the link reset step.

Fixes: 472e18f63c ("ALSA: hda: Release controller display power during shutdown/reboot")
References: https://bugzilla.kernel.org/show_bug.cgi?id=214045
References: https://gitlab.freedesktop.org/drm/intel/-/issues/3618#note_1024665
Reported-and-tested-by: youling257@gmail.com
Cc: youling257@gmail.com
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/20210816174259.2759103-1-imre.deak@intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-17 07:14:30 +02: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
Kristin Paget
da94692001 ALSA: hda/realtek: Enable 4-speaker output for Dell XPS 15 9510 laptop
The 2021-model XPS 15 appears to use the same 4-speakers-on-ALC289 audio
setup as the Precision models, so requires the same quirk to enable woofer
output. Tested on my own 9510.

Signed-off-by: Kristin Paget <kristin@tombom.co.uk>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/e1fc95c5-c10a-1f98-a5c2-dd6e336157e1@tombom.co.uk
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-15 09:27:37 +02:00
Takashi Iwai
327b34f2a9 ALSA: hda: Nuke unused reboot_notify callback
As reboot_notify callback is no longer used by the codec core, let's
get rid of the unused code.  Conexant codec needs a slight code change
as it used to call the reboot_notify at the codec removal, too.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214045
Link: https://lore.kernel.org/r/20210813081230.4268-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-14 08:39:38 +02:00
Takashi Iwai
b98444ed59 ALSA: hda: Suspend codec at shutdown
So far we have a few workarounds at shutdown for each codec,
e.g. turning off the display power and setting the codec to D3.
But all those are basically a part of the suspend procedure.
Moreover, the streams are still active after that call, hence it might
hit the update on the codec that has been already put to D3.

In this patch, instead of calling each reboot_notify callback, simply
put the codec into the runtime-suspended state after the manual
suspend of all PCM streams.  It makes the code and the behavior more
consistent.

The reboot_notify callback is no longer used after this patch, and
will be cleaned up later.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214045
Link: https://lore.kernel.org/r/20210813081230.4268-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-14 08:39:27 +02:00
Takashi Iwai
95dc85dba0 ALSA: hda: conexant: Turn off EAPD at suspend, too
Conexant codecs have a workaround for the noise at shutdown to turn
off EAPD, but it wasn't applied at suspend.  In the later patch, we'll
switch from reboot_notify callback to the general suspend-at-shutdown,
so let's apply the workaround to the suspend case, too.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214045
Link: https://lore.kernel.org/r/20210813081230.4268-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-14 08:39:13 +02:00
Takashi Iwai
81be109349 ALSA: pcm: Add SNDRV_PCM_INFO_EXPLICIT_SYNC flag
ALSA PCM core has an optimized way to communicate with user-space for
its control and status data via mmap on the supported architectures
like x86.  Depending on the situation, however, we'd rather want to
enforce user-space notifying the applptr or hwptr change explicitly
via ioctl.  For example, the upcoming non-contig and non-coherent
buffer handling would need an explicit sync, and this needs to catch
the applptr and hwptr changes.  Also, ASoC SOF driver will have the
SPIB support that has the similar requirement for the explicit control
of the applptr and hwptr.

This patch adds the new PCM hardware info flag,
SNDRV_PCM_INFO_EXPLICIT_SYNC.  When this flag is set, PCM core
disables both the control and the status mmap, which enforces
user-space to update via SYNC_PTR ioctl.  In that way, drivers can
catch the applptr and hwptr update and apply the sync operation if
needed.

Link: https://lore.kernel.org/r/20210812113818.6479-1-tiwai@suse.de
Link: https://lore.kernel.org/r/20210610205326.1176400-1-pierre-louis.bossart@linux.intel.com
Link: https://lore.kernel.org/r/20210813082142.5375-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-14 08:38:25 +02:00
Damien Zammit
7ac2246f56 ALSA: usb-audio: Input source control - digidesign mbox
This adds a second mixer control to Digidesign Mbox
to select between Analog/SPDIF capture.

Users will note that selecting the SPDIF input source
automatically switches the clock mode to sync to SPDIF,
which is a feature of the hardware.

(You can change the clock source back to internal if you want
to capture from spdif but not sync to its clock although this mode
is probably not recommended).

Unfortunately, starting the stream resets both modes
to Internally clocked and Analog input mode.

Signed-off-by: Damien Zammit <damien@zamaudio.com>
Tested-by: Damien Zammit <damien@zamaudio.com>
Link: https://lore.kernel.org/r/20210813113402.11849-1-damien@zamaudio.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-14 08:37:20 +02: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
Takashi Iwai
bda36b0fc2 ALSA: memalloc: Count continuous pages in vmalloc buffer handler
This is an enhancement for the SG-style page handling in vmalloc
buffer handler to calculate the continuous pages.
When snd_sgbuf_get_chunk_size() is called for a vmalloc buffer,
currently we return only the size that fits into a single page.
However, this API call is rather supposed for obtaining the continuous
pages and most of vmalloc or noncontig buffers do have lots of
continuous pages indeed.  So, in this patch, the callback now
calculates the possibly continuous pages up to the given size limit.

Note that the end address in the function is calculated from the last
byte, hence it's one byte shorter.  This is because ofs + size can be
above the actual buffer size boundary.

Until now, this feature isn't really used, but it'll become useful in
a later patch that adds the non-contiguous buffer type that shares the
same callback function as vmalloc.

Link: https://lore.kernel.org/r/20210812113818.6479-1-tiwai@suse.de
Link: https://lore.kernel.org/r/20210813081645.4680-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-13 10:17:25 +02:00
Stefan Binding
1a04830169 ALSA: hda/cs8409: Prevent pops and clicks during suspend
Some of the register values set for type detection cause pops during suspend,
ensure these are cleaned up after type detection completes, as well
ensuring that these are cleared when we suspend.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210812183433.6330-1-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-13 08:07:59 +02:00
Pierre-Louis Bossart
360a5812b9 ALSA: core: control_led: use strscpy instead of strlcpy
strlcpy is deprecated, use its safe replacement

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210812225904.171529-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-13 08:05:17 +02:00
Linus Torvalds
59cd4f435e sound fixes for 5.14-rc6
This seems to be a usual bump in the middle, containing lots of
 pending ASoC fixes since the previous PR.
 
 - Yet another PCM mmap regression fix
 - Fix for ASoC DAPM prefix handling
 - Various cs42l42 codec fixes
 - PCM buffer reference fixes in a few ASoC drivers
 - Fixes for ASoC SOF, AMD, tlv320, WM
 - HD-audio quirks
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmEVASYOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE/FWg/8Dn/P/KWndpnhbI56xnFS7A2eSVUWxfVMnOYG
 YHIoiuPbOnnmC2T9RNEtMBfwv3yzbkswSC6RBoHWP+HwJ2ffifYNNbA18F0Vg4ik
 0GZhKR8prLuaXKJ/5JIlDnrVitdmqXjNLbgGfCUWPhQ1ECV2JUMB3VIyeU2e2WNy
 hUZRt8ipuORcCKZP/PkIUkYv0iOBQNVQU/v0VqgOsgV3yIl5B9qoaJqRXLyzlDVC
 SAOKWC2CH+8lKsoI1ejqFfUANJR5nP4brLUUFQQjO8PZNep8BDFT/TYhEyDsfwBH
 xi3aigJEr/LiQ5z6nJ/Oc6qAZU/ujAkrXR4CdNpPbDxjs+q09HL38Blxwftzj7um
 V1J3rKSmi2qH/PysN6z4hRE1g2beFaDD0/nsqkhu36LOmN0LzuvZPUuIbMaZ3pPy
 AT0LglWSp0akv8j89H8Z1//sPcNFvf1SJFh14eCen78ANAAhrjEWOu4x0Qchl3hm
 e4HrM6yRly/viQiWedZQq2WT8HSmDpj+H3/PLZfIgPxc5+VN95tadXp2r7iQgcGu
 /WnIV0loAm8RYtZk9MdFxXj3xGOaX+PBOgUoGpCx7FQuPwe1tf9e9aPhWr4Hc9DY
 SjunWgySDEQg9dtdl8F2jRYBsEeuveOjSjGLu1glIHVopMa7kFYk32GQDsBtbH0R
 F8yI5RA=
 =uLVL
 -----END PGP SIGNATURE-----

Merge tag 'sound-5.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "This seems to be a usual bump in the middle, containing lots of
  pending ASoC fixes:

   - Yet another PCM mmap regression fix

   - Fix for ASoC DAPM prefix handling

   - Various cs42l42 codec fixes

   - PCM buffer reference fixes in a few ASoC drivers

   - Fixes for ASoC SOF, AMD, tlv320, WM

   - HD-audio quirks"

* tag 'sound-5.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (32 commits)
  ALSA: hda/realtek: fix mute/micmute LEDs for HP ProBook 650 G8 Notebook PC
  ALSA: pcm: Fix mmap breakage without explicit buffer setup
  ALSA: hda: Add quirk for ASUS Flow x13
  ASoC: cs42l42: Fix mono playback
  ASoC: cs42l42: Constrain sample rate to prevent illegal SCLK
  ASoC: cs42l42: Fix LRCLK frame start edge
  ASoC: cs42l42: PLL must be running when changing MCLK_SRC_SEL
  ASoC: cs42l42: Remove duplicate control for WNF filter frequency
  ASoC: cs42l42: Fix inversion of ADC Notch Switch control
  ASoC: SOF: Intel: hda-ipc: fix reply size checking
  ASoC: SOF: Intel: Kconfig: fix SoundWire dependencies
  ASoC: amd: Fix reference to PCM buffer address
  ASoC: nau8824: Fix open coded prefix handling
  ASoC: kirkwood: Fix reference to PCM buffer address
  ASoC: uniphier: Fix reference to PCM buffer address
  ASoC: xilinx: Fix reference to PCM buffer address
  ASoC: intel: atom: Fix reference to PCM buffer address
  ASoC: cs42l42: Fix bclk calculation for mono
  ASoC: cs42l42: Don't allow SND_SOC_DAIFMT_LEFT_J
  ASoC: cs42l42: Correct definition of ADC Volume control
  ...
2021-08-12 07:06:40 -10:00
Stefan Binding
7482ec7111 ALSA: hda/cs8409: Unmute/Mute codec when stream starts/stops
Codec is muted on init, and then unmuted when the stream starts.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210811185654.6837-28-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-12 13:42:01 +02:00
Stefan Binding
4ff2ae3a13 ALSA: hda/cs8409: Follow correct CS42L42 power down sequence for suspend
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210811185654.6837-27-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-12 13:42:00 +02:00
Stefan Binding
c8b4f0865e ALSA: hda/cs8409: Remove unnecessary delays
Since delays when starting jack detection after initialization
have been reduced/removed, it is necessary to add back in an extra
20ms delay after the init sequence to allow the CS42L42 to power up
correctly.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210811185654.6837-26-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-12 13:41:59 +02:00
Stefan Binding
928adf0ebc ALSA: hda/cs8409: Use timeout rather than retries for I2C transaction waits
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210811185654.6837-25-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-12 13:41:58 +02:00
Stefan Binding
fed0aaca0b ALSA: hda/cs8409: Set fixed sample rate of 48kHz for CS42L42
CS42L42 is configured to use a fixed sample rate of 48kHz.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210811185654.6837-24-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-12 13:41:57 +02:00
Stefan Binding
e4e6c584f5 ALSA: hda/cs8409: Enable Full Scale Volume for Line Out Codec on Dolphin
Headphones codec will keep reduced maximum volume.
Line Out codec will have increased maximum volume.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210811185654.6837-23-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-12 13:41:57 +02:00
Lucas Tanure
20e5077241 ALSA: hda/cs8409: Add support for dolphin
Dolphin devices have CS8409 HDA Bridge connected to two CS42L42 codecs.
Codec 1 supports Headphone and Headset Mic.
Codec 2 supports Line Out.

Features:
 - Front and Read Jacks appear as separate jacks; Removal or connection
   of on jack should not affect the connection of the other.
 - Front Jack only shows up on jack detection.
 - Rear Jack is Phantom Jack.
 - Separate Volume Controls for each Jack

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210811185654.6837-22-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-12 13:41:55 +02:00
Stefan Binding
404e770a9c ALSA: hda/cs8409: Add Support to disable jack type detection for CS42L42
Some hardware configurations do not support jack type detection.
Instead, for those configurations, only tip detection is supported.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210811185654.6837-21-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-12 13:41:54 +02:00
Stefan Binding
c076e201d5 ALSA: hda/cs8409: Support multiple sub_codecs for Suspend/Resume/Unsol events
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210811185654.6837-20-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-12 13:41:54 +02:00
Lucas Tanure
24f7ac3d3b ALSA: hda/cs8409: Move codec properties to its own struct
To accommodate move, cs42l42_resume has been added to mirror
the existing function cs42l42_suspend.
Function cs42l42_reset is no longer required, since cs42l42_resume
and cs42l42_suspend perform the same operations.

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210811185654.6837-19-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-12 13:41:53 +02:00
Lucas Tanure
636eb9d26f ALSA: hda/cs8409: Separate CS8409, CS42L42 and project functions
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210811185654.6837-18-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-12 13:41:51 +02:00
Lucas Tanure
165b81c4ac ALSA: hda/cs8409: Support i2c bulk read/write functions
This allows mutex locks to be moved into i2c functions, as
the bulk read/write functions can lock/unlock themselves to
prevent interruption of sequence reads/writes.

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210811185654.6837-17-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-12 13:41:50 +02:00
Lucas Tanure
8de4e5a668 ALSA: hda/cs8409: Avoid re-setting the same page as the last access
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210811185654.6837-16-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-12 13:41:49 +02:00
Lucas Tanure
d395fd7864 ALSA: hda/cs8409: Avoid setting the same I2C address for every access
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210811185654.6837-15-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-12 13:41:48 +02:00
Lucas Tanure
647d50a0c3 ALSA: hda/cs8409: Dont disable I2C clock between consecutive accesses
Only disable I2C clock 25 ms after not being used.

The current implementation enables and disables the I2C clock for each
I2C transaction. Each enable/disable call requires two verb transactions.
This means each I2C transaction requires a total of four verb transactions
to enable and disable the clock.
However, if there are multiple consecutive I2C transactions, it is not
necessary to enable and disable the clock each time, instead it is more
efficient to enable the clock for the first transaction, and disable it
after the final transaction, which would improve performance.
This is achieved by using a timeout which disables the clock if no request
to enable the clock has occurred for 25 ms.

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210811185654.6837-14-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-12 13:41:48 +02:00
Lucas Tanure
b2a887748e ALSA: hda/cs8409: Generalize volume controls
Use amp offsets as indexes for saved volumes.
Remove dependencies on NID inside volume control functions.

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210811185654.6837-13-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-12 13:41:47 +02:00
Lucas Tanure
a1a6c7df2b ALSA: hda/cs8409: Prevent I2C access during suspend time
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210811185654.6837-12-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-12 13:41:46 +02:00
Stefan Binding
db0ae848a9 ALSA: hda/cs8409: Simplify CS42L42 jack detect.
Cleanup interrupt masks.
Remove unnecessary read/writes.
Ensure Tip Sense/Type Detection interrupts are enabled/disabled
when needed.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210811185654.6837-11-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-12 13:41:45 +02:00
Stefan Binding
1e0a975a8a ALSA: hda/cs8409: Mask CS42L42 wake events
Wake events are not needed for jack detect.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210811185654.6837-10-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-12 13:41:44 +02:00
Lucas Tanure
134ae782c4 ALSA: hda/cs8409: Disable unsolicited response for the first boot
The subsequence suspend and remuse have their enable/disable
unsolicited responses at the correct place already

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210811185654.6837-9-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-12 13:41:44 +02:00
Stefan Binding
cc7df1623c ALSA: hda/cs8409: Disable unsolicited responses during suspend
Ensure unsolicited responses cannot occur whilst the sub codecs are
being disabled.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210811185654.6837-8-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-12 13:41:43 +02:00
Stefan Binding
1f03db6865 ALSA: hda/cs8409: Disable unnecessary Ring Sense for Cyborg/Warlock/Bullseye
Also remove unnecessary repeated register writes.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210811185654.6837-7-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-12 13:41:43 +02:00
Stefan Binding
29dbb9bcd3 ALSA: hda/cs8409: Reduce HS pops/clicks for Cyborg
Enable HSBIAS_SENSE_EN for Cyborg during jack detect to reduce
pops and clicks.
Do not enable this for Warlock/Bullseye, as it causes ESD issues.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210811185654.6837-6-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-12 13:41:42 +02:00
Stefan Binding
cab82a222f ALSA: hda/cs8409: Mask all CS42L42 interrupts on initialization
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210811185654.6837-5-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-12 13:41:41 +02:00
Stefan Binding
ccff0064a7 ALSA: hda/cs8409: Use enums for register names and coefficients
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210811185654.6837-4-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-12 13:41:40 +02:00
Lucas Tanure
9e7647b507 ALSA: hda/cs8409: Move arrays of configuration to a new file
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210811185654.6837-3-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-12 13:41:39 +02:00
Lucas Tanure
8c70461bbb ALSA: hda/cirrus: Move CS8409 HDA bridge to separate module
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210811185654.6837-2-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-12 13:41:36 +02:00
Takashi Sakamoto
67bb66d329 ALSA: oxfw: fix functioal regression for silence in Apogee Duet FireWire
OXFW 971 has no function to use the value in syt field of received
isochronous packet for playback timing generation. In kernel prepatch for
v5.14, ALSA OXFW driver got change to send NO_INFO value in the field
instead of actual timing value. The change brings Apogee Duet FireWire to
generate no playback sound, while output meter moves.

As long as I investigate, _any_ value in the syt field takes the device to
generate sound. It's reasonable to think that the device just ignores data
blocks in packet with NO_INFO value in its syt field for audio data
processing.

This commit adds a new flag for the quirk to fix regression.

Fixes: 029ffc4294 ("ALSA: oxfw: perform sequence replay for media clock recovery")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210812022839.42043-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-12 13:40:27 +02:00
Jaroslav Kysela
a2befe9380 ALSA: hda - fix the 'Capture Switch' value change notifications
The original code in the cap_put_caller() function does not
handle correctly the positive values returned from the passed
function for multiple iterations. It means that the change
notifications may be lost.

Fixes: 352f7f914e ("ALSA: hda - Merge Realtek parser code to generic parser")
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=213851
Cc: <stable@kernel.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20210811161441.1325250-1-perex@perex.cz
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-12 13:39:30 +02: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
Derek Fang
cf2a19f7d2
ASoC: rt5682: Adjust headset volume button threshold again
This reverts commit 6d20bf7c02.
Since it may risk affecting other headset Vol- button.

Signed-off-by: Derek Fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/20210811083750.26680-1-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-12 12:19:12 +01:00
Jeremy Szu
d07149aba2 ALSA: hda/realtek: fix mute/micmute LEDs for HP ProBook 650 G8 Notebook PC
The HP ProBook 650 G8 Notebook PC is using ALC236 codec which is
using 0x02 to control mute LED and 0x01 to control micmute LED.
Therefore, add a quirk to make it works.

Signed-off-by: Jeremy Szu <jeremy.szu@canonical.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210810100846.65844-1-jeremy.szu@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-10 14:23:10 +02:00
Curtis Malainey
f4eeaed04e
ASoC: Intel: Fix platform ID matching
Sparse warnings triggered truncating the IDs of some platform device
tables. Unfortunately some of the IDs in the match tables were missed
which breaks audio. The KBL change has been verified to fix audio, the
CML change was not tested as it was found through grepping the broken
changes and found to match the same situation in anticipation that it
should also be fixed.

Fixes: 94efd726b9 ("ASoC: Intel: kbl_da7219_max98357a: shrink platform_id below 20 characters")
Fixes: 24e46fb811 ("ASoC: Intel: bxt_da7219_max98357a: shrink platform_id below 20 characters")
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Tested-by: Matt Davis <mattedavis@google.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210809213544.1682444-1-cujomalainey@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-10 13:22:13 +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
Takashi Iwai
ca4c5b334f ALSA: msnd: Use proper mmap method
The old ISA MSND driver basically maps the iomem as the DMA buffer.
For this type of buffer, we have already the standard mmap helper,
snd_pcm_lib_mmap_iomem().  Correct the PCM info, set the DMA address
and use the standard helper for handling the mmap on all architectures
properly.

Link: https://lore.kernel.org/r/20210809140532.11006-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-09 16:06:17 +02: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
Takashi Iwai
4d9e9153f1 ALSA: pci: cs46xx: Fix set up buffer type properly
CS46xx driver switches the buffer depending on the number of periods,
and in some cases it switches to the own buffer without updating the
buffer type properly.  This may cause a problem with the mmap on
exotic architectures that require the own mmap call for the coherent
DMA buffer.

This patch addresses the potential breakage by replacing the buffer
setup with the proper macro.  It also simplifies the source code,
too.

Link: https://lore.kernel.org/r/20210809071829.22238-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-09 10:04:05 +02:00
Takashi Iwai
0899a7a230 ALSA: pci: rme: Set up buffer type properly
Although the regression of the mmap was fixed in the recent commit
dc0dc8a73e ("ALSA: pcm: Fix mmap breakage without explicit buffer
setup"), RME9652 and HDSP drivers have still potential issues with
their mmap handling.  Namely, they use the default mmap handler
without the standard buffer preallocation, and PCM core wouldn't use
the coherent DMA mapping.  It's practically OK on x86, but on some
exotic architectures, it wouldn't work.

This patch addresses the potential breakage by replacing the buffer
setup with the proper macro.  It also simplifies the source code,
too.

Link: https://lore.kernel.org/r/20210809071829.22238-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-09 10:04:04 +02:00
Takashi Iwai
cbea6e5a77 ALSA: pcm: Check mmap capability of runtime dma buffer at first
Currently we check only the substream->dma_buffer as the preset of the
buffer configuration for verifying the availability of mmap.  But a
few drivers rather set up the buffer in the own way without the
standard buffer preallocation using substream->dma_buffer, and they
miss the proper checks.  (Now it's working more or less fine as most
of them are running only on x86).

Actually, they may set up the runtime dma_buffer (referred via
snd_pcm_get_dma_buf()) at the open callback, though.  That is, this
could have been used as the primary source.

This patch changes the hw_support_mmap() function to check the runtime
dma buffer at first.  It's usually NULL with the standard buffer
preallocation, and in that case, we continue checking
substream->dma_buffer as fallback.

Link: https://lore.kernel.org/r/20210809071829.22238-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-09 10:04:03 +02:00
Takashi Iwai
2c86446f8e ALSA: harmony: Drop superfluous address setup
Harmony driver never uses CONTINUOUS buffer type any longer, hence the
code setting the address is superfluous.  Moreover, the recent change
in the ALSA core already covered the missing address field; it's
already set up.  So let's drop the superfluous line, which includes
the full hw_params callback.

Link: https://lore.kernel.org/r/20210809071250.21846-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-09 09:14:05 +02:00
Greg Kroah-Hartman
bd935a7b21 Merge 5.14-rc5 into driver-core-next
We need the driver core fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-09 09:03:47 +02:00
Takashi Iwai
ad797a04f1 Merge branch 'for-linus' into for-next 2021-08-09 07:53:22 +02:00
Takashi Iwai
dc0dc8a73e ALSA: pcm: Fix mmap breakage without explicit buffer setup
The recent fix c4824ae7db ("ALSA: pcm: Fix mmap capability check")
restricts the mmap capability only to the drivers that properly set up
the buffers, but it caused a regression for a few drivers that manage
the buffer on its own way.

For those with UNKNOWN buffer type (i.e. the uninitialized / unused
substream->dma_buffer), just assume that the driver handles the mmap
properly and blindly trust the hardware info bit.

Fixes: c4824ae7db ("ALSA: pcm: Fix mmap capability check")
Reported-and-tested-by: Jeff Woods <jwoods@fnordco.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/s5him0gpghv.wl-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-09 07:52:31 +02:00
Takashi Iwai
9732c148d0 ALSA: memalloc: Fix mmap of SG-buffer with WC pages
The code refactoring to move the WC page handling into the common
memalloc layer caused a breakage for HD-audio HDMI.  I overlooked that
the driver is using the SG-buffer, which isn't covered by the patch.

This patch adds the mmap workaround for WC pages to SG-buffer
handler.  A caveat is that it falls back to the default handler by
returning an error after setting the pgprot, so it won't work in all
cases but merely for PCM (which is currently the only use case).

Fixes: 623c101083 ("ALSA: memalloc: Fix pgprot for WC mmap on x86")
Reported-and-tested-by: Andy Lavr <andy.lavr@gmail.com>
Link: https://lore.kernel.org/r/20210808080034.20337-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-08 10:01:33 +02:00
Luke D Jones
739d0959fb ALSA: hda: Add quirk for ASUS Flow x13
The ASUS GV301QH sound appears to work well with the quirk for
ALC294_FIXUP_ASUS_DUAL_SPK.

Signed-off-by: Luke D Jones <luke@ljones.dev>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210807025805.27321-1-luke@ljones.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-07 08:42:34 +02:00
Linus Torvalds
484faec8f1 sound fixes for 5.14-rc5
Here is a collection of small fixes:
 - A few regression fixes (PCM core fixes, USB-audio fixes)
 - Follow up fixes for the USB-audio mixer changes in this cycle
 - A long-standing ALSA sequencer race bug fix
 - Usual device-specific quirks for HD- and USB-audio
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmEL5joOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE+VMg/+J0k0bRrUDW+2STr2/iUqM7g8hfgp1f5Xf2Np
 CRxMHpcEQb/8AcT/9A2MdX5bgcAeOzUmO0Ym4qE5a889fuAqTLSifHWceE28+6oX
 bT0fCiGsZ+JjL2vOCSWQfsLeEnwBZHgMFEccYCv+SbjsEcOVtDm5F6Wzuy3TN5gF
 BsxFYalaaFwHdP55tIcxNvEoh1OkuE6vJninD48OQCRXYsBe+ntIHJ8Ak6B2f2QV
 JYS8JWrcQNBeEkhrj9femFqVQ4pDzXr6Gnm1E32Fjpl8E77cHWbSPi6+nY+XOyoI
 eQ2tZFmQnz9p7T+otxB6LnOpKtCZECVITO57dPgYLDepuRrn6luYaOdsfroWoJX1
 u3qmNsPdbr2HAsJ9G+xeZOs6//+tiVfw2TT4HIQbcA1VN0yxPGkdbw0DNB3l7yk4
 dakJFmSIu5lAymeXK5ix3hlXJR69JxyKKg8lunDUnKQP1YWruzvnujdo1eAP5b9v
 BMQgFTSFuLd77HTWHeDs3EG1fqFlYRKIXJwZcaoEgGTDqaVuuWTk7AkjcNA3fIRM
 FW/37NSb++JGd5bY0M3j9imP+NG3aVItgKlLBMImdeQ6o/2N9Mgv2/J5Xpxw38j8
 Km6WQvXthUr+F/K8skTgZPoVRy+DWRb8CxWSm9gAxgA5FBUrou6/ZWk+/9NT+4YA
 yKFSIq0=
 =umHe
 -----END PGP SIGNATURE-----

Merge tag 'sound-5.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "A collection of small fixes:

   - A few regression fixes (PCM core fixes, USB-audio fixes)

   - Follow up fixes for the USB-audio mixer changes in this cycle

   - A long-standing ALSA sequencer race bug fix

   - Usual device-specific quirks for HD- and USB-audio"

* tag 'sound-5.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: seq: Fix racy deletion of subscriber
  ALSA: memalloc: Fix regression with SNDRV_DMA_TYPE_CONTINUOUS
  ALSA: pcm - fix mmap capability check for the snd-dummy driver
  ALSA: usb-audio: Avoid unnecessary or invalid connector selection at resume
  ALSA: hda/realtek: add mic quirk for Acer SF314-42
  ALSA: usb-audio: Add registration quirk for JBL Quantum 600
  ALSA: hda/realtek: Fix headset mic for Acer SWIFT SF314-56 (ALC256)
  ALSA: usb-audio: Fix superfluous autosuspend recovery
  ALSA: usb-audio: fix incorrect clock source setting
  ALSA: scarlett2: Fix line out/speaker switching notifications
  ALSA: scarlett2: Correct channel mute status after mute button pressed
  ALSA: scarlett2: Fix Direct Monitor control name for 2i2
  ALSA: scarlett2: Fix Mute/Dim/MSD Mode control names
2021-08-06 10:50:26 -07:00
Takashi Iwai
56e7a93160 ASoC: Fixes for v5.14
Quite a lot of fixes here, the biggest set being for the cs42l42 driver
 which is reasonably old but has seen a sudden uptick in activity.
 There's also some fixes for correctly referencing PCM buffer addresses
 and the removal of some driver-local bodges that had been done for the
 lack of prefix handling in DAPM which were broken by the core handling
 that as expected.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmENS7kACgkQJNaLcl1U
 h9AxAgf/RDnVYb2b77qhUbHva/5fOUQMCx6NMWQ79LG8rRU2cZ5f+NxJtLKNOQIQ
 A05mH0Y4BCQFeCKWN/JpGlJWITUpBLhYIxBe//5URjzkds8h8KCfkxc+UGxYxy/h
 xPrXztFRMRD74kQKwpISLxM134qRW0j3fONSAxXwWSmamL2UEefohVX+edsHgl37
 vdJNMiBfq8g9fCIq5nT/Il7yNBlEosLoB1UxBpMRElMa+y5ZuYRjl2R8n0CIIbHG
 kER2ilNY7ldU1cs+KPbbXcfRrDc3BUs2/eNNSljqJb7XK4pJGndpEKX2i/Bzi5i0
 BfPcN7VIm4fG79GbJ/Xw+hsOcA58YA==
 =r49k
 -----END PGP SIGNATURE-----

Merge tag 'asoc-fix-v5.14-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v5.14

Quite a lot of fixes here, the biggest set being for the cs42l42 driver
which is reasonably old but has seen a sudden uptick in activity.
There's also some fixes for correctly referencing PCM buffer addresses
and the removal of some driver-local bodges that had been done for the
lack of prefix handling in DAPM which were broken by the core handling
that as expected.
2021-08-06 17:00:51 +02:00
Mark Brown
ddaa1ed52c
Merge some cs42l42 patches into asoc-5.15 2021-08-06 01:46:24 +01:00
Richard Fitzgerald
e2f6867299
ASoC: cs42l42: Update module authors
Add the current authors of this module.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210805161111.10410-8-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-05 23:33:46 +01:00
Richard Fitzgerald
c76d572c1e
ASoC: cs42l42: Assume 24-bit samples are in 32-bit slots
If the machine driver doesn't call snd_soc_dai_set_sysclk() the
SCLK is assumed to be sample_rate * sample_bits * 2 (that is, the
rate necessary for a standard I2S frame).

But 24-bit samples can be sent in either a 24-bit slot or a 32-bit
slot. If the PLL is configured for a 24-bit slot, but a 32-bit slot is
used, cs42l42 will be overclocked.

Ultimately it is the machine driver's responsibilty to call
snd_soc_dai_set_sysclk() if SLK will be different from the standard
I2S rate. However, it is convenient to assume 32-bit slots to allow
this common case without needing special machine driver support. The
machine driver then only has to set SCLK if the slots are 24-bit, but
if it fails to do this cs42l42 won't be overclocked.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210805161111.10410-7-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-05 23:33:45 +01:00
Richard Fitzgerald
24cdbb79bb
ASoC: cs42l42: Validate dai_set_sysclk() frequency
If the machine driver calls snd_set_sysclk() with an unsupported
SCLK frequency, return an error instead of letting hw_params() fail.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210805161111.10410-6-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-05 23:33:44 +01:00
Richard Fitzgerald
b962bae81f
ASoC: cs42l42: Add PLL configuration for 44.1kHz/16-bit
44.1kHz 16-bit standard I2S gives a SCLK of 1.4112 MHz. Add
a PLL configuration for this.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210805161111.10410-5-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-05 23:33:43 +01:00