@@ -459,93 +459,6 @@ void omap3_noncore_dpll_disable(struct clk_hw *hw)
459
459
460
460
/* Non-CORE DPLL rate set code */
461
461
462
- /**
463
- * omap3_noncore_dpll_set_rate - set non-core DPLL rate
464
- * @clk: struct clk * of DPLL to set
465
- * @rate: rounded target rate
466
- *
467
- * Set the DPLL CLKOUT to the target rate. If the DPLL can enter
468
- * low-power bypass, and the target rate is the bypass source clock
469
- * rate, then configure the DPLL for bypass. Otherwise, round the
470
- * target rate if it hasn't been done already, then program and lock
471
- * the DPLL. Returns -EINVAL upon error, or 0 upon success.
472
- */
473
- int omap3_noncore_dpll_set_rate (struct clk_hw * hw , unsigned long rate ,
474
- unsigned long parent_rate )
475
- {
476
- struct clk_hw_omap * clk = to_clk_hw_omap (hw );
477
- struct clk * new_parent = NULL ;
478
- unsigned long rrate ;
479
- u16 freqsel = 0 ;
480
- struct dpll_data * dd ;
481
- int ret ;
482
-
483
- if (!hw || !rate )
484
- return - EINVAL ;
485
-
486
- dd = clk -> dpll_data ;
487
- if (!dd )
488
- return - EINVAL ;
489
-
490
- if (__clk_get_rate (dd -> clk_bypass ) == rate &&
491
- (dd -> modes & (1 << DPLL_LOW_POWER_BYPASS ))) {
492
- pr_debug ("%s: %s: set rate: entering bypass.\n" ,
493
- __func__ , __clk_get_name (hw -> clk ));
494
-
495
- __clk_prepare (dd -> clk_bypass );
496
- clk_enable (dd -> clk_bypass );
497
- ret = _omap3_noncore_dpll_bypass (clk );
498
- if (!ret )
499
- new_parent = dd -> clk_bypass ;
500
- clk_disable (dd -> clk_bypass );
501
- __clk_unprepare (dd -> clk_bypass );
502
- } else {
503
- __clk_prepare (dd -> clk_ref );
504
- clk_enable (dd -> clk_ref );
505
-
506
- /* XXX this check is probably pointless in the CCF context */
507
- if (dd -> last_rounded_rate != rate ) {
508
- rrate = __clk_round_rate (hw -> clk , rate );
509
- if (rrate != rate ) {
510
- pr_warn ("%s: %s: final rate %lu does not match desired rate %lu\n" ,
511
- __func__ , __clk_get_name (hw -> clk ),
512
- rrate , rate );
513
- rate = rrate ;
514
- }
515
- }
516
-
517
- if (dd -> last_rounded_rate == 0 )
518
- return - EINVAL ;
519
-
520
- /* Freqsel is available only on OMAP343X devices */
521
- if (ti_clk_features .flags & TI_CLK_DPLL_HAS_FREQSEL ) {
522
- freqsel = _omap3_dpll_compute_freqsel (clk ,
523
- dd -> last_rounded_n );
524
- WARN_ON (!freqsel );
525
- }
526
-
527
- pr_debug ("%s: %s: set rate: locking rate to %lu.\n" ,
528
- __func__ , __clk_get_name (hw -> clk ), rate );
529
-
530
- ret = omap3_noncore_dpll_program (clk , freqsel );
531
- if (!ret )
532
- new_parent = dd -> clk_ref ;
533
- clk_disable (dd -> clk_ref );
534
- __clk_unprepare (dd -> clk_ref );
535
- }
536
- /*
537
- * FIXME - this is all wrong. common code handles reparenting and
538
- * migrating prepare/enable counts. dplls should be a multiplexer
539
- * clock and this should be a set_parent operation so that all of that
540
- * stuff is inherited for free
541
- */
542
-
543
- if (!ret && clk_get_parent (hw -> clk ) != new_parent )
544
- __clk_reparent (hw -> clk , new_parent );
545
-
546
- return 0 ;
547
- }
548
-
549
462
/**
550
463
* omap3_noncore_dpll_determine_rate - determine rate for a DPLL
551
464
* @hw: pointer to the clock to determine rate for
@@ -611,7 +524,7 @@ int omap3_noncore_dpll_set_parent(struct clk_hw *hw, u8 index)
611
524
}
612
525
613
526
/**
614
- * omap3_noncore_dpll_set_rate_new - set rate for a DPLL clock
527
+ * omap3_noncore_dpll_set_rate - set rate for a DPLL clock
615
528
* @hw: pointer to the clock to set parent for
616
529
* @rate: target rate for the clock
617
530
* @parent_rate: rate of the parent clock
@@ -621,9 +534,8 @@ int omap3_noncore_dpll_set_parent(struct clk_hw *hw, u8 index)
621
534
* changed) and proceeds with the rate change operation. Returns 0
622
535
* with success, negative error value otherwise.
623
536
*/
624
- static int omap3_noncore_dpll_set_rate_new (struct clk_hw * hw ,
625
- unsigned long rate ,
626
- unsigned long parent_rate )
537
+ int omap3_noncore_dpll_set_rate (struct clk_hw * hw , unsigned long rate ,
538
+ unsigned long parent_rate )
627
539
{
628
540
struct clk_hw_omap * clk = to_clk_hw_omap (hw );
629
541
struct dpll_data * dd ;
@@ -688,7 +600,7 @@ int omap3_noncore_dpll_set_rate_and_parent(struct clk_hw *hw,
688
600
if (index )
689
601
ret = omap3_noncore_dpll_set_parent (hw , index );
690
602
else
691
- ret = omap3_noncore_dpll_set_rate_new (hw , rate , parent_rate );
603
+ ret = omap3_noncore_dpll_set_rate (hw , rate , parent_rate );
692
604
693
605
return ret ;
694
606
}
0 commit comments