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

Commit d252f0f3 authored by Mohan Pallaka's avatar Mohan Pallaka
Browse files

platform: qpnp-power-on: Add explicit support for bark irq



PM8941 has a hardware bug related to resin line (connects
vol- key) which needs bark interrupt for proper functionality.
PMICs released after PM8941 like PM8x26 and PM8x10 don't have
this bug so add explicit platform entry to handle bark.

CRs-fixed: 555854
Change-Id: I23b3ea0c9d07687542c9a7ff3fca010dbf7ad486
Signed-off-by: default avatarMohan Pallaka <mpallaka@codeaurora.org>
parent 9743153b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ Sub-node optional properties:
				0 = Not supported
				1 = Supported
				This property is set to '0' if not specified.
- qcom,use-bark                        Specify if this pon type needs to handle bark irq
- qcom,s1-timer			The debounce timer for the BARK interrupt for
				that reset source. Value is specified in ms.
				Supported values are -
@@ -108,6 +109,7 @@ Example:
			qcom,s2-timer = <2000>;
			qcom,s2-type = <1>;
			linux,code = <114>;
			qcom,use-bark;
		};

		qcom,pon_3 {
@@ -117,5 +119,6 @@ Example:
			qcom,s2-timer = <2000>;
			qcom,s2-type = <7>;
			qcom,pull-up = <1>;
			qcom,use-bark;
		};
	};
+5 −0
Original line number Diff line number Diff line
@@ -50,6 +50,10 @@
				qcom,pon-type = <1>;
				qcom,pull-up = <1>;
				linux,code = <114>;
				qcom,support-reset = <1>;
				qcom,s1-timer = <6720>;
				qcom,s2-timer = <2000>;
				qcom,s2-type = <7>;
			};

			qcom,pon_3 {
@@ -59,6 +63,7 @@
				qcom,s1-timer = <6720>;
				qcom,s2-timer = <2000>;
				qcom,s2-type = <7>;
				qcom,use-bark;
			};
		};

+2 −0
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@
			qcom,s2-timer = <2000>;
			qcom,s2-type = <1>;
			linux,code = <114>;
			qcom,use-bark;
		};

		qcom,pon_3 {
@@ -78,6 +79,7 @@
			qcom,s2-timer = <2000>;
			qcom,s2-type = <7>;
			qcom,pull-up = <1>;
			qcom,use-bark;
		};
	};

+13 −6
Original line number Diff line number Diff line
@@ -112,6 +112,7 @@ struct qpnp_pon_config {
	u16 s2_cntl_addr;
	u16 s2_cntl2_addr;
	bool old_state;
	bool use_bark;
};

struct qpnp_pon {
@@ -762,7 +763,7 @@ qpnp_pon_request_irqs(struct qpnp_pon *pon, struct qpnp_pon_config *cfg)
							cfg->state_irq);
			return rc;
		}
		if (cfg->support_reset) {
		if (cfg->use_bark) {
			rc = devm_request_irq(&pon->spmi->dev, cfg->bark_irq,
						qpnp_kpdpwr_bark_irq,
						IRQF_TRIGGER_RISING,
@@ -785,7 +786,7 @@ qpnp_pon_request_irqs(struct qpnp_pon *pon, struct qpnp_pon_config *cfg)
							cfg->state_irq);
			return rc;
		}
		if (cfg->support_reset) {
		if (cfg->use_bark) {
			rc = devm_request_irq(&pon->spmi->dev, cfg->bark_irq,
						qpnp_resin_bark_irq,
						IRQF_TRIGGER_RISING,
@@ -810,7 +811,7 @@ qpnp_pon_request_irqs(struct qpnp_pon *pon, struct qpnp_pon_config *cfg)
		}
		break;
	case PON_KPDPWR_RESIN:
		if (cfg->support_reset) {
		if (cfg->use_bark) {
			rc = devm_request_irq(&pon->spmi->dev, cfg->bark_irq,
					qpnp_kpdpwr_resin_bark_irq,
					IRQF_TRIGGER_RISING,
@@ -903,7 +904,9 @@ static int qpnp_pon_config_init(struct qpnp_pon *pon)
				return rc;
			}

			if (cfg->support_reset) {
			cfg->use_bark = of_property_read_bool(pp,
							"qcom,use-bark");
			if (cfg->use_bark) {
				cfg->bark_irq = spmi_get_irq_byname(pon->spmi,
							NULL, "kpdpwr-bark");
				if (cfg->bark_irq < 0) {
@@ -941,7 +944,9 @@ static int qpnp_pon_config_init(struct qpnp_pon *pon)
				return rc;
			}

			if (cfg->support_reset) {
			cfg->use_bark = of_property_read_bool(pp,
							"qcom,use-bark");
			if (cfg->use_bark) {
				cfg->bark_irq = spmi_get_irq_byname(pon->spmi,
							NULL, "resin-bark");
				if (cfg->bark_irq < 0) {
@@ -980,7 +985,9 @@ static int qpnp_pon_config_init(struct qpnp_pon *pon)
				return rc;
			}

			if (cfg->support_reset) {
			cfg->use_bark = of_property_read_bool(pp,
							"qcom,use-bark");
			if (cfg->use_bark) {
				cfg->bark_irq = spmi_get_irq_byname(pon->spmi,
						NULL, "kpdpwr-resin-bark");
				if (cfg->bark_irq < 0) {