1. 03 Dec, 2020 2 commits
  2. 02 Dec, 2020 12 commits
  3. 30 Nov, 2020 11 commits
  4. 27 Nov, 2020 8 commits
  5. 26 Nov, 2020 7 commits
    • Mark Brown's avatar
      Merge series "ASoC: merge soc_compr_open() rollback and soc_compr_free()" from... · 6d9b4dbf
      Mark Brown authored
      Merge series "ASoC: merge soc_compr_open() rollback and soc_compr_free()" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
      
      Hi Mark
      
      soc_compr_open() does rollback when failed (A),
      but, it is almost same as soc_compr_free().
      
      	static int soc_compr_open(xxx)
      	{
      		...
      		if (ret < 0)
      			goto xxx_err;
      		...
      		return 0;
      
       ^	machine_err:
       |		...
       |	out:
      (A)		...
       |	pm_err:
       |		...
       v		return ret;
      	}
      
      This kind of duplicated code can be a hotbed of bugs,
      thus, this patch-set share soc_compr_free() and rollback.
      
      Kuninori Morimoto (5):
        ASoC: soc-compress: move soc_compr_free() next to soc_compr_open()
        ASoC: soc-dai: add mark for snd_soc_dai_compr_startup/shutdown()
        ASoC: soc-component: add mark for snd_soc_component_compr_open/free()
        ASoC: soc-component: add mark for snd_soc_link_compr_startup/shutdown()
        ASoC: soc-compress: add soc_compr_clean() and call it from soc_compr_open/free()
      
       include/sound/soc-component.h |   6 +-
       include/sound/soc-dai.h       |   4 +-
       include/sound/soc-link.h      |   3 +-
       include/sound/soc.h           |   1 +
       sound/soc/soc-component.c     |  17 +++--
       sound/soc/soc-compress.c      | 115 +++++++++++++++++-----------------
       sound/soc/soc-dai.c           |  13 +++-
       sound/soc/soc-link.c          |  11 +++-
       8 files changed, 95 insertions(+), 75 deletions(-)
      
      --
      2.25.1
      6d9b4dbf
    • Mark Brown's avatar
      Merge series "ASoC: fix !OF compile test warnings" from Krzysztof Kozlowski <krzk@kernel.org>: · 0858fc17
      Mark Brown authored
      Hi,
      
      Changes since v1:
      1. New patch 2/39: ASoC: bd28623: mark OF related data as maybe unused,
      2. Patches 1-13: add maybe_unused after discussions with Mark,
      3. Add Sylwester's review to two patches (one changed so please review
         one more time).
      
      Best regards,
      Krzysztof
      
      Krzysztof Kozlowski (39):
        ASoC: ak5558: mark OF related data as maybe unused
        ASoC: bd28623: mark OF related data as maybe unused
        ASoC: gtm601: mark OF related data as maybe unused
        ASoC: inno_rk3036: mark OF related data as maybe unused
        ASoC: rk3328: mark OF related data as maybe unused
        ASoC: tas571x: mark OF related data as maybe unused
        ASoC: kirkwood: armada-370-db: mark OF related data as maybe unused
        ASoC: meson: t9015: mark OF related data as maybe unused
        ASoC: qcom: mark OF related data as maybe unused
        ASoC: samsung: smdk_wm8994: mark OF related data as maybe unused
        ASoC: rockchip: mark OF related data as maybe unused
        ASoC: ti: davinci: mark OF related data as maybe unused
        ASoC: uniphier: mark OF related data as maybe unused
        ASoC: ak4118: skip of_device_id table when !CONFIG_OF
        ASoC: alc5623: skip of_device_id table when !CONFIG_OF
        ASoC: alc5632: skip of_device_id table when !CONFIG_OF
        ASoC: da7218: skip of_device_id table when !CONFIG_OF
        ASoC: da7219: skip of_device_id table when !CONFIG_OF
        ASoC: da9055: skip of_device_id table when !CONFIG_OF
        ASoC: es8316: skip of_device_id table when !CONFIG_OF
        ASoC: max98090: skip of_device_id table when !CONFIG_OF
        ASoC: max98095: skip of_device_id table when !CONFIG_OF
        ASoC: max98371: skip of_device_id table when !CONFIG_OF
        ASoC: max9867: skip of_device_id table when !CONFIG_OF
        ASoC: max98925: skip of_device_id table when !CONFIG_OF
        ASoC: max98926: skip of_device_id table when !CONFIG_OF
        ASoC: pcm1789: skip of_device_id table when !CONFIG_OF
        ASoC: pcm179x: skip of_device_id table when !CONFIG_OF
        ASoC: rt5660: skip of_device_id table when !CONFIG_OF
        ASoC: tas2562: skip of_device_id table when !CONFIG_OF
        ASoC: tlv320: skip of_device_id table when !CONFIG_OF
        ASoC: ts3a227e: skip of_device_id table when !CONFIG_OF
        ASoC: es7134: mark OF related data as maybe unused
        ASoC: es7241: mark OF related data as maybe unused
        ASoC: samsung: i2s: mark OF related data as maybe unused
        ASoC: max98371: drop driver pm=NULL assignment
        ASoC: max98925: drop driver pm=NULL assignment
        ASoC: max98926: drop driver pm=NULL assignment
        ASoC: samsung: smdk_wm8994: remove redundant of_match_ptr()
      
       sound/soc/codecs/ak4118.c           | 2 ++
       sound/soc/codecs/ak5558.c           | 2 +-
       sound/soc/codecs/alc5623.c          | 2 ++
       sound/soc/codecs/alc5632.c          | 2 ++
       sound/soc/codecs/bd28623.c          | 2 +-
       sound/soc/codecs/da7218.c           | 2 ++
       sound/soc/codecs/da7219.c           | 2 ++
       sound/soc/codecs/da9055.c           | 2 ++
       sound/soc/codecs/es7134.c           | 4 ++--
       sound/soc/codecs/es7241.c           | 2 +-
       sound/soc/codecs/es8316.c           | 2 ++
       sound/soc/codecs/gtm601.c           | 2 +-
       sound/soc/codecs/inno_rk3036.c      | 2 +-
       sound/soc/codecs/max98090.c         | 2 ++
       sound/soc/codecs/max98095.c         | 2 ++
       sound/soc/codecs/max98371.c         | 3 ++-
       sound/soc/codecs/max9867.c          | 2 ++
       sound/soc/codecs/max98925.c         | 3 ++-
       sound/soc/codecs/max98926.c         | 3 ++-
       sound/soc/codecs/pcm1789-i2c.c      | 2 ++
       sound/soc/codecs/pcm179x-i2c.c      | 2 ++
       sound/soc/codecs/rk3328_codec.c     | 2 +-
       sound/soc/codecs/rt5660.c           | 2 ++
       sound/soc/codecs/tas2562.c          | 2 ++
       sound/soc/codecs/tas571x.c          | 4 ++--
       sound/soc/codecs/tlv320adcx140.c    | 2 ++
       sound/soc/codecs/tlv320aic23-i2c.c  | 2 ++
       sound/soc/codecs/ts3a227e.c         | 2 ++
       sound/soc/kirkwood/armada-370-db.c  | 2 +-
       sound/soc/meson/t9015.c             | 2 +-
       sound/soc/qcom/apq8016_sbc.c        | 2 +-
       sound/soc/qcom/lpass-apq8016.c      | 2 +-
       sound/soc/qcom/lpass-ipq806x.c      | 2 +-
       sound/soc/qcom/lpass-sc7180.c       | 2 +-
       sound/soc/rockchip/rockchip_i2s.c   | 2 +-
       sound/soc/rockchip/rockchip_pdm.c   | 2 +-
       sound/soc/rockchip/rockchip_spdif.c | 2 +-
       sound/soc/samsung/i2s.c             | 8 ++++----
       sound/soc/samsung/smdk_wm8994.c     | 4 ++--
       sound/soc/ti/davinci-i2s.c          | 2 +-
       sound/soc/uniphier/aio-ld11.c       | 2 +-
       sound/soc/uniphier/aio-pxs2.c       | 2 +-
       sound/soc/uniphier/evea.c           | 2 +-
       43 files changed, 69 insertions(+), 32 deletions(-)
      
      --
      2.25.1
      0858fc17
    • Jack Yu's avatar
    • Pierre-Louis Bossart's avatar
      regmap/SoundWire: sdw: add support for SoundWire 1.2 MBQ · fb5103f9
      Pierre-Louis Bossart authored
      The SoundWire 1.1 specification only allowed for reads and writes of
      bytes. The SoundWire 1.2 specification adds a new capability to
      transfer "Multi-Byte Quantities" (MBQ) across the bus. The transfers
      still happens one-byte-at-a-time, but the update is atomic.
      
      For example when writing a 16-bit volume, the first byte transferred
      is only taken into account when the second byte is successfully
      transferred.
      
      The mechanism is symmetrical for read and writes:
      - On a read, the address of the last byte to be read is modified by
      setting the MBQ bit
      - On a write, the address of all but the last byte to be written are
      modified by setting the MBQ bit. The address for the last byte relies
      on the MBQ bit being cleared.
      
      The current definitions for MBQ-based controls in the SDCA draft
      standard are limited to 16 bits for volumes, so for now this is the
      only supported format. An update will be provided if and when support
      for 24-bit and 32-bit values is specified by the SDCA standard.
      
      One possible objection is that this code could have been handled with
      regmap-sdw.c. However this is a new spec addition not handled by every
      SoundWire 1.1 and non-SDCA device, so there's no reason to load code
      that will never be used.
      
      Also in practice it's extremely unlikely that CONFIG_REGMAP would not
      be selected with CONFIG_REGMAP_MBQ selected. However there's no
      functional dependency between the two modules so they can be selected
      separately.
      Reviewed-by: default avatarRander Wang <rander.wang@linux.intel.com>
      Reviewed-by: default avatarGuennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
      Reviewed-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
      Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Signed-off-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
      Reviewed-by: default avatarVinod Koul <vkoul@kernel.org>
      Link: https://lore.kernel.org/r/20201103172226.4278-3-yung-chuan.liao@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      fb5103f9
    • Pierre-Louis Bossart's avatar
      soundwire: SDCA: add helper macro to access controls · 07e21d4d
      Pierre-Louis Bossart authored
      The upcoming SDCA (SoundWire Device Class Audio) specification defines
      a hierarchical encoding to interface with Class-defined capabilities.
      
      The specification is not yet accessible to the general public but this
      information is released with explicit permission from the MIPI Board
      to avoid delays with SDCA support on Linux platforms.
      
      A block of 64 MBytes of register addresses are allocated to SDCA
      controls, starting at address 0x40000000. The 26 LSBs which identify
      individual controls are set based on the following variables:
      
      - Function Number. An SCDA device can be split in up to 8 independent
        Functions. Each of these Functions is described in the SDCA
        specification, e.g. Smart Amplifier, Smart Microphone, Simple
        Microphone, Jack codec, HID, etc.
      
      - Entity Number.  Within each Function,  an Entity is  an identifiable
        block.  Up   to  127  Entities   are  connected  in   a  pre-defined
        graph  (similar to  USB), with  Entity0 reserved  for Function-level
        configurations.  In  contrast  to  USB, the  SDCA  spec  pre-defines
        Function Types, topologies, and allowed  options, i.e. the degree of
        freedom  is not  unlimited to  limit  the possibility  of errors  in
        descriptors leading to software quirks.
      
      - Control Selector. Within each Entity, the SDCA specification defines
        48 controls such as Mute, Gain, AGC, etc, and 16 implementation
        defined ones. Some Control Selectors might be used for low-level
        platform setup, and other exposed to applications and users. Note
        that the same Control Selector capability, e.g. Latency control,
        might be located at different offsets in different entities, the
        Control Selector mapping is Entity-specific.
      
      - Control Number. Some Control Selectors allow channel-specific values
        to be set, with up to 64 channels allowed. This is mostly used for
        volume control.
      
      - Current/Next values. Some Control Selectors are
        'Dual-Ranked'. Software may either update the Current value directly
        for immediate effect. Alternatively, software may write into the
        'Next' values and update the SoundWire 1.2 'Commit Groups' register
        to copy 'Next' values into 'Current' ones in a synchronized
        manner. This is different from bank switching which is typically
        used to change the bus configuration only.
      
      - MBQ. the Multi-Byte Quantity bit is used to provide atomic updates
        when accessing more that one byte, for example a 16-bit volume
        control would be updated consistently, the intermediate values
        mixing old MSB with new LSB are not applied.
      
      These 6 parameters are used to build a 32-bit address to access the
      desired Controls. Because of address range, paging is required, but
      the most often used parameter values are placed in the lower 16 bits
      of the address. This helps to keep the paging registers constant while
      updating Controls for a specific Device/Function.
      Reviewed-by: default avatarRander Wang <rander.wang@linux.intel.com>
      Reviewed-by: default avatarGuennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
      Reviewed-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
      Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Signed-off-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
      Acked-By: default avatarVinod Koul <vkoul@kernel.org>
      Link: https://lore.kernel.org/r/20201103172226.4278-2-yung-chuan.liao@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      07e21d4d
    • Kuninori Morimoto's avatar
      ASoC: soc-compress: add soc_compr_clean() and call it from soc_compr_open/free() · 453d32c2
      Kuninori Morimoto authored
      soc_compr_open() does rollback when failed (A),
      but, it is almost same as soc_compr_free().
      
      	static int soc_compr_open(xxx)
      	{
      		...
      		if (ret < 0)
      			goto xxx_err;
      		...
      		return 0;
      
       ^	machine_err:
       |		...
       |	out:
      (A)		...
       |	pm_err:
       |		...
       v		return ret;
      	}
      
      The difference is
      soc_compr_free()  is for all dai/component/substream,
      rollback          is for succeeded part only.
      
      This kind of duplicated code can be a hotbed of bugs,
      thus, we want to share soc_compr_free() and rollback.
      
      Now, soc_compr_open/free() are handling
      	1) snd_soc_dai_compr_startup/shutdown()
      	2) snd_soc_component_compr_open/free()
      	3) snd_soc_link_compr_startup/shutdown()
      
      Now, 1) to 3) are handled.
      This patch adds new soc_compr_clean() and call it from
      soc_compr_open() as rollback, and from soc_compr_free_free() as
      normal close handler.
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/87ima25iwa.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      453d32c2
    • Kuninori Morimoto's avatar
      ASoC: soc-component: add mark for snd_soc_link_compr_startup/shutdown() · cd7c7d10
      Kuninori Morimoto authored
      soc_compr_open() does rollback when failed (A),
      but, it is almost same as soc_compr_free().
      
      	static int soc_compr_open(xxx)
      	{
      		...
      		if (ret < 0)
      			goto xxx_err;
      		...
      		return 0;
      
       ^	machine_err:
       |		...
       |	out:
      (A)		...
       |	pm_err:
       |		...
       v		return ret;
      	}
      
      The difference is
      soc_compr_free()  is for all dai/component/substream,
      rollback          is for succeeded part only.
      
      This kind of duplicated code can be a hotbed of bugs,
      thus, we want to share soc_compr_free() and rollback.
      	1) snd_soc_dai_compr_startup/shutdown()
      	2) snd_soc_component_compr_open/free()
      =>	3) snd_soc_link_compr_startup/shutdown()
      
      This patch is for 3) snd_soc_link_compr_startup/shutdown()
      and adds new cstream mark.
      It will mark cstream when startup() was suceeded.
      If rollback happen *after* that, it will check rollback flag
      and marked cstream.
      
      It cares *previous* startup() only now,
      but we might want to check *whole* marked cstream in the future.
      This patch is using macro so that it can be easily adjust to it.
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/87k0ui5iwf.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      cd7c7d10