Skip to contentSkip to conversation

clk: at91: sama5d2 materials

GIT PULL Boris Brezillon 4 participants 5 messages Aug 18, 2015 – Oct 2, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Stephen, Mike,

Here is a PR for the sama5d2 materials.
I know we're already late in the release cycle and I'm not sure you can take this PR into account for 4.3, so if you can't could you please queue it for 4.4?

Thanks,

Boris

The following changes since commit c42743f11f58646a50bc4b96da363429dca0c5e6:

clk: add bindings for the Ux500 clocks (2015-08-13 11:29:45 -0700)

are available in the git repository at:

https://github.com/bbrezillon/linux-at91.git clk/atmel-clk-next

for you to fetch changes up to 3be0527c0f8bbbb744a6a34603d6a83e511c6741:

clk: at91: add generated clock driver (2015-08-18 10:11:57 +0200)

----------------------------------------------------------------
Nicolas Ferre (4):
clk: at91: cleanup PMC header file for PCR register fields
clk: at91: modify PMC peripheral clock to deal with newer register layout
clk: at91: add PMC sama5d2 support
clk: at91: add generated clock driver

 Documentation/devicetree/bindings/clock/at91-clock.txt |  35 +++++++++++++++++++++
 arch/arm/mach-at91/Kconfig                             |   3 ++
 drivers/clk/at91/Makefile                              |   1 +
 drivers/clk/at91/clk-generated.c                       | 306 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 drivers/clk/at91/clk-peripheral.c                      |  24 +++++++++-----
 drivers/clk/at91/pmc.c                                 |  21 +++++++++++++
 drivers/clk/at91/pmc.h                                 |   3 ++
 include/dt-bindings/clock/at91.h                       |   1 +
 include/linux/clk/at91_pmc.h                           |  22 ++++++++-----
 9 files changed, 400 insertions(+), 16 deletions(-)
 create mode 100644 drivers/clk/at91/clk-generated.c
#1 lore raw

Quoting Boris Brezillon (2015-08-18 01:24:01)

Quoted 6 lines

Stephen, Mike,

Here is a PR for the sama5d2 materials.
I know we're already late in the release cycle and I'm not sure you can take this PR into account for 4.3, so if you can't could you please queue it for 4.4?

Queued for 4.4.

Thanks,
Mike

Quoted 40 lines

Thanks,

Boris

The following changes since commit c42743f11f58646a50bc4b96da363429dca0c5e6:

clk: add bindings for the Ux500 clocks (2015-08-13 11:29:45 -0700)

are available in the git repository at:

https://github.com/bbrezillon/linux-at91.git clk/atmel-clk-next

for you to fetch changes up to 3be0527c0f8bbbb744a6a34603d6a83e511c6741:

clk: at91: add generated clock driver (2015-08-18 10:11:57 +0200)

----------------------------------------------------------------
Nicolas Ferre (4):
clk: at91: cleanup PMC header file for PCR register fields
clk: at91: modify PMC peripheral clock to deal with newer register layout
clk: at91: add PMC sama5d2 support
clk: at91: add generated clock driver

 Documentation/devicetree/bindings/clock/at91-clock.txt |  35 +++++++++++++++++++++
 arch/arm/mach-at91/Kconfig                             |   3 ++
 drivers/clk/at91/Makefile                              |   1 +
 drivers/clk/at91/clk-generated.c                       | 306 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 drivers/clk/at91/clk-peripheral.c                      |  24 +++++++++-----
 drivers/clk/at91/pmc.c                                 |  21 +++++++++++++
 drivers/clk/at91/pmc.h                                 |   3 ++
 include/dt-bindings/clock/at91.h                       |   1 +
 include/linux/clk/at91_pmc.h                           |  22 ++++++++-----
 9 files changed, 400 insertions(+), 16 deletions(-)
 create mode 100644 drivers/clk/at91/clk-generated.c

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#2 lore raw
Quoted 8 lines · Michael Turquette

Quoting Boris Brezillon (2015-08-18 01:24:01)

Quoted 6 lines

Stephen, Mike,

Here is a PR for the sama5d2 materials.
I know we're already late in the release cycle and I'm not sure you can take this PR into account for 4.3, so if you can't could you please queue it for 4.4?

Quoted 12 lines

Queued for 4.4.

Thanks,
Mike

Quoted 7 lines

Thanks,

Boris

The following changes since commit c42743f11f58646a50bc4b96da363429dca0c5e6:

This commit was in clk-next and then got rebased. clk-next isn't stable, please don't base pull requests on it. If you have some dependency on the patches in there then we need to know so that we can provide some branch.

I cherry-picked the 4 patches to clk-next. I had to squash in this fix to get it to compile. Please check.

---8<----

drivers/clk/at91/clk-generated.c +6 -6
index 631123ca6f85..abc80949e1dd 100644
@@ -99,22 +99,22 @@ static int clk_generated_determine_rate(struct clk_hw *hw,
 					struct clk_rate_request *req)
 {
 	struct clk_generated *gck = to_clk_generated(hw);
-	struct clk *parent = NULL;
+	struct clk_hw *parent = NULL;
 	long best_rate = -EINVAL;
 	unsigned long tmp_rate, min_rate;
 	int best_diff = -1;
 	int tmp_diff;
 	int i;
 
-	for (i = 0; i < __clk_get_num_parents(hw->clk); i++) {
+	for (i = 0; i < clk_hw_get_num_parents(hw); i++) {
 		u32 div;
 		unsigned long parent_rate;
 
-		parent = clk_get_parent_by_index(hw->clk, i);
+		parent = clk_hw_get_parent_by_index(hw, i);
 		if (!parent)
 			continue;
 
-		parent_rate = __clk_get_rate(parent);
+		parent_rate = clk_hw_get_rate(parent);
 		min_rate = DIV_ROUND_CLOSEST(parent_rate, GENERATED_MAX_DIV + 1);
 		if (!parent_rate ||
 		    (gck->range.max && min_rate > gck->range.max))
@@ -128,7 +128,7 @@ static int clk_generated_determine_rate(struct clk_hw *hw,
 				best_rate = tmp_rate;
 				best_diff = tmp_diff;
 				req->best_parent_rate = parent_rate;
-				req->best_parent_hw = __clk_get_hw(parent);
+				req->best_parent_hw = parent;
 			}
 
 			if (!best_diff || tmp_rate < req->rate)
@@ -156,7 +156,7 @@ static int clk_generated_set_parent(struct clk_hw *hw, u8 index)
 {
 	struct clk_generated *gck = to_clk_generated(hw);
 
-	if (index >= __clk_get_num_parents(hw->clk))
+	if (index >= clk_hw_get_num_parents(hw))
 		return -EINVAL;
 
 	gck->parent_id = index;
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
#3 lore raw

Hi Stephen,

Quoted 19 lines · On Thu, 1 Oct 2015 12:47:48 -0700 Stephen Boyd <[email protected]> wrote:
Quoted 18 lines · Michael Turquette

Quoting Boris Brezillon (2015-08-18 01:24:01)

Quoted 6 lines

Stephen, Mike,

Here is a PR for the sama5d2 materials.
I know we're already late in the release cycle and I'm not sure you can take this PR into account for 4.3, so if you can't could you please queue it for 4.4?

Queued for 4.4.

Thanks,
Mike

Quoted 5 lines

Thanks,

Boris

Quoted 7 lines
Quoted 2 lines
Quoted 2 lines

The following changes since commit c42743f11f58646a50bc4b96da363429dca0c5e6:

This commit was in clk-next and then got rebased. clk-next isn't stable, please don't base pull requests on it. If you have some dependency on the patches in there then we need to know so that we can provide some branch.

Yes, sorry about that, I'll base my future PR on linus' master branch.

Quoted 3 lines

I cherry-picked the 4 patches to clk-next. I had to squash in this fix to get it to compile. Please check.

Thanks, looks good to me.
Nicolas, can you test it on a real platform?

Quoted 52 lines

---8<----

drivers/clk/at91/clk-generated.c +6 -6
index 631123ca6f85..abc80949e1dd 100644
@@ -99,22 +99,22 @@ static int clk_generated_determine_rate(struct clk_hw *hw,
 					struct clk_rate_request *req)
 {
 	struct clk_generated *gck = to_clk_generated(hw);
-	struct clk *parent = NULL;
+	struct clk_hw *parent = NULL;
 	long best_rate = -EINVAL;
 	unsigned long tmp_rate, min_rate;
 	int best_diff = -1;
 	int tmp_diff;
 	int i;
 
-	for (i = 0; i < __clk_get_num_parents(hw->clk); i++) {
+	for (i = 0; i < clk_hw_get_num_parents(hw); i++) {
 		u32 div;
 		unsigned long parent_rate;
 
-		parent = clk_get_parent_by_index(hw->clk, i);
+		parent = clk_hw_get_parent_by_index(hw, i);
 		if (!parent)
 			continue;
 
-		parent_rate = __clk_get_rate(parent);
+		parent_rate = clk_hw_get_rate(parent);
 		min_rate = DIV_ROUND_CLOSEST(parent_rate, GENERATED_MAX_DIV + 1);
 		if (!parent_rate ||
 		    (gck->range.max && min_rate > gck->range.max))
@@ -128,7 +128,7 @@ static int clk_generated_determine_rate(struct clk_hw *hw,
 				best_rate = tmp_rate;
 				best_diff = tmp_diff;
 				req->best_parent_rate = parent_rate;
-				req->best_parent_hw = __clk_get_hw(parent);
+				req->best_parent_hw = parent;
 			}
 
 			if (!best_diff || tmp_rate < req->rate)
@@ -156,7 +156,7 @@ static int clk_generated_set_parent(struct clk_hw *hw, u8 index)
 {
 	struct clk_generated *gck = to_clk_generated(hw);
 
-	if (index >= __clk_get_num_parents(hw->clk))
+	if (index >= clk_hw_get_num_parents(hw))
 		return -EINVAL;
 
 	gck->parent_id = index;
Signature · 3 lines
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
Tested-by
#4 lore raw

Le 01/10/2015 22:38, Boris Brezillon a ?crit :

Quoted 32 lines

Hi Stephen,

Quoted 19 lines · On Thu, 1 Oct 2015 12:47:48 -0700 Stephen Boyd <[email protected]> wrote:
Quoted 18 lines · Michael Turquette

Quoting Boris Brezillon (2015-08-18 01:24:01)

Quoted 6 lines

Stephen, Mike,

Here is a PR for the sama5d2 materials.
I know we're already late in the release cycle and I'm not sure you can take this PR into account for 4.3, so if you can't could you please queue it for 4.4?

Queued for 4.4.

Thanks,
Mike

Quoted 5 lines

Thanks,

Boris

Quoted 7 lines
Quoted 2 lines
Quoted 2 lines

The following changes since commit c42743f11f58646a50bc4b96da363429dca0c5e6:

This commit was in clk-next and then got rebased. clk-next isn't stable, please don't base pull requests on it. If you have some dependency on the patches in there then we need to know so that we can provide some branch.

Quoted 8 lines

Yes, sorry about that, I'll base my future PR on linus' master branch.

Quoted 3 lines

I cherry-picked the 4 patches to clk-next. I had to squash in this fix to get it to compile. Please check.

Thanks, looks good to me.
Nicolas, can you test it on a real platform?

Yep, tested and works okay. So for your changes (and for the record actually):

Quoted 54 lines
Quoted 51 lines

---8<----

drivers/clk/at91/clk-generated.c +6 -6
index 631123ca6f85..abc80949e1dd 100644
@@ -99,22 +99,22 @@ static int clk_generated_determine_rate(struct clk_hw *hw,
 					struct clk_rate_request *req)
 {
 	struct clk_generated *gck = to_clk_generated(hw);
-	struct clk *parent = NULL;
+	struct clk_hw *parent = NULL;
 	long best_rate = -EINVAL;
 	unsigned long tmp_rate, min_rate;
 	int best_diff = -1;
 	int tmp_diff;
 	int i;
 
-	for (i = 0; i < __clk_get_num_parents(hw->clk); i++) {
+	for (i = 0; i < clk_hw_get_num_parents(hw); i++) {
 		u32 div;
 		unsigned long parent_rate;
 
-		parent = clk_get_parent_by_index(hw->clk, i);
+		parent = clk_hw_get_parent_by_index(hw, i);
 		if (!parent)
 			continue;
 
-		parent_rate = __clk_get_rate(parent);
+		parent_rate = clk_hw_get_rate(parent);
 		min_rate = DIV_ROUND_CLOSEST(parent_rate, GENERATED_MAX_DIV + 1);
 		if (!parent_rate ||
 		    (gck->range.max && min_rate > gck->range.max))
@@ -128,7 +128,7 @@ static int clk_generated_determine_rate(struct clk_hw *hw,
 				best_rate = tmp_rate;
 				best_diff = tmp_diff;
 				req->best_parent_rate = parent_rate;
-				req->best_parent_hw = __clk_get_hw(parent);
+				req->best_parent_hw = parent;
 			}
 
 			if (!best_diff || tmp_rate < req->rate)
@@ -156,7 +156,7 @@ static int clk_generated_set_parent(struct clk_hw *hw, u8 index)
 {
 	struct clk_generated *gck = to_clk_generated(hw);
 
-	if (index >= __clk_get_num_parents(hw->clk))
+	if (index >= clk_hw_get_num_parents(hw))
 		return -EINVAL;
 
 	gck->parent_id = index;
Signature · 1 line
Nicolas Ferre