driverdev-devel.linuxdriverproject.org archive mirror
 help / color / mirror / Atom feed
From: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
To: <devicetree@vger.kernel.org>
Cc: devel@driverdev.osuosl.org, shubhrajyoti.datta@gmail.com,
	sboyd@kernel.org, gregkh@linuxfoundation.org,
	mturquette@baylibre.com,
	Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>,
	robh+dt@kernel.org, git@xilinx.com, miquel.raynal@bootlin.com,
	linux-clk@vger.kernel.org
Subject: [PATCH v10 4/9] staging: clocking-wizard: Allow changing of parent rate for single output
Date: Wed, 24 Feb 2021 18:40:36 +0530	[thread overview]
Message-ID: <1614172241-17326-5-git-send-email-shubhrajyoti.datta@xilinx.com> (raw)
In-Reply-To: <1614172241-17326-1-git-send-email-shubhrajyoti.datta@xilinx.com>

If there is only one output then allow changing of the parent rate.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
---
 drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
index 9cc2f6d..e08fc2f 100644
--- a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
+++ b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
@@ -138,6 +138,7 @@ static int clk_wzrd_probe(struct platform_device *pdev)
 	void __iomem *ctrl_reg;
 	struct clk_wzrd *clk_wzrd;
 	struct device_node *np = pdev->dev.of_node;
+	int nr_outputs;
 	unsigned long flags = 0;
 
 	clk_wzrd = devm_kzalloc(&pdev->dev, sizeof(*clk_wzrd), GFP_KERNEL);
@@ -201,6 +202,14 @@ static int clk_wzrd_probe(struct platform_device *pdev)
 		goto err_disable_clk;
 	}
 
+	ret = of_property_read_u32(np, "nr-outputs", &nr_outputs);
+	if (ret || nr_outputs > WZRD_NUM_OUTPUTS) {
+		ret = -EINVAL;
+		goto err_disable_clk;
+	}
+	if (nr_outputs == 1)
+		flags = CLK_SET_RATE_PARENT;
+
 	clk_wzrd->clks_internal[wzrd_clk_mul] = clk_register_fixed_factor
 			(&pdev->dev, clk_name,
 			 __clk_get_name(clk_wzrd->clk_in1),
-- 
2.1.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  parent reply	other threads:[~2021-02-24 13:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-24 13:10 [PATCH v10 0/9] clk: clocking-wizard: driver updates Shubhrajyoti Datta
2021-02-24 13:10 ` [PATCH v10 1/9] staging: clocking-wizard: Fix kernel-doc warning Shubhrajyoti Datta
2021-02-24 13:10 ` [PATCH v10 2/9] staging: clocking-wizard: Rename speed-grade to xlnx, speed-grade Shubhrajyoti Datta
2021-02-24 13:10 ` [PATCH v10 3/9] staging: clocking-wizard: Update the fixed factor divisors Shubhrajyoti Datta
2021-02-24 13:10 ` Shubhrajyoti Datta [this message]
2021-02-24 13:10 ` [PATCH v10 5/9] staging: clocking-wizard: Add support for dynamic reconfiguration Shubhrajyoti Datta
2021-02-24 13:10 ` [PATCH v10 6/9] staging: clocking-wizard: Add support for fractional support Shubhrajyoti Datta
2021-02-24 13:10 ` [PATCH v10 7/9] staging: clocking-wizard: Remove the hardcoding of the clock outputs Shubhrajyoti Datta
2021-02-24 13:10 ` [PATCH v10 8/9] dt-bindings: add documentation of xilinx clocking wizard Shubhrajyoti Datta
2021-03-06 20:20   ` Rob Herring
2021-04-08 10:26     ` Shubhrajyoti Datta
2021-04-08 10:40       ` Michal Simek
2021-04-09 23:32         ` Stephen Boyd
2021-05-13  6:48           ` Shubhrajyoti Datta
2021-02-24 13:10 ` [PATCH v10 9/9] clk: clock-wizard: Add the clockwizard to clk directory Shubhrajyoti Datta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1614172241-17326-5-git-send-email-shubhrajyoti.datta@xilinx.com \
    --to=shubhrajyoti.datta@xilinx.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=devicetree@vger.kernel.org \
    --cc=git@xilinx.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=mturquette@baylibre.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=shubhrajyoti.datta@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).