Skip to content

Commit 9c67494

Browse files
committed
Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux
Pull clk fixes from Stephen Boyd: "One more small batch of clk driver fixes: - A fix for the Qualcomm GDSC power domain delays that avoids black screens at boot on some more recent SoCs that use a different delay than the hard-coded delays in the driver. - A build fix LAN966X clk driver that let it be built on architectures that didn't have IOMEM" * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: clk: lan966x: Fix linking error clk: qcom: dispcc: Update the transition delay for MDSS GDSC clk: qcom: gdsc: Add support to update GDSC transition delay
2 parents b5521fe + aa091a6 commit 9c67494

File tree

6 files changed

+42
-9
lines changed

6 files changed

+42
-9
lines changed

drivers/clk/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ config COMMON_CLK_GEMINI
231231

232232
config COMMON_CLK_LAN966X
233233
bool "Generic Clock Controller driver for LAN966X SoC"
234+
depends on HAS_IOMEM
235+
depends on OF
234236
help
235237
This driver provides support for Generic Clock Controller(GCK) on
236238
LAN966X SoC. GCK generates and supplies clock to various peripherals

drivers/clk/qcom/dispcc-sc7180.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22
/*
3-
* Copyright (c) 2019, The Linux Foundation. All rights reserved.
3+
* Copyright (c) 2019, 2022, The Linux Foundation. All rights reserved.
44
*/
55

66
#include <linux/clk-provider.h>
@@ -625,6 +625,9 @@ static struct clk_branch disp_cc_mdss_vsync_clk = {
625625

626626
static struct gdsc mdss_gdsc = {
627627
.gdscr = 0x3000,
628+
.en_rest_wait_val = 0x2,
629+
.en_few_wait_val = 0x2,
630+
.clk_dis_wait_val = 0xf,
628631
.pd = {
629632
.name = "mdss_gdsc",
630633
},

drivers/clk/qcom/dispcc-sc7280.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22
/*
3-
* Copyright (c) 2021, The Linux Foundation. All rights reserved.
3+
* Copyright (c) 2021-2022, The Linux Foundation. All rights reserved.
44
*/
55

66
#include <linux/clk-provider.h>
@@ -787,6 +787,9 @@ static struct clk_branch disp_cc_sleep_clk = {
787787

788788
static struct gdsc disp_cc_mdss_core_gdsc = {
789789
.gdscr = 0x1004,
790+
.en_rest_wait_val = 0x2,
791+
.en_few_wait_val = 0x2,
792+
.clk_dis_wait_val = 0xf,
790793
.pd = {
791794
.name = "disp_cc_mdss_core_gdsc",
792795
},

drivers/clk/qcom/dispcc-sm8250.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22
/*
3-
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
3+
* Copyright (c) 2018-2020, 2022, The Linux Foundation. All rights reserved.
44
*/
55

66
#include <linux/clk-provider.h>
@@ -1126,6 +1126,9 @@ static struct clk_branch disp_cc_mdss_vsync_clk = {
11261126

11271127
static struct gdsc mdss_gdsc = {
11281128
.gdscr = 0x3000,
1129+
.en_rest_wait_val = 0x2,
1130+
.en_few_wait_val = 0x2,
1131+
.clk_dis_wait_val = 0xf,
11291132
.pd = {
11301133
.name = "mdss_gdsc",
11311134
},

drivers/clk/qcom/gdsc.c

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22
/*
3-
* Copyright (c) 2015, 2017-2018, The Linux Foundation. All rights reserved.
3+
* Copyright (c) 2015, 2017-2018, 2022, The Linux Foundation. All rights reserved.
44
*/
55

66
#include <linux/bitops.h>
@@ -35,9 +35,14 @@
3535
#define CFG_GDSCR_OFFSET 0x4
3636

3737
/* Wait 2^n CXO cycles between all states. Here, n=2 (4 cycles). */
38-
#define EN_REST_WAIT_VAL (0x2 << 20)
39-
#define EN_FEW_WAIT_VAL (0x8 << 16)
40-
#define CLK_DIS_WAIT_VAL (0x2 << 12)
38+
#define EN_REST_WAIT_VAL 0x2
39+
#define EN_FEW_WAIT_VAL 0x8
40+
#define CLK_DIS_WAIT_VAL 0x2
41+
42+
/* Transition delay shifts */
43+
#define EN_REST_WAIT_SHIFT 20
44+
#define EN_FEW_WAIT_SHIFT 16
45+
#define CLK_DIS_WAIT_SHIFT 12
4146

4247
#define RETAIN_MEM BIT(14)
4348
#define RETAIN_PERIPH BIT(13)
@@ -380,7 +385,18 @@ static int gdsc_init(struct gdsc *sc)
380385
*/
381386
mask = HW_CONTROL_MASK | SW_OVERRIDE_MASK |
382387
EN_REST_WAIT_MASK | EN_FEW_WAIT_MASK | CLK_DIS_WAIT_MASK;
383-
val = EN_REST_WAIT_VAL | EN_FEW_WAIT_VAL | CLK_DIS_WAIT_VAL;
388+
389+
if (!sc->en_rest_wait_val)
390+
sc->en_rest_wait_val = EN_REST_WAIT_VAL;
391+
if (!sc->en_few_wait_val)
392+
sc->en_few_wait_val = EN_FEW_WAIT_VAL;
393+
if (!sc->clk_dis_wait_val)
394+
sc->clk_dis_wait_val = CLK_DIS_WAIT_VAL;
395+
396+
val = sc->en_rest_wait_val << EN_REST_WAIT_SHIFT |
397+
sc->en_few_wait_val << EN_FEW_WAIT_SHIFT |
398+
sc->clk_dis_wait_val << CLK_DIS_WAIT_SHIFT;
399+
384400
ret = regmap_update_bits(sc->regmap, sc->gdscr, mask, val);
385401
if (ret)
386402
return ret;

drivers/clk/qcom/gdsc.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* SPDX-License-Identifier: GPL-2.0-only */
22
/*
3-
* Copyright (c) 2015, 2017-2018, The Linux Foundation. All rights reserved.
3+
* Copyright (c) 2015, 2017-2018, 2022, The Linux Foundation. All rights reserved.
44
*/
55

66
#ifndef __QCOM_GDSC_H__
@@ -22,6 +22,9 @@ struct reset_controller_dev;
2222
* @cxcs: offsets of branch registers to toggle mem/periph bits in
2323
* @cxc_count: number of @cxcs
2424
* @pwrsts: Possible powerdomain power states
25+
* @en_rest_wait_val: transition delay value for receiving enr ack signal
26+
* @en_few_wait_val: transition delay value for receiving enf ack signal
27+
* @clk_dis_wait_val: transition delay value for halting clock
2528
* @resets: ids of resets associated with this gdsc
2629
* @reset_count: number of @resets
2730
* @rcdev: reset controller
@@ -36,6 +39,9 @@ struct gdsc {
3639
unsigned int clamp_io_ctrl;
3740
unsigned int *cxcs;
3841
unsigned int cxc_count;
42+
unsigned int en_rest_wait_val;
43+
unsigned int en_few_wait_val;
44+
unsigned int clk_dis_wait_val;
3945
const u8 pwrsts;
4046
/* Powerdomain allowable state bitfields */
4147
#define PWRSTS_OFF BIT(0)

0 commit comments

Comments
 (0)