@@ -143,6 +143,9 @@ EXPORT_SYMBOL_GPL(clk_alpha_pll_regs);
143
143
#define TRION_PLL_CAL_VAL 0x44
144
144
#define TRION_PCAL_DONE BIT(26)
145
145
146
+ /* LUCID PLL specific settings and offsets */
147
+ #define LUCID_PCAL_DONE BIT(27)
148
+
146
149
#define pll_alpha_width (p ) \
147
150
((PLL_ALPHA_VAL_U(p) - PLL_ALPHA_VAL(p) == 4) ? \
148
151
ALPHA_REG_BITWIDTH : ALPHA_REG_16BIT_WIDTH)
@@ -1447,15 +1450,15 @@ EXPORT_SYMBOL_GPL(clk_trion_pll_configure);
1447
1450
* The TRION PLL requires a power-on self-calibration which happens when the
1448
1451
* PLL comes out of reset. Calibrate in case it is not completed.
1449
1452
*/
1450
- static int alpha_pll_trion_prepare (struct clk_hw * hw )
1453
+ static int __alpha_pll_trion_prepare (struct clk_hw * hw , u32 pcal_done )
1451
1454
{
1452
1455
struct clk_alpha_pll * pll = to_clk_alpha_pll (hw );
1453
1456
u32 regval ;
1454
1457
int ret ;
1455
1458
1456
1459
/* Return early if calibration is not needed. */
1457
1460
regmap_read (pll -> clkr .regmap , PLL_STATUS (pll ), & regval );
1458
- if (regval & TRION_PCAL_DONE )
1461
+ if (regval & pcal_done )
1459
1462
return 0 ;
1460
1463
1461
1464
/* On/off to calibrate */
@@ -1466,6 +1469,16 @@ static int alpha_pll_trion_prepare(struct clk_hw *hw)
1466
1469
return ret ;
1467
1470
}
1468
1471
1472
+ static int alpha_pll_trion_prepare (struct clk_hw * hw )
1473
+ {
1474
+ return __alpha_pll_trion_prepare (hw , TRION_PCAL_DONE );
1475
+ }
1476
+
1477
+ static int alpha_pll_lucid_prepare (struct clk_hw * hw )
1478
+ {
1479
+ return __alpha_pll_trion_prepare (hw , LUCID_PCAL_DONE );
1480
+ }
1481
+
1469
1482
static int alpha_pll_trion_set_rate (struct clk_hw * hw , unsigned long rate ,
1470
1483
unsigned long prate )
1471
1484
{
@@ -1529,6 +1542,17 @@ const struct clk_ops clk_alpha_pll_trion_ops = {
1529
1542
.round_rate = clk_alpha_pll_round_rate ,
1530
1543
.set_rate = alpha_pll_trion_set_rate ,
1531
1544
};
1545
+ EXPORT_SYMBOL_GPL (clk_alpha_pll_trion_ops );
1546
+
1547
+ const struct clk_ops clk_alpha_pll_lucid_ops = {
1548
+ .prepare = alpha_pll_lucid_prepare ,
1549
+ .enable = clk_trion_pll_enable ,
1550
+ .disable = clk_trion_pll_disable ,
1551
+ .is_enabled = clk_trion_pll_is_enabled ,
1552
+ .recalc_rate = clk_trion_pll_recalc_rate ,
1553
+ .round_rate = clk_alpha_pll_round_rate ,
1554
+ .set_rate = alpha_pll_trion_set_rate ,
1555
+ };
1532
1556
EXPORT_SYMBOL_GPL (clk_alpha_pll_lucid_ops );
1533
1557
1534
1558
const struct clk_ops clk_alpha_pll_postdiv_lucid_ops = {
0 commit comments