From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B2DB2FD86F; Tue, 24 Jun 2025 15:09:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.154.123 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750777759; cv=none; b=dd4dQlOMDyNAOxP70Nagb3FpvbAZ5pdixJ4y2FPc7dIiu1kosXCNHAz6Rvd9cz4wKm3Ji1KFYGMJnN2U6Y7m82n4CmSQx/zed/EqXm3+68Pzofvhazw9tKpYTrKxb2DsZX94u3ipailbUPDsSA5uVc4Vv9QI6fOym5VnmvsLYAo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750777759; c=relaxed/simple; bh=Lq3ejPHh/1kZivQehV7HtGomJvKoYkbHzTKnAbhG0IQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LlqgnvO4fIFwz31qdvqG0nfSBLNVnTn2zpiBe4kHSPpKgm2IA1sc5dPaA2mvX+gCQ+XYSfJbGhy1shLnS457J1haCxn8sXFverQcjF5qKd6TQchnTGtT4b0FStGpJrH3Dc3LzvVF6jBQo82t0CJDa+t43N7BV+jlHj0xNwa9v2g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=x1IwGCBS; arc=none smtp.client-ip=68.232.154.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="x1IwGCBS" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1750777757; x=1782313757; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Lq3ejPHh/1kZivQehV7HtGomJvKoYkbHzTKnAbhG0IQ=; b=x1IwGCBS2w17Tst+5GcViTji2thcmFxPY7Nny85pjAtEE3puA+S3ImdI qMAPi1BnfumsvCfq70XN9jn7cKnSsdE4sPRa+GqTjRUkcp4NcE3Zrn0ar 8htLIitWm1CO8Xi2PVKyJ1Dn7V2JTIkpjJHonMvHA+528iL7gP8ohDtp4 9UI6tqAS48p8J0M+9wCJ+BPAsvDYV/jVMEXueXkyAlWjTg/QcDEn38zt4 zFHhDQP4w5/MWr0knN1NpJjpAhHRV3ElRoTL9VuLiHvlmlfNFcmhCfcZy vAZc5Kk+Dws+dW1Dj0DqtSN2okFp8obenEK04hTtmw6GjgR0hb+s9PYmW g==; X-CSE-ConnectionGUID: ticneE1VRpCt6c5L3blMOw== X-CSE-MsgGUID: mCaPvkNXRU+OPC+zyXMjlg== X-IronPort-AV: E=Sophos;i="6.16,262,1744095600"; d="scan'208";a="210641584" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 24 Jun 2025 08:09:15 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.44; Tue, 24 Jun 2025 08:08:38 -0700 Received: from ryan-Precision-3630-Tower.microchip.com (10.10.85.11) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.44 via Frontend Transport; Tue, 24 Jun 2025 08:08:38 -0700 From: To: , , , , CC: , , , , Subject: [PATCH v2 17/32] clk: at91: clk-smd: add support for clk_parent_data Date: Tue, 24 Jun 2025 08:08:14 -0700 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain From: Claudiu Beznea Add support for parent_hw in smd clock drivers. With this parent-child relation is described with pointers rather than strings making registration a bit faster. All the SoC based drivers that rely on clk-smd were adapted to the new API change. The switch itself for SoCs will be done in subsequent patches. Signed-off-by: Claudiu Beznea [ryan.wanner@microchip.com: Remove SoC specific changes as they are going to be coalesced into one SoC specific commit.] Signed-off-by: Ryan Wanner --- drivers/clk/at91/clk-smd.c | 10 +++++++--- drivers/clk/at91/dt-compat.c | 2 +- drivers/clk/at91/pmc.h | 3 ++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/clk/at91/clk-smd.c b/drivers/clk/at91/clk-smd.c index 09c649c8598e..d53dc32b36be 100644 --- a/drivers/clk/at91/clk-smd.c +++ b/drivers/clk/at91/clk-smd.c @@ -111,11 +111,12 @@ static const struct clk_ops at91sam9x5_smd_ops = { struct clk_hw * __init at91sam9x5_clk_register_smd(struct regmap *regmap, const char *name, - const char **parent_names, u8 num_parents) + const char **parent_names, struct clk_parent_data *parent_data, + u8 num_parents) { struct at91sam9x5_clk_smd *smd; struct clk_hw *hw; - struct clk_init_data init; + struct clk_init_data init = {}; int ret; smd = kzalloc(sizeof(*smd), GFP_KERNEL); @@ -124,7 +125,10 @@ at91sam9x5_clk_register_smd(struct regmap *regmap, const char *name, init.name = name; init.ops = &at91sam9x5_smd_ops; - init.parent_names = parent_names; + if (parent_data) + init.parent_data = (const struct clk_parent_data *)parent_data; + else + init.parent_names = parent_names; init.num_parents = num_parents; init.flags = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE; diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index 2b1aa834f111..5afd7c9f53fd 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -859,7 +859,7 @@ static void __init of_at91sam9x5_clk_smd_setup(struct device_node *np) if (IS_ERR(regmap)) return; - hw = at91sam9x5_clk_register_smd(regmap, name, parent_names, + hw = at91sam9x5_clk_register_smd(regmap, name, parent_names, NULL, num_parents); if (IS_ERR(hw)) return; diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h index a380054d580d..e5ab2fb3bc89 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -277,7 +277,8 @@ at91_clk_register_sam9260_slow(struct regmap *regmap, struct clk_hw * __init at91sam9x5_clk_register_smd(struct regmap *regmap, const char *name, - const char **parent_names, u8 num_parents); + const char **parent_names, struct clk_parent_data *parent_data, + u8 num_parents); struct clk_hw * __init at91_clk_register_system(struct regmap *regmap, const char *name, -- 2.43.0