Add resin key support to handle different types of key events
defined in different platforms.
+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;
+ 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;
+ }
+ }
+