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

Commit b8d20946 authored by Tirupathi Reddy's avatar Tirupathi Reddy Committed by Gerrit - the friendly Code Review server
Browse files

regulator: cpr3-regulator: remove ceiling interrupt for CPR4 controllers



For CPR4 controllers, SW does not perform any specific operation
upon receiving ceiling interrupt. Do not configure ceiling interrupt
for CPR4 controllers.

CRs-Fixed: 987525
Change-Id: I467ff12ad8d58036a64928249d4e5671eb8ec6b5
Signed-off-by: default avatarTirupathi Reddy <tirupath@codeaurora.org>
parent e3ea6c56
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -41,15 +41,14 @@ APSS specific properties:
- interrupts
	Usage:      required
	Value type: <prop-encoded-array>
	Definition: CPR interrupt specifier and a hardware closed-loop ceiling
		    interrupt specifier.
	Definition: CPR interrupt specifier.

- interrupt-names
	Usage:      required
	Value type: <stringlist>
	Definition: Interrupt names.  This list must match up 1-to-1 with the
		    interrupts specified in the 'interrupts' property. "cpr"
		    and "ceiling" must be specified.
		    must be specified.

- qcom,apm-ctrl
	Usage:      required on systems that need APM management
@@ -377,9 +376,8 @@ apc_cpr: cpr4-ctrl@b018000 {
	compatible = "qcom,cpr4-msm8953-apss-regulator";
	reg = <0xb018000 0x4000>, <0xa4000 0x1000>;
	reg-names = "cpr_ctrl", "fuse_base";
	interrupts = <GIC_SPI 15 IRQ_TYPE_EDGE_RISING>,
		<GIC_SPI 282 IRQ_TYPE_EDGE_RISING>;
	interrupt-names = "cpr", "ceiling";
	interrupts = <GIC_SPI 15 IRQ_TYPE_EDGE_RISING>;
	interrupt-names = "cpr";

	qcom,cpr-ctrl-name = "apc";

+21 −12
Original line number Diff line number Diff line
@@ -1481,12 +1481,15 @@ static int cpr3_regulator_init_ctrl(struct cpr3_controller *ctrl)
			return rc;
		}

		if (ctrl->ctrl_type == CPR_CTRL_TYPE_CPR3) {
			rc = msm_spm_avs_enable_irq(0, MSM_SPM_AVS_IRQ_MAX);
			if (rc) {
			cpr3_err(ctrl, "could not enable max IRQ, rc=%d\n", rc);
				cpr3_err(ctrl, "could not enable max IRQ, rc=%d\n",
					rc);
				return rc;
			}
		}
	}

	if (ctrl->ctrl_type == CPR_CTRL_TYPE_CPR4) {
		rc = cpr3_regulator_init_cpr4(ctrl);
@@ -5846,12 +5849,15 @@ int cpr3_regulator_register(struct platform_device *pdev,
			return rc;
		}

		ctrl->ceiling_irq = platform_get_irq_byname(pdev, "ceiling");
		if (ctrl->ctrl_type == CPR_CTRL_TYPE_CPR3) {
			ctrl->ceiling_irq = platform_get_irq_byname(pdev,
						"ceiling");
			if (ctrl->ceiling_irq < 0) {
				cpr3_err(ctrl, "missing ceiling interrupt\n");
				return ctrl->ceiling_irq;
			}
		}
	}

	if (ctrl->ctrl_type != CPR_CTRL_TYPE_CPRH) {
		rc = cpr3_regulator_init_ctrl_data(ctrl);
@@ -5913,7 +5919,7 @@ int cpr3_regulator_register(struct platform_device *pdev,
	}

	if (ctrl->supports_hw_closed_loop &&
	    ctrl->ctrl_type != CPR_CTRL_TYPE_CPRH) {
	    ctrl->ctrl_type == CPR_CTRL_TYPE_CPR3) {
		rc = devm_request_threaded_irq(dev, ctrl->ceiling_irq, NULL,
			cpr3_ceiling_irq_handler,
			IRQF_ONESHOT | IRQF_TRIGGER_RISING,
@@ -5967,9 +5973,12 @@ int cpr3_regulator_unregister(struct cpr3_controller *ctrl)

	cpr3_closed_loop_disable(ctrl);

	if (ctrl->use_hw_closed_loop ||
		ctrl->ctrl_type == CPR_CTRL_TYPE_CPR4) {
	if ((ctrl->use_hw_closed_loop
			|| ctrl->ctrl_type == CPR_CTRL_TYPE_CPR4)
		&& ctrl->ctrl_type != CPR_CTRL_TYPE_CPRH) {
		regulator_disable(ctrl->vdd_limit_regulator);

		if (ctrl->ctrl_type == CPR_CTRL_TYPE_CPR3)
			msm_spm_avs_disable_irq(0, MSM_SPM_AVS_IRQ_MAX);
	}