Skip to content
  1. Mar 25, 2021
    • Jack Yu's avatar
      ASoC: rt1015: Add bclk detection and dc detection · 9f44673b
      Jack Yu authored
      
      
      Add bclk detection and dc detection before playback.
      
      Signed-off-by: default avatarJack Yu <jack.yu@realtek.com>
      Link: https://lore.kernel.org/r/20210322055053.31797-1-jack.yu@realtek.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      9f44673b
    • Tian Tao's avatar
      spi: imx: Use of_device_get_match_data() helper · 200d925e
      Tian Tao authored
      
      
      Use the of_device_get_match_data() helper instead of open coding.
      
      Signed-off-by: default avatarTian Tao <tiantao6@hisilicon.com>
      Link: https://lore.kernel.org/r/1616385476-53327-1-git-send-email-tiantao6@hisilicon.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      200d925e
    • Mark Brown's avatar
      Merge series "MFD/extcon/ASoC: Rework arizona codec jack-detect support" from... · 3f994c25
      Mark Brown authored
      Merge series "MFD/extcon/ASoC: Rework arizona codec jack-detect support" from Hans de Goede <hdegoede@redhat.com>:
      
      Hi All,
      
      Here is v4 of my series to rework the arizona codec jack-detect support
      to use the snd_soc_jack helpers instead of direct extcon reporting.
      
      As discussed before here is a resend rebased on 5.12-rc2, making sure that
      all patches this depends on are in place.
      
      Lee, can you pick-up patches 1-6 through the MFD tree and then send a
      pull-req to Mark so that Mark can merge the Asoc parts throught the ASoC
      tree ?
      
      Patches 2-6 touch drivers/extcon, these all have an Ack from Chanwoo Choi
      for merging these through the MFD tree.
      
      Here is some more generic info on this series from the previous
      cover-letter:
      
      This is done by reworking the extcon driver into an arizona-jackdet
      library and then modifying the codec drivers to use that directly,
      replacing the old separate extcon child-devices and extcon-driver.
      
      This brings the arizona-codec jack-detect handling inline with how
      all other ASoC codec driver do this. This was developed and tested on
      a Lenovo Yoga Tablet 1051L with a WM5102 codec.
      
      This was also tested by Charles Keepax, one of the Cirrus Codec folks.
      
      Regards,
      
      Hans
      
      Hans de Goede (13):
        mfd: arizona: Drop arizona-extcon cells
        extcon: arizona: Fix some issues when HPDET IRQ fires after the jack
          has been unplugged
        extcon: arizona: Fix various races on driver unbind
        extcon: arizona: Fix flags parameter to the gpiod_get("wlf,micd-pol")
          call
        extcon: arizona: Always use pm_runtime_get_sync() when we need the
          device to be awake
        ASoC/extcon: arizona: Move arizona jack code to
          sound/soc/codecs/arizona-jack.c
        ASoC: arizona-jack: Move jack-detect variables to struct arizona_priv
        ASoC: arizona-jack: Use arizona->dev for runtime-pm
        ASoC: arizona-jack: convert into a helper library for codec drivers
        ASoC: arizona-jack: Use snd_soc_jack to report jack events
        ASoC: arizona-jack: Cleanup logging
        ASoC: arizona: Make the wm5102, wm5110, wm8997 and wm8998 drivers use
          the new jack library
        ASoC: Intel: bytcr_wm5102: Add jack detect support
      
       MAINTAINERS                                   |   3 +-
       drivers/extcon/Kconfig                        |   8 -
       drivers/extcon/Makefile                       |   1 -
       drivers/mfd/arizona-core.c                    |  20 -
       sound/soc/codecs/Makefile                     |   2 +-
       .../soc/codecs/arizona-jack.c                 | 577 +++++++-----------
       sound/soc/codecs/arizona.h                    |  44 ++
       sound/soc/codecs/wm5102.c                     |  12 +-
       sound/soc/codecs/wm5110.c                     |  12 +-
       sound/soc/codecs/wm8997.c                     |  14 +-
       sound/soc/codecs/wm8998.c                     |   9 +
       sound/soc/intel/boards/bytcr_wm5102.c         |  28 +-
       12 files changed, 325 insertions(+), 405 deletions(-)
       rename drivers/extcon/extcon-arizona.c => sound/soc/codecs/arizona-jack.c (76%)
      
      --
      2.30.1
      3f994c25
    • Hans de Goede's avatar
      ASoC: Intel: bytcr_wm5102: Add jack detect support · ecd77d49
      Hans de Goede authored
      
      
      Add jack detect support by creating a jack and calling
      snd_soc_component_set_jack to register the created jack
      with the codec.
      
      Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20210307151807.35201-14-hdegoede@redhat.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      ecd77d49
    • Hans de Goede's avatar
      ASoC: arizona: Make the wm5102, wm5110, wm8997 and wm8998 drivers use the new jack library · 37dbabf1
      Hans de Goede authored
      
      
      Make all arizona codec drivers for which drivers/mfd/arizona-core.c used
      to instantiate a "arizona-extcon" child-device use the new arizona-jack.c
      library for jack-detection.
      
      This has been tested on a Lenovo Yoga Tablet 2 1051L with a WM5102 codec.
      
      Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
      Acked-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
      Tested-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20210307151807.35201-13-hdegoede@redhat.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      37dbabf1
    • Hans de Goede's avatar
      ASoC: arizona-jack: Cleanup logging · 69c58eb6
      Hans de Goede authored
      
      
      Cleanup the use of dev_foo functions used for logging:
      
      1. Many of these are unnecessarily split over multiple lines
      2. Use dev_err_probe() in cases where we might get a -EPROBE_DEFER
         return value
      
      Suggested-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
      Acked-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
      Tested-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20210307151807.35201-12-hdegoede@redhat.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      69c58eb6
    • Hans de Goede's avatar
      ASoC: arizona-jack: Use snd_soc_jack to report jack events · 236b7285
      Hans de Goede authored
      
      
      Use the snd_soc_jack code to report jack events, instead of using extcon
      for reporting the cable-type + an input_dev for reporting the button
      presses.
      
      The snd_soc_jack code will report the cable-type through both input_dev
      events and through ALSA controls and the button-presses through input_dev
      events.
      
      Note that this means that when the codec drivers are moved over to use
      the new arizona-jack.c library code instead of having a separate MFD
      extcon cell with the extcon-arizona.c driver, we will no longer report
      extcon events to userspace for cable-type changes. This should not be
      a problem since "standard" Linux distro userspace does not (and has
      never) used the extcon class interface for this. Android does have
      support for the extcon class interface, but that was introduced in
      the same release as support for input_dev cable-type events, so this
      should not be a problem for Android either.
      
      Note this also reduces ARIZONA_MAX_MICD_RANGE from 8 to 6, this is
      ok to do since this info is always provided through pdata (or defaults)
      and cannot be overridden from devicetree. All in-kernel users of the
      pdata (and the fallback defaults) define 6 or less buttons/ranges.
      
      Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
      Acked-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
      Tested-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20210307151807.35201-11-hdegoede@redhat.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      236b7285
    • Hans de Goede's avatar
      ASoC: arizona-jack: convert into a helper library for codec drivers · ffcc84b9
      Hans de Goede authored
      
      
      Convert the arizona extcon driver into a helper library for direct use
      from the arizona codec-drivers, rather then being bound to a separate
      MFD cell.
      
      Note the probe (and remove) sequence is split into 2 parts:
      
      1. The arizona_jack_codec_dev_probe() function inits a bunch of
      jack-detect specific variables in struct arizona_priv and tries to get
      a number of resources where getting them may fail with -EPROBE_DEFER.
      
      2. Then once the machine driver has create a snd_sock_jack through
      snd_soc_card_jack_new() it calls snd_soc_component_set_jack() on
      the codec component, which will call the new arizona_jack_set_jack(),
      which sets up jack-detection and requests the IRQs.
      
      This split is necessary, because the IRQ handlers need access to the
      arizona->dapm pointer and the snd_sock_jack which are not available
      when the codec-driver's probe function runs.
      
      Note this requires that machine-drivers for codecs which are converted
      to use the new helper functions from arizona-jack.c are modified to
      create a snd_soc_jack through snd_soc_card_jack_new() and register
      this jack with the codec through snd_soc_component_set_jack().
      
      Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
      Acked-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
      Tested-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20210307151807.35201-10-hdegoede@redhat.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      ffcc84b9
    • Hans de Goede's avatar
      ASoC: arizona-jack: Use arizona->dev for runtime-pm · 688c8461
      Hans de Goede authored
      
      
      Drivers for MFD child-devices such as the arizona codec drivers
      and the arizona-extcon driver can choose to either make
      runtime_pm_get/_put calls on their own child-device, which will
      then be propagated to their parent; or they can make them directly
      on their MFD parent-device.
      
      The arizona-extcon code was using runtime_pm_get/_put calls on
      its own child-device where as the codec drivers are using
      runtime_pm_get/_put calls on their parent.
      
      The arizona-extcon MFD cell/child-device has been removed and this
      commit is part of refactoring the arizona-extcon code into a library
      to be used directly from the codec drivers.
      
      Specifically this commit moves the code over to make
      runtime_pm_get/_put calls on the parent device (on arizona->dev)
      bringing the code inline with how the codec drivers do this.
      
      Note this also removes the pm_runtime_enable/_disable calls
      as pm_runtime support has already been enabled on the parent-device
      by the arizona MFD driver.
      
      This is part of a patch series converting the arizona extcon driver into
      a helper library for letting the arizona codec-drivers directly report
      jack state through the standard sound/soc/soc-jack.c functions.
      
      Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
      Acked-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
      Tested-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20210307151807.35201-9-hdegoede@redhat.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      688c8461
    • Hans de Goede's avatar
      ASoC: arizona-jack: Move jack-detect variables to struct arizona_priv · bcda8cc4
      Hans de Goede authored
      
      
      Move all the jack-detect variables from struct arizona_extcon_info to
      struct arizona_priv.
      
      This is part of a patch series converting the arizona extcon driver into
      a helper library for letting the arizona codec-drivers directly report jack
      state through the standard sound/soc/soc-jack.c functions.
      
      Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
      Acked-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
      Tested-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20210307151807.35201-8-hdegoede@redhat.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      bcda8cc4
    • Shengjiu Wang's avatar
      ASoC: fsl_micfil: Don't use devm_regmap_init_mmio_clk · b5cf28f7
      Shengjiu Wang authored
      
      
      When there is power domain bind with ipg_clk clock,
      
      The call flow:
      devm_regmap_init_mmio_clk
         - clk_prepare()
            - clk_pm_runtime_get()
      
      cause the power domain of clock always be enabled after
      regmap_init(). which impact the power consumption.
      
      So use devm_regmap_init_mmio instead of
      devm_regmap_init_mmio_clk,but explicitly enable
      clock when it is used.
      
      Signed-off-by: default avatarShengjiu Wang <shengjiu.wang@nxp.com>
      Reviewed-by: default avatarViorel Suman <viorel.suman@nxp.com>
      Link: https://lore.kernel.org/r/1616579928-22428-7-git-send-email-shengjiu.wang@nxp.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      b5cf28f7
    • Shengjiu Wang's avatar
      ASoC: fsl_audmix: Don't use devm_regmap_init_mmio_clk · 3feaba79
      Shengjiu Wang authored
      
      
      When there is power domain bind with ipg clock,
      
      The call flow:
      devm_regmap_init_mmio_clk
         - clk_prepare()
             - clk_pm_runtime_get()
      
      cause the power domain of clock always be enabled after
      regmap_init(). which impact the power consumption.
      
      So use devm_regmap_init_mmio instead of
      devm_regmap_init_mmio_clk,but explicitly enable
      clock when it is used.
      
      Signed-off-by: default avatarShengjiu Wang <shengjiu.wang@nxp.com>
      Link: https://lore.kernel.org/r/1616579928-22428-6-git-send-email-shengjiu.wang@nxp.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      3feaba79
    • Shengjiu Wang's avatar
      ASoC: fsl_easrc: Don't use devm_regmap_init_mmio_clk · 069b24f2
      Shengjiu Wang authored
      
      
      When there is power domain bind with mem clock,
      
      The call flow:
      devm_regmap_init_mmio_clk
        - clk_prepare()
            - clk_pm_runtime_get()
      
      cause the power domain of clock always be enabled after
      regmap_init(). which impact the power consumption.
      
      So use devm_regmap_init_mmio instead of
      devm_regmap_init_mmio_clk,but explicitly enable
      clock when it is used.
      
      Signed-off-by: default avatarShengjiu Wang <shengjiu.wang@nxp.com>
      Link: https://lore.kernel.org/r/1616579928-22428-5-git-send-email-shengjiu.wang@nxp.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      069b24f2
    • Shengjiu Wang's avatar
      ASoC: fsl_asrc: Don't use devm_regmap_init_mmio_clk · cab04ab5
      Shengjiu Wang authored
      
      
      When there is power domain bind with mem clock,
      
      The call flow:
      devm_regmap_init_mmio_clk
         - clk_prepare()
             - clk_pm_runtime_get()
      
      cause the power domain of clock always be enabled after
      regmap_init(). which impact the power consumption.
      
      So use devm_regmap_init_mmio instead of
      devm_regmap_init_mmio_clk,but explicitly enable
      clock when it is used.
      
      Signed-off-by: default avatarShengjiu Wang <shengjiu.wang@nxp.com>
      Link: https://lore.kernel.org/r/1616579928-22428-4-git-send-email-shengjiu.wang@nxp.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      cab04ab5
    • Shengjiu Wang's avatar
      ASoC: fsl_spdif: Don't use devm_regmap_init_mmio_clk · c2562572
      Shengjiu Wang authored
      
      
      When there is power domain bind with core clock,
      
      The call flow:
      devm_regmap_init_mmio_clk
         - clk_prepare()
             - clk_pm_runtime_get()
      
      cause the power domain of clock always be enabled after
      regmap_init(). which impact the power consumption.
      
      So use devm_regmap_init_mmio instead of
      devm_regmap_init_mmio_clk,but explicitly enable
      clock when it is used.
      
      Signed-off-by: default avatarShengjiu Wang <shengjiu.wang@nxp.com>
      Link: https://lore.kernel.org/r/1616579928-22428-3-git-send-email-shengjiu.wang@nxp.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      c2562572
    • Shengjiu Wang's avatar
      ASoC: fsl_esai: Don't use devm_regmap_init_mmio_clk · 203773e3
      Shengjiu Wang authored
      
      
      When there is power domain bind with bus clock,
      
      The call flow:
      devm_regmap_init_mmio_clk
          - clk_prepare()
             - clk_pm_runtime_get()
      
      cause the power domain of clock always be enabled after
      regmap_init(). which impact the power consumption.
      
      So use devm_regmap_init_mmio instead of
      devm_regmap_init_mmio_clk,but explicitly enable
      clock when it is used.
      
      Signed-off-by: default avatarShengjiu Wang <shengjiu.wang@nxp.com>
      Link: https://lore.kernel.org/r/1616579928-22428-2-git-send-email-shengjiu.wang@nxp.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      203773e3
  2. Mar 24, 2021
  3. Mar 22, 2021
  4. Mar 20, 2021
    • Mark Brown's avatar
      Merge series "ASoC: tidyup error message timing" from Kuninori Morimoto... · 3722e4ec
      Mark Brown authored
      Merge series "ASoC: tidyup error message timing" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
      
      Hi Mark
      
      Indicating error message when failed case is very useful for debuging.
      In many case, it uses below style.
      
      	int function(...)
      	{
      		...
      		return ret;
      	}
      
      	int caller(...)
      	{
      		...
      		ret = function(...);
      		if (ret < 0)
      			dev_err(...)
      		...
      	}
      
      This is not so bad, but in this style *each caller* needs to indicate
      duplicate same error message, and some caller is forgetting to do it.
      And caller can't indicate detail function() error information.
      
      I know many people have many opinion, but if function() indicates error
      message, we can get same and detail information without forgot, and it is better.
      This patch-set tidyup to do it.
      
      	int function(...)
      	{
      		...
      		if (ret < 0)
      			dev_err(...)
      
      		return ret;
      	}
      
      	int caller(...)
      	{
      		...
      		ret = function(...);
      		...
      	}
      
      Kuninori Morimoto (14):
        ASoC: soc-pcm: indicate error message at soc_pcm_open()
        ASoC: soc-pcm: indicate error message at soc_pcm_hw_params()
        ASoC: soc-pcm: indicate error message at soc_pcm_prepare()
        ASoC: soc-pcm: indicate error message at dpcm_path_get()
        ASoC: soc-pcm: indicate error message at dpcm_be_dai_trigger()
        ASoC: soc-pcm: indicate error message at dpcm_apply_symmetry()
        ASoC: soc-pcm: indicate error message at dpcm_run_update_startup/shutdown()
        ASoC: soc-pcm: indicate error message at dpcm_fe/be_dai_startup()
        ASoC: soc-pcm: indicate error message at dpcm_fe/be_dai_hw_params()
        ASoC: soc-pcm: indicate error message at dpcm_fe/be_dai_prepare()
        ASoC: soc-pcm: don't indicate error message for soc_pcm_hw_free()
        ASoC: soc-pcm: don't indicate error message for dpcm_be_dai_hw_free()
        ASoC: don't indicate error message for snd_soc_[pcm_]dai_xxx()
        ASoC: don't indicate error message for snd_soc_[pcm_]component_xxx()
      
       include/sound/soc-dpcm.h |   2 +-
       sound/soc/soc-compress.c |   9 +-
       sound/soc/soc-core.c     |  22 +----
       sound/soc/soc-dapm.c     |  24 ++---
       sound/soc/soc-pcm.c      | 197 +++++++++++++++++++--------------------
       5 files changed, 108 insertions(+), 146 deletions(-)
      
      --
      2.25.1
      3722e4ec
  5. Mar 19, 2021
    • Wei Yongjun's avatar
      ASoC: rt1019: make symbol 'rt1019_i2c_driver' static · e6d8af66
      Wei Yongjun authored
      The sparse tool complains as follows:
      
      sound/soc/codecs/rt1019.c:927:19: warning:
       symbol 'rt1019_i2c_driver' was not declared. Should it be static?
      
      This symbol is not used outside of rt1019.c, so this
      commit marks it static.
      
      Fixes: 7ec79d38
      
       ("ASoC: rt1019: add rt1019 amplifier driver")
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
      Link: https://lore.kernel.org/r/20210319094102.4185096-1-weiyongjun1@huawei.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      e6d8af66
    • Kuninori Morimoto's avatar
      ASoC: don't indicate error message for snd_soc_[pcm_]component_xxx() · 60adbd8f
      Kuninori Morimoto authored
      
      
      All snd_soc_component_xxx() and snd_soc_pcm_component_xxx() itself
      indicate error message if failed.
      Its caller doesn't need to indicate duplicated error message.
      This patch removes it.
      
      All snd_soc_component_xxx() indicate error message if failed.
      Its caller doesn't need to indicate duplicated error message.
      This patch removes it.
      
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/878s6puta6.wl-kuninori.morimoto.gx@renesas.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      60adbd8f
    • Kuninori Morimoto's avatar
      ASoC: don't indicate error message for snd_soc_[pcm_]dai_xxx() · 62462e01
      Kuninori Morimoto authored
      
      
      All snd_soc_dai_xxx() and snd_soc_pcm_dai_xxx() itself
      indicate error message if failed.
      Its caller doesn't need to indicate duplicated error message.
      This patch removes it.
      
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/87a6r5utaa.wl-kuninori.morimoto.gx@renesas.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      62462e01
    • Kuninori Morimoto's avatar
      ASoC: soc-pcm: don't indicate error message for dpcm_be_dai_hw_free() · f52366e6
      Kuninori Morimoto authored
      
      
      dpcm_be_dai_hw_free() never fail, error message is not needed.
      
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/87blblutaf.wl-kuninori.morimoto.gx@renesas.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      f52366e6
    • Kuninori Morimoto's avatar
      ASoC: soc-pcm: don't indicate error message for soc_pcm_hw_free() · e20c9c4f
      Kuninori Morimoto authored
      
      
      soc_pcm_hw_free() never fail, error message is not needed.
      We can't use void function for it, because it is used
      part of struct snd_pcm_ops :: hw_free.
      
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/87czw1utaj.wl-kuninori.morimoto.gx@renesas.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      e20c9c4f
    • Kuninori Morimoto's avatar
      ASoC: soc-pcm: indicate error message at dpcm_fe/be_dai_prepare() · 273db971
      Kuninori Morimoto authored
      
      
      Indicating error message when failed case is very useful for debuging.
      In many case, its style is like below.
      
      	int function(...)
      	{
      		...
      		return ret;
      	}
      
      	int caller(...)
      	{
      		...
      		ret = function(...);
      		if (ret < 0)
      			dev_err(...)
      		...
      	}
      
      This is not so bad, but in this style *each caller* needs to indicate
      duplicate same error message, and some caller is forgetting to do it.
      And caller can't indicate detail function() error information.
      
      If function() indicates error message, we can get same and
      detail information without forgot.
      
      	int function(...)
      	{
      		...
      		if (ret < 0)
      			dev_err(...)
      
      		return ret;
      	}
      
      	int caller(...)
      	{
      		...
      		ret = function(...);
      		...
      	}
      
      This patch follow above style at dpcm_fe/be_dai_prepare()
      
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/87eeghutap.wl-kuninori.morimoto.gx@renesas.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      273db971
    • Kuninori Morimoto's avatar
      ASoC: soc-pcm: indicate error message at dpcm_fe/be_dai_hw_params() · 33b6b94f
      Kuninori Morimoto authored
      
      
      Indicating error message when failed case is very useful for debuging.
      In many case, its style is like below.
      
      	int function(...)
      	{
      		...
      		return ret;
      	}
      
      	int caller(...)
      	{
      		...
      		ret = function(...);
      		if (ret < 0)
      			dev_err(...)
      		...
      	}
      
      This is not so bad, but in this style *each caller* needs to indicate
      duplicate same error message, and some caller is forgetting to do it.
      And caller can't indicate detail function() error information.
      
      If function() indicates error message, we can get same and
      detail information without forgot.
      
      	int function(...)
      	{
      		...
      		if (ret < 0)
      			dev_err(...)
      
      		return ret;
      	}
      
      	int caller(...)
      	{
      		...
      		ret = function(...);
      		...
      	}
      
      This patch follow above style at dpcm_fe/be_dai_hw_params()
      
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/87ft0xutat.wl-kuninori.morimoto.gx@renesas.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      33b6b94f
    • Kuninori Morimoto's avatar
      ASoC: soc-pcm: indicate error message at dpcm_fe/be_dai_startup() · 06aaeb87
      Kuninori Morimoto authored
      
      
      Indicating error message when failed case is very useful for debuging.
      In many case, its style is like below.
      
      	int function(...)
      	{
      		...
      		return ret;
      	}
      
      	int caller(...)
      	{
      		...
      		ret = function(...);
      		if (ret < 0)
      			dev_err(...)
      		...
      	}
      
      This is not so bad, but in this style *each caller* needs to indicate
      duplicate same error message, and some caller is forgetting to do it.
      And caller can't indicate detail function() error information.
      
      If function() indicates error message, we can get same and
      detail information without forgot.
      
      	int function(...)
      	{
      		...
      		if (ret < 0)
      			dev_err(...)
      
      		return ret;
      	}
      
      	int caller(...)
      	{
      		...
      		ret = function(...);
      		...
      	}
      
      This patch follow above style at dpcm_fe/be_dai_startup().
      
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/87h7ldutay.wl-kuninori.morimoto.gx@renesas.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      06aaeb87
    • Kuninori Morimoto's avatar
      ASoC: soc-pcm: indicate error message at dpcm_run_update_startup/shutdown() · 81c82a9e
      Kuninori Morimoto authored
      
      
      Indicating error message when failed case is very useful for debuging.
      In many case, its style is like below.
      
      	int function(...)
      	{
      		...
      		return ret;
      	}
      
      	int caller(...)
      	{
      		...
      		ret = function(...);
      		if (ret < 0)
      			dev_err(...)
      		...
      	}
      
      This is not so bad, but in this style *each caller* needs to indicate
      duplicate same error message, and some caller is forgetting to do it.
      And caller can't indicate detail function() error information.
      
      If function() indicates error message, we can get same and
      detail information without forgot.
      
      	int function(...)
      	{
      		...
      		if (ret < 0)
      			dev_err(...)
      
      		return ret;
      	}
      
      	int caller(...)
      	{
      		...
      		ret = function(...);
      		...
      	}
      
      This patch also
      do below to dpcm_run_update_startup()
      	1) remove duplicated ret = -EINVAL
      	2) remove blank line
      do below to dpcm_run_update_shutdown()
      	1) remove unused ret
      
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/87im5tutb3.wl-kuninori.morimoto.gx@renesas.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      81c82a9e
    • Kuninori Morimoto's avatar
      ASoC: soc-pcm: indicate error message at dpcm_apply_symmetry() · bbd2bac8
      Kuninori Morimoto authored
      
      
      Indicating error message when failed case is very useful for debuging.
      In many case, its style is like below.
      
      	int function(...)
      	{
      		...
      		return ret;
      	}
      
      	int caller(...)
      	{
      		...
      		ret = function(...);
      		if (ret < 0)
      			dev_err(...)
      		...
      	}
      
      This is not so bad, but in this style *each caller* needs to indicate
      duplicate same error message, and some caller is forgetting to do it.
      And caller can't indicate detail function() error information.
      
      If function() indicates error message, we can get same and
      detail information without forgot.
      
      	int function(...)
      	{
      		...
      		if (ret < 0)
      			dev_err(...)
      
      		return ret;
      	}
      
      	int caller(...)
      	{
      		...
      		ret = function(...);
      		...
      	}
      
      This patch follow above style at dpcm_apply_symmetry(...)
      
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/87k0q9utb9.wl-kuninori.morimoto.gx@renesas.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      bbd2bac8
    • Kuninori Morimoto's avatar
      ASoC: soc-pcm: indicate error message at dpcm_be_dai_trigger() · db3aa39c
      Kuninori Morimoto authored
      
      
      Indicating error message when failed case is very useful for debuging.
      In many case, its style is like below.
      
      	int function(...)
      	{
      		...
      		return ret;
      	}
      
      	int caller(...)
      	{
      		...
      		ret = function(...);
      		if (ret < 0)
      			dev_err(...)
      		...
      	}
      
      This is not so bad, but in this style *each caller* needs to indicate
      duplicate same error message, and some caller is forgetting to do it.
      And caller can't indicate detail function() error information.
      
      If function() indicates error message, we can get same and
      detail information without forgot.
      
      	int function(...)
      	{
      		...
      		if (ret < 0)
      			dev_err(...)
      
      		return ret;
      	}
      
      	int caller(...)
      	{
      		...
      		ret = function(...);
      		...
      	}
      
      Now, dpcm_be_dai_trigger() user uses it like below.
      
      	err = dpcm_be_dai_trigger(...);
      	if (err < 0)
      		dev_err(..., "ASoC: trigger FE failed %d\n", err);
      
      But we can get more detail information if dpcm_be_dai_trigger() itself
      had dev_err(). And above error message is confusable,
      failed is *BE*, not *FE*.
      
      This patch indicates error message at dpcm_be_dai_trigger().
      
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/87lfaputbe.wl-kuninori.morimoto.gx@renesas.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      db3aa39c
    • Kuninori Morimoto's avatar
      ASoC: soc-pcm: indicate error message at dpcm_path_get() · d479f00b
      Kuninori Morimoto authored
      
      
      Indicating error message when failed case is very useful for debuging.
      In many case, its style is like below.
      
      	int function(...)
      	{
      		...
      		return ret;
      	}
      
      	int caller(...)
      	{
      		...
      		ret = function(...);
      		if (ret < 0)
      			dev_err(...)
      		...
      	}
      
      This is not so bad, but in this style *each caller* needs to indicate
      duplicate same error message, and some caller is forgetting to do it.
      And caller can't indicate detail function() error information.
      
      If function() indicates error message, we can get same and
      detail information without forgot.
      
      	int function(...)
      	{
      		...
      		if (ret < 0)
      			dev_err(...)
      
      		return ret;
      	}
      
      	int caller(...)
      	{
      		...
      		ret = function(...);
      		...
      	}
      
      Now, many place uses dpcm_path_get() like below
      
      	ret = dpcm_path_get(...);
      	if (ret < 0)
      		goto error;
      (A)	else if (ret == 0)
      		dev_dbg(...)
      
      But here, (A) part can be indicated at dpcm_path_get() not caller.
      It is simple and readable code.
      
      This patch do it.
      Small detail behaviors will be exchanged by this patch.
      
      	1) indicates debug info (= path numbers) if path > 0 case only
      	   (It was *always* indicated).
      	2) soc_dpcm_fe_runtime_update() is indicating error message
      	   for paths < 0 case, but it is already done at dpcm_path_get().
      	   Thus just remove it. but dev_dbg() vs dev_warn() is exchanged.
      
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/87mtv5utbj.wl-kuninori.morimoto.gx@renesas.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      d479f00b
    • Kuninori Morimoto's avatar
      ASoC: soc-pcm: indicate error message at soc_pcm_prepare() · dab7eeb4
      Kuninori Morimoto authored
      
      
      Indicating error message when failed case is very useful for debuging.
      In many case, its style is like below.
      
      	int function(...)
      	{
      		...
      		return ret;
      	}
      
      	int caller(...)
      	{
      		...
      		ret = function(...);
      		if (ret < 0)
      			dev_err(...)
      		...
      	}
      
      This is not so bad, but in this style *each caller* needs to indicate
      duplicate same error message, and some caller is forgetting to do it.
      And caller can't indicate detail function() error information.
      
      If function() indicates error message, we can get same and
      detail information without forgot.
      
      	int function(...)
      	{
      		...
      		if (ret < 0)
      			dev_err(...)
      
      		return ret;
      	}
      
      	int caller(...)
      	{
      		...
      		ret = function(...);
      		...
      	}
      
      This patch follow above style at soc_pcm_prepare().
      
      By this patch, dpcm_fe/be_dai_prepare(...)
      temporary lacks FE/BE error info, but it will reborn soon.
      
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/87o8flutbn.wl-kuninori.morimoto.gx@renesas.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      dab7eeb4
    • Kuninori Morimoto's avatar
      ASoC: soc-pcm: indicate error message at soc_pcm_hw_params() · cb11f79b
      Kuninori Morimoto authored
      
      
      Indicating error message when failed case is very useful for debuging.
      In many case, its style is like below.
      
      	int function(...)
      	{
      		...
      		return ret;
      	}
      
      	int caller(...)
      	{
      		...
      		ret = function(...);
      		if (ret < 0)
      			dev_err(...)
      		...
      	}
      
      This is not so bad, but in this style *each caller* needs to indicate
      duplicate same error message, and some caller is forgetting to do it.
      And caller can't indicate detail function() error information.
      
      If function() indicates error message, we can get same and
      detail information without forgot.
      
      	int function(...)
      	{
      		...
      		if (ret < 0)
      			dev_err(...)
      
      		return ret;
      	}
      
      	int caller(...)
      	{
      		...
      		ret = function(...);
      		...
      	}
      
      This patch follow above style at soc_pcm_hw_params().
      
      By this patch, dpcm_fe/be_dai_hw_params(...)
      temporary lacks FE/BE error info, but it will reborn soon.
      
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/87pn01utbt.wl-kuninori.morimoto.gx@renesas.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      cb11f79b
    • Kuninori Morimoto's avatar
      ASoC: soc-pcm: indicate error message at soc_pcm_open() · e4b044f4
      Kuninori Morimoto authored
      
      
      Indicating error message when failed case is very useful for debuging.
      In many case, its style is like below.
      
      	int function(...)
      	{
      		...
      		return ret;
      	}
      
      	int caller(...)
      	{
      		...
      		ret = function(...);
      		if (ret < 0)
      			dev_err(...)
      		...
      	}
      
      This is not so bad, but in this style *each caller* needs to indicate
      duplicate same error message, and some caller is forgetting to do it.
      And caller can't indicate detail function() error information.
      
      If function() indicates error message, we can get same and
      detail information without forgot.
      
      	int function(...)
      	{
      		...
      		if (ret < 0)
      			dev_err(...)
      
      		return ret;
      	}
      
      	int caller(...)
      	{
      		...
      		ret = function(...);
      		...
      	}
      
      This patch follow above style at soc_pcm_open().
      
      By this patch, dpcm_fe/be_dai_startup(...)
      temporary lacks FE/BE error info, but it will reborn soon.
      
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/87r1khutby.wl-kuninori.morimoto.gx@renesas.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      e4b044f4
    • Mark Brown's avatar
      Merge series "ASoC: codecs: remove cppcheck warnings" from Pierre-Louis... · bb9faecc
      Mark Brown authored
      Merge series "ASoC: codecs: remove cppcheck warnings" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
      
      Lots of small fixes in various codec drivers that should have no
      functional impact.
      
      Pierre-Louis Bossart (23):
        ASoC: ab8500-codec: remove useless structure
        ASoC: ad1836: remove useless return
        ASoC: adau1977: remove useless return
        ASoC: cros_ec_codec: remove null pointer dereference warning
        ASoC: cx2070x: remove useless assignment
        ASoC: cx2070x: remove duplicate else branch
        ASoC: da7219-aad: remove useless initialization
        ASoC: hdac_hdmi: remove useless initializations
        ASoC: hdac_hdmi: align function arguments
        ASoC: hdmi-codec: remove useless initialization
        ASoC: hdmi-codec: remove unused spk_mask member
        ASoC: max98090: remove useless assignment
        ASoC: mt6358: remove useless initializations
        ASoC: mt6359: remove useless assignment
        ASoC: nau8825: remove useless assignment
        ASoC: pcm1681: remove useless assignment
        ASoC: sigmadsp: align function prototype
        ASoC: sti-sas: remove unused struct members
        ASoC: tas2562: remove useless assignment
        ASoC: tas2562: remove warning on return value
        ASoC: tas2770: remove useless initialization
        ASoC: tlv320dac33: clarify expression
        ASoC: tscs454: remove useless test on PLL disable
      
       sound/soc/codecs/ab8500-codec.c  |  7 -------
       sound/soc/codecs/ad1836.c        |  2 --
       sound/soc/codecs/adau1977.c      |  2 --
       sound/soc/codecs/cros_ec_codec.c |  2 +-
       sound/soc/codecs/cx2072x.c       | 11 ++++-------
       sound/soc/codecs/da7219-aad.c    |  2 +-
       sound/soc/codecs/hdac_hdmi.c     | 14 +++++++-------
       sound/soc/codecs/hdac_hdmi.h     |  2 +-
       sound/soc/codecs/hdmi-codec.c    |  3 +--
       sound/soc/codecs/max98090.c      |  2 +-
       sound/soc/codecs/mt6358.c        |  4 ++--
       sound/soc/codecs/mt6359.c        |  4 ++--
       sound/soc/codecs/nau8825.c       |  2 +-
       sound/soc/codecs/pcm1681.c       |  2 +-
       sound/soc/codecs/sigmadsp.h      |  2 +-
       sound/soc/codecs/sti-sas.c       |  3 ---
       sound/soc/codecs/tas2562.c       |  3 +--
       sound/soc/codecs/tas2770.c       |  2 +-
       sound/soc/codecs/tlv320dac33.c   |  2 +-
       sound/soc/codecs/tscs454.c       |  7 ++++++-
       20 files changed, 32 insertions(+), 46 deletions(-)
      
      --
      2.25.1
      bb9faecc
    • Mark Brown's avatar
      Merge series "Fix reset controls and RPM of NVIDIA Tegra ASoC drivers" from... · cdd23ae6
      Mark Brown authored
      Merge series "Fix reset controls and RPM of NVIDIA Tegra ASoC drivers" from Dmitry Osipenko <digetx@gmail.com>:
      
      Hi,
      
      This series adds missing hardware reset controls to I2S and AC97 drivers,
      corrects runtime PM usage and drivers probe/remove order. Currently drivers
      happen to work properly because reset is implicitly deasserted by tegra-clk
      driver, but clk driver shouldn't touch the resets and we need to fix it
      because this breaks other Tegra drivers. Previously we fixed the resets of
      the AHUB and HDMI codec drivers, but turned out that we missed the I2C and
      AC97 drivers.
      
      Thanks to Paul Fertser for testing the pending clk patches and finding
      that audio got broken on Tegra20 AC100 netbook because of the missing I2S
      reset.
      
      Changelog:
      
      v5: - After taking another look at the drivers I noticed couple more
            things that could be improved. These new patches correct runtime PM
            and probe/remove order of the drivers:
      
              ASoC: tegra20: spdif: Correct driver removal order
              ASoC: tegra20: spdif: Remove handing of disabled runtime PM
              ASoC: tegra20: i2s: Add system level suspend-resume callbacks
              ASoC: tegra20: i2s: Correct driver removal order
              ASoC: tegra20: i2s: Use devm_clk_get()
              ASoC: tegra20: i2s: Remove handing of disabled runtime PM
              ASoC: tegra30: i2s: Correct driver removal order
              ASoC: tegra30: i2s: Use devm_clk_get()
              ASoC: tegra30: i2s: Remove handing of disabled runtime PM
              ASoC: tegra30: ahub: Reset global variable
              ASoC: tegra30: ahub: Correct suspend-resume callbacks
              ASoC: tegra30: ahub: Remove handing of disabled runtime PM
      
      v4: - Added missing prototype for reset_control_bulk_put().
      
      v3: - Fixed reset stubs for !CONFIG_RESET_CONTROLLER.
      
      v2: - After some more testing I found that I2S control logic doesn't require
            I2S clock to be enabled for resetting. Hence it's fine to have I2S to
            be reset by parent AHUB driver, so I dropped "tegra30: i2s: Add reset
            control" patch.
      
          - While I was double-checking resets on Tegra30, I found that that
            Tegra30 I2S driver has a broken runtime PM which doesn't restore
            hardware state on resume and it's lost after AHUB RPM-resume.
            Thus, added this new patch "tegra30: i2s: Restore hardware state
            on runtime PM resume".
      
          - Added new patches which switch AHUB driver to use reset-bulk API.
            I took the RFC patch from Philipp Zabel, fixed it and added
            devm_reset_control_bulk_optional_get_exclusive_released() that
            will be useful for further Tegra GPU patches. This is a minor
            improvement which makes code cleaner.
      
      Dmitry Osipenko (16):
        ASoC: tegra20: ac97: Add reset control
        ASoC: tegra20: i2s: Add reset control
        ASoC: tegra30: i2s: Restore hardware state on runtime PM resume
        ASoC: tegra30: ahub: Switch to use reset-bulk API
        ASoC: tegra20: spdif: Correct driver removal order
        ASoC: tegra20: spdif: Remove handing of disabled runtime PM
        ASoC: tegra20: i2s: Add system level suspend-resume callbacks
        ASoC: tegra20: i2s: Correct driver removal order
        ASoC: tegra20: i2s: Use devm_clk_get()
        ASoC: tegra20: i2s: Remove handing of disabled runtime PM
        ASoC: tegra30: i2s: Correct driver removal order
        ASoC: tegra30: i2s: Use devm_clk_get()
        ASoC: tegra30: i2s: Remove handing of disabled runtime PM
        ASoC: tegra30: ahub: Reset global variable
        ASoC: tegra30: ahub: Correct suspend-resume callbacks
        ASoC: tegra30: ahub: Remove handing of disabled runtime PM
      
      Philipp Zabel (1):
        reset: Add reset_control_bulk API
      
       drivers/reset/core.c            | 215 ++++++++++++++++++++++
       include/linux/reset.h           | 315 ++++++++++++++++++++++++++++++++
       sound/soc/tegra/tegra20_ac97.c  |  21 +++
       sound/soc/tegra/tegra20_ac97.h  |   1 +
       sound/soc/tegra/tegra20_i2s.c   |  60 +++---
       sound/soc/tegra/tegra20_i2s.h   |   1 +
       sound/soc/tegra/tegra20_spdif.c |  16 +-
       sound/soc/tegra/tegra30_ahub.c  | 168 ++++++-----------
       sound/soc/tegra/tegra30_ahub.h  |   5 +-
       sound/soc/tegra/tegra30_i2s.c   |  65 ++-----
       10 files changed, 667 insertions(+), 200 deletions(-)
      
      --
      2.30.2
      
      base-commit: a38fd874
      cdd23ae6