From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A110B38237E for ; Mon, 13 Apr 2026 10:07:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776074849; cv=none; b=L+yTNdoecpo3J1ntMUDO3wGb1CihkNHabfy+Sd8ayltWhHprzHvEv4uYwFkY7XXHalfiyUfgyij1rQXjcK7sSQAjhqRnYOkqlxnMLHpIoNt8oF7Eqx3eBOpORTG9Wj5Kyjji5TJjJ+jWYm3sQSmwMmrvV3lENzaENt5XAPo03O0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776074849; c=relaxed/simple; bh=Tp7bU0NE3+YX8R0YS0oLWp9a65H5IctfRXy2H2MEw8w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AcHMgoIYh2I7LocMweJVa5cM4Z55/ISL4Em/2L4lZVlncJMrS8IPVdthmY1F/8uD5aAPtzvQ7K9bF0H7GuZI19887VgaOb2a1xJWSqae0OS8kl8D/J+g6gsuFxxKUg3MBIIE2QKvKpZp07XuVN+/meapPetwVkuZBI/fxH0BM2c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=h4Ol3YWw; arc=none smtp.client-ip=209.85.210.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="h4Ol3YWw" Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-82cd70febc7so2824373b3a.2 for ; Mon, 13 Apr 2026 03:07:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776074848; x=1776679648; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BKAxSP/4ix5smOiePDg7BRwPz1GOM3xb3FVW1Uy+aNY=; b=h4Ol3YWwLPMAljplto6B4F3jkTn7zWRREKm8ad0BSpHL4tpR6PZB/qXPNCfymzjgtP phAzHx16B28N76lHr0B2j2BWP6IieXzQqlEeSVDbR88qyrAwEkeoMsXsTRt50h0aZmQO N8qTpq4gjzD0UHQPlQ4v4+aXmVNDNHNW/lzBf8fPDE4quaediO0kfo1SKBQnAkjX8nRk wtEJr6Psm88GiQt/r3Tka601hnp/iax48zgd1J/vnC5u93ueRCut0ncy0kbvyW5FCTR5 5YpR7hz2Tf3HVDDuHaOZEGQM00mDPVWfQwNg+tp327knrXekwJY6JNU7XwYeuPOQdX3v ZdYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776074848; x=1776679648; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=BKAxSP/4ix5smOiePDg7BRwPz1GOM3xb3FVW1Uy+aNY=; b=WriKvQ4eXPqp2Y1/KJq18fP2Ikdjk80cji3g72H0YgpUbFZuSRFZcssqePVZDKYxxB +Ve2hj8nOk9xkUpTZ7y1CJbSyV2WFWzpxcyeSYMw/UyFmTzxat7Wws46w6ncDPfwHbLw wkVrsJZxVK9syU/h6lqB2cy7JZva9F29bcDXU0HBuQrgQGp2c/3BGFWD0IOsEz2/jYtN 0DMyB+mzI0HDpLkOnoa13ekLNIoSwL3T49R3pmAqhio8TBeXHPCKRdO5CqOAHf5rid74 9DOc++cRUvcOYfcdCXpguYHED3x2Q/AjWMG54XcQzPnY+gADvNs+hkDE3i4YcbPhwz76 2ZvA== X-Forwarded-Encrypted: i=1; AFNElJ9ynHqKFaOAqQuUblrqR5wF6gZorFCmXWjkoLXx8ZrLyBVVmNRw5Y2YhzQtkbuBsLKjzYu0jPscIU57EhM=@vger.kernel.org X-Gm-Message-State: AOJu0YyWLRuy9jjMdJmAHnDn4xONgNT3kEFvp01Ig0GmJj5crgDN0id3 zmbzbyDn3cnGd1BUjxWWrZq59vBdb7s+CxdtuMH/YL7JV9wEipI88CTx X-Gm-Gg: AeBDieu882NOdL+FRgSUw50EH2IWnKcJthkboo4lSjP7zKh+el3i5bMd2aZVw41ePwf +Ff8+reO7PVW1OMJMlnQ3XOb3FyD4HIPMf/yVT5LVTTPvZSB+n/FYm8qRSKVnyjdP0TvjfYG0qq 778e4b/fT8aDTJGtZTWhfHr+yINGLZj/mLZGNy58l1PxgQZkbTM+Q6v+ZOd8EeKLlZTi7WtSGvh 5+/qhEPgSY0WGS95/BcS/0n0LrV+dnEJK9UFqxkaMvIQNAqpefVhqsE1EpiDj1mhcyxfDubEg/z ZcTv9b9p3plM5BjJ3YBMn/ftQQnNhscvL7ZNHmiS2DbIi0Aa4RRE5MiTWD0MHo5gQ+G44CYqBWj ok0zhskvvbd0tl87h+H3B2VqLJFCAa3ATKfn0JxAO/HlU/yxXf04gwzKNlqneNzNadopM+wD+Id NQ7G2qfLzXsHv8tUfAZb4pWMOdSpCoFAGOTrzwRKYP+eALRPM718TX7Z4gPQ== X-Received: by 2002:a05:6a00:4218:b0:824:374a:1407 with SMTP id d2e1a72fcca58-82f0c210956mr12547467b3a.16.1776074848063; Mon, 13 Apr 2026 03:07:28 -0700 (PDT) Received: from phuc-desktop.. ([183.91.15.56]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82f0c50a8f7sm10232140b3a.56.2026.04.13.03.07.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Apr 2026 03:07:27 -0700 (PDT) From: phucduc.bui@gmail.com To: kuninori.morimoto.gx@renesas.com, broonie@kernel.org Cc: lgirdwood@gmail.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, geert+renesas@glider.be, magnus.damm@gmail.com, perex@perex.cz, tiwai@suse.com, linux-sound@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, bui duc phuc Subject: [PATCH v2 1/6] ASoC: renesas: fsi: Add shared SPU clock support Date: Mon, 13 Apr 2026 17:06:55 +0700 Message-ID: <20260413100700.30995-2-phucduc.bui@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260413100700.30995-1-phucduc.bui@gmail.com> References: <20260413100700.30995-1-phucduc.bui@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: bui duc phuc Add SPU clock pointer, reference counter, and locking in fsi_master for shared FSIA/FSIB usage, and initialize them in fsi_probe(). Signed-off-by: bui duc phuc --- Changes in v2: - Add spu_count to track active users of the SPU clock. - Add clk_lock mutex to prevent race conditions during SPU clock enable/disable operations. - Initialize spu_count and clk_lock during driver probe. sound/soc/renesas/fsi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sound/soc/renesas/fsi.c b/sound/soc/renesas/fsi.c index 1491c2f2cc96..196ec7bac33d 100644 --- a/sound/soc/renesas/fsi.c +++ b/sound/soc/renesas/fsi.c @@ -292,8 +292,11 @@ struct fsi_master { void __iomem *base; struct fsi_priv fsia; struct fsi_priv fsib; + struct clk *clk_spu; const struct fsi_core *core; + int spu_count; spinlock_t lock; + struct mutex clk_lock; }; static inline int fsi_stream_is_play(struct fsi_priv *fsi, @@ -1961,7 +1964,9 @@ static int fsi_probe(struct platform_device *pdev) /* master setting */ master->core = core; + master->spu_count = 0; spin_lock_init(&master->lock); + mutex_init(&master->clk_lock); /* FSI A setting */ fsi = &master->fsia; -- 2.43.0