Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7ed25593 authored by Sayali Lokhande's avatar Sayali Lokhande
Browse files

scsi: ufs: Get UFS ref_clk min/max voltage from device tree



This change allows selecting the UFS ref clk voltage level
by setting ref-clk-min-uV and ref-clk-max-uV in device tree.
If ref_clk voltage level setting is not found in device tree,
use default values provided by driver.

Change-Id: Ia3c0c61a508045448057cc3057a30546a458bfc9
Signed-off-by: default avatarSayali Lokhande <sayalil@codeaurora.org>
parent 829ed9cc
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -36,6 +36,8 @@ Optional properties:
- vdda-pll-max-microamp : specifies max. load that can be drawn from pll supply
- vdda-pll-max-microamp : specifies max. load that can be drawn from pll supply
- vddp-ref-clk-supply   : phandle to UFS device ref_clk pad power supply
- vddp-ref-clk-supply   : phandle to UFS device ref_clk pad power supply
- vddp-ref-clk-max-microamp : specifies max. load that can be drawn from this supply
- vddp-ref-clk-max-microamp : specifies max. load that can be drawn from this supply
- vddp-ref-clk-min-uV : specifies min voltage that can be set for reference clock supply
- vddp-ref-clk-max-uV : specifies max voltage that can be set for reference clock supply
- qcom,disable-lpm : disable various LPM mechanisms in UFS for platform compatibility
- qcom,disable-lpm : disable various LPM mechanisms in UFS for platform compatibility
  (limit link to PWM Gear-1, 1-lane slow mode; disable hibernate, and avoid suspend/resume)
  (limit link to PWM Gear-1, 1-lane slow mode; disable hibernate, and avoid suspend/resume)


+17 −3
Original line number Original line Diff line number Diff line
/*
/*
 * Copyright (c) 2013-2017, Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2018, Linux Foundation. All rights reserved.
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * it under the terms of the GNU General Public License version 2 and
@@ -2086,8 +2086,22 @@ static int ufs_qcom_parse_reg_info(struct ufs_qcom_host *host, char *name,
		dev_err(dev, "%s: %s get failed, err=%d\n",
		dev_err(dev, "%s: %s get failed, err=%d\n",
			__func__, vreg->name, ret);
			__func__, vreg->name, ret);
	}
	}

	snprintf(prop_name, MAX_PROP_SIZE, "%s-min-uV", name);
	ret = of_property_read_u32(np, prop_name, &vreg->min_uV);
	if (ret) {
		dev_dbg(dev, "%s: unable to find %s err %d, using default\n",
			__func__, prop_name, ret);
		vreg->min_uV = VDDP_REF_CLK_MIN_UV;
		vreg->min_uV = VDDP_REF_CLK_MIN_UV;
	}

	snprintf(prop_name, MAX_PROP_SIZE, "%s-max-uV", name);
	ret = of_property_read_u32(np, prop_name, &vreg->max_uV);
	if (ret) {
		dev_dbg(dev, "%s: unable to find %s err %d, using default\n",
			__func__, prop_name, ret);
		vreg->max_uV = VDDP_REF_CLK_MAX_UV;
		vreg->max_uV = VDDP_REF_CLK_MAX_UV;
	}


out:
out:
	if (!ret)
	if (!ret)