aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2015-11-18 08:04:20 -0500
committerThierry Reding <treding@nvidia.com>2015-11-18 09:54:11 -0500
commite52d7c04bb3911d4ce98bd237f69f5246d9c7083 (patch)
treefc1af5cb677bf3350fdd74e420082bdeb84a6040 /drivers
parentc4947e364b5096f00f3cfc0a7af2a4f688ffb919 (diff)
clk: tegra: Miscellaneous coding style cleanups
Use unsigned int for loop variables that can never become negative and remove a couple of gratuitous blank lines. Also use single spaces around operators and use a single space instead of a tab to separate comments from code. Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/clk/tegra/clk-pll.c6
-rw-r--r--drivers/clk/tegra/clk-tegra114.c12
-rw-r--r--drivers/clk/tegra/clk-tegra124.c6
-rw-r--r--drivers/clk/tegra/clk-tegra20.c5
-rw-r--r--drivers/clk/tegra/clk-tegra30.c15
5 files changed, 19 insertions, 25 deletions
diff --git a/drivers/clk/tegra/clk-pll.c b/drivers/clk/tegra/clk-pll.c
index d6d4ecb88e94..c72340830521 100644
--- a/drivers/clk/tegra/clk-pll.c
+++ b/drivers/clk/tegra/clk-pll.c
@@ -439,7 +439,7 @@ static int _calc_rate(struct clk_hw *hw, struct tegra_clk_pll_freq_table *cfg,
439 /* 439 /*
440 * PLL_P_OUT1 rate is not listed in PLLA table 440 * PLL_P_OUT1 rate is not listed in PLLA table
441 */ 441 */
442 cfreq = parent_rate/(parent_rate/1000000); 442 cfreq = parent_rate / (parent_rate / 1000000);
443 break; 443 break;
444 default: 444 default:
445 pr_err("%s Unexpected reference rate %lu\n", 445 pr_err("%s Unexpected reference rate %lu\n",
@@ -936,8 +936,8 @@ static int _calc_dynamic_ramp_rate(struct clk_hw *hw,
936 p_div = _p_div_to_hw(hw, p); 936 p_div = _p_div_to_hw(hw, p);
937 if (p_div < 0) 937 if (p_div < 0)
938 return p_div; 938 return p_div;
939 else 939
940 cfg->p = p_div; 940 cfg->p = p_div;
941 941
942 if (cfg->n > divn_max(pll) || cfg->output_rate > pll->params->vco_max) 942 if (cfg->n > divn_max(pll) || cfg->output_rate > pll->params->vco_max)
943 return -EINVAL; 943 return -EINVAL;
diff --git a/drivers/clk/tegra/clk-tegra114.c b/drivers/clk/tegra/clk-tegra114.c
index 9a50471009d8..8668ecd0046c 100644
--- a/drivers/clk/tegra/clk-tegra114.c
+++ b/drivers/clk/tegra/clk-tegra114.c
@@ -215,7 +215,7 @@ static struct tegra_clk_pll_params pll_c_params = {
215 .input_min = 12000000, 215 .input_min = 12000000,
216 .input_max = 800000000, 216 .input_max = 800000000,
217 .cf_min = 12000000, 217 .cf_min = 12000000,
218 .cf_max = 19200000, /* s/w policy, h/w capability 50 MHz */ 218 .cf_max = 19200000, /* s/w policy, h/w capability 50 MHz */
219 .vco_min = 600000000, 219 .vco_min = 600000000,
220 .vco_max = 1400000000, 220 .vco_max = 1400000000,
221 .base_reg = PLLC_BASE, 221 .base_reg = PLLC_BASE,
@@ -337,7 +337,7 @@ static struct tegra_clk_pll_params pll_m_params = {
337 .input_min = 12000000, 337 .input_min = 12000000,
338 .input_max = 500000000, 338 .input_max = 500000000,
339 .cf_min = 12000000, 339 .cf_min = 12000000,
340 .cf_max = 19200000, /* s/w policy, h/w capability 50 MHz */ 340 .cf_max = 19200000, /* s/w policy, h/w capability 50 MHz */
341 .vco_min = 400000000, 341 .vco_min = 400000000,
342 .vco_max = 1066000000, 342 .vco_max = 1066000000,
343 .base_reg = PLLM_BASE, 343 .base_reg = PLLM_BASE,
@@ -534,7 +534,7 @@ static struct tegra_clk_pll_params pll_x_params = {
534 .input_min = 12000000, 534 .input_min = 12000000,
535 .input_max = 800000000, 535 .input_max = 800000000,
536 .cf_min = 12000000, 536 .cf_min = 12000000,
537 .cf_max = 19200000, /* s/w policy, h/w capability 50 MHz */ 537 .cf_max = 19200000, /* s/w policy, h/w capability 50 MHz */
538 .vco_min = 700000000, 538 .vco_min = 700000000,
539 .vco_max = 2400000000U, 539 .vco_max = 2400000000U,
540 .base_reg = PLLX_BASE, 540 .base_reg = PLLX_BASE,
@@ -965,8 +965,8 @@ static void __init tegra114_fixed_clk_init(void __iomem *clk_base)
965 965
966static __init void tegra114_utmi_param_configure(void __iomem *clk_base) 966static __init void tegra114_utmi_param_configure(void __iomem *clk_base)
967{ 967{
968 unsigned int i;
968 u32 reg; 969 u32 reg;
969 int i;
970 970
971 for (i = 0; i < ARRAY_SIZE(utmi_parameters); i++) { 971 for (i = 0; i < ARRAY_SIZE(utmi_parameters); i++) {
972 if (osc_freq == utmi_parameters[i].osc_frequency) 972 if (osc_freq == utmi_parameters[i].osc_frequency)
@@ -1173,7 +1173,7 @@ static __init void tegra114_periph_clk_init(void __iomem *clk_base,
1173{ 1173{
1174 struct clk *clk; 1174 struct clk *clk;
1175 struct tegra_periph_init_data *data; 1175 struct tegra_periph_init_data *data;
1176 int i; 1176 unsigned int i;
1177 1177
1178 /* xusb_ss_div2 */ 1178 /* xusb_ss_div2 */
1179 clk = clk_register_fixed_factor(NULL, "xusb_ss_div2", "xusb_ss_src", 0, 1179 clk = clk_register_fixed_factor(NULL, "xusb_ss_div2", "xusb_ss_src", 0,
@@ -1278,7 +1278,7 @@ static struct tegra_cpu_car_ops tegra114_cpu_car_ops = {
1278 1278
1279static const struct of_device_id pmc_match[] __initconst = { 1279static const struct of_device_id pmc_match[] __initconst = {
1280 { .compatible = "nvidia,tegra114-pmc" }, 1280 { .compatible = "nvidia,tegra114-pmc" },
1281 {}, 1281 { },
1282}; 1282};
1283 1283
1284/* 1284/*
diff --git a/drivers/clk/tegra/clk-tegra124.c b/drivers/clk/tegra/clk-tegra124.c
index 9b78e1c77f77..b58f58576e77 100644
--- a/drivers/clk/tegra/clk-tegra124.c
+++ b/drivers/clk/tegra/clk-tegra124.c
@@ -235,7 +235,7 @@ static struct tegra_clk_pll_params pll_c_params = {
235 .input_min = 12000000, 235 .input_min = 12000000,
236 .input_max = 800000000, 236 .input_max = 800000000,
237 .cf_min = 12000000, 237 .cf_min = 12000000,
238 .cf_max = 19200000, /* s/w policy, h/w capability 50 MHz */ 238 .cf_max = 19200000, /* s/w policy, h/w capability 50 MHz */
239 .vco_min = 600000000, 239 .vco_min = 600000000,
240 .vco_max = 1400000000, 240 .vco_max = 1400000000,
241 .base_reg = PLLC_BASE, 241 .base_reg = PLLC_BASE,
@@ -1024,8 +1024,8 @@ static struct clk **clks;
1024 1024
1025static void tegra124_utmi_param_configure(void __iomem *clk_base) 1025static void tegra124_utmi_param_configure(void __iomem *clk_base)
1026{ 1026{
1027 unsigned int i;
1027 u32 reg; 1028 u32 reg;
1028 int i;
1029 1029
1030 for (i = 0; i < ARRAY_SIZE(utmi_parameters); i++) { 1030 for (i = 0; i < ARRAY_SIZE(utmi_parameters); i++) {
1031 if (osc_freq == utmi_parameters[i].osc_frequency) 1031 if (osc_freq == utmi_parameters[i].osc_frequency)
@@ -1356,7 +1356,7 @@ static struct tegra_cpu_car_ops tegra124_cpu_car_ops = {
1356 1356
1357static const struct of_device_id pmc_match[] __initconst = { 1357static const struct of_device_id pmc_match[] __initconst = {
1358 { .compatible = "nvidia,tegra124-pmc" }, 1358 { .compatible = "nvidia,tegra124-pmc" },
1359 {}, 1359 { },
1360}; 1360};
1361 1361
1362static struct tegra_clk_init_table common_init_table[] __initdata = { 1362static struct tegra_clk_init_table common_init_table[] __initdata = {
diff --git a/drivers/clk/tegra/clk-tegra20.c b/drivers/clk/tegra/clk-tegra20.c
index bf004f0e4f65..319e80ef69e1 100644
--- a/drivers/clk/tegra/clk-tegra20.c
+++ b/drivers/clk/tegra/clk-tegra20.c
@@ -759,7 +759,6 @@ static void __init tegra20_audio_clk_init(void)
759 CLK_SET_RATE_PARENT, 89, 759 CLK_SET_RATE_PARENT, 89,
760 periph_clk_enb_refcnt); 760 periph_clk_enb_refcnt);
761 clks[TEGRA20_CLK_AUDIO_2X] = clk; 761 clks[TEGRA20_CLK_AUDIO_2X] = clk;
762
763} 762}
764 763
765static const char *i2s1_parents[] = {"pll_a_out0", "audio_2x", "pll_p", 764static const char *i2s1_parents[] = {"pll_a_out0", "audio_2x", "pll_p",
@@ -802,7 +801,7 @@ static void __init tegra20_periph_clk_init(void)
802{ 801{
803 struct tegra_periph_init_data *data; 802 struct tegra_periph_init_data *data;
804 struct clk *clk; 803 struct clk *clk;
805 int i; 804 unsigned int i;
806 805
807 /* ac97 */ 806 /* ac97 */
808 clk = tegra_clk_register_periph_gate("ac97", "pll_a_out0", 807 clk = tegra_clk_register_periph_gate("ac97", "pll_a_out0",
@@ -1085,7 +1084,7 @@ static struct tegra_clk_duplicate tegra_clk_duplicates[] = {
1085 1084
1086static const struct of_device_id pmc_match[] __initconst = { 1085static const struct of_device_id pmc_match[] __initconst = {
1087 { .compatible = "nvidia,tegra20-pmc" }, 1086 { .compatible = "nvidia,tegra20-pmc" },
1088 {}, 1087 { },
1089}; 1088};
1090 1089
1091static void __init tegra20_clock_init(struct device_node *np) 1090static void __init tegra20_clock_init(struct device_node *np)
diff --git a/drivers/clk/tegra/clk-tegra30.c b/drivers/clk/tegra/clk-tegra30.c
index c1d065d61156..b670e315be4d 100644
--- a/drivers/clk/tegra/clk-tegra30.c
+++ b/drivers/clk/tegra/clk-tegra30.c
@@ -505,7 +505,6 @@ static struct tegra_clk_pll_params pll_d_params = {
505 .freq_table = pll_d_freq_table, 505 .freq_table = pll_d_freq_table,
506 .flags = TEGRA_PLL_HAS_CPCON | TEGRA_PLL_SET_LFCON | 506 .flags = TEGRA_PLL_HAS_CPCON | TEGRA_PLL_SET_LFCON |
507 TEGRA_PLL_USE_LOCK, 507 TEGRA_PLL_USE_LOCK,
508
509}; 508};
510 509
511static struct tegra_clk_pll_params pll_d2_params = { 510static struct tegra_clk_pll_params pll_d2_params = {
@@ -861,13 +860,12 @@ static struct tegra_clk tegra30_clks[tegra_clk_max] __initdata = {
861 [tegra_clk_pll_p_out4] = { .dt_id = TEGRA30_CLK_PLL_P_OUT4, .present = true }, 860 [tegra_clk_pll_p_out4] = { .dt_id = TEGRA30_CLK_PLL_P_OUT4, .present = true },
862 [tegra_clk_pll_a] = { .dt_id = TEGRA30_CLK_PLL_A, .present = true }, 861 [tegra_clk_pll_a] = { .dt_id = TEGRA30_CLK_PLL_A, .present = true },
863 [tegra_clk_pll_a_out0] = { .dt_id = TEGRA30_CLK_PLL_A_OUT0, .present = true }, 862 [tegra_clk_pll_a_out0] = { .dt_id = TEGRA30_CLK_PLL_A_OUT0, .present = true },
864
865}; 863};
866 864
867static void tegra30_utmi_param_configure(void) 865static void tegra30_utmi_param_configure(void)
868{ 866{
867 unsigned int i;
869 u32 reg; 868 u32 reg;
870 int i;
871 869
872 for (i = 0; i < ARRAY_SIZE(utmi_parameters); i++) { 870 for (i = 0; i < ARRAY_SIZE(utmi_parameters); i++) {
873 if (input_freq == utmi_parameters[i].osc_frequency) 871 if (input_freq == utmi_parameters[i].osc_frequency)
@@ -925,7 +923,7 @@ static void __init tegra30_pll_init(void)
925 923
926 /* PLLC */ 924 /* PLLC */
927 clk = tegra_clk_register_pll("pll_c", "pll_ref", clk_base, pmc_base, 0, 925 clk = tegra_clk_register_pll("pll_c", "pll_ref", clk_base, pmc_base, 0,
928 &pll_c_params, NULL); 926 &pll_c_params, NULL);
929 clks[TEGRA30_CLK_PLL_C] = clk; 927 clks[TEGRA30_CLK_PLL_C] = clk;
930 928
931 /* PLLC_OUT1 */ 929 /* PLLC_OUT1 */
@@ -1135,7 +1133,7 @@ static void __init tegra30_periph_clk_init(void)
1135{ 1133{
1136 struct tegra_periph_init_data *data; 1134 struct tegra_periph_init_data *data;
1137 struct clk *clk; 1135 struct clk *clk;
1138 int i; 1136 unsigned int i;
1139 1137
1140 /* dsia */ 1138 /* dsia */
1141 clk = tegra_clk_register_periph_gate("dsia", "pll_d_out0", 0, clk_base, 1139 clk = tegra_clk_register_periph_gate("dsia", "pll_d_out0", 0, clk_base,
@@ -1224,7 +1222,6 @@ static void tegra30_cpu_out_of_reset(u32 cpu)
1224 wmb(); 1222 wmb();
1225} 1223}
1226 1224
1227
1228static void tegra30_enable_cpu_clock(u32 cpu) 1225static void tegra30_enable_cpu_clock(u32 cpu)
1229{ 1226{
1230 unsigned int reg; 1227 unsigned int reg;
@@ -1237,7 +1234,6 @@ static void tegra30_enable_cpu_clock(u32 cpu)
1237 1234
1238static void tegra30_disable_cpu_clock(u32 cpu) 1235static void tegra30_disable_cpu_clock(u32 cpu)
1239{ 1236{
1240
1241 unsigned int reg; 1237 unsigned int reg;
1242 1238
1243 reg = readl(clk_base + TEGRA_CLK_RST_CONTROLLER_CLK_CPU_CMPLX); 1239 reg = readl(clk_base + TEGRA_CLK_RST_CONTROLLER_CLK_CPU_CMPLX);
@@ -1268,7 +1264,7 @@ static void tegra30_cpu_clock_suspend(void)
1268 /* switch coresite to clk_m, save off original source */ 1264 /* switch coresite to clk_m, save off original source */
1269 tegra30_cpu_clk_sctx.clk_csite_src = 1265 tegra30_cpu_clk_sctx.clk_csite_src =
1270 readl(clk_base + CLK_RESET_SOURCE_CSITE); 1266 readl(clk_base + CLK_RESET_SOURCE_CSITE);
1271 writel(3<<30, clk_base + CLK_RESET_SOURCE_CSITE); 1267 writel(3 << 30, clk_base + CLK_RESET_SOURCE_CSITE);
1272 1268
1273 tegra30_cpu_clk_sctx.cpu_burst = 1269 tegra30_cpu_clk_sctx.cpu_burst =
1274 readl(clk_base + CLK_RESET_CCLK_BURST); 1270 readl(clk_base + CLK_RESET_CCLK_BURST);
@@ -1402,7 +1398,7 @@ static struct tegra_clk_duplicate tegra_clk_duplicates[] = {
1402 1398
1403static const struct of_device_id pmc_match[] __initconst = { 1399static const struct of_device_id pmc_match[] __initconst = {
1404 { .compatible = "nvidia,tegra30-pmc" }, 1400 { .compatible = "nvidia,tegra30-pmc" },
1405 {}, 1401 { },
1406}; 1402};
1407 1403
1408static struct tegra_audio_clk_info tegra30_audio_plls[] = { 1404static struct tegra_audio_clk_info tegra30_audio_plls[] = {
@@ -1441,7 +1437,6 @@ static void __init tegra30_clock_init(struct device_node *np)
1441 NULL) < 0) 1437 NULL) < 0)
1442 return; 1438 return;
1443 1439
1444
1445 tegra_fixed_clk_init(tegra30_clks); 1440 tegra_fixed_clk_init(tegra30_clks);
1446 tegra30_pll_init(); 1441 tegra30_pll_init();
1447 tegra30_super_clk_init(); 1442 tegra30_super_clk_init();