All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: vkoul@kernel.org, yung-chuan.liao@linux.intel.com,
	pierre-louis.bossart@linux.dev, linux-sound@vger.kernel.org,
	patches@opensource.cirrus.com, mfd@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] mfd: cs42l43: Move to core detach helper
Date: Wed, 16 Sep 2026 16:21:48 +0100	[thread overview]
Message-ID: <20260916152148.GF1605367@google.com> (raw)
In-Reply-To: <20260831140157.1736905-3-ckeepax@opensource.cirrus.com>

On Mon, 31 Aug 2026, Charles Keepax wrote:

> Now the core has a helper to signal a device will detach from
> the SoundWire bus, there is no need for the cs42l43 driver code
> to separately track that. Switch to using the new core helper.
> 
> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
> ---
> 
> No changes since v1.
> 
>  drivers/mfd/cs42l43-sdw.c   |  2 --
>  drivers/mfd/cs42l43.c       | 15 +--------------
>  include/linux/mfd/cs42l43.h |  1 -
>  3 files changed, 1 insertion(+), 17 deletions(-)
> 
> diff --git a/drivers/mfd/cs42l43-sdw.c b/drivers/mfd/cs42l43-sdw.c
> index 0a6999453f325..f0825d6bf7b38 100644
> --- a/drivers/mfd/cs42l43-sdw.c
> +++ b/drivers/mfd/cs42l43-sdw.c
> @@ -102,8 +102,6 @@ static int cs42l43_sdw_update_status(struct sdw_slave *sdw, enum sdw_slave_statu
>  		break;
>  	case SDW_SLAVE_UNATTACHED:
>  		dev_dbg(cs42l43->dev, "Device detach\n");

Is this now superfluous?

> -
> -		complete(&cs42l43->device_detach);
>  		break;
>  	default:
>  		break;
> diff --git a/drivers/mfd/cs42l43.c b/drivers/mfd/cs42l43.c
> index 4212ebcca60b5..f08ee598366d9 100644
> --- a/drivers/mfd/cs42l43.c
> +++ b/drivers/mfd/cs42l43.c
> @@ -30,7 +30,6 @@
>  #define CS42L43_RESET_DELAY_MS			20
>  
>  #define CS42L43_SDW_ATTACH_TIMEOUT_MS		5000
> -#define CS42L43_SDW_DETACH_TIMEOUT_MS		100
>  
>  #define CS42L43_MCU_BOOT_STAGE1			1
>  #define CS42L43_MCU_BOOT_STAGE2			2
> @@ -555,7 +554,7 @@ static int cs42l43_soft_reset(struct cs42l43 *cs42l43)
>  		{ CS42L43_SFT_RESET, CS42L43_SFT_RESET_VAL },
>  	};
>  
> -	reinit_completion(&cs42l43->device_detach);
> +	sdw_slave_signal_unattach(cs42l43->sdw);

If this call NULL safe?

>  	/*
>  	 * Apply cache only because the soft reset will cause the device to
> @@ -566,17 +565,6 @@ static int cs42l43_soft_reset(struct cs42l43 *cs42l43)
>  
>  	msleep(CS42L43_RESET_DELAY_MS);
>  
> -	if (cs42l43->sdw) {
> -		unsigned long timeout = msecs_to_jiffies(CS42L43_SDW_DETACH_TIMEOUT_MS);
> -		unsigned long time;
> -
> -		time = wait_for_completion_timeout(&cs42l43->device_detach, timeout);
> -		if (!time) {
> -			dev_err(cs42l43->dev, "Timed out waiting for device detach\n");
> -			return -ETIMEDOUT;
> -		}
> -	}
> -
>  	return -EAGAIN;
>  }
>  
> @@ -1115,7 +1103,6 @@ int cs42l43_dev_probe(struct cs42l43 *cs42l43)
>  	dev_set_drvdata(cs42l43->dev, cs42l43);
>  
>  	mutex_init(&cs42l43->pll_lock);
> -	init_completion(&cs42l43->device_detach);
>  	init_completion(&cs42l43->firmware_download);
>  	INIT_WORK(&cs42l43->boot_work, cs42l43_boot_work);
>  
> diff --git a/include/linux/mfd/cs42l43.h b/include/linux/mfd/cs42l43.h
> index 8e993fb535e68..798dc55149662 100644
> --- a/include/linux/mfd/cs42l43.h
> +++ b/include/linux/mfd/cs42l43.h
> @@ -86,7 +86,6 @@ struct cs42l43 {
>  	struct regmap_irq_chip_data *irq_data;
>  
>  	struct work_struct boot_work;
> -	struct completion device_detach;
>  	struct completion firmware_download;
>  	int firmware_error;
>  
> -- 
> 2.47.3
> 

-- 
Lee Jones

  reply	other threads:[~2026-09-16 15:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 14:01 [PATCH v2 0/2] Add SoundWire detach helper Charles Keepax
2026-08-31 14:01 ` [PATCH v2 1/2] soundwire: Add a helper function to indicate a device will detach Charles Keepax
2026-10-03  7:56   ` Vinod Koul
2026-08-31 14:01 ` [PATCH v2 2/2] mfd: cs42l43: Move to core detach helper Charles Keepax
2026-09-16 15:21   ` Lee Jones [this message]
2026-09-16 16:01     ` Charles Keepax
2026-09-04  7:20 ` [PATCH v2 0/2] Add SoundWire " Pierre-Louis Bossart
2026-09-17 10:59 ` Lee Jones
2026-10-03  7:58   ` Vinod Koul

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=20260916152148.GF1605367@google.com \
    --to=lee@kernel.org \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=mfd@lists.linux.dev \
    --cc=patches@opensource.cirrus.com \
    --cc=pierre-louis.bossart@linux.dev \
    --cc=vkoul@kernel.org \
    --cc=yung-chuan.liao@linux.intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.