From patchwork Thu Jun 22 14:13:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacky Huang X-Patchwork-Id: 111683 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp5103343vqr; Thu, 22 Jun 2023 07:17:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5UdQamIfdZxDmx3d0X2ex6N2XVRzBMFJS8v4/lpT8zzpe/8GuJOw0WOjf0yfjlZ/Q4Pgls X-Received: by 2002:a17:902:cec6:b0:1b5:25f8:2154 with SMTP id d6-20020a170902cec600b001b525f82154mr13460814plg.67.1687443465845; Thu, 22 Jun 2023 07:17:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687443465; cv=none; d=google.com; s=arc-20160816; b=Q2i58jhzZbSEtvVxCDLbyBKc+2jjPItrhNuviwuSGcO9FVDxY/XKDTAUPo0BFiZFR9 JBQo+nN57eQjSmv8gHkawkZvcpnztadESQWNNpFgzfQNHCvtQXtV6w+jd/i4SWiV6MpX TQn3MzTFLDdonDjygYxiOmXAlNQElIbjVxwYPgseVy84dJpDC2/kb1+OpG10eJGxjHZD MdrxaZg0erz38C6qxX357tSdjd21PiguPMJwKWMLXLJZEh+ITebG2+s1B9hHoSnOGvTU a8ccJV40qjuPZ/oa5w9WXpyArJi72lvDeK0rwPwwcqsOm17hlpcZHcDdCmH+TNYdz5Hf QhZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uck4efyxSDISYaLtLdpY/TFsx4URlVDC4giZ3DrD9s0=; b=dDpXxiB8lCN8RpHawXTbXCGIYiDlxgC7h/3oMTFcDtj/RfCqjww/RzsoRrsA4q1u+I D5ia9+4e8SnC/Kwjcez0axI6KnHcGeGWJDdfygOsegNV7SH93yPkxxIkjJ6Skc1ymZnX MaYUGJ3Npk3L8AwDY7QHLCdNqyvEWk+FmroQlq+m8u+1J0LtGuQVTjn9AqzpQjL6XG6h dtu8ZPoMejiDfJq7kivz+aP65tn/vLNE1bjUHiWlkp3nifoSADJT3pWpL+mrxs4ICmZd rWtwBMpJp98TsPMBIhTmez+cTWH5/qTDbKc1LIptaY0Db8zv7r0C+v9aKeU2C9tRQ4gw ohFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=gKCrPDh8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u9-20020a170903124900b001a920be2722si6979929plh.610.2023.06.22.07.17.31; Thu, 22 Jun 2023 07:17:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=gKCrPDh8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231681AbjFVOOZ (ORCPT + 99 others); Thu, 22 Jun 2023 10:14:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231549AbjFVOOE (ORCPT ); Thu, 22 Jun 2023 10:14:04 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EF171BE2; Thu, 22 Jun 2023 07:13:52 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-66767d628e2so3097090b3a.2; Thu, 22 Jun 2023 07:13:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687443231; x=1690035231; 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=uck4efyxSDISYaLtLdpY/TFsx4URlVDC4giZ3DrD9s0=; b=gKCrPDh8tcKTl9WlIrPCoDRriKK/t2zA27OoQ47QjaPoueNs+BFilnZ4/V2TunI8hz xF8I2fyLOXBNckRcIM615JSSHb5txh8ycE1HFSRY+vm3s06+VrlKGl7cuKx1v5nmRVwl RNbeR+4KS+Rf/EGFkZXf45x3KP0Bkcfwrx/P74Kftd6EqDrma08EbqlVpQMrYDSyStKA aUeOkz+6CdTH64UMGyfYkj0Zai1QXbUNUAs2IKTilK8xyHvEHo9JYr12cmwgNKgwbgDr BCqZUh9k7G5dWg5k8/tJGrxWHjcbEwFoeCoBgb5m7PHinWmV2r5+ww9oG6ftJ8OPWoyb gGiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687443231; x=1690035231; 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=uck4efyxSDISYaLtLdpY/TFsx4URlVDC4giZ3DrD9s0=; b=fj9RuyAcjaCQKby9sgIeUrXwaesfc57ATTP5t4zk2TDiChv7Nl2rY4vTPA71eJJyDN siY9g/hujG9pqWgm6ZUiGLPlacTS33C2VLS6jE0C2XNBjrQBz6T3pkiviCeWDrspmzb6 wgomRQA1kAkorhHvxmBWMXWxNoQyvKBQIzAMeSujdZ+XqwMi9wgBPPjJVSJZgq82ODoM Sa1efEW20/Xh7MneEPl4T+qzc/8BwzcRaRO4T7ewqCPMRBG/rqQ9K8E1QeuVSjLzpUma gQBDfiA+e9p7G/TTT/v7K3AHtDBa3+gSZI0kxARyILPAv2d3XgiOYUBuuVFP41b0cEzV yvTg== X-Gm-Message-State: AC+VfDxr1EcJOOqwPmfcaJz4VtcvFrUfJOcdhMOueX2ScU/6U2x0T6wG +HBjjSYh8tgsC7UHBeWrxWE= X-Received: by 2002:a05:6a00:c8a:b0:66a:5260:36c3 with SMTP id a10-20020a056a000c8a00b0066a526036c3mr2530547pfv.17.1687443231390; Thu, 22 Jun 2023 07:13:51 -0700 (PDT) Received: from a28aa0606c51.. (60-250-192-107.hinet-ip.hinet.net. [60.250.192.107]) by smtp.gmail.com with ESMTPSA id i20-20020aa79094000000b0065a1b05193asm4604268pfa.185.2023.06.22.07.13.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jun 2023 07:13:51 -0700 (PDT) From: Jacky Huang To: mturquette@baylibre.com, sboyd@kernel.org, arnd@arndb.de, gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, soc@kernel.org, krzysztof.kozlowski+dt@linaro.org, schung@nuvoton.com, Jacky Huang Subject: [PATCH v3 1/3] clk: nuvoton: Add clk-ma35d1.h for driver extern functions Date: Thu, 22 Jun 2023 14:13:41 +0000 Message-Id: <20230622141343.13595-2-ychuang570808@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230622141343.13595-1-ychuang570808@gmail.com> References: <20230622141343.13595-1-ychuang570808@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769412719547860423?= X-GMAIL-MSGID: =?utf-8?q?1769412719547860423?= From: Jacky Huang Moved the declaration of extern functions ma35d1_reg_clk_pll() and ma35d1_reg_adc_clkdiv() from the .c files to the newly created header file clk-ma35d1.h. Signed-off-by: Jacky Huang --- drivers/clk/nuvoton/clk-ma35d1-divider.c | 7 ++----- drivers/clk/nuvoton/clk-ma35d1-pll.c | 5 ++--- drivers/clk/nuvoton/clk-ma35d1.c | 10 ++-------- drivers/clk/nuvoton/clk-ma35d1.h | 18 ++++++++++++++++++ 4 files changed, 24 insertions(+), 16 deletions(-) create mode 100644 drivers/clk/nuvoton/clk-ma35d1.h diff --git a/drivers/clk/nuvoton/clk-ma35d1-divider.c b/drivers/clk/nuvoton/clk-ma35d1-divider.c index 0c2bed47909a..bb8c23d2b895 100644 --- a/drivers/clk/nuvoton/clk-ma35d1-divider.c +++ b/drivers/clk/nuvoton/clk-ma35d1-divider.c @@ -9,6 +9,8 @@ #include #include +#include "clk-ma35d1.h" + struct ma35d1_adc_clk_div { struct clk_hw hw; void __iomem *reg; @@ -20,11 +22,6 @@ struct ma35d1_adc_clk_div { spinlock_t *lock; }; -struct clk_hw *ma35d1_reg_adc_clkdiv(struct device *dev, const char *name, - struct clk_hw *parent_hw, spinlock_t *lock, - unsigned long flags, void __iomem *reg, - u8 shift, u8 width, u32 mask_bit); - static inline struct ma35d1_adc_clk_div *to_ma35d1_adc_clk_div(struct clk_hw *_hw) { return container_of(_hw, struct ma35d1_adc_clk_div, hw); diff --git a/drivers/clk/nuvoton/clk-ma35d1-pll.c b/drivers/clk/nuvoton/clk-ma35d1-pll.c index e4c9f94e6796..ff3fb8b87c24 100644 --- a/drivers/clk/nuvoton/clk-ma35d1-pll.c +++ b/drivers/clk/nuvoton/clk-ma35d1-pll.c @@ -15,6 +15,8 @@ #include #include +#include "clk-ma35d1.h" + /* PLL frequency limits */ #define PLL_FREF_MAX_FREQ (200 * HZ_PER_MHZ) #define PLL_FREF_MIN_FREQ (1 * HZ_PER_MHZ) @@ -71,9 +73,6 @@ struct ma35d1_clk_pll { void __iomem *ctl2_base; }; -struct clk_hw *ma35d1_reg_clk_pll(struct device *dev, u32 id, u8 u8mode, const char *name, - struct clk_hw *parent_hw, void __iomem *base); - static inline struct ma35d1_clk_pll *to_ma35d1_clk_pll(struct clk_hw *_hw) { return container_of(_hw, struct ma35d1_clk_pll, hw); diff --git a/drivers/clk/nuvoton/clk-ma35d1.c b/drivers/clk/nuvoton/clk-ma35d1.c index 297b11585f00..8dfa762494fe 100644 --- a/drivers/clk/nuvoton/clk-ma35d1.c +++ b/drivers/clk/nuvoton/clk-ma35d1.c @@ -12,6 +12,8 @@ #include #include +#include "clk-ma35d1.h" + static DEFINE_SPINLOCK(ma35d1_lock); #define PLL_MAX_NUM 5 @@ -60,14 +62,6 @@ static DEFINE_SPINLOCK(ma35d1_lock); #define PLL_MODE_FRAC 1 #define PLL_MODE_SS 2 -struct clk_hw *ma35d1_reg_clk_pll(struct device *dev, u32 id, u8 u8mode, - const char *name, struct clk_hw *parent_hw, - void __iomem *base); -struct clk_hw *ma35d1_reg_adc_clkdiv(struct device *dev, const char *name, - struct clk_hw *hw, spinlock_t *lock, - unsigned long flags, void __iomem *reg, - u8 shift, u8 width, u32 mask_bit); - static const struct clk_parent_data ca35clk_sel_clks[] = { { .index = 0 }, /* HXT */ { .index = 1 }, /* CAPLL */ diff --git a/drivers/clk/nuvoton/clk-ma35d1.h b/drivers/clk/nuvoton/clk-ma35d1.h new file mode 100644 index 000000000000..3adee440f60a --- /dev/null +++ b/drivers/clk/nuvoton/clk-ma35d1.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (C) 2023 Nuvoton Technology Corp. + * Author: Chi-Fang Li + */ + +#ifndef __DRV_CLK_NUVOTON_MA35D1_H +#define __DRV_CLK_NUVOTON_MA35D1_H + +struct clk_hw *ma35d1_reg_clk_pll(struct device *dev, u32 id, u8 u8mode, const char *name, + struct clk_hw *parent_hw, void __iomem *base); + +struct clk_hw *ma35d1_reg_adc_clkdiv(struct device *dev, const char *name, + struct clk_hw *parent_hw, spinlock_t *lock, + unsigned long flags, void __iomem *reg, + u8 shift, u8 width, u32 mask_bit); + +#endif /* __DRV_CLK_NUVOTON_MA35D1_H */ From patchwork Thu Jun 22 14:13:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacky Huang X-Patchwork-Id: 111682 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp5103270vqr; Thu, 22 Jun 2023 07:17:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Fry4uJt0CXgOg35lHVmJtVewud+juvnux78tP0XNDOMeBMoXemNV/HSXPiNplDTBS9gdL X-Received: by 2002:a05:6a00:d89:b0:668:71d5:a764 with SMTP id bf9-20020a056a000d8900b0066871d5a764mr14697864pfb.9.1687443459959; Thu, 22 Jun 2023 07:17:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687443459; cv=none; d=google.com; s=arc-20160816; b=FFJPQWYoPerbnUtAqR3NvHQ6RfWU00bN/pkPD/xdGHmNR7ke0VZLKleALD9+rAQ+PT 40bfbq8oJs0xGppyrXZ8eoJsqnODnuqlDQGvjD5rFXuvn1qLDzASJND6PQrmWuGlD6cc Lf1+IajUWf45cRqDOhn/d3XZtrp1MFegh8B39pWmcNszIeYn3maQhmPNNVygyc6xrP7+ Jnf4IXt4HzbOwTn86exUlNGfbIepE+H+1eWUq7ldaXTajVrtDQQsPnTqCLLw6xThXUNP O9sW/9DRlEQROhr5XBHJ0eEy/pDDDpsKmJg2K78vwuRdXLpuH1B+hp0k/lQtxk7w+zli ncMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ozzSuaR+vnDFbS3Ue8g2TvzzMcrPMRjUdhLQZS2AMB4=; b=tCMCeQzE2g+YEH57tRSiDjM1t/G5w2kJKHH6KbwEyJrKSwB70eLBNdf4JHs6PYG340 0ATUlv8WU83s3b5bTpbsulUb/XNukDtsoYOFzk00QlWVooJUriEvsKZ07zNDR4h53xP6 O+aYK6w6dNr3Nu0/JfJ3XDB0Ll0RAVEzJ6krHIcsQ/2zPR+grMg19hgQiiBNePyDX7Go kx9HBByMo1f7pvC6fWsNj31+VyBPnaubN8vZNjXgbPe5K3k/tyK1Si7Ijdn4vG/A4HcE oP9nlI9Wo7DLaVaRB3Gvhv9CEaga0SxYkpYON8TphElQzZdIK3VA6vifwkbCK2m+Ngbj fl7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=rhN8Dy22; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k4-20020aa79984000000b00660b5630927si6548054pfh.133.2023.06.22.07.17.26; Thu, 22 Jun 2023 07:17:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=rhN8Dy22; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231586AbjFVOOV (ORCPT + 99 others); Thu, 22 Jun 2023 10:14:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231567AbjFVOOO (ORCPT ); Thu, 22 Jun 2023 10:14:14 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 718CC1BF9; Thu, 22 Jun 2023 07:13:54 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-666edfc50deso526579b3a.0; Thu, 22 Jun 2023 07:13:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687443234; x=1690035234; 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=ozzSuaR+vnDFbS3Ue8g2TvzzMcrPMRjUdhLQZS2AMB4=; b=rhN8Dy22F+u6C76NBeAxC1X09kWA1VwYKW3uQ8ro3k+XPwoNfej8PEFZ9gyydgIm4x spG1AKCMn6kyixBlojnUoWTsnm1a77kQmERndtSTmqrbPagrGOvqc7lH35KtxfXx01Ze c/LnotwTMUY9q7bQRy9lebu9PL2B16nyDCBOUBHn54Fk7ly9V/JRt0yj4KVqk0OkNhdI pxFng66Ca8xjUvE9xup8bdExG2WRbHwwWOEJoO2SuphCeH22BiVKkj++pZlzGQlGyTbB 0rBe0bgwKxJ5BOv7GFL2Nr/ioNo6ajYCpUrYaryAB7brwiqv3SdpPy8jI/8ICL9b5R4J QiZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687443234; x=1690035234; 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=ozzSuaR+vnDFbS3Ue8g2TvzzMcrPMRjUdhLQZS2AMB4=; b=LztPi7g3JclbadWHwEwgJgTxD65X6NbVM15b6wERYQK6fFxaHTXrXSTvvDtbk3NKiq ni564bfie0TPt4LZkkESiqvqUauA+fqo7EovsicVl5+t9TBVVfgur5cTIqHFZcIJvaY8 HnO/WYfmNkpR0ojRcqxXYoiI+ciiglv0ayRugP2xZPs1AD453fsWlVeaM1Ygp3m9oqX8 BfBGjAUVo4jVZVk2gPtY5GeYWirkgNCdRwC+0YGJb2q7+kPQesrnKbRyqcvaU5IMGRYv 9KHpoFf6Wz1UzpdQC92NlA/LQ6DQp1LAhd31LBY6I8QZV9dPiXqUETR9SFTp8IW3v8MB i9iA== X-Gm-Message-State: AC+VfDxGpbR2O9aZYkvu/40F6KYQ1/OPmpVUw+ZLrGt4kn62yT0CL+Wj A0eudSYmi5cpQLGue4CaCSewYOxdrXg= X-Received: by 2002:a05:6a00:2449:b0:657:1fe5:eb63 with SMTP id d9-20020a056a00244900b006571fe5eb63mr34321717pfj.7.1687443233684; Thu, 22 Jun 2023 07:13:53 -0700 (PDT) Received: from a28aa0606c51.. (60-250-192-107.hinet-ip.hinet.net. [60.250.192.107]) by smtp.gmail.com with ESMTPSA id i20-20020aa79094000000b0065a1b05193asm4604268pfa.185.2023.06.22.07.13.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jun 2023 07:13:53 -0700 (PDT) From: Jacky Huang To: mturquette@baylibre.com, sboyd@kernel.org, arnd@arndb.de, gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, soc@kernel.org, krzysztof.kozlowski+dt@linaro.org, schung@nuvoton.com, Jacky Huang Subject: [PATCH v3 2/3] clk: nuvoton: Update all constant hex values to lowercase Date: Thu, 22 Jun 2023 14:13:42 +0000 Message-Id: <20230622141343.13595-3-ychuang570808@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230622141343.13595-1-ychuang570808@gmail.com> References: <20230622141343.13595-1-ychuang570808@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769412713189216565?= X-GMAIL-MSGID: =?utf-8?q?1769412713189216565?= From: Jacky Huang The constant hex values used to define register offsets were written in uppercase. This patch update all these constant hex values to be lowercase. Signed-off-by: Jacky Huang --- drivers/clk/nuvoton/clk-ma35d1.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/clk/nuvoton/clk-ma35d1.c b/drivers/clk/nuvoton/clk-ma35d1.c index 8dfa762494fe..733750dda0f4 100644 --- a/drivers/clk/nuvoton/clk-ma35d1.c +++ b/drivers/clk/nuvoton/clk-ma35d1.c @@ -22,19 +22,19 @@ static DEFINE_SPINLOCK(ma35d1_lock); #define REG_CLK_PWRCTL 0x00 #define REG_CLK_SYSCLK0 0x04 #define REG_CLK_SYSCLK1 0x08 -#define REG_CLK_APBCLK0 0x0C +#define REG_CLK_APBCLK0 0x0c #define REG_CLK_APBCLK1 0x10 #define REG_CLK_APBCLK2 0x14 #define REG_CLK_CLKSEL0 0x18 -#define REG_CLK_CLKSEL1 0x1C +#define REG_CLK_CLKSEL1 0x1c #define REG_CLK_CLKSEL2 0x20 #define REG_CLK_CLKSEL3 0x24 #define REG_CLK_CLKSEL4 0x28 -#define REG_CLK_CLKDIV0 0x2C +#define REG_CLK_CLKDIV0 0x2c #define REG_CLK_CLKDIV1 0x30 #define REG_CLK_CLKDIV2 0x34 #define REG_CLK_CLKDIV3 0x38 -#define REG_CLK_CLKDIV4 0x3C +#define REG_CLK_CLKDIV4 0x3c #define REG_CLK_CLKOCTL 0x40 #define REG_CLK_STATUS 0x50 #define REG_CLK_PLL0CTL0 0x60 @@ -44,18 +44,18 @@ static DEFINE_SPINLOCK(ma35d1_lock); #define REG_CLK_PLL3CTL0 0x90 #define REG_CLK_PLL3CTL1 0x94 #define REG_CLK_PLL3CTL2 0x98 -#define REG_CLK_PLL4CTL0 0xA0 -#define REG_CLK_PLL4CTL1 0xA4 -#define REG_CLK_PLL4CTL2 0xA8 -#define REG_CLK_PLL5CTL0 0xB0 -#define REG_CLK_PLL5CTL1 0xB4 -#define REG_CLK_PLL5CTL2 0xB8 -#define REG_CLK_CLKDCTL 0xC0 -#define REG_CLK_CLKDSTS 0xC4 -#define REG_CLK_CDUPB 0xC8 -#define REG_CLK_CDLOWB 0xCC -#define REG_CLK_CKFLTRCTL 0xD0 -#define REG_CLK_TESTCLK 0xF0 +#define REG_CLK_PLL4CTL0 0xa0 +#define REG_CLK_PLL4CTL1 0xa4 +#define REG_CLK_PLL4CTL2 0xa8 +#define REG_CLK_PLL5CTL0 0xb0 +#define REG_CLK_PLL5CTL1 0xb4 +#define REG_CLK_PLL5CTL2 0xb8 +#define REG_CLK_CLKDCTL 0xc0 +#define REG_CLK_CLKDSTS 0xc4 +#define REG_CLK_CDUPB 0xc8 +#define REG_CLK_CDLOWB 0xcc +#define REG_CLK_CKFLTRCTL 0xd0 +#define REG_CLK_TESTCLK 0xf0 #define REG_CLK_PLLCTL 0x40 #define PLL_MODE_INT 0 From patchwork Thu Jun 22 14:13:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacky Huang X-Patchwork-Id: 111684 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp5110788vqr; Thu, 22 Jun 2023 07:29:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ65XMqa17w9HJ2bwQl3zp40f0D6oXiJX7Mgqm52JOpCjrYLD08QkvT1ppr47gVW0Roj02Xq X-Received: by 2002:a05:6a20:734a:b0:122:cb38:636a with SMTP id v10-20020a056a20734a00b00122cb38636amr6403199pzc.33.1687444170277; Thu, 22 Jun 2023 07:29:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687444170; cv=none; d=google.com; s=arc-20160816; b=taR+Lka/V1XpF/tFdQfk99iacpR8omSdKzxRw2Mt3jgX6JPVUE9MEfVwEYsJyUA17z sWbWwCUOAOM6lCab2MtP75iiCFvC2O8VlK4762AlL9V/+Hwm8y9sbwv1A4ZAyTXMQRhC vKAkAVuoxQX5NO8KGCjdtKXt8hDEj3D//1NyzlEymJsWUt/ClfZtprwHzb0cktB0FXOI otOXWCPCaH1jLpyaa6Jzqju3fc6LqiW5HagEnXK247S8urmuf7BRQ3HkRcWM8Imd4anX 5p3ohUO/dJZ9T1ESjS1vH+yFU1QVwtMUegmt65EuwOzA5F4ZG/Y7Riqao7Nq85uR1ERq SeLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NZIzshyEXvO+GMr2MxUbz2W/g/qd87fRl8ljhcscWKk=; b=Ss4EODD6SAslql7rr6jrhtr9IJXNTRLhB3hKVSkUm+W+feFMGiwXX12BTiXNeQlNMv GlxztMlFALdmZvEJt/Awya3WrkaBFnuZlxS3MkWnz0DitXGO8B1v9eR8Mtt0Q435090J 7/JIXTiVFeVi9KWq3HvLX2IiCS9MJvMOZ7GgFlG9gAOOJ8t+wIjPPDMWF17qgT0ZKra3 ZHS+cT0xIN9b2fh4aKiPn5jvBslXQG5rR3Sfg4PbUUuxFUy0y6gimUGwBs7JnZ+uSKys cvlR1YizeYWrp0zoPb6kmYNl2z9beizP6n5WvXQ9XQ73XuPRU9oQewUMQ4BSr3g5t9B4 o/6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=TRYsQWHb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 195-20020a6218cc000000b006632ef0dcf8si986260pfy.53.2023.06.22.07.29.17; Thu, 22 Jun 2023 07:29:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=TRYsQWHb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231697AbjFVOO2 (ORCPT + 99 others); Thu, 22 Jun 2023 10:14:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231615AbjFVOOR (ORCPT ); Thu, 22 Jun 2023 10:14:17 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2305D1FED; Thu, 22 Jun 2023 07:13:56 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-666eef03ebdso3242634b3a.1; Thu, 22 Jun 2023 07:13:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687443236; x=1690035236; 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=NZIzshyEXvO+GMr2MxUbz2W/g/qd87fRl8ljhcscWKk=; b=TRYsQWHby4zYuQr124gQ98AaJGzMIdSoi6qDkUhzHtwtstnHkYqno37q79yEBUxN2C 4tTJR/WX+egbkny3j/QE9SpQq0GKcI5O8oZ0vtO4cyETWsjvXSeEE9ftPronuaCDoxKT xpR3Hn9oRq/qMuuBOwVFI/KDza9LtbdUgugHQnYnsaMh7b1NxTr1phJN060UzCwJHIkj zf3IV0+UQF3nex1yxNCPApw8NGtX/rfPXrrLDlla6qBvq+gQxhStvNNBn67DwMK0PCzs +W5tAB/chkGN7OwhnnQ5xHDQQ4ON9UnsvBgRdYGvtCAmqZFPTpQRiHwd1vBwnKiCHWFW YW5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687443236; x=1690035236; 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=NZIzshyEXvO+GMr2MxUbz2W/g/qd87fRl8ljhcscWKk=; b=eE1tnWIVz2vIlluf01X/hHsWsGWYa+iVJ1A9LB4DqoSLZQBbvvKoRoLrr5mGPclGRS PKAuDUut69lq8qGrgxYgQ9b2Bo+bJOhZDP1tXs0YZ62NknLHe8wH8DauwhuQHP4cCi2D 3r4VL+OS2JKOfU70OZHc2V5BmrfmLf2tQoLv1tPFzdzcdQ0bq1bZYkHKQ2kc6+S1Wq3T /v6XWlvTa7WrlBNt/C1B8Hy4G9s6ewXYmWU1xmzJ/WPjKdJzNPY1f8nx14FrErQ8T5fU b4whCy78rKi13IcIaVc3+0gEwInT7PAu3qC0zdNcr3Lx9wnUMmKpc0MrCSVrWdYV7K3A iTeA== X-Gm-Message-State: AC+VfDwiP47l+nAf9EVLDvCCk3I9HtX1cXFBlNvoPp/ilnbkH9kOCGls T+gS50Bf0wmp6bj37wmYQuY= X-Received: by 2002:a05:6a00:1486:b0:66a:3818:8aa3 with SMTP id v6-20020a056a00148600b0066a38188aa3mr6308934pfu.0.1687443235960; Thu, 22 Jun 2023 07:13:55 -0700 (PDT) Received: from a28aa0606c51.. (60-250-192-107.hinet-ip.hinet.net. [60.250.192.107]) by smtp.gmail.com with ESMTPSA id i20-20020aa79094000000b0065a1b05193asm4604268pfa.185.2023.06.22.07.13.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jun 2023 07:13:55 -0700 (PDT) From: Jacky Huang To: mturquette@baylibre.com, sboyd@kernel.org, arnd@arndb.de, gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, soc@kernel.org, krzysztof.kozlowski+dt@linaro.org, schung@nuvoton.com, Jacky Huang Subject: [PATCH v3 3/3] clk: nuvoton: Use clk_parent_data instead of string for parent clock Date: Thu, 22 Jun 2023 14:13:43 +0000 Message-Id: <20230622141343.13595-4-ychuang570808@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230622141343.13595-1-ychuang570808@gmail.com> References: <20230622141343.13595-1-ychuang570808@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769413458771158034?= X-GMAIL-MSGID: =?utf-8?q?1769413458771158034?= From: Jacky Huang For the declaration of parent clocks, use struct clk_parent_data instead of a string. Due to the change in the passed arguments, replace the usage of devm_clk_hw_register_mux() with clk_hw_register_mux_parent_data() for all cases. Signed-off-by: Jacky Huang --- drivers/clk/nuvoton/clk-ma35d1.c | 306 ++++++++++++++++++++++--------- 1 file changed, 219 insertions(+), 87 deletions(-) diff --git a/drivers/clk/nuvoton/clk-ma35d1.c b/drivers/clk/nuvoton/clk-ma35d1.c index 733750dda0f4..f1fe7edd21b5 100644 --- a/drivers/clk/nuvoton/clk-ma35d1.c +++ b/drivers/clk/nuvoton/clk-ma35d1.c @@ -63,167 +63,298 @@ static DEFINE_SPINLOCK(ma35d1_lock); #define PLL_MODE_SS 2 static const struct clk_parent_data ca35clk_sel_clks[] = { - { .index = 0 }, /* HXT */ - { .index = 1 }, /* CAPLL */ - { .index = 2 } /* DDRPLL */ + { .fw_name = "hxt", }, + { .fw_name = "capll", }, + { .fw_name = "ddrpll", }, }; -static const char *const sysclk0_sel_clks[] = { - "epll_div2", "syspll" +static const struct clk_parent_data sysclk0_sel_clks[] = { + { .fw_name = "epll_div2", }, + { .fw_name = "syspll", }, }; -static const char *const sysclk1_sel_clks[] = { - "hxt", "syspll" +static const struct clk_parent_data sysclk1_sel_clks[] = { + { .fw_name = "hxt", }, + { .fw_name = "syspll", }, }; -static const char *const axiclk_sel_clks[] = { - "capll_div2", "capll_div4" +static const struct clk_parent_data axiclk_sel_clks[] = { + { .fw_name = "capll_div2", }, + { .fw_name = "capll_div4", }, }; -static const char *const ccap_sel_clks[] = { - "hxt", "vpll", "apll", "syspll" +static const struct clk_parent_data ccap_sel_clks[] = { + { .fw_name = "hxt", }, + { .fw_name = "vpll", }, + { .fw_name = "apll", }, + { .fw_name = "syspll", }, }; -static const char *const sdh_sel_clks[] = { - "syspll", "apll", "dummy", "dummy" +static const struct clk_parent_data sdh_sel_clks[] = { + { .fw_name = "syspll", }, + { .fw_name = "apll", }, }; -static const char *const dcu_sel_clks[] = { - "epll_div2", "syspll" +static const struct clk_parent_data dcu_sel_clks[] = { + { .fw_name = "epll_div2", }, + { .fw_name = "syspll", }, }; -static const char *const gfx_sel_clks[] = { - "epll", "syspll" +static const struct clk_parent_data gfx_sel_clks[] = { + { .fw_name = "epll", }, + { .fw_name = "syspll", }, }; -static const char *const dbg_sel_clks[] = { - "hirc", "syspll" +static const struct clk_parent_data dbg_sel_clks[] = { + { .fw_name = "hirc", }, + { .fw_name = "syspll", }, }; -static const char *const timer0_sel_clks[] = { - "hxt", "lxt", "pclk0", "dummy", "dummy", "lirc", "dummy", "hirc" +static const struct clk_parent_data timer0_sel_clks[] = { + { .fw_name = "hxt", }, + { .fw_name = "lxt", }, + { .fw_name = "pclk0", }, + { .index = -1, }, + { .index = -1, }, + { .fw_name = "lirc", }, + { .index = -1, }, + { .fw_name = "hirc", }, }; -static const char *const timer1_sel_clks[] = { - "hxt", "lxt", "pclk0", "dummy", "dummy", "lirc", "dummy", "hirc" +static const struct clk_parent_data timer1_sel_clks[] = { + { .fw_name = "hxt", }, + { .fw_name = "lxt", }, + { .fw_name = "pclk0", }, + { .index = -1, }, + { .index = -1, }, + { .fw_name = "lirc", }, + { .index = -1, }, + { .fw_name = "hirc", }, }; -static const char *const timer2_sel_clks[] = { - "hxt", "lxt", "pclk1", "dummy", "dummy", "lirc", "dummy", "hirc" +static const struct clk_parent_data timer2_sel_clks[] = { + { .fw_name = "hxt", }, + { .fw_name = "lxt", }, + { .fw_name = "pclk1", }, + { .index = -1, }, + { .index = -1, }, + { .fw_name = "lirc", }, + { .index = -1, }, + { .fw_name = "hirc", }, }; -static const char *const timer3_sel_clks[] = { - "hxt", "lxt", "pclk1", "dummy", "dummy", "lirc", "dummy", "hirc" +static const struct clk_parent_data timer3_sel_clks[] = { + { .fw_name = "hxt", }, + { .fw_name = "lxt", }, + { .fw_name = "pclk1", }, + { .index = -1, }, + { .index = -1, }, + { .fw_name = "lirc", }, + { .index = -1, }, + { .fw_name = "hirc", }, }; -static const char *const timer4_sel_clks[] = { - "hxt", "lxt", "pclk2", "dummy", "dummy", "lirc", "dummy", "hirc" +static const struct clk_parent_data timer4_sel_clks[] = { + { .fw_name = "hxt", }, + { .fw_name = "lxt", }, + { .fw_name = "pclk2", }, + { .index = -1, }, + { .index = -1, }, + { .fw_name = "lirc", }, + { .index = -1, }, + { .fw_name = "hirc", }, }; -static const char *const timer5_sel_clks[] = { - "hxt", "lxt", "pclk2", "dummy", "dummy", "lirc", "dummy", "hirc" +static const struct clk_parent_data timer5_sel_clks[] = { + { .fw_name = "hxt", }, + { .fw_name = "lxt", }, + { .fw_name = "pclk2", }, + { .index = -1, }, + { .index = -1, }, + { .fw_name = "lirc", }, + { .index = -1, }, + { .fw_name = "hirc", }, }; -static const char *const timer6_sel_clks[] = { - "hxt", "lxt", "pclk0", "dummy", "dummy", "lirc", "dummy", "hirc" +static const struct clk_parent_data timer6_sel_clks[] = { + { .fw_name = "hxt", }, + { .fw_name = "lxt", }, + { .fw_name = "pclk0", }, + { .index = -1, }, + { .index = -1, }, + { .fw_name = "lirc", }, + { .index = -1, }, + { .fw_name = "hirc", }, }; -static const char *const timer7_sel_clks[] = { - "hxt", "lxt", "pclk0", "dummy", "dummy", "lirc", "dummy", "hirc" +static const struct clk_parent_data timer7_sel_clks[] = { + { .fw_name = "hxt", }, + { .fw_name = "lxt", }, + { .fw_name = "pclk0", }, + { .index = -1, }, + { .index = -1, }, + { .fw_name = "lirc", }, + { .index = -1, }, + { .fw_name = "hirc", }, }; -static const char *const timer8_sel_clks[] = { - "hxt", "lxt", "pclk1", "dummy", "dummy", "lirc", "dummy", "hirc" +static const struct clk_parent_data timer8_sel_clks[] = { + { .fw_name = "hxt", }, + { .fw_name = "lxt", }, + { .fw_name = "pclk1", }, + { .index = -1, }, + { .index = -1, }, + { .fw_name = "lirc", }, + { .index = -1, }, + { .fw_name = "hirc", }, }; -static const char *const timer9_sel_clks[] = { - "hxt", "lxt", "pclk1", "dummy", "dummy", "lirc", "dummy", "hirc" +static const struct clk_parent_data timer9_sel_clks[] = { + { .fw_name = "hxt", }, + { .fw_name = "lxt", }, + { .fw_name = "pclk1", }, + { .index = -1, }, + { .index = -1, }, + { .fw_name = "lirc", }, + { .index = -1, }, + { .fw_name = "hirc", }, }; -static const char *const timer10_sel_clks[] = { - "hxt", "lxt", "pclk2", "dummy", "dummy", "lirc", "dummy", "hirc" +static const struct clk_parent_data timer10_sel_clks[] = { + { .fw_name = "hxt", }, + { .fw_name = "lxt", }, + { .fw_name = "pclk2", }, + { .index = -1, }, + { .index = -1, }, + { .fw_name = "lirc", }, + { .index = -1, }, + { .fw_name = "hirc", }, }; -static const char *const timer11_sel_clks[] = { - "hxt", "lxt", "pclk2", "dummy", "dummy", "lirc", "dummy", "hirc" +static const struct clk_parent_data timer11_sel_clks[] = { + { .fw_name = "hxt", }, + { .fw_name = "lxt", }, + { .fw_name = "pclk2", }, + { .index = -1, }, + { .index = -1, }, + { .fw_name = "lirc", }, + { .index = -1, }, + { .fw_name = "hirc", }, }; -static const char *const uart_sel_clks[] = { - "hxt", "sysclk1_div2", "dummy", "dummy" +static const struct clk_parent_data uart_sel_clks[] = { + { .fw_name = "hxt", }, + { .fw_name = "sysclk1_div2", }, }; -static const char *const wdt0_sel_clks[] = { - "dummy", "lxt", "pclk3_div4096", "lirc" +static const struct clk_parent_data wdt0_sel_clks[] = { + { .index = -1, }, + { .fw_name = "lxt", }, + { .fw_name = "pclk3_div4096", }, + { .fw_name = "lirc", }, }; -static const char *const wdt1_sel_clks[] = { - "dummy", "lxt", "pclk3_div4096", "lirc" +static const struct clk_parent_data wdt1_sel_clks[] = { + { .index = -1, }, + { .fw_name = "lxt", }, + { .fw_name = "pclk3_div4096", }, + { .fw_name = "lirc", }, }; -static const char *const wdt2_sel_clks[] = { - "dummy", "lxt", "pclk4_div4096", "lirc" +static const struct clk_parent_data wdt2_sel_clks[] = { + { .index = -1, }, + { .fw_name = "lxt", }, + { .fw_name = "pclk4_div4096", }, + { .fw_name = "lirc", }, }; -static const char *const wwdt0_sel_clks[] = { - "dummy", "dummy", "pclk3_div4096", "lirc" +static const struct clk_parent_data wwdt0_sel_clks[] = { + { .index = -1, }, + { .index = -1, }, + { .fw_name = "pclk3_div4096", }, + { .fw_name = "lirc", }, }; -static const char *const wwdt1_sel_clks[] = { - "dummy", "dummy", "pclk3_div4096", "lirc" +static const struct clk_parent_data wwdt1_sel_clks[] = { + { .index = -1, }, + { .index = -1, }, + { .fw_name = "pclk3_div4096", }, + { .fw_name = "lirc", }, }; -static const char *const wwdt2_sel_clks[] = { - "dummy", "dummy", "pclk4_div4096", "lirc" +static const struct clk_parent_data wwdt2_sel_clks[] = { + { .index = -1, }, + { .index = -1, }, + { .fw_name = "pclk4_div4096", }, + { .fw_name = "lirc", }, }; -static const char *const spi0_sel_clks[] = { - "pclk1", "apll", "dummy", "dummy" +static const struct clk_parent_data spi0_sel_clks[] = { + { .fw_name = "pclk1", }, + { .fw_name = "apll", }, }; -static const char *const spi1_sel_clks[] = { - "pclk2", "apll", "dummy", "dummy" +static const struct clk_parent_data spi1_sel_clks[] = { + { .fw_name = "pclk2", }, + { .fw_name = "apll", }, }; -static const char *const spi2_sel_clks[] = { - "pclk1", "apll", "dummy", "dummy" +static const struct clk_parent_data spi2_sel_clks[] = { + { .fw_name = "pclk1", }, + { .fw_name = "apll", }, }; -static const char *const spi3_sel_clks[] = { - "pclk2", "apll", "dummy", "dummy" +static const struct clk_parent_data spi3_sel_clks[] = { + { .fw_name = "pclk2", }, + { .fw_name = "apll", }, }; -static const char *const qspi0_sel_clks[] = { - "pclk0", "apll", "dummy", "dummy" +static const struct clk_parent_data qspi0_sel_clks[] = { + { .fw_name = "pclk0", }, + { .fw_name = "apll", }, }; -static const char *const qspi1_sel_clks[] = { - "pclk0", "apll", "dummy", "dummy" +static const struct clk_parent_data qspi1_sel_clks[] = { + { .fw_name = "pclk0", }, + { .fw_name = "apll", }, }; -static const char *const i2s0_sel_clks[] = { - "apll", "sysclk1_div2", "dummy", "dummy" +static const struct clk_parent_data i2s0_sel_clks[] = { + { .fw_name = "apll", }, + { .fw_name = "sysclk1_div2", }, }; -static const char *const i2s1_sel_clks[] = { - "apll", "sysclk1_div2", "dummy", "dummy" +static const struct clk_parent_data i2s1_sel_clks[] = { + { .fw_name = "apll", }, + { .fw_name = "sysclk1_div2", }, }; -static const char *const can_sel_clks[] = { - "apll", "vpll" +static const struct clk_parent_data can_sel_clks[] = { + { .fw_name = "apll", }, + { .fw_name = "vpll", }, }; -static const char *const cko_sel_clks[] = { - "hxt", "lxt", "hirc", "lirc", "capll_div4", "syspll", - "ddrpll", "epll_div2", "apll", "vpll", "dummy", "dummy", - "dummy", "dummy", "dummy", "dummy" +static const struct clk_parent_data cko_sel_clks[] = { + { .fw_name = "hxt", }, + { .fw_name = "lxt", }, + { .fw_name = "hirc", }, + { .fw_name = "lirc", }, + { .fw_name = "capll_div4", }, + { .fw_name = "syspll", }, + { .fw_name = "ddrpll", }, + { .fw_name = "epll_div2", }, + { .fw_name = "apll", }, + { .fw_name = "vpll", }, }; -static const char *const smc_sel_clks[] = { - "hxt", "pclk4" +static const struct clk_parent_data smc_sel_clks[] = { + { .fw_name = "hxt", }, + { .fw_name = "pclk4", }, }; -static const char *const kpi_sel_clks[] = { - "hxt", "lxt" +static const struct clk_parent_data kpi_sel_clks[] = { + { .fw_name = "hxt", }, + { .fw_name = "lxt", }, }; static const struct clk_div_table ip_div_table[] = { @@ -255,11 +386,12 @@ static struct clk_hw *ma35d1_clk_mux_parent(struct device *dev, const char *name static struct clk_hw *ma35d1_clk_mux(struct device *dev, const char *name, void __iomem *reg, u8 shift, u8 width, - const char *const *parents, int num_parents) + const struct clk_parent_data *pdata, + int num_pdata) { - return devm_clk_hw_register_mux(dev, name, parents, num_parents, - CLK_SET_RATE_NO_REPARENT, reg, shift, - width, 0, &ma35d1_lock); + return clk_hw_register_mux_parent_data(dev, name, pdata, num_pdata, + CLK_SET_RATE_NO_REPARENT, reg, shift, + width, 0, &ma35d1_lock); } static struct clk_hw *ma35d1_clk_divider(struct device *dev, const char *name,