From patchwork Sat Jul 23 14:55:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 12927220 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E23DC433EF for ; Sat, 23 Jul 2022 14:56:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235682AbiGWO4F (ORCPT ); Sat, 23 Jul 2022 10:56:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229563AbiGWO4E (ORCPT ); Sat, 23 Jul 2022 10:56:04 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8118CC29; Sat, 23 Jul 2022 07:56:03 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id g1so8874283edb.12; Sat, 23 Jul 2022 07:56:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JSxzmKxjlNqM9TSDpV5dH/r3annlSczSnTdVT/KLPhw=; b=Ci/8784Th6shNIq9MybffNf+/ze500Ci6XwQIr/9wvzIYV5DMQTHa7Gx8cOETmA0X+ Vh3ynnxhg5VWGXUMzrJm+dfHH0ZCJcPDt0CalKGqwxr1LCrXDE4j/1CkCeWtMkbXpbrX sijdgkJvhZtulYKyrsVb5QSMcuxuuql23EhOTLNdJg07uANubwIyvE1MtcMJXhXFG6v4 NYYkd6/Gl9LYF0sjphn7IyCZD/bYU/aCKgHCsqZU4/TtbeZYcaJ8Ycp57HEyb6Ro7jQO fHn/5m6EoBi5aX+yToRNEqK36gbQXLtgYeadxNyBWFSP9Y91sxIRK19A/DEBCeqGHDqf LLEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JSxzmKxjlNqM9TSDpV5dH/r3annlSczSnTdVT/KLPhw=; b=fcOBgQoQhCSTrantY0Fep8R5Hkhma+rWBzLau/htRyG5PIC+l32nyL18tC0PY93URi GtNYyIGMWC3xYs27ZAvpjTDyRLd57RNj/dvSMIj598n5Y72QaBI9kqDiT8843dNhwtgV rEfuX7B4iwMPzbGQMeKQyyOsSOK+f4Bw2pzXNksS4nBC8rLbMETwuX1S18hafmAhcmCc wBnWKetxdnGVu1VM/iUmCE3TeaupWS0GpflKEzYkUoSQL2W9b80kiJY49mrsPQOAyAgP 2BN8X37mAkEYLFxtyx+jL0kIluKowL90vKEGggjqgJX9ebKr4pwfv8dmXWzihICOZW8v bHHw== X-Gm-Message-State: AJIora+RN30vjJ1Rn7J88wKWBwBfjrDJ+1jxmFI1FWrHmGutrmc91gOm nNK9EnGOYCdABLD4rri/SEw= X-Google-Smtp-Source: AGRyM1svGBQm8o/vHZh+k4JHCekqFN+vfcSGobyHkEzWj6qxW4FvY4cABfx0prHfMW79df6QR3Q+fg== X-Received: by 2002:a05:6402:5513:b0:43a:b866:b9ab with SMTP id fi19-20020a056402551300b0043ab866b9abmr4860586edb.290.1658588161719; Sat, 23 Jul 2022 07:56:01 -0700 (PDT) Received: from localhost.localdomain (host-87-7-207-127.retail.telecomitalia.it. [87.7.207.127]) by smtp.googlemail.com with ESMTPSA id cy24-20020a0564021c9800b0043ba1ecb0dfsm4143781edb.75.2022.07.23.07.56.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Jul 2022 07:56:01 -0700 (PDT) From: Christian Marangi To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: Christian Marangi , Dmitry Baryshkov , Rob Herring Subject: [PATCH v6 1/4] dt-bindings: clock: add pcm reset for ipq806x lcc Date: Sat, 23 Jul 2022 16:55:55 +0200 Message-Id: <20220723145558.25210-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org Add pcm reset define for ipq806x lcc. Signed-off-by: Christian Marangi Reviewed-by: Dmitry Baryshkov Acked-by: Rob Herring --- v3: - Added review tag - Added ack tag v2: - Fix Sob tag include/dt-bindings/clock/qcom,lcc-ipq806x.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/dt-bindings/clock/qcom,lcc-ipq806x.h b/include/dt-bindings/clock/qcom,lcc-ipq806x.h index 25b92bbf0ab4..e0fb4acf4ba8 100644 --- a/include/dt-bindings/clock/qcom,lcc-ipq806x.h +++ b/include/dt-bindings/clock/qcom,lcc-ipq806x.h @@ -19,4 +19,6 @@ #define SPDIF_CLK 10 #define AHBIX_CLK 11 +#define LCC_PCM_RESET 0 + #endif From patchwork Sat Jul 23 14:55:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 12927221 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ACCE2CCA48A for ; Sat, 23 Jul 2022 14:56:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237255AbiGWO4H (ORCPT ); Sat, 23 Jul 2022 10:56:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236191AbiGWO4G (ORCPT ); Sat, 23 Jul 2022 10:56:06 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCA21101DA; Sat, 23 Jul 2022 07:56:04 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id tk8so13140132ejc.7; Sat, 23 Jul 2022 07:56:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TYMK3ln+pSNgbS7KOrXcaQql59e3lfO5o9Vh/Disa6M=; b=IWTtt2ngyBcGG/5CAnF4n7K/4H5wmjxVFDsP+5b2f9FxGZ3uaiEaxDksAazRtynZiG HrA+VZZtXSicN4WovL6uTfUc5YGnimXnNXO3waCHc4S7d8Fne90NEB5ZjwPlQ0yzSlMz UZ4Ji3CNSFnxfRozRV7fZX5GfBpoKswUQjtcORSzvIjAStQgLdbgEsv0ATkfZzfhcFpq kEzzNx95Y7JrMgtvzvCwaJ3//y+rktDRWj8qZlIywCcCcaSQIWCx358FLpOgovdUuX8e nSF54S3HkmudGREQP+tmVcvqgY7YR6lFdJzqlwg9i5CDFRj1AYK7yIc4vCQMRWFHeMjQ HlZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TYMK3ln+pSNgbS7KOrXcaQql59e3lfO5o9Vh/Disa6M=; b=aUNBLAetlkUhcTtfhl9098helRy5uSyNz2vEzhi4TcPIntko7UGydBHoIKow+Ue02x qlpY/8YlkQJ2bk8Onr4Z63ZQnyLWWOgnQK3Sk/TVffC21c/MR4rW3hnAVi7EOa/eFH6R Qi5cqPLduqO3u5hQL/5oodshra4UrNhkQ55SsjUwFm53vkm/xAQZUjBGxku0fQv1M6N3 XTnu4S51O9jkJB3+tC7uSx5InWcE/vb4F6OCiUlR+Yxs6sRzvCcQM6x0D0nl1DWPOasB L1j3EslcdCCdWvs+k/leLaB98vevnUCIXPkwQ8wG2efRL7eAYj5ceODQGRUBbaDWQ2Pk 70MA== X-Gm-Message-State: AJIora80KeoQDVviwkzApQRg236txSF6keq0TWKBXu7jlm72BVOOsXsY SX8Wbj0yedCdPl/gdEyS3sGpCdUwQ3U= X-Google-Smtp-Source: AGRyM1uJOSRbEs9FMeIIof8y6QSVSs3G/IJBSDg5ZCvC0xUq2NHaIIDR3Qd5xj5tMuIZ1pG6Ww8O9g== X-Received: by 2002:a17:906:478b:b0:72b:5cd6:3f50 with SMTP id cw11-20020a170906478b00b0072b5cd63f50mr3712733ejc.514.1658588163186; Sat, 23 Jul 2022 07:56:03 -0700 (PDT) Received: from localhost.localdomain (host-87-7-207-127.retail.telecomitalia.it. [87.7.207.127]) by smtp.googlemail.com with ESMTPSA id cy24-20020a0564021c9800b0043ba1ecb0dfsm4143781edb.75.2022.07.23.07.56.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Jul 2022 07:56:02 -0700 (PDT) From: Christian Marangi To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: Christian Marangi , Dmitry Baryshkov Subject: [PATCH v6 2/4] clk: qcom: lcc-ipq806x: add reset definition Date: Sat, 23 Jul 2022 16:55:56 +0200 Message-Id: <20220723145558.25210-2-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220723145558.25210-1-ansuelsmth@gmail.com> References: <20220723145558.25210-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org Add reset definition for lcc-ipq806x. Signed-off-by: Christian Marangi Reviewed-by: Dmitry Baryshkov --- v3: - Added review tag v2: - Fix Sob tag drivers/clk/qcom/lcc-ipq806x.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/clk/qcom/lcc-ipq806x.c b/drivers/clk/qcom/lcc-ipq806x.c index 1a2be4aeb31d..ba90bebba597 100644 --- a/drivers/clk/qcom/lcc-ipq806x.c +++ b/drivers/clk/qcom/lcc-ipq806x.c @@ -22,6 +22,7 @@ #include "clk-branch.h" #include "clk-regmap-divider.h" #include "clk-regmap-mux.h" +#include "reset.h" static struct clk_pll pll4 = { .l_reg = 0x4, @@ -405,6 +406,10 @@ static struct clk_regmap *lcc_ipq806x_clks[] = { [AHBIX_CLK] = &ahbix_clk.clkr, }; +static const struct qcom_reset_map lcc_ipq806x_resets[] = { + [LCC_PCM_RESET] = { 0x54, 13 }, +}; + static const struct regmap_config lcc_ipq806x_regmap_config = { .reg_bits = 32, .reg_stride = 4, @@ -417,6 +422,8 @@ static const struct qcom_cc_desc lcc_ipq806x_desc = { .config = &lcc_ipq806x_regmap_config, .clks = lcc_ipq806x_clks, .num_clks = ARRAY_SIZE(lcc_ipq806x_clks), + .resets = lcc_ipq806x_resets, + .num_resets = ARRAY_SIZE(lcc_ipq806x_resets), }; static const struct of_device_id lcc_ipq806x_match_table[] = { From patchwork Sat Jul 23 14:55:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 12927223 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E648DCCA48C for ; Sat, 23 Jul 2022 14:56:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237693AbiGWO4L (ORCPT ); Sat, 23 Jul 2022 10:56:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236274AbiGWO4J (ORCPT ); Sat, 23 Jul 2022 10:56:09 -0400 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C68812A8D; Sat, 23 Jul 2022 07:56:06 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id m8so8890886edd.9; Sat, 23 Jul 2022 07:56:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BuuvdWXJhrjPPhNUbwdMly3ckuq+/euuqy+8CL69hCM=; b=EppRU8EIU8xG7ZKf+/ibUq2rPjfFowXLdzh42+x67p82Zp1JK6vmpHJtP8ZQ+r43E0 5CRcCxYPMXL9i5waWcXvGEn34IIk26QlFFbhl/LRJlfOe6cHNULVfiN8k3aHY2w/shJJ q1/YVAiOxlfhE9lP4gOYEqD0VnCRU2KIg4ymXpSQfdZCJ1xW3VACAZcBvDQKwsF5L834 A+/sHOxwMuZxUoaZR5QZjJfcIk2S4MRQjBYJUJZ8/St9QNqQh8m9xtl8C6VIQcxWOEaq LcTkrGRUNol+V40utpeQd/YkskOb+MbGg/d39+I6OOhlHNQ/kmoUa/qIJRZQDKMpoOnG dAPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BuuvdWXJhrjPPhNUbwdMly3ckuq+/euuqy+8CL69hCM=; b=c3o+55Lziajg7I1cFPnZAstsHpOGZsQytt0R1mAmQ6MNOm76FPY0SOZA90JiVXmTI1 dY2F91s3fb3lYW+su7uuyX93GGZ7hVTVtDTrAIhGysEEKCOvLos+WGbT6SRryJ0vapNy bR21yLt8kLDXr1TL+OA38Rj4/3A79vNYpxEwaBzqNcuGQXBITAkj+jYy9WOx9NCzyObm QJdJBHI3lCRK7Rvk3rVO/Ny4Q+/ayJlpbm1q/HJYjapBQY/2o6bhrbocPlxVpwio7nUR 0N1lZdqg09CmvyNh6wYcUhyPK7YvKK7FAFmsl1ZdGEX1+BgTjr6sFo/AfF7d4HJ5EuHw mYlg== X-Gm-Message-State: AJIora++pnbBdQMuUShggFlOycO2OBmcWvf1Rwi6yBCdJRzQP0HMfVcp TxCj8XEVAB6k7De+iSz4Nn8= X-Google-Smtp-Source: AGRyM1t9FNgP5Bk7gCelvwv4h6vic1dVH3UreaP/3AE/xmozomC3ujLB0cqyTUZrEGhb8GQ/AhPPIg== X-Received: by 2002:a05:6402:1159:b0:43b:bc82:5ddb with SMTP id g25-20020a056402115900b0043bbc825ddbmr4610867edw.355.1658588164432; Sat, 23 Jul 2022 07:56:04 -0700 (PDT) Received: from localhost.localdomain (host-87-7-207-127.retail.telecomitalia.it. [87.7.207.127]) by smtp.googlemail.com with ESMTPSA id cy24-20020a0564021c9800b0043ba1ecb0dfsm4143781edb.75.2022.07.23.07.56.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Jul 2022 07:56:04 -0700 (PDT) From: Christian Marangi To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: Christian Marangi Subject: [PATCH v6 3/4] clk: qcom: lcc-ipq806x: convert to parent data Date: Sat, 23 Jul 2022 16:55:57 +0200 Message-Id: <20220723145558.25210-3-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220723145558.25210-1-ansuelsmth@gmail.com> References: <20220723145558.25210-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org Convert lcc-ipq806x driver to parent_data API. Signed-off-by: Christian Marangi Reviewed-by: Dmitry Baryshkov --- v6: - Split to separate patch for ARRAY_SIZE - Rename .name to pxo_board - Drop _clk from .fw_name v5: - Fix the same compilation error (don't know what the hell happen to my buildroot) v4: - Fix compilation error v3: - Inline pxo pll4 parent - Change .name from pxo to pxo_board drivers/clk/qcom/lcc-ipq806x.c | 69 +++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 31 deletions(-) diff --git a/drivers/clk/qcom/lcc-ipq806x.c b/drivers/clk/qcom/lcc-ipq806x.c index ba90bebba597..1833e59a6434 100644 --- a/drivers/clk/qcom/lcc-ipq806x.c +++ b/drivers/clk/qcom/lcc-ipq806x.c @@ -34,7 +34,9 @@ static struct clk_pll pll4 = { .status_bit = 16, .clkr.hw.init = &(struct clk_init_data){ .name = "pll4", - .parent_names = (const char *[]){ "pxo" }, + .parent_data = &(const struct clk_parent_data) { + .fw_name = "pxo", .name = "pxo_board", + }, .num_parents = 1, .ops = &clk_pll_ops, }, @@ -64,9 +66,9 @@ static const struct parent_map lcc_pxo_pll4_map[] = { { P_PLL4, 2 } }; -static const char * const lcc_pxo_pll4[] = { - "pxo", - "pll4_vote", +static const struct clk_parent_data lcc_pxo_pll4[] = { + { .fw_name = "pxo", .name = "pxo_board" }, + { .fw_name = "pll4_vote", .name = "pll4_vote" }, }; static struct freq_tbl clk_tbl_aif_mi2s[] = { @@ -131,7 +133,7 @@ static struct clk_rcg mi2s_osr_src = { .enable_mask = BIT(9), .hw.init = &(struct clk_init_data){ .name = "mi2s_osr_src", - .parent_names = lcc_pxo_pll4, + .parent_data = lcc_pxo_pll4, .num_parents = 2, .ops = &clk_rcg_ops, .flags = CLK_SET_RATE_GATE, @@ -139,10 +141,6 @@ static struct clk_rcg mi2s_osr_src = { }, }; -static const char * const lcc_mi2s_parents[] = { - "mi2s_osr_src", -}; - static struct clk_branch mi2s_osr_clk = { .halt_reg = 0x50, .halt_bit = 1, @@ -152,7 +150,9 @@ static struct clk_branch mi2s_osr_clk = { .enable_mask = BIT(17), .hw.init = &(struct clk_init_data){ .name = "mi2s_osr_clk", - .parent_names = lcc_mi2s_parents, + .parent_hws = (const struct clk_hw*[]) { + &mi2s_osr_src.clkr.hw, + }, .num_parents = 1, .ops = &clk_branch_ops, .flags = CLK_SET_RATE_PARENT, @@ -167,7 +167,9 @@ static struct clk_regmap_div mi2s_div_clk = { .clkr = { .hw.init = &(struct clk_init_data){ .name = "mi2s_div_clk", - .parent_names = lcc_mi2s_parents, + .parent_hws = (const struct clk_hw*[]) { + &mi2s_osr_src.clkr.hw, + }, .num_parents = 1, .ops = &clk_regmap_div_ops, }, @@ -183,7 +185,9 @@ static struct clk_branch mi2s_bit_div_clk = { .enable_mask = BIT(15), .hw.init = &(struct clk_init_data){ .name = "mi2s_bit_div_clk", - .parent_names = (const char *[]){ "mi2s_div_clk" }, + .parent_hws = (const struct clk_hw*[]) { + &mi2s_div_clk.clkr.hw, + }, .num_parents = 1, .ops = &clk_branch_ops, .flags = CLK_SET_RATE_PARENT, @@ -191,6 +195,10 @@ static struct clk_branch mi2s_bit_div_clk = { }, }; +static const struct clk_parent_data lcc_mi2s_bit_div_codec_clk[] = { + { .hw = &mi2s_bit_div_clk.clkr.hw, }, + { .fw_name = "mi2s_codec", .name = "mi2s_codec_clk" }, +}; static struct clk_regmap_mux mi2s_bit_clk = { .reg = 0x48, @@ -199,11 +207,8 @@ static struct clk_regmap_mux mi2s_bit_clk = { .clkr = { .hw.init = &(struct clk_init_data){ .name = "mi2s_bit_clk", - .parent_names = (const char *[]){ - "mi2s_bit_div_clk", - "mi2s_codec_clk", - }, - .num_parents = 2, + .parent_data = lcc_mi2s_bit_div_codec_clk, + .num_parents = ARRAY_SIZE(lcc_mi2s_bit_div_codec_clk), .ops = &clk_regmap_mux_closest_ops, .flags = CLK_SET_RATE_PARENT, }, @@ -245,7 +250,7 @@ static struct clk_rcg pcm_src = { .enable_mask = BIT(9), .hw.init = &(struct clk_init_data){ .name = "pcm_src", - .parent_names = lcc_pxo_pll4, + .parent_data = lcc_pxo_pll4, .num_parents = 2, .ops = &clk_rcg_ops, .flags = CLK_SET_RATE_GATE, @@ -262,7 +267,9 @@ static struct clk_branch pcm_clk_out = { .enable_mask = BIT(11), .hw.init = &(struct clk_init_data){ .name = "pcm_clk_out", - .parent_names = (const char *[]){ "pcm_src" }, + .parent_hws = (const struct clk_hw*[]) { + &pcm_src.clkr.hw, + }, .num_parents = 1, .ops = &clk_branch_ops, .flags = CLK_SET_RATE_PARENT, @@ -270,6 +277,11 @@ static struct clk_branch pcm_clk_out = { }, }; +static const struct clk_parent_data lcc_pcm_clk_out_codec_clk[] = { + { .hw = &pcm_clk_out.clkr.hw, }, + { .fw_name = "pcm_codec_clk", .name = "pcm_codec_clk" }, +}; + static struct clk_regmap_mux pcm_clk = { .reg = 0x54, .shift = 10, @@ -277,11 +289,8 @@ static struct clk_regmap_mux pcm_clk = { .clkr = { .hw.init = &(struct clk_init_data){ .name = "pcm_clk", - .parent_names = (const char *[]){ - "pcm_clk_out", - "pcm_codec_clk", - }, - .num_parents = 2, + .parent_data = lcc_pcm_clk_out_codec_clk, + .num_parents = ARRAY_SIZE(lcc_pcm_clk_out_codec_clk), .ops = &clk_regmap_mux_closest_ops, .flags = CLK_SET_RATE_PARENT, }, @@ -325,7 +334,7 @@ static struct clk_rcg spdif_src = { .enable_mask = BIT(9), .hw.init = &(struct clk_init_data){ .name = "spdif_src", - .parent_names = lcc_pxo_pll4, + .parent_data = lcc_pxo_pll4, .num_parents = 2, .ops = &clk_rcg_ops, .flags = CLK_SET_RATE_GATE, @@ -333,10 +342,6 @@ static struct clk_rcg spdif_src = { }, }; -static const char * const lcc_spdif_parents[] = { - "spdif_src", -}; - static struct clk_branch spdif_clk = { .halt_reg = 0xd4, .halt_bit = 1, @@ -346,7 +351,9 @@ static struct clk_branch spdif_clk = { .enable_mask = BIT(12), .hw.init = &(struct clk_init_data){ .name = "spdif_clk", - .parent_names = lcc_spdif_parents, + .parent_hws = (const struct clk_hw*[]) { + &spdif_src.clkr.hw, + }, .num_parents = 1, .ops = &clk_branch_ops, .flags = CLK_SET_RATE_PARENT, @@ -384,7 +391,7 @@ static struct clk_rcg ahbix_clk = { .enable_mask = BIT(11), .hw.init = &(struct clk_init_data){ .name = "ahbix", - .parent_names = lcc_pxo_pll4, + .parent_data = lcc_pxo_pll4, .num_parents = 2, .ops = &clk_rcg_lcc_ops, }, From patchwork Sat Jul 23 14:55:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 12927222 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7205ACCA48D for ; Sat, 23 Jul 2022 14:56:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237363AbiGWO4J (ORCPT ); Sat, 23 Jul 2022 10:56:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237274AbiGWO4H (ORCPT ); Sat, 23 Jul 2022 10:56:07 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C6D112A96; Sat, 23 Jul 2022 07:56:06 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id g1so8874374edb.12; Sat, 23 Jul 2022 07:56:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dCntW+N4qFqJP1njW6qSw/U6Vf1iTyFtCTiRKA2t2aE=; b=VyKK6R4d30UkLENldCcfiTaiaoYpWNZ5FFG+13E1fK6IQDtRYqmg2sMK3EWV9H50kS xq8wdS3t5hfLyosERiSyVEgM2HaM3eUnQ3IxNgU+D5gQvH1kgQbn7GLNR5KV7vkURUE4 +3En4F3ek9/0aJVNn9gAnCUGfSQleYFs7mkXENfapOkA3k/6Ro8qO29zd8+82R/vGqvR sKWkQ3wwTYyqVa4bQgRkl4RmI7IOcOZnh1qlJm3E7IClIRFUjO4xJDvwhLfTxDJMiFiq edKO6LQxYm89cMhIxCpDrEXZB4PlEKpiu858K2+/e9zXrE6z5HTH30P4KEP7dCjZNY3H WZQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dCntW+N4qFqJP1njW6qSw/U6Vf1iTyFtCTiRKA2t2aE=; b=BiJD4HI/0IATb3eKhXJPzlhwk21enV26OA0v+h7gek6Uu7PTsXqgeRrDbHnQekYq3Q Q593FpwvLJXmK3smIh7f6iox8GDpYqAgS8xdIBI8LMuYCeqC6++g7uwLDt1VtCMwv7ll byhDZKmuLAiNPryB7UjodYlER72XxViQlHeqgpvs46adJ0OfX5G5k+3ao2gTU0bPA/mc b0qviTUM/TLHBqfMgB2j3AJTsB4+58VQdWslxn47vhQ1tC2dVWAZtpnqtEelKRHr62+P 1f/9qf4/IVEzK6Aym6JTu8SUwBv5LiNQiVz2MQ6ZKshFU/YzjsQBlrIQUA/uuJRktbyO qqfg== X-Gm-Message-State: AJIora9QIQnThEBIgQE15o1UfaYLPI1yCOk5apeCCWgVg9FIuvmvj3b1 zaq8vNWW85eGMdEoyq0dfWE= X-Google-Smtp-Source: AGRyM1tbbIAfKL2bPbXr8tRU/rHmChn91fpKl2CxQjsJf3FCTVGQyhYSKIvMsAcVWmdx8ta6EU9hSQ== X-Received: by 2002:a05:6402:1c97:b0:43b:b984:f817 with SMTP id cy23-20020a0564021c9700b0043bb984f817mr4815344edb.196.1658588165647; Sat, 23 Jul 2022 07:56:05 -0700 (PDT) Received: from localhost.localdomain (host-87-7-207-127.retail.telecomitalia.it. [87.7.207.127]) by smtp.googlemail.com with ESMTPSA id cy24-20020a0564021c9800b0043ba1ecb0dfsm4143781edb.75.2022.07.23.07.56.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Jul 2022 07:56:05 -0700 (PDT) From: Christian Marangi To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: Christian Marangi Subject: [PATCH v6 4/4] clk: qcom: lcc-ipq806x: use ARRAY_SIZE for num_parents Date: Sat, 23 Jul 2022 16:55:58 +0200 Message-Id: <20220723145558.25210-4-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220723145558.25210-1-ansuelsmth@gmail.com> References: <20220723145558.25210-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org Use ARRAY_SIZE for num_parents instead of raw number to prevent any confusion/mistake. Signed-off-by: Christian Marangi Reviewed-by: Dmitry Baryshkov --- drivers/clk/qcom/lcc-ipq806x.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/clk/qcom/lcc-ipq806x.c b/drivers/clk/qcom/lcc-ipq806x.c index 1833e59a6434..81a44a9a9abc 100644 --- a/drivers/clk/qcom/lcc-ipq806x.c +++ b/drivers/clk/qcom/lcc-ipq806x.c @@ -134,7 +134,7 @@ static struct clk_rcg mi2s_osr_src = { .hw.init = &(struct clk_init_data){ .name = "mi2s_osr_src", .parent_data = lcc_pxo_pll4, - .num_parents = 2, + .num_parents = ARRAY_SIZE(lcc_pxo_pll4), .ops = &clk_rcg_ops, .flags = CLK_SET_RATE_GATE, }, @@ -251,7 +251,7 @@ static struct clk_rcg pcm_src = { .hw.init = &(struct clk_init_data){ .name = "pcm_src", .parent_data = lcc_pxo_pll4, - .num_parents = 2, + .num_parents = ARRAY_SIZE(lcc_pxo_pll4), .ops = &clk_rcg_ops, .flags = CLK_SET_RATE_GATE, }, @@ -335,7 +335,7 @@ static struct clk_rcg spdif_src = { .hw.init = &(struct clk_init_data){ .name = "spdif_src", .parent_data = lcc_pxo_pll4, - .num_parents = 2, + .num_parents = ARRAY_SIZE(lcc_pxo_pll4), .ops = &clk_rcg_ops, .flags = CLK_SET_RATE_GATE, }, @@ -392,7 +392,7 @@ static struct clk_rcg ahbix_clk = { .hw.init = &(struct clk_init_data){ .name = "ahbix", .parent_data = lcc_pxo_pll4, - .num_parents = 2, + .num_parents = ARRAY_SIZE(lcc_pxo_pll4), .ops = &clk_rcg_lcc_ops, }, },