Re: [PATCH V2] Input: pm8941-pwrkey: add resin key capabilities

From
Trilok Soni <hidden>
Date
2018-03-13 19:24:18
Also in
linux-arm-msm, linux-input, lkml
Reply to
Tirupathi Reddy, 2018-03-13
Hi Tirupathi,

On 3/13/2018 1:35 AM, Tirupathi Reddy wrote:
Add resin key support to handle different types of key events
defined in different platforms.
Describe "resin"  in the commit text? or just call it same as power key or different purpose?
quoted hunk ↗ jump to hunk
  
+static irqreturn_t pm8941_resinkey_irq(int irq, void *_data)
+{
+	struct pm8941_pwrkey *pwrkey = _data;
+	unsigned int sts;
+	int error;
+
+	error = regmap_read(pwrkey->regmap,
+			    pwrkey->baseaddr + PON_RT_STS, &sts);
+	if (error)
+		return IRQ_HANDLED;
You may want to document here why you still return as IRQ_HANDLED on the error after reading the status register?
quoted hunk ↗ jump to hunk
  
+	resin_irq = platform_get_irq_byname(pdev, "resin");
+	if (resin_irq < 0 && resin_irq != -ENXIO) {
+		if (resin_irq != -EPROBE_DEFER)
+			dev_err(&pdev->dev, "failed to get resin irq\n");
+		return resin_irq;
+	} else if (resin_irq >= 0) {
+		/* resin key capabilities are defined in device node */
+		error = pm8941_resin_key_init(pwrkey, resin_irq);
+		if (error) {
+			dev_err(&pdev->dev, "failed resin key initialization: %d\n",
+				error);
+			return error;
+		}
+	}
+
Any reason you don't want to create different driver for "resin" key? Is this going to be physically different key on the platform? Please describe why it needs to be part of the power key driver.

---Trilok Soni

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Thread (5 messages) 5 messages, 4 authors, last reply 2018-03-15
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help