mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: perex@perex.cz, alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org, lgirdwood@gmail.com,
	devicetree@vger.kernel.org, robh+dt@kernel.org
Subject: Re: [PATCH 2/7] ASoC: codec: lpass-rx-macro: add support for lpass rx macro
Date: Thu, 28 Jan 2021 16:07:18 +0000	[thread overview]
Message-ID: <20210128160718.GE4537@sirena.org.uk> (raw)
In-Reply-To: <20210128141929.26573-3-srinivas.kandagatla@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 1720 bytes --]

On Thu, Jan 28, 2021 at 02:19:24PM +0000, Srinivas Kandagatla wrote:

>  snd-soc-lpass-wsa-macro-objs := lpass-wsa-macro.o
>  snd-soc-lpass-va-macro-objs := lpass-va-macro.o
> +snd-soc-lpass-rx-macro-objs := lpass-rx-macro.o

Please keep things sorted.

> @@ -0,0 +1,2020 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
> + */

Please make the entire comment a C++ one so things look more
intentional.

> +static const char *const rx_macro_ear_mode_text[] = {"OFF", "ON"};
> +static const struct soc_enum rx_macro_ear_mode_enum =
> +	SOC_ENUM_SINGLE_EXT(2, rx_macro_ear_mode_text);

On/off controls should be standard Switch controls.

> +		if (rx->rx_mclk_users == 0) {
> +			regcache_mark_dirty(regmap);
> +			regcache_sync(regmap);

I'd expect this to be joined up with whatever caused the register state
to become invalid, this looks like it's inviting bugs.  This also seems
to have only one caller...

> +	SOC_ENUM_EXT("RX_HPH HD2 Mode", rx_macro_hph_hd2_mode_enum,
> +		rx_macro_get_hph_hd2_mode, rx_macro_put_hph_hd2_mode),
> +
> +	SOC_ENUM_EXT("RX_HPH_PWR_MODE", rx_macro_hph_pwr_mode_enum,
> +		rx_macro_get_hph_pwr_mode, rx_macro_put_hph_pwr_mode),

The naming seems a bit random here.

> +static int rx_swrm_clock(struct rx_macro *rx, bool enable)
> +{

> +static int swclk_gate_enable(struct clk_hw *hw)
> +{
> +	return rx_swrm_clock(to_rx_macro(hw), true);
> +}
> +
> +static void swclk_gate_disable(struct clk_hw *hw)
> +{
> +	rx_swrm_clock(to_rx_macro(hw), false);
> +}

This all seems very redundant and like it'll get in the way of grepping
for users.  It would be better to just inline the operation into the clk
API functions.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2021-01-28 16:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-28 14:19 [PATCH 0/7] ASoC: codecs: add support for LPASS Codec TX and RX macros Srinivas Kandagatla
2021-01-28 14:19 ` [PATCH 1/7] ASoC: qcom: dt-bindings: add bindings for lpass rx macro codec Srinivas Kandagatla
2021-01-28 14:19 ` [PATCH 2/7] ASoC: codec: lpass-rx-macro: add support for lpass rx macro Srinivas Kandagatla
2021-01-28 16:07   ` Mark Brown [this message]
2021-01-28 14:19 ` [PATCH 3/7] ASoC: codec: lpass-rx-macro: add dapm widgets and route Srinivas Kandagatla
2021-01-28 14:19 ` [PATCH 4/7] ASoC: codec: lpass-rx-macro: add iir widgets Srinivas Kandagatla
2021-01-28 14:19 ` [PATCH 5/7] ASoC: qcom: dt-bindings: add bindings for lpass tx macro codec Srinivas Kandagatla
2021-01-28 14:19 ` [PATCH 6/7] ASoC: codec: lpass-tx-macro: add support for lpass tx macro Srinivas Kandagatla
2021-01-28 14:19 ` [PATCH 7/7] ASoC: codec: lpass-tx-macro: add dapm widgets and route Srinivas Kandagatla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210128160718.GE4537@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=robh+dt@kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®