From patchwork Thu Jun 28 15:08:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 141531 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2304216ljj; Thu, 28 Jun 2018 08:09:30 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd3b9YUtQg06U0pvYdjN7lzTmcEMk9+t91kzjeizEOMDEB9z65p8zqsJUj1fsCHhdAqCO7v X-Received: by 2002:a62:4dc5:: with SMTP id a188-v6mr2235807pfb.217.1530198570606; Thu, 28 Jun 2018 08:09:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530198570; cv=none; d=google.com; s=arc-20160816; b=HgpMGtND0JKbtHvgTrPZ9HcKr/XudqlJziOc785m6jixa4RvKsDOC9RHuLSyntVlno bm4F+Qkey6GTW4WCPruwlb3OrtXZvwEe3KNj7VgQLZCP+hftne2wy9/bnlBgOEImaadk BgmvQ1MoemRMUOV9+WBjyTi7KzMCQ5fc8Mk7A3cVFYyJpiavRu3hyE6VH39ihTkFU8wl bP2SjWOZEnMhiPY59A5KVAj3IqUMa6zs35N7ExjrWNSRC4GCyh+hb7+cB8CEBB1b/t+n meIHC3KQWq+WaRWmQIVs0OKzMrnwC9TIcv7FhompLnFmH1+hWGh83AbWG0LpaBMc5q4R tBmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=2cpT5zICUcDYvs7pahsN61CyPYw593k2YbqT7nm1TmA=; b=nFWk+kcSGig4psQ/s74V+JigdFtPKfzRuKcJmXem3oMrng0/i17QsJhI6JRROQhsUY 3iWDPrnzTwXI84GiLdV12jfgojVkoz5tOiaOYBqWHSlFF8Pbc/kzKHUn7xD7VLNEp/07 c3JfR7PdCHbuz70GCdX5Xm6xU3QfrXJVXMRbQldpcpG88A7+K5uiqwQAE0FZp3HxGBVG JHvFT1EVdTEwXS7m+wMj8AgwJO4mc5OCTZj/HbQTIdoUf6tQRAwqDyxsysm8IADhru9r 9fJe7OmdbdSJptsxN0Q+s51x/PpSHS+ObU5+J0xTe5c16pB5ILqEov1Lr5RiHoHGV7bG CpoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=default header.b=2djM+t4C; spf=pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q15-v6si6070562pgc.620.2018.06.28.08.09.30 for ; Thu, 28 Jun 2018 08:09:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=default header.b=2djM+t4C; spf=pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967008AbeF1PJ2 (ORCPT ); Thu, 28 Jun 2018 11:09:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:37702 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966685AbeF1PJ1 (ORCPT ); Thu, 28 Jun 2018 11:09:27 -0400 Received: from localhost.localdomain (unknown [106.201.104.231]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AED5F24832; Thu, 28 Jun 2018 15:09:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1530198567; bh=egAjrg1yzTNg5UFnxaVx03jxSSSK+Q1OP8Eb4q4cOXw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2djM+t4C8c2gM5CnjbDpeJDCtACxSjvQfBfhtnHUdB3GCvLcbfgy9LLIzuVvXfds+ xNmNhTKKBVRlLA8NxHwy7HHocyQHDJDsPoyoiPIRC3G3ba3YWpAuTsevDy9eFl/10Q cJGFiHgmf3VYA6ZoJ0vPF9dajAMz3WccF683FDPk= From: Vinod Koul To: linux-input@vger.kernel.org, linux-pm@vger.kernel.org Cc: Bjorn Andersson , Dmitry Torokhov , Rob Herring , Sebastian Reichel , devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, Vinod Koul Subject: [PATCH v5 1/6] dt-bindings: power: reset: Add qcom pon binding Date: Thu, 28 Jun 2018 20:38:45 +0530 Message-Id: <20180628150850.15358-2-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180628150850.15358-1-vkoul@kernel.org> References: <20180628150850.15358-1-vkoul@kernel.org> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The Power On device for Qcom PM 8xxx is a MFD supporting pwrkey and resin along with the Android reboot-mode. Add the binding describing this. Suggested-by: Bjorn Andersson Reviewed-by: Bjorn Andersson Signed-off-by: Vinod Koul --- .../devicetree/bindings/power/reset/qcom,pon.txt | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/reset/qcom,pon.txt -- 2.14.4 -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Rob Herring diff --git a/Documentation/devicetree/bindings/power/reset/qcom,pon.txt b/Documentation/devicetree/bindings/power/reset/qcom,pon.txt new file mode 100644 index 000000000000..f32cdd358267 --- /dev/null +++ b/Documentation/devicetree/bindings/power/reset/qcom,pon.txt @@ -0,0 +1,35 @@ +Qualcomm PON Device + +The Power On device for Qualcomm PM8xxx is MFD supporting pwrkey +along with the Android reboot-mode. + +This DT node has pwrkey as sub node. + +Required Properties: +-compatible: "qcom,pm8916-pon" +-reg: Specifies the physical address of the pon register + +Optional subnode: +-pwrkey: Specifies the subnode pwrkey and should follow the + qcom,pm8941-pwrkey.txt description. + +The rest of the properties should follow the generic reboot-mode description +found in reboot-mode.txt + +Example: + + pon@800 { + compatible = "qcom,pm8916-pon"; + + reg = <0x800>; + mode-bootloader = <0x2>; + mode-recovery = <0x1>; + + pwrkey { + compatible = "qcom,pm8941-pwrkey"; + interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>; + debounce = <15625>; + bias-pull-up; + linux,code = ; + }; + }; From patchwork Thu Jun 28 15:08:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 141571 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2304458ljj; Thu, 28 Jun 2018 08:09:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeb1lLYpr+GI8i/yugIAlz18TcpZfrUl+hOvrcuWcDeIhWFdQBV81s5Humc3SBPHddpfNqg X-Received: by 2002:a62:e83:: with SMTP id 3-v6mr10494079pfo.63.1530198581739; Thu, 28 Jun 2018 08:09:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530198581; cv=none; d=google.com; s=arc-20160816; b=rd6dhOvdS5cA2aaS1N/+OS6W6MpwTwmKBN1dlOQXZ7XFezT+38tQ83YydbJe9YEIqQ bnze/KS7cMxl/urDbw5AV1irs1FFjlZRyzRbheyD7rlyqSdIfCeHed03Ldt/sfthJtzI pC6bc9GqODL85aAANSLV7r1Yl6J+IU05V92FRgP1RXDIiO660Hsd/UFSk2pZvPSFhF0U Xu2nraaZkFiGAxpPtI37o8lYmBxUCuxiMOuQ0pwFSWoWCjax67lLcv1SyVRhHoYSvvRl ZoKT+xV+nPIF1VYXJfxZm4OKV6MdEkLp7Lcn6/b7rFMmmgKHXWFtfyr9KzBImxY1NWLt KWkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=jqILEuZmEWutW7/mkNOkkkKBSQ91v4EVGGeM96uHHyA=; b=F/bVMgYpCPPcLpeRg6Db/z0D7bfyrzpIdqfK8JwsLhR/XJoZrq2sNnMKhVDSxXhHSS c66x1o/C3Ti1c2Tvcmc0RTyb1+ia7j1/r1e6yUvCVzqT7FGOd7RjOJcfKLuQfbNwsoIt 7Sw0g1Xeq3V/4hTxt0F/yp+kmnC1B1V40q25lvo+meBgp7scr1A6uNxRsQwL6Nk0fPwl 2KWu+FzvaDipVQkwbY2nmdtd3/VinPAc7NkMKg4gMWzkiDfw09KOT3pKYwPIHc2MUhAF 4qUTcrkW37kcsfzS9afT5pfnfcOi+lTkox3wkEjU+j3gx+XzUtOGkysR6tqq9PwT3aTj Di6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=default header.b=OEOeBtde; spf=pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f14-v6si6681332plr.365.2018.06.28.08.09.41 for ; Thu, 28 Jun 2018 08:09:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=default header.b=OEOeBtde; spf=pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967023AbeF1PJj (ORCPT ); Thu, 28 Jun 2018 11:09:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:37834 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966685AbeF1PJg (ORCPT ); Thu, 28 Jun 2018 11:09:36 -0400 Received: from localhost.localdomain (unknown [106.201.104.231]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 800772759F; Thu, 28 Jun 2018 15:09:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1530198575; bh=REHIuA6Z1012OXNqOE+CKt6KOowxQYKTrI3QpL4HArk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OEOeBtdeVLNeXaAJcO/0KDlxHs5jXS+Ja0Pb2UOLQF/qXnSFSlJirGlD3z3phsY9n QN86AwB+F0vDZFogW8thAba7dO9RUtaCV567MKY1vBdxzc4EjNfy8PunIdkzQAGvab BH5HEAQiEXfSKVGC+q4Gg6WbLIEA9xoKHUNJeetc= From: Vinod Koul To: linux-input@vger.kernel.org, linux-pm@vger.kernel.org Cc: Bjorn Andersson , Dmitry Torokhov , Rob Herring , Sebastian Reichel , devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, Vinod Koul Subject: [PATCH v5 4/6] input: pm8941-pwrkey: Abstract register offsets and event code Date: Thu, 28 Jun 2018 20:38:48 +0530 Message-Id: <20180628150850.15358-5-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180628150850.15358-1-vkoul@kernel.org> References: <20180628150850.15358-1-vkoul@kernel.org> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org In order to support resin thru the pwrkey driver (they are very similar in nature) we need to abstract the handling in this driver. First we abstract pull_up_bit and status_bit along in driver data. The event code sent for key events is quiried from DT. Since the device can be child of pon lookup regmap and reg from parent if lookup fails (we are child). Reviewed-by: Bjorn Andersson Signed-off-by: Vinod Koul --- drivers/input/misc/pm8941-pwrkey.c | 61 ++++++++++++++++++++++++++++++-------- 1 file changed, 48 insertions(+), 13 deletions(-) -- 2.14.4 -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/input/misc/pm8941-pwrkey.c b/drivers/input/misc/pm8941-pwrkey.c index 18ad956454f1..2047e34c0982 100644 --- a/drivers/input/misc/pm8941-pwrkey.c +++ b/drivers/input/misc/pm8941-pwrkey.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -42,6 +43,10 @@ #define PON_DBC_CTL 0x71 #define PON_DBC_DELAY_MASK 0x7 +struct pm8941_data { + unsigned int pull_up_bit; + unsigned int status_bit; +}; struct pm8941_pwrkey { struct device *dev; @@ -52,6 +57,9 @@ struct pm8941_pwrkey { unsigned int revision; struct notifier_block reboot_notifier; + + u32 code; + const struct pm8941_data *data; }; static int pm8941_reboot_notify(struct notifier_block *nb, @@ -124,7 +132,8 @@ static irqreturn_t pm8941_pwrkey_irq(int irq, void *_data) if (error) return IRQ_HANDLED; - input_report_key(pwrkey->input, KEY_POWER, !!(sts & PON_KPDPWR_N_SET)); + input_report_key(pwrkey->input, pwrkey->code, + sts & pwrkey->data->status_bit); input_sync(pwrkey->input); return IRQ_HANDLED; @@ -157,6 +166,7 @@ static int pm8941_pwrkey_probe(struct platform_device *pdev) { struct pm8941_pwrkey *pwrkey; bool pull_up; + struct device *parent; u32 req_delay; int error; @@ -175,12 +185,30 @@ static int pm8941_pwrkey_probe(struct platform_device *pdev) return -ENOMEM; pwrkey->dev = &pdev->dev; + pwrkey->data = of_device_get_match_data(&pdev->dev); - pwrkey->regmap = dev_get_regmap(pdev->dev.parent, NULL); + parent = pdev->dev.parent; + pwrkey->regmap = dev_get_regmap(parent, NULL); if (!pwrkey->regmap) { - dev_err(&pdev->dev, "failed to locate regmap\n"); - return -ENODEV; + /* + * we failed to get regmap for parent + * Check if we are child on pon and read regmap and reg from + * parent + */ + pwrkey->regmap = dev_get_regmap(parent->parent, NULL); + if (!pwrkey->regmap) { + dev_err(&pdev->dev, "failed to locate regmap\n"); + return -ENODEV; + } + + error = of_property_read_u32(parent->of_node, + "reg", &pwrkey->baseaddr); + } else { + error = of_property_read_u32(pdev->dev.of_node, "reg", + &pwrkey->baseaddr); } + if (error) + return error; pwrkey->irq = platform_get_irq(pdev, 0); if (pwrkey->irq < 0) { @@ -188,11 +216,6 @@ static int pm8941_pwrkey_probe(struct platform_device *pdev) return pwrkey->irq; } - error = of_property_read_u32(pdev->dev.of_node, "reg", - &pwrkey->baseaddr); - if (error) - return error; - error = regmap_read(pwrkey->regmap, pwrkey->baseaddr + PON_REV2, &pwrkey->revision); if (error) { @@ -200,13 +223,20 @@ static int pm8941_pwrkey_probe(struct platform_device *pdev) return error; } + error = of_property_read_u32(pdev->dev.of_node, "linux,code", + &pwrkey->code); + if (error) { + dev_info(&pdev->dev, "no linux,code assuming power%d\n", error); + pwrkey->code = KEY_POWER; + } + pwrkey->input = devm_input_allocate_device(&pdev->dev); if (!pwrkey->input) { dev_dbg(&pdev->dev, "unable to allocate input device\n"); return -ENOMEM; } - input_set_capability(pwrkey->input, EV_KEY, KEY_POWER); + input_set_capability(pwrkey->input, EV_KEY, pwrkey->code); pwrkey->input->name = "pm8941_pwrkey"; pwrkey->input->phys = "pm8941_pwrkey/input0"; @@ -225,8 +255,8 @@ static int pm8941_pwrkey_probe(struct platform_device *pdev) error = regmap_update_bits(pwrkey->regmap, pwrkey->baseaddr + PON_PULL_CTL, - PON_KPDPWR_PULL_UP, - pull_up ? PON_KPDPWR_PULL_UP : 0); + pwrkey->data->pull_up_bit, + pull_up ? pwrkey->data->pull_up_bit : 0); if (error) { dev_err(&pdev->dev, "failed to set pull: %d\n", error); return error; @@ -271,8 +301,13 @@ static int pm8941_pwrkey_remove(struct platform_device *pdev) return 0; } +static const struct pm8941_data pwrkey_data = { + .pull_up_bit = PON_KPDPWR_PULL_UP, + .status_bit = PON_KPDPWR_N_SET, +}; + static const struct of_device_id pm8941_pwr_key_id_table[] = { - { .compatible = "qcom,pm8941-pwrkey" }, + { .compatible = "qcom,pm8941-pwrkey", .data = &pwrkey_data }, { } }; MODULE_DEVICE_TABLE(of, pm8941_pwr_key_id_table); From patchwork Thu Jun 28 15:08:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 141548 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2304539ljj; Thu, 28 Jun 2018 08:09:45 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfqaHlhNR1VNjpW+1bW7yw5i5CR5V+PGwHc27atotMl0gG+J4p3iYlmbVF4dl+GIKr0Tpi1 X-Received: by 2002:a63:67c4:: with SMTP id b187-v6mr9049954pgc.86.1530198585734; Thu, 28 Jun 2018 08:09:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530198585; cv=none; d=google.com; s=arc-20160816; b=joDlRFKBYtqGWT7QtiagAkpBESqoMx7A4P6yjCPNKiXOpZkX6p7IsVT3l9XvUT/O6F UnOuq2zYiV7p+EJ6+DjzI2Q9Nhi6OxB6pA7bTeVyyURiMsBacdggFgs8xr3FAzMba2hM Yok0q7eky45ROOkuSKYEcJrSfWYZdxLX0Msewd0IWgqQt52RxbD9IoK+xb/37/Uwpp8w KdE0eakDY4RsyQ8oomKx+bfdpdqcrs2M0HtbZ7xPuD6qDQ9wYmA6Bhf3Ekk4IX3imMnP LdW0xoF28sdD3QHzMbVoaS4p5OBUTQ6lOR7BWFnnFf1p8YNTaRV7OBmWOuu48IpEO0jI psPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=t4z01GowZDcJ+l5xKr0CyN9iRTBviKmjelGrBkGByXY=; b=RNbQFM8w+bYyyR6YnST00qanPQ6oAWh93+fHjoltVXJLVWzRsIXbJj3Amk6j5bS3Qw 9bQAfMvSM4jtri5BbGkq8UYWda78M6AVQ1ghZXqlUQqu70lxd9H6BOJB55zNQs4iUaOP pWyABU6X0qoLLu7kCEHxpzeiTqu147z5/0lwiEzxR0pdXyNmkJ6eWBhFbCQJjMMQZS8n 1U3sDsLCqJCwsHY/sNAU5Mt/QBCN1reNH9JilcZUkfGvJ5OnN24WJwTI7b8qCfSZtud/ +IxdxDea33Ed6jwcFumlIIRmVqe705oucWgzNGd/1ZdJyW4Pr4Szpa8yLqocof2yMuT5 Mm2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=default header.b=Ut7M6xEm; spf=pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f14-v6si6681332plr.365.2018.06.28.08.09.45 for ; Thu, 28 Jun 2018 08:09:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=default header.b=Ut7M6xEm; spf=pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967031AbeF1PJm (ORCPT ); Thu, 28 Jun 2018 11:09:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:37898 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967024AbeF1PJj (ORCPT ); Thu, 28 Jun 2018 11:09:39 -0400 Received: from localhost.localdomain (unknown [106.201.104.231]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 70D4A275A0; Thu, 28 Jun 2018 15:09:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1530198578; bh=27CVBHRbZ3bZ6ACVlUSGRKhkR5VJ6l7cM82I03/4ubc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ut7M6xEmag5iSF6sOsEDcEVPbbqxuRDTsOvoaE11/sUxN/xGHZbGs8+4qf62PH2Qg Wkw1QZftV5oMV3D0uhRWBwIsEK/WyKt4hBmv2S07r+KaXbkbetC/jUY7EELpK7KKju 3WUs16K0XjN/E23EBd/nUqQlCpnE3TcFSE4IOE28= From: Vinod Koul To: linux-input@vger.kernel.org, linux-pm@vger.kernel.org Cc: Bjorn Andersson , Dmitry Torokhov , Rob Herring , Sebastian Reichel , devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, Vinod Koul Subject: [PATCH v5 5/6] dt-bindings: power: reset: qcom: Add resin binding Date: Thu, 28 Jun 2018 20:38:49 +0530 Message-Id: <20180628150850.15358-6-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180628150850.15358-1-vkoul@kernel.org> References: <20180628150850.15358-1-vkoul@kernel.org> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Resin is similar to pwrkey, add the description and example for resin bindings Signed-off-by: Vinod Koul --- .../devicetree/bindings/input/qcom,pm8941-pwrkey.txt | 1 + Documentation/devicetree/bindings/power/reset/qcom,pon.txt | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) -- 2.14.4 -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Rob Herring diff --git a/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.txt b/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.txt index bf719396eadd..34ab5763f494 100644 --- a/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.txt +++ b/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.txt @@ -7,6 +7,7 @@ PROPERTIES Value type: Definition: must be one of: "qcom,pm8941-pwrkey" + "qcom,pm8941-resin" - reg: Usage: required diff --git a/Documentation/devicetree/bindings/power/reset/qcom,pon.txt b/Documentation/devicetree/bindings/power/reset/qcom,pon.txt index f32cdd358267..651491bb63b7 100644 --- a/Documentation/devicetree/bindings/power/reset/qcom,pon.txt +++ b/Documentation/devicetree/bindings/power/reset/qcom,pon.txt @@ -1,9 +1,9 @@ Qualcomm PON Device The Power On device for Qualcomm PM8xxx is MFD supporting pwrkey -along with the Android reboot-mode. +and resin along with the Android reboot-mode. -This DT node has pwrkey as sub node. +This DT node has pwrkey and resin as sub nodes. Required Properties: -compatible: "qcom,pm8916-pon" @@ -12,6 +12,8 @@ Required Properties: Optional subnode: -pwrkey: Specifies the subnode pwrkey and should follow the qcom,pm8941-pwrkey.txt description. +-resin: Specifies the subnode resin and should follow the + qcom,pm8xxx-pwrkey.txt description. The rest of the properties should follow the generic reboot-mode description found in reboot-mode.txt @@ -32,4 +34,12 @@ Example: bias-pull-up; linux,code = ; }; + + resin { + compatible = "qcom,pm8941-resin"; + interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>; + debounce = <15625>; + bias-pull-up; + linux,code = ; + }; }; From patchwork Thu Jun 28 15:08:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 141570 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2304644ljj; Thu, 28 Jun 2018 08:09:50 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKxQWYPsYd6MNaNTIWHzT1L/h5hsch+RjJnENNTAZ2qCnYI1bxDs86UZ3TYhYozjceTeHgh X-Received: by 2002:a63:2505:: with SMTP id l5-v6mr9450472pgl.40.1530198590683; Thu, 28 Jun 2018 08:09:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530198590; cv=none; d=google.com; s=arc-20160816; b=vIwtAp6YhSUVZ/WNae/KUtN6g9pioZd3PuD792iyaieiaA4dA6dXV2B6qf7zk47Y7f gk7f8X4ubHYhjFoCDnS8BL9LrbHoyzBw3BpbhzWFe2FmvNEaevKiLGb9pNd0UiS2ZHGh LJ9RRwZ+0QA1eySJR5Kfz4/HH8jmfon5pTt93r/Zch4GqC/O0C15zOOweRTs9ZCjIU0x lGb6fWQuKEq1OYKURzQciJoW9uAI1Z5Uu0vU+9qm7slheaCDiZi827Xo00oZ3thVnTzQ p5MVQ7JhgIQCooCIueYA3Kxq3c8f5NwzLyT5w8AGZlcTsi1L7/dvnbtE4AwM6UXs5SdN /Qqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=mGg+xUQc988INa1Yg+XHJsMMlCBYs/5NmxG9CgKR1MU=; b=z8Ck96sl3938pLkc6LJR1jibMlQsHzxe+YoSdQAwTgPOcCURRG2srfB3ZWlisBMYmt WVXk6oUK6OJtgmWqS7sRtPxNNUl0aWcxeslqdDnYkKm7ivapy0mj25mwJOkUv5FIZkKQ tzUXsyWpYFu6uFZto1SCbgju4KuIg3da6OMD/+kpUVipaluEdkoiP5QqeinLc2xr/Hp7 /aLC02oAvlNH3mGudPCu05Sth1EdOxkk+5ftaREJkkS8hRjefmkze1ai1h51h7YlN/Z+ KEJajcqKqc6u+B+oKiFwrZTbzisaByFL7S/hDhhr7TqsPlDk7xzR0IlkZqZ65qLn+/En iDaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=default header.b=EFf3PTP9; spf=pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f14-v6si6681332plr.365.2018.06.28.08.09.50 for ; Thu, 28 Jun 2018 08:09:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=default header.b=EFf3PTP9; spf=pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967026AbeF1PJs (ORCPT ); Thu, 28 Jun 2018 11:09:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:37918 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966685AbeF1PJm (ORCPT ); Thu, 28 Jun 2018 11:09:42 -0400 Received: from localhost.localdomain (unknown [106.201.104.231]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6143D24832; Thu, 28 Jun 2018 15:09:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1530198581; bh=18zSlxLW6hAhdBXWIFXD/MmFR9Mxa1xrsMWvFj3m/Bk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EFf3PTP9hy+MpGhQPMlSLUBtDHph/WH7OdFQsGznBsry7LF6m0Gy2rsrxCw/4eAXC PssJD+TjtQHRVnSYhTrgKravEFfVQD82FJcq1Zc+GeQ77AMEgknX/7I0lTxQv6+xpX pKorp67P4RgK3EdjRgul59AqJDOaCD+S81sgvDnw= From: Vinod Koul To: linux-input@vger.kernel.org, linux-pm@vger.kernel.org Cc: Bjorn Andersson , Dmitry Torokhov , Rob Herring , Sebastian Reichel , devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, Vinod Koul Subject: [PATCH v5 6/6] input: pm8941-pwrkey: Add resin entry Date: Thu, 28 Jun 2018 20:38:50 +0530 Message-Id: <20180628150850.15358-7-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180628150850.15358-1-vkoul@kernel.org> References: <20180628150850.15358-1-vkoul@kernel.org> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Since handling is abstracted in this driver, we need to add resin entry in id table along with pwrkey_data. Reviewed-by: Bjorn Andersson Signed-off-by: Vinod Koul --- drivers/input/misc/pm8941-pwrkey.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.14.4 -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/input/misc/pm8941-pwrkey.c b/drivers/input/misc/pm8941-pwrkey.c index 2047e34c0982..6547a57f5222 100644 --- a/drivers/input/misc/pm8941-pwrkey.c +++ b/drivers/input/misc/pm8941-pwrkey.c @@ -29,6 +29,7 @@ #define PON_RT_STS 0x10 #define PON_KPDPWR_N_SET BIT(0) +#define PON_RESIN_N_SET BIT(1) #define PON_PS_HOLD_RST_CTL 0x5a #define PON_PS_HOLD_RST_CTL2 0x5b @@ -39,6 +40,7 @@ #define PON_PULL_CTL 0x70 #define PON_KPDPWR_PULL_UP BIT(1) +#define PON_RESIN_PULL_UP BIT(0) #define PON_DBC_CTL 0x71 #define PON_DBC_DELAY_MASK 0x7 @@ -306,8 +308,14 @@ static const struct pm8941_data pwrkey_data = { .status_bit = PON_KPDPWR_N_SET, }; +static const struct pm8941_data resin_data = { + .pull_up_bit = PON_RESIN_PULL_UP, + .status_bit = PON_RESIN_N_SET, +}; + static const struct of_device_id pm8941_pwr_key_id_table[] = { { .compatible = "qcom,pm8941-pwrkey", .data = &pwrkey_data }, + { .compatible = "qcom,pm8941-resin", .data = &resin_data }, { } }; MODULE_DEVICE_TABLE(of, pm8941_pwr_key_id_table);