From patchwork Sun Jan 5 14:41:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 13926543 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 03CE410FD; Sun, 5 Jan 2025 14:42:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736088172; cv=none; b=jB34KBFcOk4Lwhgd37lS8a3MYQNTvcbPwfxEzlFppS7/Bw8PUXBYPNMetvXyxhHZoWid2sntHCHiz+x+6ooihSs5WHHJfupfd9KvofaCNWZIHqQYQCvo0T/1X7E7LGUR1CnMAjg17zwT0SBS2BikZ7XPiQrIGd+m+nneqmiVESs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736088172; c=relaxed/simple; bh=6BGnUDDq1mySwnhl+zlQlCFd6dSbJTRu98xY1jtLjlc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=eu4Mjl5195/9TUL3I8jhhkXVkWYDqxZDGmmDJCw3gX/VAhHcDwsss3N36hGZWRGxAceqsNxIyQ1WW1IU476Rd3ULnkQHBHleZSrTdQ+5c7OgH4ntipJjeaTuJSEZP2NHDks5TM6Q+IAlQ1LcDQuFYsN0MaGwfFpIJwk58sbSwj0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ikJIvnrb; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ikJIvnrb" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4363ae65100so140684135e9.0; Sun, 05 Jan 2025 06:42:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736088169; x=1736692969; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=+RaZP63LlODlhkgW/Sv7eVVJog+or5Lh7FndxDbg2/4=; b=ikJIvnrbLsvyb+EDnvGXVO3ykPGiT5k49IV1GFx9pzBIb0KsBoS7V18fpVeWhbIpyg 6PAMvkgCo1xDVgFFHovxc4LxgHVQHqBKMQdaDiEph43iVsR7uqigXXvs4Hdr1mPJFUfR GR6kphAH24nuZS6ht/ZXvkynHLyD1sdWU7+bNHVmmBBzpt2FHeHQwyswsYgXRpT88v4g xKt7KEe2+fGKNbeOtrREGat1KgUmJ/uHCIh3YoXWni0octd7sZIYhxA+Jarr+6qsDZs0 695Zog5tEVzm7OPi5E+D3auPdqW77Fru8uZYj0dqQuSi+XlXoyCnjbp9EDF0EI2k5kZ1 hPCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736088169; x=1736692969; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+RaZP63LlODlhkgW/Sv7eVVJog+or5Lh7FndxDbg2/4=; b=REs64rmwlc96ax+DJ7HPfzpb2apB8GRmk7M9o76rRuXzpnNGf1WJJRSvUMyhURk2+s ZV8BsQocwYvJVTFXi38dymFU0lCa1ph06Ep8bNjHv8cYveugolmcEvaVciIHakebdn9+ n/VCFfsWU1QG5vJcnsb4XKHV16CHsqzTHWwNyunjaiwFF0Xo9k6w8L8U6mKG+5OAZNT8 2AZUY3YA43QWZNkCkJeM7mRg0f+5crgA7o+BO0sC3nPJwiWWrSFbtu0IR2P/RcI/b7Vn aKCTRzET9eOIAAaYI2E8LFAExuFiSp1xHhvTs/zQ/DGIoBavevWCn8cbsR3tB86ZoMMI aLeA== X-Forwarded-Encrypted: i=1; AJvYcCUKhxIU6i9cQ3tcMCxDq89QX3atYTK9KEm9/62c688tBMMssv5kLeRmxTwxVJ8g3euBfh8u2NR79S21IGZr@vger.kernel.org, AJvYcCV+bn4VBLGkmY9hNzgatQv5YrQHvup79ceM8Ge3szxnoadkPEZRXXaHbNzOQNqS2904n2wLOmi8AKGt@vger.kernel.org, AJvYcCXkJzgygskuXd2InYlozi/XyK4N5n2zn6FxpqOxFINw0EXYX/DBmJ0jeEIKZ9gGYdqMMtneoND/jo0i@vger.kernel.org X-Gm-Message-State: AOJu0Yxt9TXnDffpM1Jsp1T3x3eiQ2UiIR36T8D8JTC4Odcyc/mcyYE+ AgfP33kHydCz4u50WqbWwGivNjSPIlS/fAXCA93Po24QUG1l+O4xXOFliw== X-Gm-Gg: ASbGncszOyWQUwXZRBwbtXEBFYs7CM3yRhGmSjOeMMQJ5EzwIAqf4L8S5vTt0ooqmUr gypj1PNOcmRtteO+ghK82q7L2WRDoJvadTLtIgWZEukvNOkjcclFtCa+HCgy2ys3jlW7oeQS6ES 8AaCjnCKTE26gJjltJAM+RudQn/bxU+etzmUU4V62f/dspt5CqPpahvR6bfSNlh5QuLUC2gKiCd AEGdQe7laNKgedKABx3yGRtAnddhpqZ2kYzRJippU7x92UCCdbPoa6Z4bryBrikhGJHKu4ATgnc fGwyAzIfaPSxF5dDLVO9Eti7vUI3DXXE5NRiTM0RnA== X-Google-Smtp-Source: AGHT+IE+dhS2d4IYp6eELhBgd8bcIPj8a5GN+Vx2v3+BUVCMYBYs90X6s/8TnQ3cvbS1s4C3vKOphw== X-Received: by 2002:a05:6000:1568:b0:385:dc45:ea22 with SMTP id ffacd0b85a97d-38a223f835dmr44160371f8f.39.1736088169177; Sun, 05 Jan 2025 06:42:49 -0800 (PST) Received: from localhost.localdomain (host-95-246-253-26.retail.telecomitalia.it. [95.246.253.26]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-436611fc161sm537419415e9.10.2025.01.05.06.42.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jan 2025 06:42:48 -0800 (PST) From: Christian Marangi To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, upstream@airoha.com Cc: Christian Marangi Subject: [PATCH v4 1/4] clk: en7523: Rework clock handling for different clock numbers Date: Sun, 5 Jan 2025 15:41:58 +0100 Message-ID: <20250105144219.22663-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.45.2 Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Airoha EN7581 SoC have additional clock compared to EN7523 but current driver permits to only support up to EN7523 clock numbers. To handle this, rework the clock handling and permit to declare the clocks number in match_data and alloca clk_data based on the compatible match_data. Signed-off-by: Christian Marangi --- Changes v4: - Move to patch 1 (improve bisectability) Changes v3: - Rework num_clocks for en7523 Changes v2: - Add this patch drivers/clk/clk-en7523.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/clk/clk-en7523.c b/drivers/clk/clk-en7523.c index 495c0d607c7d..596847446b14 100644 --- a/drivers/clk/clk-en7523.c +++ b/drivers/clk/clk-en7523.c @@ -75,6 +75,7 @@ struct en_rst_data { }; struct en_clk_soc_data { + u32 num_clocks; const struct clk_ops pcie_ops; int (*hw_init)(struct platform_device *pdev, struct clk_hw_onecell_data *clk_data); @@ -504,8 +505,6 @@ static void en7523_register_clocks(struct device *dev, struct clk_hw_onecell_dat u32 rate; int i; - clk_data->num = EN7523_NUM_CLOCKS; - for (i = 0; i < ARRAY_SIZE(en7523_base_clks); i++) { const struct en_clk_desc *desc = &en7523_base_clks[i]; u32 reg = desc->div_reg ? desc->div_reg : desc->base_reg; @@ -587,8 +586,6 @@ static void en7581_register_clocks(struct device *dev, struct clk_hw_onecell_dat hw = en7523_register_pcie_clk(dev, base); clk_data->hws[EN7523_CLK_PCIE] = hw; - - clk_data->num = EN7523_NUM_CLOCKS; } static int en7523_reset_update(struct reset_controller_dev *rcdev, @@ -702,21 +699,24 @@ static int en7523_clk_probe(struct platform_device *pdev) struct clk_hw_onecell_data *clk_data; int r; + soc_data = device_get_match_data(&pdev->dev); + clk_data = devm_kzalloc(&pdev->dev, - struct_size(clk_data, hws, EN7523_NUM_CLOCKS), + struct_size(clk_data, hws, soc_data->num_clocks), GFP_KERNEL); if (!clk_data) return -ENOMEM; - soc_data = device_get_match_data(&pdev->dev); r = soc_data->hw_init(pdev, clk_data); if (r) return r; + clk_data->num = soc_data->num_clocks; return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data); } static const struct en_clk_soc_data en7523_data = { + .num_clocks = ARRAY_SIZE(en7523_base_clks) + 1, .pcie_ops = { .is_enabled = en7523_pci_is_enabled, .prepare = en7523_pci_prepare, @@ -726,6 +726,8 @@ static const struct en_clk_soc_data en7523_data = { }; static const struct en_clk_soc_data en7581_data = { + /* We increment num_clocks by 1 to account for additional PCIe clock */ + .num_clocks = ARRAY_SIZE(en7581_base_clks) + 1, .pcie_ops = { .is_enabled = en7581_pci_is_enabled, .enable = en7581_pci_enable, From patchwork Sun Jan 5 14:41:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 13926544 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E96114831D; Sun, 5 Jan 2025 14:42:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736088174; cv=none; b=O4iAz3OKQqmg4pwZdjRLSo3VNQj4OrjyEPUlAituXZpnlSXl+u+vl34Ccw+BBdIVer5B1XukCmsYUmJMJGxyDk8HMPqkBQyBIEBgYZXcSYvx5utlkRYhIt9/o3osd9Xo1FI+qzO3yEtQC1De5XtYhI7SVWZ0ccXXS2i3DN4CPPk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736088174; c=relaxed/simple; bh=DgQkbNFMUZF6etT7F+MrPQ8TpkR7eOYkicYA3rO6KXg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mlBBDp5AL9SENEiIP3wua58DN5HDOY5/HnhLXFo11HOieHh5PIpXg8FmDKZ4LwJbHIIZjuWP7/Bvk2T39CBQPbqZeO+gcW5AfByfglo26Ft3M7clhPsEQJFznifEEVwuBOtQDngkHbKlA5Dl072+US1oVNC8uW7igvO56mIwGwM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ToAZDbWd; arc=none smtp.client-ip=209.85.221.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ToAZDbWd" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-385d7f19f20so5971623f8f.1; Sun, 05 Jan 2025 06:42:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736088170; x=1736692970; darn=vger.kernel.org; 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=WOhybleOhTHPjeZzsBPFEaO9jmQOHgc34Dw9om0Q4h8=; b=ToAZDbWd6jje84VnjtD4YhyzSKN7qKO3yYjvvC3jV2iL8nzVIexWnb8zEBgm4qzRV8 +DJ+B+BBapMdLUOjWkAPn+XFt37JAhtLyn6j3vpz8afwzdW6CNzk+qmNVAaiyjMzlMvq D6DWSjtN+BLMukDGD3XY9KbrTwxqy66scOlDI9OUdM2BvPA10bH8WjOXaCfkSA1oT4CG Avd6hnNMd20vPg4nITcvYD2UH8taAlgYCilqp+4hsRVpPblxk4VbhrbzfShZLnu3ZFpQ ME23OrnKQ+MIHLzVJguXCjRRHU+vjhIkmPaLqk8A1O+jsguply3qmKjs1cri6Nxh2Q3C TpFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736088170; x=1736692970; 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=WOhybleOhTHPjeZzsBPFEaO9jmQOHgc34Dw9om0Q4h8=; b=J4sV6cFC5E0C04IRAm9oZxJYd4jNzgISij+VEUsD/2xfptpS9SS5Lbstq7FF1lpf/i Qz+GO+bYhgUXr67lct53lJ4ht/+PDDDhkAopqOd/rAK9zsgKKUTgQ7w9vPj4xoh1tJO6 IGAYF9yjse84af+JOrbQUs9MBw+MpKbfoyatYmScfXEZin5/oYT91BMXTKnmDf3u0g0x 4ir55mO4cNQ/G4hxqJrVBLZDD12UEME4EDrRMIIFp/pGRRjRQreigB24zCZontDJ3t2f 0h3Yi+uH1ImOWGwmb1y9HOn+/AtUV1fwj00mBfBfjgjVwJAIxyeUFvHjK4C6hKVtvu7+ iqsA== X-Forwarded-Encrypted: i=1; AJvYcCVE2kdRU54/DOzoadkDx7vY1frZMAlLVMlxWtqHcuiknpvL8VwRDt7w34ytJErd+dHxJaLOruQIhg5k@vger.kernel.org, AJvYcCVxblavyXzelmUZt3QTFO7SxZiGjMfOconhmHuV53Wil2JjYG2hZ68CQWnh/ZdA/zmTLeqqQOJVyfX5pX0c@vger.kernel.org, AJvYcCWAgPPe/jvZRvrb2Wl6MybICLqvmzT68O6YWOJj8boDxz/6YvVQDGISg+zfqqp3GY2VK87QJLP0bHYg@vger.kernel.org X-Gm-Message-State: AOJu0YzfYjaW9Qbl840hZovAzqWh9wYqGXRsBJw2OF/jypAxg58CPbnF /zGtUD2yEaLNxp+PDC6Cmh/sQqo3tKpQ8uaUdu0S9WuVtMSg+6EU X-Gm-Gg: ASbGncvrXpC37zsiaLoMe/vCzPKWO4Rz/84Tt9GP4MPaBt8lTJ8C2omDLY6ryJeufXQ 9a9XmHOnJT6pRQJVr2Jx27saPZooIsOv2DGagzo4gjhcCtpvoVVYkJYYLkltFj4lzrwxa6w0IkX JXa6TW10H7/vp/ZIwUvbfqUSjMULaWieHEyOYq/FtijWgmVWwC9vZifYmlYiDP3WKinTJuYdZpr pn45i5Iuihhg0K3ARDqy6RDoNuSDKmzDRFxQuqrNgnQN/+9xJiShjLZfvVsTgY4U66Lr/EBk7f0 rcyD9yqs9e2YiENPTN8IjoGBWdiYWqMpydtXx25wAQ== X-Google-Smtp-Source: AGHT+IE3hZS2I+GK+KUi0d3XAsWuMwOFs9eilu3b8uldtYNCW7Pvn/usnSWG1s0nvTT7w6Z9eUSuRg== X-Received: by 2002:a05:6000:1f89:b0:385:e013:39ec with SMTP id ffacd0b85a97d-38a221f1307mr48869956f8f.8.1736088170517; Sun, 05 Jan 2025 06:42:50 -0800 (PST) Received: from localhost.localdomain (host-95-246-253-26.retail.telecomitalia.it. [95.246.253.26]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-436611fc161sm537419415e9.10.2025.01.05.06.42.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jan 2025 06:42:50 -0800 (PST) From: Christian Marangi To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, upstream@airoha.com Cc: Christian Marangi Subject: [PATCH v4 2/4] dt-bindings: clock: drop NUM_CLOCKS define for EN7581 Date: Sun, 5 Jan 2025 15:41:59 +0100 Message-ID: <20250105144219.22663-2-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250105144219.22663-1-ansuelsmth@gmail.com> References: <20250105144219.22663-1-ansuelsmth@gmail.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Drop NUM_CLOCKS define for EN7581 include. This is not a binding and should not be placed here. Value is derived internally in the user driver. Signed-off-by: Christian Marangi Acked-by: Krzysztof Kozlowski --- Changes v4: - Move to patch 2 (improves bisectability) Changes v3: - Add this patch include/dt-bindings/clock/en7523-clk.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/dt-bindings/clock/en7523-clk.h b/include/dt-bindings/clock/en7523-clk.h index 717d23a5e5ae..28e56745ccff 100644 --- a/include/dt-bindings/clock/en7523-clk.h +++ b/include/dt-bindings/clock/en7523-clk.h @@ -12,6 +12,4 @@ #define EN7523_CLK_CRYPTO 6 #define EN7523_CLK_PCIE 7 -#define EN7523_NUM_CLOCKS 8 - #endif /* _DT_BINDINGS_CLOCK_AIROHA_EN7523_H_ */ From patchwork Sun Jan 5 14:42:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 13926545 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F17861552FA; Sun, 5 Jan 2025 14:42:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736088175; cv=none; b=GGPc9L/4S+ut9MxoOHXv4mQAdhSjrUTHpvsuoRy7Efv2rxcVx39fF4Um9J911nrLgMESHPn2z0HXIuEqziF10XfSNstjhwN63DBI5JMlYKY41aM4SQbn0qj6keBPHGkuJ8MgTjJsRgQYdwseDUcwj7ueC83n7q5Y1OKvxdpfBHs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736088175; c=relaxed/simple; bh=7GIQqUjlMT5bgex6Ozz6WNE/20sFjJIoGKoZOcWPOlA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qhRpcJSO7D9MoIU9ZrPLEGjTGyzOHe1G5jBmeY777Rz2rhEp0+UJsK+bjebsNUUeHCE1BY7ZJhJCLoZN5PRmnXD4urvPNRHlLzvolZrq7Jvq9fErmhI1uZEXaOZMpK9NTc5Io1VVPjjaFFO5apixEArGdoO4fGm661eA8m3jBVw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SF8gTX7e; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SF8gTX7e" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-43622267b2eso142849435e9.0; Sun, 05 Jan 2025 06:42:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736088172; x=1736692972; darn=vger.kernel.org; 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=M2d8+jeTpX799XdIAphX2pC/RY7vgNu0VjS1hTZC2as=; b=SF8gTX7eAtXMffrfwhV+kuORldJCwMq/ZqpzFwQBUxg66fBkHPTwVSiMGC1rK2HXtL buhURSdj+xeYafG+ZUjMGVTO06lad/txFKfyOMWxtekeqrruBFJyMzyfzNWiUuaFRDr4 NbC+nhQPKgiEqUflpfsv2NjLPnUB1IcBHKjzzxWqMrdrh0QMNVlawzoTTHbgi2TuEXbk jvj/Y1fFhY3dtV6s3K0pV4T3nf3RsF/Xr8az44EJA0biDH09jPoH3YwkOgXofIADpUyp tbhFs/RX9xJJhI0OCx5OikFDcacyv7BNQJ5jXtzJchNBIV8G1veW2czaDgf7IvGHQmI0 Roeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736088172; x=1736692972; 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=M2d8+jeTpX799XdIAphX2pC/RY7vgNu0VjS1hTZC2as=; b=s5x4a0BlBbBthJMpG3ggcMQEgDAK3D6M1lHX/3D1ZtQjm9Ef/BuolMwze3ufbMLR70 daXeq2jyb4Rchd4Cg968fVyU0uwNZC9glwLv+aZeoo8tHn3rd2++3VeSUcfNlo/GutRh d16ZV8X8x1rlcrPRY/4s3JzLyHi+K6knDxxhP2X3AxK+o23jeg1qEHsJb3O+KmPACU2V 9F/J0jm++mo4K87dSyxQBWzP9hj+AwmB7071hJzqCxYeWfriGr9iebjaQQzJwSuVr/pa 2NNBy9cpmBGH1HcLBrGhlhVeWUmOx8iRJkl9GZnVaoqrrLKFMOemIJ3q7frPUBQak9H7 4vXA== X-Forwarded-Encrypted: i=1; AJvYcCXV/ctfcEIbfF5PQO3Dex8P6mHh1P2PLbLmhg66SpOIl0WCMTGdXSmLVLNig0yTZaR7xkz6aapaQ4ByNwQT@vger.kernel.org, AJvYcCXkomAzB0VyX0jtAFbRXdCfuB/Lrm2Pu/ONM5ZEvrl9GVEYZ3Srgb1t2X0h95pgzFH2/w7Oup7gBoqU@vger.kernel.org, AJvYcCXoVBFJEgTaeKMRGI4f6M5ys+BDGAgrA6x2c7QiecvfQ0bwBrU1IHNnONFj+tnp/H4hfymc/2NbjS6u@vger.kernel.org X-Gm-Message-State: AOJu0YzERSLgnpQBiQtk/Naupf7kpnWfbb68T8sh+Bdlcrinwiz68CUq 51BTdpwWgzT3bVw4fKMyprTWe8H94JclLYBMfQz3Y/COMMHUZWNg X-Gm-Gg: ASbGncs2xfeWZT7icBg77kiPPNPV/0moiGJ16jTO/Wjyy9GZfhGvp2bbUwxSv942Hb2 SbeZFNQDVekXbRRanrcN2zGxWIlxakLpEuyL2k3W+zp3P1/KPeU9fSrv/3Xh18OoQ1cpT0wlKnx rgdBGTXOpAhID5FGqDEvVG971BZgm1CAeXmS7/yCxP3qILguYum2cs48zeubXvhM8WGGiY3qrd+ MJ7Ir17y6SZRdFUPdhLBIftXJALmHbrq+BIkjE5D43Z8f2Oz7aj7YhCdKuLCYnNQd07q4cCUA25 7cvrM4CNIIaWvX7ohasBBboKQFGlEUrfxk7RGApvCw== X-Google-Smtp-Source: AGHT+IH/ngJ/94qJYlVC0z68a2qrl9BiLG+fxJwepXTHF7UlB2BB81+aDyFpedZ38wpVf2/CAe1hfg== X-Received: by 2002:a05:600c:450f:b0:434:f4f9:8104 with SMTP id 5b1f17b1804b1-436cf91aff0mr39676535e9.33.1736088172231; Sun, 05 Jan 2025 06:42:52 -0800 (PST) Received: from localhost.localdomain (host-95-246-253-26.retail.telecomitalia.it. [95.246.253.26]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-436611fc161sm537419415e9.10.2025.01.05.06.42.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jan 2025 06:42:51 -0800 (PST) From: Christian Marangi To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, upstream@airoha.com Cc: Christian Marangi , Conor Dooley Subject: [PATCH v4 3/4] dt-bindings: clock: add ID for eMMC for EN7581 Date: Sun, 5 Jan 2025 15:42:00 +0100 Message-ID: <20250105144219.22663-3-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250105144219.22663-1-ansuelsmth@gmail.com> References: <20250105144219.22663-1-ansuelsmth@gmail.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add ID for eMMC for EN7581. This is to control clock selection of eMMC between 200MHz and 150MHz. Signed-off-by: Christian Marangi Acked-by: Conor Dooley --- Changes v4: - Move to patch 3 Changes v3: - Add ack tag Changes v2: - Drop additional define for EN7581_NUM_CLOCKS include/dt-bindings/clock/en7523-clk.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/dt-bindings/clock/en7523-clk.h b/include/dt-bindings/clock/en7523-clk.h index 28e56745ccff..edfa64045f52 100644 --- a/include/dt-bindings/clock/en7523-clk.h +++ b/include/dt-bindings/clock/en7523-clk.h @@ -12,4 +12,6 @@ #define EN7523_CLK_CRYPTO 6 #define EN7523_CLK_PCIE 7 +#define EN7581_CLK_EMMC 8 + #endif /* _DT_BINDINGS_CLOCK_AIROHA_EN7523_H_ */ From patchwork Sun Jan 5 14:42:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 13926546 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61E3715625A; Sun, 5 Jan 2025 14:42:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736088177; cv=none; b=fHgItpz/mEgGAp89HWwpLq1xGP8ep9GeS1zk0aabFx242ddIeCIAb0FKwedjchmT7AEEVY7pCM8zVE2uzEQccr7vvFFAIpLEk4+bWkz1ObAy6xGnHKCu2j0k6wBwJGWVnW2BwehSCWxlMMI2HTJs0OY44i9mVU8A/6Q8E11H1+s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736088177; c=relaxed/simple; bh=aXYHEyhcGDnwQtSXky3nGDQSSqSNdvxMLGJcZmOBs/k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pTmymDgpjv98S6UtQxysuUOkY66LvCOjbtLDpg+P8NwjigA8nyAQhGHK51M3T+E4xh+hYQ2/mX8KOoserem+6gGlDadn8/Mb4UCrlws7UnAhLJdFAZ7OfPygm7U8mgqUO2NrgNdxr5iSMehMBbHJM+ZHIb/bEtmFtbgnmxsWPx4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Q6luk0g1; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Q6luk0g1" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4361e89b6daso92795515e9.3; Sun, 05 Jan 2025 06:42:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736088173; x=1736692973; darn=vger.kernel.org; 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=Jd0ivsCOxo6eepP3Mt6WIBgGEYTd25op3kx8K4XoTrc=; b=Q6luk0g1ByDhDMAULCi1aYYiptJHs0kAcXAoLbwFxIYYOXR1vYmwDtRwkMoS9QYftc r+UjUort9CVwyQxenocnOvuj1rs2vPMh3TvYYbb2ONl4Y8JG+/YYEdbAeUcYtMdjOLjl 2WYp8fMGJ2Bapv6BWxlmu32MNsaI9RV7RL+VyJV49eDLvD418lpoPuYT/0sYkBuWc2eT Gyc5xoy8sTX115DFk5ojzmhmC3k8K+4GbQ1VRTcBRNrd8IR6I2HPxrxXQ/lfUK/IVpid YZt9dZz7RuoVajemJ/foEvk2DJ+0g1UhMKM+dWX2i7NF46Zw0/z0Axpys+Mk1W2LSaaf ptjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736088173; x=1736692973; 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=Jd0ivsCOxo6eepP3Mt6WIBgGEYTd25op3kx8K4XoTrc=; b=PA9GA8mwUa2m4KmOcPwofjNopxE5LJxr2yN1jDLZ7SikDiazCISNiT/L4ZrxWkKGLm XHkKCYVjqzcChPg7yRGLLG4K5ulBWQ1XJqjUiDef5+xOAsfBsMZoyZALA5yc2oClekjr 6GFuJ8K0A8k9mB1laWZKh5f+DYSUqlX+xahyRIdd8YeEdr6hEuiSXA0zND51nulsCQuc R5Q8qxrLJ6/G9ysfrf3+JM/7r2Wp+icBl4J3IhPMwrFIA47A+hHOr2a4QqYFSBg0tJ9s E3mR7TU/Q71OxgNkMwzKcDEU4hLWBfbfcupxXmyllIFhK4BNI/qxK/z0Zi0Tly3ll7By 7Kyg== X-Forwarded-Encrypted: i=1; AJvYcCWGuZ8d8d9xEXo/uK+U6BjCf+wr6Dg/QT47XhpzWIgLT7Tp05c007hW8RgktXh5e4pmOO3j1Yf/uyOhLnIE@vger.kernel.org, AJvYcCWbXzDJVcnrdtcZ3ZBSU4jO0v8tXO2qCEGROIdsLtb6xuXlrXb/BkKw9jnaUi7LzEx2zTiiyR30g3pB@vger.kernel.org, AJvYcCXbednUfRREAkHCNlmbWA9phgbCVcJiOVRaoZBcqqWia67ohnv2u2bWjnlv0Z18QcWoRIRiSHpZ4+vK@vger.kernel.org X-Gm-Message-State: AOJu0YzhPGHJCzGpfGRcCaElplMHsluvQ2H93gWZh/7I2nmmImD75s19 edYNfRz3KQdvuThKfqvV0D8YrfgQcPsL5d2GiyTvMR92z4buSAzi X-Gm-Gg: ASbGncvLdBStq+pWQk0//8EiUMBo86JegHtTwB3y6nYvBm1aaBSXNbuziW6MDrWQ1lB f05Uf9WCreBS4nJBvHx0r83SO+DoqE5M8VdgXzq3JCvFhEjfJvp5v+WnZNIXArD+HuzJKV8eo53 U+vf1H5uTl/BkNxYoFI3sIxlWsDxTGtEkO3CcB6a1puMLF92aAMFyd/FajCabzXwjU3XgIt4sJH 1OkcVenaOg64P44szGSu/jQo5Q8rdSgvx9IzXBY0pdJ2CyYmVWhtAHgu/gYeW861T2WMst/jq6z I9qpj2P4d/RJeX6ezNZlXvf16wRCa1cLqd/eVqxtMA== X-Google-Smtp-Source: AGHT+IGG/tO2Lt1RR3RwIADrDoxZJHJyg2667n9OATP8E6fkLp+FqDm6xbKIJUkTGitScnbjrZs9tg== X-Received: by 2002:adf:a342:0:b0:38a:624b:e37b with SMTP id ffacd0b85a97d-38a624be4e4mr11369844f8f.53.1736088173542; Sun, 05 Jan 2025 06:42:53 -0800 (PST) Received: from localhost.localdomain (host-95-246-253-26.retail.telecomitalia.it. [95.246.253.26]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-436611fc161sm537419415e9.10.2025.01.05.06.42.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jan 2025 06:42:53 -0800 (PST) From: Christian Marangi To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, upstream@airoha.com Cc: Christian Marangi Subject: [PATCH v4 4/4] clk: en7523: Add clock for eMMC for EN7581 Date: Sun, 5 Jan 2025 15:42:01 +0100 Message-ID: <20250105144219.22663-4-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250105144219.22663-1-ansuelsmth@gmail.com> References: <20250105144219.22663-1-ansuelsmth@gmail.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add clock for eMMC for EN7581. This is used to give info of the current eMMC source clock and to switch it from 200MHz or 150MHz. Signed-off-by: Christian Marangi --- Changes v4: - Move to patch 4 Changes v2: - Rename emmc_base to emmc7581_base to make it more clear drivers/clk/clk-en7523.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/clk/clk-en7523.c b/drivers/clk/clk-en7523.c index 596847446b14..b36445359b5a 100644 --- a/drivers/clk/clk-en7523.c +++ b/drivers/clk/clk-en7523.c @@ -91,6 +91,7 @@ static const u32 emi7581_base[] = { 540000000, 480000000, 400000000, 300000000 } static const u32 bus7581_base[] = { 600000000, 540000000 }; static const u32 npu7581_base[] = { 800000000, 750000000, 720000000, 600000000 }; static const u32 crypto_base[] = { 540000000, 480000000 }; +static const u32 emmc7581_base[] = { 200000000, 150000000 }; static const struct en_clk_desc en7523_base_clks[] = { { @@ -281,6 +282,15 @@ static const struct en_clk_desc en7581_base_clks[] = { .base_shift = 0, .base_values = crypto_base, .n_base_values = ARRAY_SIZE(crypto_base), + }, { + .id = EN7581_CLK_EMMC, + .name = "emmc", + + .base_reg = REG_CRYPTO_CLKSRC2, + .base_bits = 1, + .base_shift = 12, + .base_values = emmc7581_base, + .n_base_values = ARRAY_SIZE(emmc7581_base), } };