All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
To: <devicetree@vger.kernel.org>
Cc: <linux-clk@vger.kernel.org>, <gregkh@linuxfoundation.org>,
	<robh+dt@kernel.org>, <sboyd@kernel.org>,
	<mturquette@baylibre.com>, <shubhrajyoti.datta@gmail.com>,
	<git@xilinx.com>, <miquel.raynal@bootlin.com>,
	<devel@driverdev.osuosl.org>,
	Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Subject: [PATCH v10 3/9] staging: clocking-wizard: Update the fixed factor divisors
Date: Wed, 24 Feb 2021 18:40:35 +0530	[thread overview]
Message-ID: <1614172241-17326-4-git-send-email-shubhrajyoti.datta@xilinx.com> (raw)
In-Reply-To: <1614172241-17326-1-git-send-email-shubhrajyoti.datta@xilinx.com>

Update the fixed factor clock registration to register the divisors.

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

diff --git a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
index 57f80ba..9cc2f6d 100644
--- a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
+++ b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
@@ -135,8 +135,10 @@ static int clk_wzrd_probe(struct platform_device *pdev)
 	u32 reg;
 	unsigned long rate;
 	const char *clk_name;
+	void __iomem *ctrl_reg;
 	struct clk_wzrd *clk_wzrd;
 	struct device_node *np = pdev->dev.of_node;
+	unsigned long flags = 0;
 
 	clk_wzrd = devm_kzalloc(&pdev->dev, sizeof(*clk_wzrd), GFP_KERNEL);
 	if (!clk_wzrd)
@@ -198,6 +200,7 @@ static int clk_wzrd_probe(struct platform_device *pdev)
 		ret = -ENOMEM;
 		goto err_disable_clk;
 	}
+
 	clk_wzrd->clks_internal[wzrd_clk_mul] = clk_register_fixed_factor
 			(&pdev->dev, clk_name,
 			 __clk_get_name(clk_wzrd->clk_in1),
@@ -209,19 +212,19 @@ static int clk_wzrd_probe(struct platform_device *pdev)
 		goto err_disable_clk;
 	}
 
-	/* register div */
-	reg = (readl(clk_wzrd->base + WZRD_CLK_CFG_REG(0)) &
-			WZRD_DIVCLK_DIVIDE_MASK) >> WZRD_DIVCLK_DIVIDE_SHIFT;
 	clk_name = kasprintf(GFP_KERNEL, "%s_mul_div", dev_name(&pdev->dev));
 	if (!clk_name) {
 		ret = -ENOMEM;
 		goto err_rm_int_clk;
 	}
 
-	clk_wzrd->clks_internal[wzrd_clk_mul_div] = clk_register_fixed_factor
+	ctrl_reg = clk_wzrd->base + WZRD_CLK_CFG_REG(0);
+	/* register div */
+	clk_wzrd->clks_internal[wzrd_clk_mul_div] = clk_register_divider
 			(&pdev->dev, clk_name,
 			 __clk_get_name(clk_wzrd->clks_internal[wzrd_clk_mul]),
-			 0, 1, reg);
+			flags, ctrl_reg, 0, 8, CLK_DIVIDER_ONE_BASED |
+			CLK_DIVIDER_ALLOW_ZERO, &clkwzrd_lock);
 	if (IS_ERR(clk_wzrd->clks_internal[wzrd_clk_mul_div])) {
 		dev_err(&pdev->dev, "unable to register divider clock\n");
 		ret = PTR_ERR(clk_wzrd->clks_internal[wzrd_clk_mul_div]);
-- 
2.1.1


WARNING: multiple messages have this Message-ID (diff)
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 3/9] staging: clocking-wizard: Update the fixed factor divisors
Date: Wed, 24 Feb 2021 18:40:35 +0530	[thread overview]
Message-ID: <1614172241-17326-4-git-send-email-shubhrajyoti.datta@xilinx.com> (raw)
In-Reply-To: <1614172241-17326-1-git-send-email-shubhrajyoti.datta@xilinx.com>

Update the fixed factor clock registration to register the divisors.

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

diff --git a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
index 57f80ba..9cc2f6d 100644
--- a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
+++ b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
@@ -135,8 +135,10 @@ static int clk_wzrd_probe(struct platform_device *pdev)
 	u32 reg;
 	unsigned long rate;
 	const char *clk_name;
+	void __iomem *ctrl_reg;
 	struct clk_wzrd *clk_wzrd;
 	struct device_node *np = pdev->dev.of_node;
+	unsigned long flags = 0;
 
 	clk_wzrd = devm_kzalloc(&pdev->dev, sizeof(*clk_wzrd), GFP_KERNEL);
 	if (!clk_wzrd)
@@ -198,6 +200,7 @@ static int clk_wzrd_probe(struct platform_device *pdev)
 		ret = -ENOMEM;
 		goto err_disable_clk;
 	}
+
 	clk_wzrd->clks_internal[wzrd_clk_mul] = clk_register_fixed_factor
 			(&pdev->dev, clk_name,
 			 __clk_get_name(clk_wzrd->clk_in1),
@@ -209,19 +212,19 @@ static int clk_wzrd_probe(struct platform_device *pdev)
 		goto err_disable_clk;
 	}
 
-	/* register div */
-	reg = (readl(clk_wzrd->base + WZRD_CLK_CFG_REG(0)) &
-			WZRD_DIVCLK_DIVIDE_MASK) >> WZRD_DIVCLK_DIVIDE_SHIFT;
 	clk_name = kasprintf(GFP_KERNEL, "%s_mul_div", dev_name(&pdev->dev));
 	if (!clk_name) {
 		ret = -ENOMEM;
 		goto err_rm_int_clk;
 	}
 
-	clk_wzrd->clks_internal[wzrd_clk_mul_div] = clk_register_fixed_factor
+	ctrl_reg = clk_wzrd->base + WZRD_CLK_CFG_REG(0);
+	/* register div */
+	clk_wzrd->clks_internal[wzrd_clk_mul_div] = clk_register_divider
 			(&pdev->dev, clk_name,
 			 __clk_get_name(clk_wzrd->clks_internal[wzrd_clk_mul]),
-			 0, 1, reg);
+			flags, ctrl_reg, 0, 8, CLK_DIVIDER_ONE_BASED |
+			CLK_DIVIDER_ALLOW_ZERO, &clkwzrd_lock);
 	if (IS_ERR(clk_wzrd->clks_internal[wzrd_clk_mul_div])) {
 		dev_err(&pdev->dev, "unable to register divider clock\n");
 		ret = PTR_ERR(clk_wzrd->clks_internal[wzrd_clk_mul_div]);
-- 
2.1.1

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

  parent reply	other threads:[~2021-02-24 14:19 UTC|newest]

Thread overview: 30+ 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 ` 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   ` 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 2/9] staging: clocking-wizard: Rename speed-grade to xlnx, speed-grade Shubhrajyoti Datta
2021-02-24 13:10 ` Shubhrajyoti Datta [this message]
2021-02-24 13:10   ` [PATCH v10 3/9] staging: clocking-wizard: Update the fixed factor divisors Shubhrajyoti Datta
2021-02-24 13:10 ` [PATCH v10 4/9] staging: clocking-wizard: Allow changing of parent rate for single output Shubhrajyoti Datta
2021-02-24 13:10   ` Shubhrajyoti Datta
2021-02-24 13:10 ` [PATCH v10 5/9] staging: clocking-wizard: Add support for dynamic reconfiguration Shubhrajyoti Datta
2021-02-24 13:10   ` 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   ` 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   ` Shubhrajyoti Datta
2021-02-24 13:10 ` [PATCH v10 8/9] dt-bindings: add documentation of xilinx clocking wizard Shubhrajyoti Datta
2021-02-24 13:10   ` Shubhrajyoti Datta
2021-03-06 20:20   ` Rob Herring
2021-03-06 20:20     ` Rob Herring
2021-04-08 10:26     ` Shubhrajyoti Datta
2021-04-08 10:26       ` Shubhrajyoti Datta
2021-04-08 10:40       ` Michal Simek
2021-04-08 10:40         ` Michal Simek
2021-04-09 23:32         ` Stephen Boyd
2021-04-09 23:32           ` Stephen Boyd
2021-05-13  6:48           ` Shubhrajyoti Datta
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
2021-02-24 13:10   ` 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-4-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.