Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,11 @@ examples:
<0x0aec2000 0x1c8>;

clocks = <&dispcc0 MDSS_DISP_CC_MDSS_DPTX0_AUX_CLK>,
<&dispcc0 MDSS_DISP_CC_MDSS_AHB_CLK>;
<&dispcc0 MDSS_DISP_CC_MDSS_AHB_CLK>,
<&gcc GCC_EDP_REF_CLKREF_EN>;
clock-names = "aux",
"cfg_ahb";
"cfg_ahb",
"ref";

#clock-cells = <1>;
#phy-cells = <0>;
Expand Down
29 changes: 28 additions & 1 deletion Documentation/devicetree/bindings/phy/qcom,edp-phy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,15 @@ properties:
- description: PLL register block

clocks:
maxItems: 2
minItems: 2
maxItems: 3

clock-names:
minItems: 2
items:
- const: aux
- const: cfg_ahb
- const: ref

"#clock-cells":
const: 1
Expand All @@ -64,6 +67,30 @@ required:
- "#clock-cells"
- "#phy-cells"

allOf:
- if:
properties:
compatible:
enum:
- qcom,x1e80100-dp-phy
- qcom,sa8775p-edp-phy
then:
properties:
clocks:
minItems: 3
maxItems: 3
clock-names:
minItems: 3
maxItems: 3
else:
properties:
clocks:
minItems: 2
maxItems: 2
clock-names:
minItems: 2
maxItems: 2

additionalProperties: false

examples:
Expand Down
16 changes: 8 additions & 8 deletions drivers/phy/qualcomm/phy-qcom-edp.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ struct qcom_edp {

struct phy_configure_opts_dp dp_opts;

struct clk_bulk_data clks[2];
struct clk_bulk_data *clks;
int num_clks;

struct regulator_bulk_data supplies[2];

bool is_edp;
Expand Down Expand Up @@ -218,7 +220,7 @@ static int qcom_edp_phy_init(struct phy *phy)
if (ret)
return ret;

ret = clk_bulk_prepare_enable(ARRAY_SIZE(edp->clks), edp->clks);
ret = clk_bulk_prepare_enable(edp->num_clks, edp->clks);
if (ret)
goto out_disable_supplies;

Expand Down Expand Up @@ -885,7 +887,7 @@ static int qcom_edp_phy_exit(struct phy *phy)
{
struct qcom_edp *edp = phy_get_drvdata(phy);

clk_bulk_disable_unprepare(ARRAY_SIZE(edp->clks), edp->clks);
clk_bulk_disable_unprepare(edp->num_clks, edp->clks);
regulator_bulk_disable(ARRAY_SIZE(edp->supplies), edp->supplies);

return 0;
Expand Down Expand Up @@ -1092,11 +1094,9 @@ static int qcom_edp_phy_probe(struct platform_device *pdev)
if (IS_ERR(edp->pll))
return PTR_ERR(edp->pll);

edp->clks[0].id = "aux";
edp->clks[1].id = "cfg_ahb";
ret = devm_clk_bulk_get(dev, ARRAY_SIZE(edp->clks), edp->clks);
if (ret)
return ret;
edp->num_clks = devm_clk_bulk_get_all(dev, &edp->clks);
if (edp->num_clks < 0)
return dev_err_probe(dev, edp->num_clks, "failed to parse clocks\n");

edp->supplies[0].supply = "vdda-phy";
edp->supplies[1].supply = "vdda-pll";
Expand Down