@@ -859,12 +859,6 @@ struct qmp_phy_cfg {
859
859
860
860
};
861
861
862
- struct qmp_phy_dp_clks {
863
- struct qmp_combo * qmp ;
864
- struct clk_hw dp_link_hw ;
865
- struct clk_hw dp_pixel_hw ;
866
- };
867
-
868
862
struct qmp_combo {
869
863
struct device * dev ;
870
864
@@ -900,7 +894,9 @@ struct qmp_combo {
900
894
struct phy * dp_phy ;
901
895
unsigned int dp_aux_cfg ;
902
896
struct phy_configure_opts_dp dp_opts ;
903
- struct qmp_phy_dp_clks * dp_clks ;
897
+
898
+ struct clk_hw dp_link_hw ;
899
+ struct clk_hw dp_pixel_hw ;
904
900
};
905
901
906
902
static void qmp_v3_dp_aux_init (struct qmp_combo * qmp );
@@ -1387,7 +1383,6 @@ static bool qmp_combo_configure_dp_mode(struct qmp_combo *qmp)
1387
1383
1388
1384
static int qmp_v3_configure_dp_phy (struct qmp_combo * qmp )
1389
1385
{
1390
- const struct qmp_phy_dp_clks * dp_clks = qmp -> dp_clks ;
1391
1386
const struct phy_configure_opts_dp * dp_opts = & qmp -> dp_opts ;
1392
1387
u32 phy_vco_div , status ;
1393
1388
unsigned long pixel_freq ;
@@ -1420,8 +1415,8 @@ static int qmp_v3_configure_dp_phy(struct qmp_combo *qmp)
1420
1415
}
1421
1416
writel (phy_vco_div , qmp -> dp_pcs + QSERDES_V3_DP_PHY_VCO_DIV );
1422
1417
1423
- clk_set_rate (dp_clks -> dp_link_hw .clk , dp_opts -> link_rate * 100000 );
1424
- clk_set_rate (dp_clks -> dp_pixel_hw .clk , pixel_freq );
1418
+ clk_set_rate (qmp -> dp_link_hw .clk , dp_opts -> link_rate * 100000 );
1419
+ clk_set_rate (qmp -> dp_pixel_hw .clk , pixel_freq );
1425
1420
1426
1421
writel (0x04 , qmp -> dp_pcs + QSERDES_DP_PHY_AUX_CFG2 );
1427
1422
writel (0x01 , qmp -> dp_pcs + QSERDES_DP_PHY_CFG );
@@ -1518,7 +1513,6 @@ static void qmp_v4_configure_dp_tx(struct qmp_combo *qmp)
1518
1513
1519
1514
static int qmp_v45_configure_dp_phy (struct qmp_combo * qmp )
1520
1515
{
1521
- const struct qmp_phy_dp_clks * dp_clks = qmp -> dp_clks ;
1522
1516
const struct phy_configure_opts_dp * dp_opts = & qmp -> dp_opts ;
1523
1517
u32 phy_vco_div , status ;
1524
1518
unsigned long pixel_freq ;
@@ -1556,8 +1550,8 @@ static int qmp_v45_configure_dp_phy(struct qmp_combo *qmp)
1556
1550
}
1557
1551
writel (phy_vco_div , qmp -> dp_pcs + QSERDES_V4_DP_PHY_VCO_DIV );
1558
1552
1559
- clk_set_rate (dp_clks -> dp_link_hw .clk , dp_opts -> link_rate * 100000 );
1560
- clk_set_rate (dp_clks -> dp_pixel_hw .clk , pixel_freq );
1553
+ clk_set_rate (qmp -> dp_link_hw .clk , dp_opts -> link_rate * 100000 );
1554
+ clk_set_rate (qmp -> dp_pixel_hw .clk , pixel_freq );
1561
1555
1562
1556
writel (0x01 , qmp -> dp_pcs + QSERDES_DP_PHY_CFG );
1563
1557
writel (0x05 , qmp -> dp_pcs + QSERDES_DP_PHY_CFG );
@@ -2342,12 +2336,10 @@ static int qcom_qmp_dp_pixel_clk_determine_rate(struct clk_hw *hw,
2342
2336
static unsigned long
2343
2337
qcom_qmp_dp_pixel_clk_recalc_rate (struct clk_hw * hw , unsigned long parent_rate )
2344
2338
{
2345
- const struct qmp_phy_dp_clks * dp_clks ;
2346
2339
const struct qmp_combo * qmp ;
2347
2340
const struct phy_configure_opts_dp * dp_opts ;
2348
2341
2349
- dp_clks = container_of (hw , struct qmp_phy_dp_clks , dp_pixel_hw );
2350
- qmp = dp_clks -> qmp ;
2342
+ qmp = container_of (hw , struct qmp_combo , dp_pixel_hw );
2351
2343
dp_opts = & qmp -> dp_opts ;
2352
2344
2353
2345
switch (dp_opts -> link_rate ) {
@@ -2386,12 +2378,10 @@ static int qcom_qmp_dp_link_clk_determine_rate(struct clk_hw *hw,
2386
2378
static unsigned long
2387
2379
qcom_qmp_dp_link_clk_recalc_rate (struct clk_hw * hw , unsigned long parent_rate )
2388
2380
{
2389
- const struct qmp_phy_dp_clks * dp_clks ;
2390
2381
const struct qmp_combo * qmp ;
2391
2382
const struct phy_configure_opts_dp * dp_opts ;
2392
2383
2393
- dp_clks = container_of (hw , struct qmp_phy_dp_clks , dp_link_hw );
2394
- qmp = dp_clks -> qmp ;
2384
+ qmp = container_of (hw , struct qmp_combo , dp_link_hw );
2395
2385
dp_opts = & qmp -> dp_opts ;
2396
2386
2397
2387
switch (dp_opts -> link_rate ) {
@@ -2413,7 +2403,7 @@ static const struct clk_ops qcom_qmp_dp_link_clk_ops = {
2413
2403
static struct clk_hw *
2414
2404
qcom_qmp_dp_clks_hw_get (struct of_phandle_args * clkspec , void * data )
2415
2405
{
2416
- struct qmp_phy_dp_clks * dp_clks = data ;
2406
+ struct qmp_combo * qmp = data ;
2417
2407
unsigned int idx = clkspec -> args [0 ];
2418
2408
2419
2409
if (idx >= 2 ) {
@@ -2422,42 +2412,34 @@ qcom_qmp_dp_clks_hw_get(struct of_phandle_args *clkspec, void *data)
2422
2412
}
2423
2413
2424
2414
if (idx == 0 )
2425
- return & dp_clks -> dp_link_hw ;
2415
+ return & qmp -> dp_link_hw ;
2426
2416
2427
- return & dp_clks -> dp_pixel_hw ;
2417
+ return & qmp -> dp_pixel_hw ;
2428
2418
}
2429
2419
2430
2420
static int phy_dp_clks_register (struct qmp_combo * qmp , struct device_node * np )
2431
2421
{
2432
2422
struct clk_init_data init = { };
2433
- struct qmp_phy_dp_clks * dp_clks ;
2434
2423
char name [64 ];
2435
2424
int ret ;
2436
2425
2437
- dp_clks = devm_kzalloc (qmp -> dev , sizeof (* dp_clks ), GFP_KERNEL );
2438
- if (!dp_clks )
2439
- return - ENOMEM ;
2440
-
2441
- dp_clks -> qmp = qmp ;
2442
- qmp -> dp_clks = dp_clks ;
2443
-
2444
2426
snprintf (name , sizeof (name ), "%s::link_clk" , dev_name (qmp -> dev ));
2445
2427
init .ops = & qcom_qmp_dp_link_clk_ops ;
2446
2428
init .name = name ;
2447
- dp_clks -> dp_link_hw .init = & init ;
2448
- ret = devm_clk_hw_register (qmp -> dev , & dp_clks -> dp_link_hw );
2429
+ qmp -> dp_link_hw .init = & init ;
2430
+ ret = devm_clk_hw_register (qmp -> dev , & qmp -> dp_link_hw );
2449
2431
if (ret )
2450
2432
return ret ;
2451
2433
2452
2434
snprintf (name , sizeof (name ), "%s::vco_div_clk" , dev_name (qmp -> dev ));
2453
2435
init .ops = & qcom_qmp_dp_pixel_clk_ops ;
2454
2436
init .name = name ;
2455
- dp_clks -> dp_pixel_hw .init = & init ;
2456
- ret = devm_clk_hw_register (qmp -> dev , & dp_clks -> dp_pixel_hw );
2437
+ qmp -> dp_pixel_hw .init = & init ;
2438
+ ret = devm_clk_hw_register (qmp -> dev , & qmp -> dp_pixel_hw );
2457
2439
if (ret )
2458
2440
return ret ;
2459
2441
2460
- ret = of_clk_add_hw_provider (np , qcom_qmp_dp_clks_hw_get , dp_clks );
2442
+ ret = of_clk_add_hw_provider (np , qcom_qmp_dp_clks_hw_get , qmp );
2461
2443
if (ret )
2462
2444
return ret ;
2463
2445
0 commit comments