From patchwork Thu Feb 6 18:14:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Wanner X-Patchwork-Id: 13963505 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 BD3DA1DE3B7; Thu, 6 Feb 2025 18:16:01 +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=1738865763; cv=none; b=R1b03vVJO76wRr4bcrHF73hEWdpBr11OWslPA0bpiz2D8EfUCiGowOry2970x+zKPemaToR/+cKq72rgXNbiKpxgTb1wYwH+ajheWEkBTjiwsaquZ5R1O4HS67GmhWHG11I5W9W91lAfNu7NcIsVdt2I6icGsHfR0n2bp2bfV/4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738865763; c=relaxed/simple; bh=yCFJftUv86WtkE4uyLlKLyOkOvHlcj4KPW0x3S20NJM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bkGFDOi8SCUB7HB8XR8u99OHFQE8KGlvUTPSM29M++3mXzZx+W7xQzF80fTzZv5VXH+JpKVCiEFGzNfgpDPXh19TPBpAFTk3Y/AStncjia/QyT0l63b4OXTui7zVwDMgUrCNrKJs64kQ0D671qvfI+MtXsaXXR1d8/lSfoXc+cc= 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=uuxfR3hm; 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="uuxfR3hm" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1738865761; x=1770401761; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yCFJftUv86WtkE4uyLlKLyOkOvHlcj4KPW0x3S20NJM=; b=uuxfR3hmiXU2WFAeSu6ki7xY8luMQ4KcUyDkWP0DaO8MMpCsse7+BWwO FJfD7JTf6hnygqpZj7sMx5LbK1/d5hvZemLkQ6ffi8/tZiLeur6hnbn0i yNVf77UxmSYSF1bot/fMvAAhxIRAUz6CpTRH3bW0ldu/Hn+48tkSM1XGv 0GALSQENE8qI74aR+PFjzdXdDadsYMiNBeZ9ZcI2HKqcrQejWoSTx4Fg5 U/rc8zUxqbR9sqohyiJFmgdYu/hcRWZ41q5+FJOa5GXeN0nelLyax/uMc CzcjSGkWxEr5JO9H3VVpwM/09tPXRCFC9U2Q9a4FBaen0rNsId9K8lsR/ Q==; X-CSE-ConnectionGUID: RUzZ0s40Rb2+hOFS2V1Qww== X-CSE-MsgGUID: DJEdfPs8T2CjM4g4xhJSWw== X-IronPort-AV: E=Sophos;i="6.13,264,1732604400"; d="scan'208";a="36973013" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 06 Feb 2025 11:15:52 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 6 Feb 2025 11:15:32 -0700 Received: from ryan-Precision-3630-Tower.microchip.com (10.10.85.11) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Thu, 6 Feb 2025 11:15:32 -0700 From: To: , , , , CC: , , , , Ryan Wanner Subject: [PATCH 1/2] clk: at91: sckc: Fix parent_data struct for slow osc Date: Thu, 6 Feb 2025 11:14:42 -0700 Message-ID: <309b2a3db855c2cfb89193d3e07ea6f692df29ea.1738864727.git.Ryan.Wanner@microchip.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ryan Wanner The slow xtal is not described correctly as a parent, the driver looks for a "slow_xtal" string which is incorrect and will not work with the new formating of xtals. To avoid this and keep this driver backwards compatible the parent_data.fw_name is replaced with parent_data.name and the original parent_data.name is replaced with parent_data.index. Using the index is safe due to the driver requiring only 1 xtal. Fixes: 8aa1db9ccee0e ("clk: at91: sckc: switch to parent_data/parent_hw") Signed-off-by: Ryan Wanner --- drivers/clk/at91/sckc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/clk/at91/sckc.c b/drivers/clk/at91/sckc.c index 021d1b412af4c..952a805b6f7e1 100644 --- a/drivers/clk/at91/sckc.c +++ b/drivers/clk/at91/sckc.c @@ -374,7 +374,7 @@ static void __init at91sam9x5_sckc_register(struct device_node *np, const char *xtal_name; struct clk_hw *slow_rc, *slow_osc, *slowck; static struct clk_parent_data parent_data = { - .name = "slow_xtal", + .index = 0, }; const struct clk_hw *parent_hws[2]; bool bypass; @@ -407,7 +407,7 @@ static void __init at91sam9x5_sckc_register(struct device_node *np, if (!xtal_name) goto unregister_slow_rc; - parent_data.fw_name = xtal_name; + parent_data.name = xtal_name; slow_osc = at91_clk_register_slow_osc(regbase, "slow_osc", &parent_data, 1200000, bypass, bits); @@ -476,7 +476,7 @@ static void __init of_sam9x60_sckc_setup(struct device_node *np) const char *xtal_name; const struct clk_hw *parent_hws[2]; static struct clk_parent_data parent_data = { - .name = "slow_xtal", + .index = 0, }; bool bypass; int ret; @@ -494,7 +494,7 @@ static void __init of_sam9x60_sckc_setup(struct device_node *np) if (!xtal_name) goto unregister_slow_rc; - parent_data.fw_name = xtal_name; + parent_data.name = xtal_name; bypass = of_property_read_bool(np, "atmel,osc-bypass"); slow_osc = at91_clk_register_slow_osc(regbase, "slow_osc", &parent_data, 5000000, bypass, @@ -592,7 +592,7 @@ static void __init of_sama5d4_sckc_setup(struct device_node *np) const char *xtal_name; const struct clk_hw *parent_hws[2]; static struct clk_parent_data parent_data = { - .name = "slow_xtal", + .index = 0, }; int ret; @@ -609,7 +609,7 @@ static void __init of_sama5d4_sckc_setup(struct device_node *np) xtal_name = of_clk_get_parent_name(np, 0); if (!xtal_name) goto unregister_slow_rc; - parent_data.fw_name = xtal_name; + parent_data.name = xtal_name; osc = kzalloc(sizeof(*osc), GFP_KERNEL); if (!osc) From patchwork Thu Feb 6 18:14:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Wanner X-Patchwork-Id: 13963506 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 709931DDC15; Thu, 6 Feb 2025 18:16:02 +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=1738865764; cv=none; b=oCBqZJJnK+w04ehQ51plaOVEDD/bIskMykK5UP5O4UR7VbjIfk/iHUcHoJJ0Hc3YzXtvuiHAe9vTbVliXj/CurMexa90az8+9Iep8wPC4KFBEmF4jvADO6dodfK2sA/iWYea+Q2q0/UxJxwbfRVp1tuN8mLeQhMU/6tXwWtT1o8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738865764; c=relaxed/simple; bh=Jos/hi+/8kc69r3zVe5hi6bwnwOoBz55vx9UJaURjZI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YK7jdmQm8w+PES4KtOCrsTToNLSAPcsfJR8eYrB0kWlcwQSlsqsVrjX3LFA3Qmca77udMXdG7ugFYU9tx73p52qvDlkLIfIGFRZ7PDkyQUqMgbvhBtnKfdH25q3I7q3VrriJ7/GA/8uOk1SOL3ql4eQkyq6VrBiY6fPSV+O+ey4= 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=UeawXaFe; 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="UeawXaFe" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1738865762; x=1770401762; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Jos/hi+/8kc69r3zVe5hi6bwnwOoBz55vx9UJaURjZI=; b=UeawXaFeccZH2i1OYVJE7t/TQiQJBxuv9SQRjKz3GWJBCZfwjT/ytsR9 0Pi8L/tUoY8dKeHhNQmdqoTGP8W4N0fOQbbftqSwjJw/mUOev/bHmLxBf WZ5+1KBfQNNyjVx+r1mt8+QrFKGuLx2xS6OC1ZfsEkdQT7hIG9nxlyV3l 8l0glpA46wLrKw+AvusjlbQy6uAA6h/6AI8ZNYRkxc7AnD5gBl37wtNrg IWIDuDDXw2SVHgx+z+Ch6Kg0+5VgNa3seXz6S1sbKRorY/1bNE6NQDXd2 2B2c45acYTJyU39/F2TUiD0PrhzbqJebabCbAR96jEUhKCW4JdzCTaZnx g==; X-CSE-ConnectionGUID: RUzZ0s40Rb2+hOFS2V1Qww== X-CSE-MsgGUID: tdrkNp/4Rsed0wn4y4s5rQ== X-IronPort-AV: E=Sophos;i="6.13,264,1732604400"; d="scan'208";a="36973015" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 06 Feb 2025 11:15:53 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 6 Feb 2025 11:15:32 -0700 Received: from ryan-Precision-3630-Tower.microchip.com (10.10.85.11) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Thu, 6 Feb 2025 11:15:32 -0700 From: To: , , , , CC: , , , , Ryan Wanner Subject: [PATCH 2/2] clk: at91: sama7d65: Add missing clk_hw to parent_data Date: Thu, 6 Feb 2025 11:14:43 -0700 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ryan Wanner The main_xtal clk_hw struct is not passed into parent_data.hw causing an issue with main_osc parent. Passing the main_xtal struct into the parent_data struct will ensure the correct parent structure. Signed-off-by: Ryan Wanner --- drivers/clk/at91/sama7d65.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/at91/sama7d65.c b/drivers/clk/at91/sama7d65.c index a5d40df8b2f27..08306261c9c7e 100644 --- a/drivers/clk/at91/sama7d65.c +++ b/drivers/clk/at91/sama7d65.c @@ -1138,6 +1138,7 @@ static void __init sama7d65_pmc_setup(struct device_node *np) parent_data.name = main_xtal_name; parent_data.fw_name = main_xtal_name; + parent_data.hw = main_xtal_hw; main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", NULL, &parent_data, bypass); if (IS_ERR(main_osc_hw))