diff options
author | Tony Lindgren <tony@atomide.com> | 2013-02-09 22:59:34 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2013-02-09 22:59:34 -0500 |
commit | 14211e2fd223212ee6498a707e01ac45fef22b10 (patch) | |
tree | 13d2968424e2e36131ce114a1560d386f67085b3 | |
parent | 88b62b915b0b7e25870eb0604ed9a92ba4bfc9f7 (diff) | |
parent | b5596a89412053aa0e18b59f40dc3a3e53917937 (diff) |
Merge tag 'omap-devel-e-for-3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/pjw/omap-pending into omap-for-v3.9/clock
Some miscellaneous OMAP2+ clock fixes, mostly related to the recent
common clock framework conversion.
Basic test logs are available here:
http://www.pwsan.com/omap/testlogs/clock_devel_a_3.9/20130208120108/
-rw-r--r-- | arch/arm/mach-omap2/cclock33xx_data.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-omap2/cclock3xxx_data.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-omap2/cclock44xx_data.c | 13 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clock.h | 11 | ||||
-rw-r--r-- | arch/arm/mach-omap2/dpll3xxx.c | 5 | ||||
-rw-r--r-- | drivers/media/platform/omap3isp/isp.c | 18 | ||||
-rw-r--r-- | drivers/media/platform/omap3isp/isp.h | 8 |
7 files changed, 46 insertions, 29 deletions
diff --git a/arch/arm/mach-omap2/cclock33xx_data.c b/arch/arm/mach-omap2/cclock33xx_data.c index ea64ad606759..476b82066cb6 100644 --- a/arch/arm/mach-omap2/cclock33xx_data.c +++ b/arch/arm/mach-omap2/cclock33xx_data.c | |||
@@ -284,9 +284,10 @@ DEFINE_STRUCT_CLK(dpll_disp_ck, dpll_core_ck_parents, dpll_ddr_ck_ops); | |||
284 | * TODO: Add clksel here (sys_clkin, CORE_CLKOUTM6, PER_CLKOUTM2 | 284 | * TODO: Add clksel here (sys_clkin, CORE_CLKOUTM6, PER_CLKOUTM2 |
285 | * and ALT_CLK1/2) | 285 | * and ALT_CLK1/2) |
286 | */ | 286 | */ |
287 | DEFINE_CLK_DIVIDER(dpll_disp_m2_ck, "dpll_disp_ck", &dpll_disp_ck, 0x0, | 287 | DEFINE_CLK_DIVIDER(dpll_disp_m2_ck, "dpll_disp_ck", &dpll_disp_ck, |
288 | AM33XX_CM_DIV_M2_DPLL_DISP, AM33XX_DPLL_CLKOUT_DIV_SHIFT, | 288 | CLK_SET_RATE_PARENT, AM33XX_CM_DIV_M2_DPLL_DISP, |
289 | AM33XX_DPLL_CLKOUT_DIV_WIDTH, CLK_DIVIDER_ONE_BASED, NULL); | 289 | AM33XX_DPLL_CLKOUT_DIV_SHIFT, AM33XX_DPLL_CLKOUT_DIV_WIDTH, |
290 | CLK_DIVIDER_ONE_BASED, NULL); | ||
290 | 291 | ||
291 | /* DPLL_PER */ | 292 | /* DPLL_PER */ |
292 | static struct dpll_data dpll_per_dd = { | 293 | static struct dpll_data dpll_per_dd = { |
@@ -723,7 +724,8 @@ static struct clk_hw_omap lcd_gclk_hw = { | |||
723 | .clksel_mask = AM33XX_CLKSEL_0_1_MASK, | 724 | .clksel_mask = AM33XX_CLKSEL_0_1_MASK, |
724 | }; | 725 | }; |
725 | 726 | ||
726 | DEFINE_STRUCT_CLK(lcd_gclk, lcd_ck_parents, gpio_fck_ops); | 727 | DEFINE_STRUCT_CLK_FLAGS(lcd_gclk, lcd_ck_parents, |
728 | gpio_fck_ops, CLK_SET_RATE_PARENT); | ||
727 | 729 | ||
728 | DEFINE_CLK_FIXED_FACTOR(mmc_clk, "dpll_per_m2_ck", &dpll_per_m2_ck, 0x0, 1, 2); | 730 | DEFINE_CLK_FIXED_FACTOR(mmc_clk, "dpll_per_m2_ck", &dpll_per_m2_ck, 0x0, 1, 2); |
729 | 731 | ||
diff --git a/arch/arm/mach-omap2/cclock3xxx_data.c b/arch/arm/mach-omap2/cclock3xxx_data.c index 6ef87580c33f..4579c3c5338f 100644 --- a/arch/arm/mach-omap2/cclock3xxx_data.c +++ b/arch/arm/mach-omap2/cclock3xxx_data.c | |||
@@ -426,6 +426,7 @@ static struct clk dpll4_m5x2_ck_3630 = { | |||
426 | .parent_names = dpll4_m5x2_ck_parent_names, | 426 | .parent_names = dpll4_m5x2_ck_parent_names, |
427 | .num_parents = ARRAY_SIZE(dpll4_m5x2_ck_parent_names), | 427 | .num_parents = ARRAY_SIZE(dpll4_m5x2_ck_parent_names), |
428 | .ops = &dpll4_m5x2_ck_3630_ops, | 428 | .ops = &dpll4_m5x2_ck_3630_ops, |
429 | .flags = CLK_SET_RATE_PARENT, | ||
429 | }; | 430 | }; |
430 | 431 | ||
431 | static struct clk cam_mclk; | 432 | static struct clk cam_mclk; |
@@ -443,7 +444,14 @@ static struct clk_hw_omap cam_mclk_hw = { | |||
443 | .clkdm_name = "cam_clkdm", | 444 | .clkdm_name = "cam_clkdm", |
444 | }; | 445 | }; |
445 | 446 | ||
446 | DEFINE_STRUCT_CLK(cam_mclk, cam_mclk_parent_names, aes2_ick_ops); | 447 | static struct clk cam_mclk = { |
448 | .name = "cam_mclk", | ||
449 | .hw = &cam_mclk_hw.hw, | ||
450 | .parent_names = cam_mclk_parent_names, | ||
451 | .num_parents = ARRAY_SIZE(cam_mclk_parent_names), | ||
452 | .ops = &aes2_ick_ops, | ||
453 | .flags = CLK_SET_RATE_PARENT, | ||
454 | }; | ||
447 | 455 | ||
448 | static const struct clksel_rate clkout2_src_core_rates[] = { | 456 | static const struct clksel_rate clkout2_src_core_rates[] = { |
449 | { .div = 1, .val = 0, .flags = RATE_IN_3XXX }, | 457 | { .div = 1, .val = 0, .flags = RATE_IN_3XXX }, |
diff --git a/arch/arm/mach-omap2/cclock44xx_data.c b/arch/arm/mach-omap2/cclock44xx_data.c index a2cc046b47f4..e71a19ce3048 100644 --- a/arch/arm/mach-omap2/cclock44xx_data.c +++ b/arch/arm/mach-omap2/cclock44xx_data.c | |||
@@ -595,15 +595,26 @@ static const char *dpll_usb_ck_parents[] = { | |||
595 | 595 | ||
596 | static struct clk dpll_usb_ck; | 596 | static struct clk dpll_usb_ck; |
597 | 597 | ||
598 | static const struct clk_ops dpll_usb_ck_ops = { | ||
599 | .enable = &omap3_noncore_dpll_enable, | ||
600 | .disable = &omap3_noncore_dpll_disable, | ||
601 | .recalc_rate = &omap3_dpll_recalc, | ||
602 | .round_rate = &omap2_dpll_round_rate, | ||
603 | .set_rate = &omap3_noncore_dpll_set_rate, | ||
604 | .get_parent = &omap2_init_dpll_parent, | ||
605 | .init = &omap2_init_clk_clkdm, | ||
606 | }; | ||
607 | |||
598 | static struct clk_hw_omap dpll_usb_ck_hw = { | 608 | static struct clk_hw_omap dpll_usb_ck_hw = { |
599 | .hw = { | 609 | .hw = { |
600 | .clk = &dpll_usb_ck, | 610 | .clk = &dpll_usb_ck, |
601 | }, | 611 | }, |
602 | .dpll_data = &dpll_usb_dd, | 612 | .dpll_data = &dpll_usb_dd, |
613 | .clkdm_name = "l3_init_clkdm", | ||
603 | .ops = &clkhwops_omap3_dpll, | 614 | .ops = &clkhwops_omap3_dpll, |
604 | }; | 615 | }; |
605 | 616 | ||
606 | DEFINE_STRUCT_CLK(dpll_usb_ck, dpll_usb_ck_parents, dpll_ck_ops); | 617 | DEFINE_STRUCT_CLK(dpll_usb_ck, dpll_usb_ck_parents, dpll_usb_ck_ops); |
607 | 618 | ||
608 | static const char *dpll_usb_clkdcoldo_ck_parents[] = { | 619 | static const char *dpll_usb_clkdcoldo_ck_parents[] = { |
609 | "dpll_usb_ck", | 620 | "dpll_usb_ck", |
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h index b40204837bd7..60ddd8612b4d 100644 --- a/arch/arm/mach-omap2/clock.h +++ b/arch/arm/mach-omap2/clock.h | |||
@@ -65,6 +65,17 @@ struct clockdomain; | |||
65 | .ops = &_clkops_name, \ | 65 | .ops = &_clkops_name, \ |
66 | }; | 66 | }; |
67 | 67 | ||
68 | #define DEFINE_STRUCT_CLK_FLAGS(_name, _parent_array_name, \ | ||
69 | _clkops_name, _flags) \ | ||
70 | static struct clk _name = { \ | ||
71 | .name = #_name, \ | ||
72 | .hw = &_name##_hw.hw, \ | ||
73 | .parent_names = _parent_array_name, \ | ||
74 | .num_parents = ARRAY_SIZE(_parent_array_name), \ | ||
75 | .ops = &_clkops_name, \ | ||
76 | .flags = _flags, \ | ||
77 | }; | ||
78 | |||
68 | #define DEFINE_STRUCT_CLK_HW_OMAP(_name, _clkdm_name) \ | 79 | #define DEFINE_STRUCT_CLK_HW_OMAP(_name, _clkdm_name) \ |
69 | static struct clk_hw_omap _name##_hw = { \ | 80 | static struct clk_hw_omap _name##_hw = { \ |
70 | .hw = { \ | 81 | .hw = { \ |
diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c index 0a02aab5df67..3aed4b0b9563 100644 --- a/arch/arm/mach-omap2/dpll3xxx.c +++ b/arch/arm/mach-omap2/dpll3xxx.c | |||
@@ -500,8 +500,9 @@ int omap3_noncore_dpll_set_rate(struct clk_hw *hw, unsigned long rate, | |||
500 | if (dd->last_rounded_rate == 0) | 500 | if (dd->last_rounded_rate == 0) |
501 | return -EINVAL; | 501 | return -EINVAL; |
502 | 502 | ||
503 | /* No freqsel on OMAP4 and OMAP3630 */ | 503 | /* No freqsel on AM335x, OMAP4 and OMAP3630 */ |
504 | if (!cpu_is_omap44xx() && !cpu_is_omap3630()) { | 504 | if (!soc_is_am33xx() && !cpu_is_omap44xx() && |
505 | !cpu_is_omap3630()) { | ||
505 | freqsel = _omap3_dpll_compute_freqsel(clk, | 506 | freqsel = _omap3_dpll_compute_freqsel(clk, |
506 | dd->last_rounded_n); | 507 | dd->last_rounded_n); |
507 | WARN_ON(!freqsel); | 508 | WARN_ON(!freqsel); |
diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c index e4aaee91201d..e7f5da0296f0 100644 --- a/drivers/media/platform/omap3isp/isp.c +++ b/drivers/media/platform/omap3isp/isp.c | |||
@@ -1338,28 +1338,15 @@ static int isp_enable_clocks(struct isp_device *isp) | |||
1338 | { | 1338 | { |
1339 | int r; | 1339 | int r; |
1340 | unsigned long rate; | 1340 | unsigned long rate; |
1341 | int divisor; | ||
1342 | |||
1343 | /* | ||
1344 | * cam_mclk clock chain: | ||
1345 | * dpll4 -> dpll4_m5 -> dpll4_m5x2 -> cam_mclk | ||
1346 | * | ||
1347 | * In OMAP3630 dpll4_m5x2 != 2 x dpll4_m5 but both are | ||
1348 | * set to the same value. Hence the rate set for dpll4_m5 | ||
1349 | * has to be twice of what is set on OMAP3430 to get | ||
1350 | * the required value for cam_mclk | ||
1351 | */ | ||
1352 | divisor = isp->revision == ISP_REVISION_15_0 ? 1 : 2; | ||
1353 | 1341 | ||
1354 | r = clk_prepare_enable(isp->clock[ISP_CLK_CAM_ICK]); | 1342 | r = clk_prepare_enable(isp->clock[ISP_CLK_CAM_ICK]); |
1355 | if (r) { | 1343 | if (r) { |
1356 | dev_err(isp->dev, "failed to enable cam_ick clock\n"); | 1344 | dev_err(isp->dev, "failed to enable cam_ick clock\n"); |
1357 | goto out_clk_enable_ick; | 1345 | goto out_clk_enable_ick; |
1358 | } | 1346 | } |
1359 | r = clk_set_rate(isp->clock[ISP_CLK_DPLL4_M5_CK], | 1347 | r = clk_set_rate(isp->clock[ISP_CLK_CAM_MCLK], CM_CAM_MCLK_HZ); |
1360 | CM_CAM_MCLK_HZ/divisor); | ||
1361 | if (r) { | 1348 | if (r) { |
1362 | dev_err(isp->dev, "clk_set_rate for dpll4_m5_ck failed\n"); | 1349 | dev_err(isp->dev, "clk_set_rate for cam_mclk failed\n"); |
1363 | goto out_clk_enable_mclk; | 1350 | goto out_clk_enable_mclk; |
1364 | } | 1351 | } |
1365 | r = clk_prepare_enable(isp->clock[ISP_CLK_CAM_MCLK]); | 1352 | r = clk_prepare_enable(isp->clock[ISP_CLK_CAM_MCLK]); |
@@ -1401,7 +1388,6 @@ static void isp_disable_clocks(struct isp_device *isp) | |||
1401 | static const char *isp_clocks[] = { | 1388 | static const char *isp_clocks[] = { |
1402 | "cam_ick", | 1389 | "cam_ick", |
1403 | "cam_mclk", | 1390 | "cam_mclk", |
1404 | "dpll4_m5_ck", | ||
1405 | "csi2_96m_fck", | 1391 | "csi2_96m_fck", |
1406 | "l3_ick", | 1392 | "l3_ick", |
1407 | }; | 1393 | }; |
diff --git a/drivers/media/platform/omap3isp/isp.h b/drivers/media/platform/omap3isp/isp.h index 517d348ce32b..c77e1f2ae5ca 100644 --- a/drivers/media/platform/omap3isp/isp.h +++ b/drivers/media/platform/omap3isp/isp.h | |||
@@ -147,7 +147,6 @@ struct isp_platform_callback { | |||
147 | * @ref_count: Reference count for handling multiple ISP requests. | 147 | * @ref_count: Reference count for handling multiple ISP requests. |
148 | * @cam_ick: Pointer to camera interface clock structure. | 148 | * @cam_ick: Pointer to camera interface clock structure. |
149 | * @cam_mclk: Pointer to camera functional clock structure. | 149 | * @cam_mclk: Pointer to camera functional clock structure. |
150 | * @dpll4_m5_ck: Pointer to DPLL4 M5 clock structure. | ||
151 | * @csi2_fck: Pointer to camera CSI2 complexIO clock structure. | 150 | * @csi2_fck: Pointer to camera CSI2 complexIO clock structure. |
152 | * @l3_ick: Pointer to OMAP3 L3 bus interface clock. | 151 | * @l3_ick: Pointer to OMAP3 L3 bus interface clock. |
153 | * @irq: Currently attached ISP ISR callbacks information structure. | 152 | * @irq: Currently attached ISP ISR callbacks information structure. |
@@ -189,10 +188,9 @@ struct isp_device { | |||
189 | u32 xclk_divisor[2]; /* Two clocks, a and b. */ | 188 | u32 xclk_divisor[2]; /* Two clocks, a and b. */ |
190 | #define ISP_CLK_CAM_ICK 0 | 189 | #define ISP_CLK_CAM_ICK 0 |
191 | #define ISP_CLK_CAM_MCLK 1 | 190 | #define ISP_CLK_CAM_MCLK 1 |
192 | #define ISP_CLK_DPLL4_M5_CK 2 | 191 | #define ISP_CLK_CSI2_FCK 2 |
193 | #define ISP_CLK_CSI2_FCK 3 | 192 | #define ISP_CLK_L3_ICK 3 |
194 | #define ISP_CLK_L3_ICK 4 | 193 | struct clk *clock[4]; |
195 | struct clk *clock[5]; | ||
196 | 194 | ||
197 | /* ISP modules */ | 195 | /* ISP modules */ |
198 | struct ispstat isp_af; | 196 | struct ispstat isp_af; |