Skip to content

Commit fa4dd53

Browse files
wasimk1988bebarino
authored andcommitted
clk: qoriq: use macros to generate pll_mask
Use macros to generate pll_mask to make code more readable. Signed-off-by: Wasim Khan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent 5c8fe58 commit fa4dd53

File tree

1 file changed

+43
-19
lines changed

1 file changed

+43
-19
lines changed

drivers/clk/clk-qoriq.c

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22
/*
33
* Copyright 2013 Freescale Semiconductor, Inc.
4+
* Copyright 2021 NXP
45
*
56
* clock driver for Freescale QorIQ SoCs.
67
*/
@@ -564,7 +565,9 @@ static const struct clockgen_chipinfo chipinfo[] = {
564565
.cmux_to_group = {
565566
0, 1, 1, 1, -1
566567
},
567-
.pll_mask = 0x3f,
568+
.pll_mask = BIT(PLATFORM_PLL) |
569+
BIT(CGA_PLL1) | BIT(CGA_PLL2) | BIT(CGA_PLL3) |
570+
BIT(CGB_PLL1) | BIT(CGB_PLL2),
568571
.flags = CG_PLL_8BIT,
569572
},
570573
{
@@ -580,7 +583,9 @@ static const struct clockgen_chipinfo chipinfo[] = {
580583
.cmux_to_group = {
581584
0, 1, 1, 1, -1
582585
},
583-
.pll_mask = 0x3f,
586+
.pll_mask = BIT(PLATFORM_PLL) |
587+
BIT(CGA_PLL1) | BIT(CGA_PLL2) | BIT(CGA_PLL3) |
588+
BIT(CGB_PLL1) | BIT(CGB_PLL2),
584589
.flags = CG_PLL_8BIT,
585590
},
586591
{
@@ -591,7 +596,8 @@ static const struct clockgen_chipinfo chipinfo[] = {
591596
.cmux_to_group = {
592597
0, -1
593598
},
594-
.pll_mask = 0x03,
599+
.pll_mask = BIT(PLATFORM_PLL) |
600+
BIT(CGA_PLL1) | BIT(CGA_PLL2),
595601
},
596602
{
597603
.compat = "fsl,ls1028a-clockgen",
@@ -605,7 +611,8 @@ static const struct clockgen_chipinfo chipinfo[] = {
605611
.cmux_to_group = {
606612
0, 0, 0, 0, -1
607613
},
608-
.pll_mask = 0x07,
614+
.pll_mask = BIT(PLATFORM_PLL) |
615+
BIT(CGA_PLL1) | BIT(CGA_PLL2),
609616
.flags = CG_VER3 | CG_LITTLE_ENDIAN,
610617
},
611618
{
@@ -620,7 +627,8 @@ static const struct clockgen_chipinfo chipinfo[] = {
620627
.cmux_to_group = {
621628
0, -1
622629
},
623-
.pll_mask = 0x07,
630+
.pll_mask = BIT(PLATFORM_PLL) |
631+
BIT(CGA_PLL1) | BIT(CGA_PLL2),
624632
.flags = CG_PLL_8BIT,
625633
},
626634
{
@@ -635,7 +643,8 @@ static const struct clockgen_chipinfo chipinfo[] = {
635643
.cmux_to_group = {
636644
0, -1
637645
},
638-
.pll_mask = 0x07,
646+
.pll_mask = BIT(PLATFORM_PLL) |
647+
BIT(CGA_PLL1) | BIT(CGA_PLL2),
639648
.flags = CG_PLL_8BIT,
640649
},
641650
{
@@ -649,7 +658,8 @@ static const struct clockgen_chipinfo chipinfo[] = {
649658
.cmux_to_group = {
650659
0, 0, -1
651660
},
652-
.pll_mask = 0x07,
661+
.pll_mask = BIT(PLATFORM_PLL) |
662+
BIT(CGA_PLL1) | BIT(CGA_PLL2),
653663
.flags = CG_VER3 | CG_LITTLE_ENDIAN,
654664
},
655665
{
@@ -660,7 +670,7 @@ static const struct clockgen_chipinfo chipinfo[] = {
660670
.cmux_to_group = {
661671
0, -1
662672
},
663-
.pll_mask = 0x03,
673+
.pll_mask = BIT(PLATFORM_PLL) | BIT(CGA_PLL1),
664674
},
665675
{
666676
.compat = "fsl,ls2080a-clockgen",
@@ -670,7 +680,9 @@ static const struct clockgen_chipinfo chipinfo[] = {
670680
.cmux_to_group = {
671681
0, 0, 1, 1, -1
672682
},
673-
.pll_mask = 0x37,
683+
.pll_mask = BIT(PLATFORM_PLL) |
684+
BIT(CGA_PLL1) | BIT(CGA_PLL2) |
685+
BIT(CGB_PLL1) | BIT(CGB_PLL2),
674686
.flags = CG_VER3 | CG_LITTLE_ENDIAN,
675687
},
676688
{
@@ -681,7 +693,9 @@ static const struct clockgen_chipinfo chipinfo[] = {
681693
.cmux_to_group = {
682694
0, 0, 0, 0, 1, 1, 1, 1, -1
683695
},
684-
.pll_mask = 0x37,
696+
.pll_mask = BIT(PLATFORM_PLL) |
697+
BIT(CGA_PLL1) | BIT(CGA_PLL2) |
698+
BIT(CGB_PLL1) | BIT(CGB_PLL2),
685699
.flags = CG_VER3 | CG_LITTLE_ENDIAN,
686700
},
687701
{
@@ -694,7 +708,8 @@ static const struct clockgen_chipinfo chipinfo[] = {
694708
.cmux_to_group = {
695709
0, 0, 1, 1, -1
696710
},
697-
.pll_mask = 0x07,
711+
.pll_mask = BIT(PLATFORM_PLL) |
712+
BIT(CGA_PLL1) | BIT(CGA_PLL2),
698713
},
699714
{
700715
.compat = "fsl,p3041-clockgen",
@@ -706,7 +721,8 @@ static const struct clockgen_chipinfo chipinfo[] = {
706721
.cmux_to_group = {
707722
0, 0, 1, 1, -1
708723
},
709-
.pll_mask = 0x07,
724+
.pll_mask = BIT(PLATFORM_PLL) |
725+
BIT(CGA_PLL1) | BIT(CGA_PLL2),
710726
},
711727
{
712728
.compat = "fsl,p4080-clockgen",
@@ -718,7 +734,9 @@ static const struct clockgen_chipinfo chipinfo[] = {
718734
.cmux_to_group = {
719735
0, 0, 0, 0, 1, 1, 1, 1, -1
720736
},
721-
.pll_mask = 0x1f,
737+
.pll_mask = BIT(PLATFORM_PLL) |
738+
BIT(CGA_PLL1) | BIT(CGA_PLL2) |
739+
BIT(CGA_PLL3) | BIT(CGA_PLL4),
722740
},
723741
{
724742
.compat = "fsl,p5020-clockgen",
@@ -730,7 +748,8 @@ static const struct clockgen_chipinfo chipinfo[] = {
730748
.cmux_to_group = {
731749
0, 1, -1
732750
},
733-
.pll_mask = 0x07,
751+
.pll_mask = BIT(PLATFORM_PLL) |
752+
BIT(CGA_PLL1) | BIT(CGA_PLL2),
734753
},
735754
{
736755
.compat = "fsl,p5040-clockgen",
@@ -742,7 +761,8 @@ static const struct clockgen_chipinfo chipinfo[] = {
742761
.cmux_to_group = {
743762
0, 0, 1, 1, -1
744763
},
745-
.pll_mask = 0x0f,
764+
.pll_mask = BIT(PLATFORM_PLL) |
765+
BIT(CGA_PLL1) | BIT(CGA_PLL2) | BIT(CGA_PLL3),
746766
},
747767
{
748768
.compat = "fsl,t1023-clockgen",
@@ -757,7 +777,7 @@ static const struct clockgen_chipinfo chipinfo[] = {
757777
.cmux_to_group = {
758778
0, 0, -1
759779
},
760-
.pll_mask = 0x03,
780+
.pll_mask = BIT(PLATFORM_PLL) | BIT(CGA_PLL1),
761781
.flags = CG_PLL_8BIT,
762782
},
763783
{
@@ -770,7 +790,8 @@ static const struct clockgen_chipinfo chipinfo[] = {
770790
.cmux_to_group = {
771791
0, 0, 0, 0, -1
772792
},
773-
.pll_mask = 0x07,
793+
.pll_mask = BIT(PLATFORM_PLL) |
794+
BIT(CGA_PLL1) | BIT(CGA_PLL2),
774795
.flags = CG_PLL_8BIT,
775796
},
776797
{
@@ -786,7 +807,8 @@ static const struct clockgen_chipinfo chipinfo[] = {
786807
.cmux_to_group = {
787808
0, -1
788809
},
789-
.pll_mask = 0x07,
810+
.pll_mask = BIT(PLATFORM_PLL) |
811+
BIT(CGA_PLL1) | BIT(CGA_PLL2),
790812
.flags = CG_PLL_8BIT,
791813
},
792814
{
@@ -802,7 +824,9 @@ static const struct clockgen_chipinfo chipinfo[] = {
802824
.cmux_to_group = {
803825
0, 0, 1, -1
804826
},
805-
.pll_mask = 0x3f,
827+
.pll_mask = BIT(PLATFORM_PLL) |
828+
BIT(CGA_PLL1) | BIT(CGA_PLL2) | BIT(CGA_PLL3) |
829+
BIT(CGB_PLL1) | BIT(CGB_PLL2),
806830
.flags = CG_PLL_8BIT,
807831
},
808832
{},

0 commit comments

Comments
 (0)