From patchwork Thu Jul 27 05:31:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu X-Patchwork-Id: 13328758 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BFB90C001E0 for ; Thu, 27 Jul 2023 05:35:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hu7yWHGJ1C4CyaCJe4EpeNdMghT5nRJcV5KTrD1PhP0=; b=FMH8+q+yOoV6tK 0IcS2PgkxJaNTdR+/bhDq59dos9pbhAvIOeWd5XE7w8YpY2YBTlpIItztsW6jFxdIKbHvwAjpyV8G q7Bxltd6Rm4DtUAYslxVFRAAY3wEyWJ7oeSd0vbf7mQUEyssMZQW1tIBQ8MD3Fzwug3vHas1lTDLf GEw5nmqBb3CnSjSZNakRhErC58vjBJkwB/M9jLBz3gJoLW8yhFX/wv9EssnOvwY+F4mzzg3KDVhKJ 5BIAuyNKMdZu8ofrJydleIPMemI2B7dq6rhsNv39a/XpZLBSTw/bezaynKFmgfGvR+R/nn3ZbNPRb 7W/3Ck4glYpMha39m0Aw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOtep-00CChE-1z; Thu, 27 Jul 2023 05:35:27 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOteB-00CCPV-1C for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:34:49 +0000 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1b89d47ffb6so3419695ad.2 for ; Wed, 26 Jul 2023 22:34:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436087; x=1691040887; 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=o/6KrvhXqa5iLUixbjzuBMiv5UYsjXjQw1Ru7hJmwyo=; b=p7tqgkwFoLsNlG4MKl0lVbtVdD+bXOGOQxOh6qFvDVQ71iCs2xwdGom9AGn/uqw8l3 uo/Ts0xEX36uzQgg8NN28OubEeAM+X41hXn52DW/S/pNFHiIKFKDN1VolkzW0MkY8UHf TFVdbFpTVlsPy0vYRQ+qZcQHSONLtM3/qxZ94DiudPxmDxfeUPDw/fbOGW9Z1gavoavn E66e3X8MNL2EhipQO5qxbTepxclX8z1Monf/djmATYpDtnCVuYWiwdKfde7LrVuakRsR 4aNS2WZIqB+hUeYktFBs7F50JstPJzh+HGoH1R9nXSSj8+wd2MqNmN6XdKqG8PWv2tyI KVlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436087; x=1691040887; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o/6KrvhXqa5iLUixbjzuBMiv5UYsjXjQw1Ru7hJmwyo=; b=TRpXCgLv0bhw1/UiHHxypoywJ1ZN5zfzZer67g4Up0gRyRW4ZBm8It1g8e5Fth/S0I fJzz6VA++VoVrCPR62ZAjNSPKKZRA9spIV1Ch5sRxl9KQ5WgTH5Vpv4UYoF5wFJDovlT veI8xgAioH625JNDTD+FjKicBnIVyqn1Z+5UFbdQGf0p2tP7Tk/dhVsFtbxLakEVhjIe Vk51rh5RDaUMqdkTWic23FVC270T1vDAF2RzWJ/sB6fqGUuSE3fLMQmBFPqtfQb+hqDM MhQb3iMZ4M0l3yHwjYtNkQk3dPdmw2yphsW9TB1pP2YQ82iIT0x55NkwThpWj67tE8c3 SPnA== X-Gm-Message-State: ABy/qLZjXfJu8vijOUktVj8bsDQdEPN1fVvSym1R3It8INClgpWe3O+f 1Jo4p5QYD5Czmp+0H/Y63uBreQ== X-Google-Smtp-Source: APBJJlEVCaNJ7OenwzA/7lBAkzFCqELwzJ48BMLT8HbMb1NI9Bu9mnwabvkhELC4Ad8laFZ98RKiFw== X-Received: by 2002:a17:902:b60a:b0:1b6:80f0:d969 with SMTP id b10-20020a170902b60a00b001b680f0d969mr2928961pls.11.1690436086872; Wed, 26 Jul 2023 22:34:46 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.34.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:34:46 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 19/42] clk: at91: clk-slow: add support for parent_hw Date: Thu, 27 Jul 2023 08:31:33 +0300 Message-Id: <20230727053156.13587-20-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223447_411159_0C304AF1 X-CRM114-Status: GOOD ( 16.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support for parent_hw in slow 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-slow were adapted to the new API change. The switch itself for SoCs will be done in subsequent patches. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/at91sam9260.c | 2 +- drivers/clk/at91/clk-slow.c | 8 ++++++-- drivers/clk/at91/dt-compat.c | 2 +- drivers/clk/at91/pmc.h | 1 + 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/clk/at91/at91sam9260.c b/drivers/clk/at91/at91sam9260.c index f39deb3ec00a..55350331b07e 100644 --- a/drivers/clk/at91/at91sam9260.c +++ b/drivers/clk/at91/at91sam9260.c @@ -385,7 +385,7 @@ static void __init at91sam926x_pmc_setup(struct device_node *np, parent_names[0] = "slow_rc_osc"; parent_names[1] = "slow_xtal"; hw = at91_clk_register_sam9260_slow(regmap, "slck", - parent_names, 2); + parent_names, NULL, 2); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/clk-slow.c b/drivers/clk/at91/clk-slow.c index ac9f7a48b76e..bea66216ed82 100644 --- a/drivers/clk/at91/clk-slow.c +++ b/drivers/clk/at91/clk-slow.c @@ -39,11 +39,12 @@ struct clk_hw * __init at91_clk_register_sam9260_slow(struct regmap *regmap, const char *name, const char **parent_names, + struct clk_hw **parent_hws, int num_parents) { struct clk_sam9260_slow *slowck; struct clk_hw *hw; - struct clk_init_data init; + struct clk_init_data init = {}; int ret; if (!name) @@ -58,7 +59,10 @@ at91_clk_register_sam9260_slow(struct regmap *regmap, init.name = name; init.ops = &sam9260_slow_ops; - init.parent_names = parent_names; + if (parent_hws) + init.parent_hws = (const struct clk_hw **)&parent_hws; + else + init.parent_names = parent_names; init.num_parents = num_parents; init.flags = 0; diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index f464e125c9fd..dbc59ac44828 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -822,7 +822,7 @@ static void __init of_at91sam9260_clk_slow_setup(struct device_node *np) of_property_read_string(np, "clock-output-names", &name); - hw = at91_clk_register_sam9260_slow(regmap, name, parent_names, + hw = at91_clk_register_sam9260_slow(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 541d2ba2fea5..6816e350d6d6 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -244,6 +244,7 @@ struct clk_hw * __init at91_clk_register_sam9260_slow(struct regmap *regmap, const char *name, const char **parent_names, + struct clk_hw **parent_hws, int num_parents); struct clk_hw * __init