Commit graph

15 commits

Author SHA1 Message Date
Mark Brown a834238961
Merge series "ASoC: Clean-up W=1 build warnings​ - part1" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
Both Lee Jones and I submitted separate series, this is the first part
of the merged result, which includes all previously reviewed patches
or suggested changes along with trivial ones for CONFIG_ACPI.

Lee Jones (2):
  ASoC: codecs: jz4770: Remove defined but never used variable
    'mic_boost_tlv'
  ASoC: ti: omap-mcbsp-st: Remove set, but unused variable 'w'

Pierre-Louis Bossart (11):
  ASoC: atmel: fix kernel-doc
  ASoC: samsung: spdif: fix kernel-doc
  ASoC: samsung: pcm: fix kernel-doc
  ASoC: tegra: tegra20_das: remove always-true comparison
  ASoC: uniphier: aio-core: fix kernel-doc
  ASoC: codecs: da7210: fix kernel-doc
  ASoC: codecs: da7219: fix 'defined but not used' warning
  ASoC: codecs: cros_ec_codec: fix 'defined but not used' warning
  ASoC: codecs: es8316: fix 'defined but not used' warning
  ASoC: codecs: max98390: fix 'defined but not used' warning
  ASoC: codecs: rt*: fix 'defined but not used' warning

 sound/soc/atmel/atmel-pcm-dma.c  |  2 +-
 sound/soc/atmel/atmel_ssc_dai.c  |  1 +
 sound/soc/codecs/cros_ec_codec.c |  2 ++
 sound/soc/codecs/da7210.c        | 12 +++++++-----
 sound/soc/codecs/da7219.c        |  2 ++
 sound/soc/codecs/es8316.c        |  2 ++
 sound/soc/codecs/jz4770.c        |  1 -
 sound/soc/codecs/max98390.c      |  8 --------
 sound/soc/codecs/rt274.c         |  2 ++
 sound/soc/codecs/rt286.c         |  2 ++
 sound/soc/codecs/rt298.c         |  2 ++
 sound/soc/codecs/rt5660.c        |  2 ++
 sound/soc/codecs/rt5677-spi.c    |  2 ++
 sound/soc/samsung/pcm.c          |  5 +++++
 sound/soc/samsung/spdif.c        |  6 +++---
 sound/soc/tegra/tegra20_das.c    |  3 +--
 sound/soc/ti/omap-mcbsp-st.c     |  3 ---
 sound/soc/uniphier/aio-core.c    |  7 +++----
 18 files changed, 37 insertions(+), 27 deletions(-)

--
2.25.1
2020-07-09 22:20:32 +01:00
Gustavo A. R. Silva 3e146b55a4
ASoC: codecs: Use fallthrough pseudo-keyword
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1].

[1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20200709010359.GA18971@embeddedor
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 22:20:31 +01:00
Pierre-Louis Bossart 56bbfbfdab
ASoC: codecs: rt*: fix 'defined but not used' warning
Fix W=1 warning when ACPI is not defined

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200707190612.97799-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 21:56:50 +01:00
Thomas Gleixner d2912cb15b treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
Based on 2 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 as
  published by the free software foundation

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 as
  published by the free software foundation #

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 4122 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Enrico Weigelt <info@metux.net>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-19 17:09:55 +02:00
Amadeusz Sławiński 04268bf275
SoC: rt274: Fix internal jack assignment in set_jack callback
When we call snd_soc_component_set_jack(component, NULL, NULL) we should
set rt274->jack to passed jack, so when interrupt is triggered it calls
snd_soc_jack_report(rt274->jack, ...) with proper value.

This fixes problem in machine where in register, we call
snd_soc_register(component, &headset, NULL), which just calls
rt274_mic_detect via callback.
Now when machine driver is removed "headset" will be gone, so we
need to tell codec driver that it's gone with:
snd_soc_register(component, NULL, NULL), but we also need to be able
to handle NULL jack argument here gracefully.
If we don't set it to NULL, next time the rt274_irq runs it will call
snd_soc_jack_report with first argument being invalid pointer and there
will be Oops.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-06-06 17:37:21 +01:00
Yizhuo 4a8191aa9e
ASoC: rt274: Variable "buf" in function rt274_jack_detect() could be uninitialized
In function rt274_jack_detect(), local variable "buf" could
be uninitialized if function regmap_read() returns -EINVAL.
However, it will be used to calculate "hp" and "mic" and
make their value unpredictable while those value are used
in the caller. This is potentially unsafe.

Signed-off-by: Yizhuo <yzhai003@ucr.edu>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-08 13:05:48 +00:00
Pierre-Louis Bossart b793a1e4eb
ASoC: rt274: fix boolean tests
Reported by Coccinelle:

sound/soc/codecs/rt274.c:958:6-8: WARNING: Comparison to bool
sound/soc/codecs/rt274.c:961:6-9: WARNING: Comparison to bool
sound/soc/codecs/rt274.c:384:5-7: WARNING: Comparison to bool
sound/soc/codecs/rt274.c:387:5-8: WARNING: Comparison to bool

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-07 16:51:46 +00:00
Yizhuo 8c3590de0a
ASoC: Variable "val" in function rt274_i2c_probe() could be uninitialized
Inside function rt274_i2c_probe(), if regmap_read() function
returns -EINVAL, then local variable "val" leaves uninitialized
but used in if statement. This is potentially unsafe.

Signed-off-by: Yizhuo <yzhai003@ucr.edu>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-04 13:49:23 +00:00
Takashi Iwai 0beeb4baf5
ASoC: rt274: Add fall-through annotations
As a preparatory patch for the upcoming -Wimplicit-fallthrough
compiler checks, add the "fall through" annotations in rt274 driver.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-05 12:38:20 +01:00
Kuninori Morimoto f548dd4f87
ASoC: rt274: replace codec to component
Now we can replace Codec to Component. Let's do it.

Note:
	xxx_codec_xxx()		->	xxx_component_xxx()
	.idle_bias_off = 1	->	.idle_bias_on = 0
	.ignore_pmdown_time = 0	->	.use_pmdown_time = 1
	-			->	.endianness = 1
	-			->	.non_legacy_dai_naming = 1

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-02-12 09:45:38 +00:00
Mark Brown e5fadb7281 Merge remote-tracking branches 'asoc/topic/rk3036', 'asoc/topic/rockchip', 'asoc/topic/rt274' and 'asoc/topic/rt5514' into asoc-next 2017-09-01 12:12:55 +01:00
Bard Liao 60b0fdeac1 ASoC: rt274: add acpi id
Add ACPI id for Intel platform.

Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com>
Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-30 16:06:22 +01:00
Bhumika Goyal a180ba45b1 ASoC: codecs: add const to snd_soc_codec_driver structures
Declare snd_soc_codec_driver structures as const as they are only passed
as an argument to the function snd_soc_register_codec. This argument is
of type const, so declare the structures with this property as const.
In file codecs/sn95031.c, snd_soc_codec_driver structure is also used in
a copy operation along with getting passed to snd_soc_register_codec.
So, it can be made const too.
Done using Coccinelle:

@match disable optional_qualifier@
identifier s;
position p;
@@
static struct snd_soc_codec_driver s@p={...};

@good1@
identifier match.s;
position p;
@@
snd_soc_register_codec(...,&s@p,...)

@bad@
identifier match.s;
position p!={match.p,good1.p};
@@
s@p

@depends on !bad disable optional_qualifier@
identifier match.s;
@@
static
+const
struct snd_soc_codec_driver s={...};

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-10 16:10:50 +01:00
Bard Liao 49a69163dd ASoC: rt274: correct comment style
There was a comment style issue in the driver.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-19 11:55:08 +01:00
Bard Liao c7e79b2b2d ASoC: rt274: add rt274 codec driver
RT274 is a HD-A/SOC dual mode codec. This is the initial codec driver
of SOC mode.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-18 14:46:20 +01:00