From patchwork Mon Jun 25 06:38:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 139808 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp3622819lji; Sun, 24 Jun 2018 23:39:16 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLgJAB+v/nAEiFCyEpmePEm2i0nUx+TDo/ibDa8mhEPCduh4DJKchsnjNF9F5Fg4GZ7x/eg X-Received: by 2002:a63:5c7:: with SMTP id 190-v6mr1716909pgf.385.1529908756475; Sun, 24 Jun 2018 23:39:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529908756; cv=none; d=google.com; s=arc-20160816; b=ychVHkn0sNE6+8aBXkAEQ/DVHYlaND7E20iVSgMrEAP4eQKNQpFV/bnTCOK01TNs2P epzuWYhYpf1b+I0oI4c3LYl7U4vlWNw7nN5Swv541nox7FD9a/fkn5XJePQF2KXjgD9n DYJ/VwaJR0NbIdLQaymYte3TTJ25QTSKbsoZndm0HYPk/2ivrsAzAqghWHHUPS6hrsmd yJ1YTsGLtaaXhTzmaY3Tbmg5zRhTSs1DUKsTXpqrMyZxNrahRk8AW01RwOZRrEd93rJo 7+cQvPgT0/vMV0JmvlPGMm1CJcWXOEZPXlP9U7KE4ztfLXUisACkxw0jAi7P/cNJeW/M +mtw== 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=hMpT3erpWkMbqS8iO6CLKxJ2mqujjnVwV4tFqczaCr0=; b=IhU0WaPtb3RTReI4qvJvn+P2BGhWTLanteNyo6F7j5Mx2runhbh4tMz0ToTGtMlNqT hUrEzS81kPZQb/eX0MQ7g8Qqjc8ZBf7FxhCveYdkVZIMdbDhgK/EXTKcRaAbEibIwfm9 qdV46uDGe3Ld59zvK921sojP05QqmNAU7zhd5V8pLHDd7HMpWnnUvddLW+wPNZt8lejX b9eWcD96xO5HeLiqulXgUZ5vYpde9Cs9bDPwi7ANJcJRkNvBhsgXB0Z1ux57xau/GKag bS2AW3Blc11Qun29/FPV6dykx0Dsoto0Ke86IHFNKPdJCHPVEHin0uan/tFgH7HQoSa7 BonQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ImX21kbe; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o10-v6si11097303pgp.153.2018.06.24.23.39.16; Sun, 24 Jun 2018 23:39:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-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=@linaro.org header.s=google header.b=ImX21kbe; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752235AbeFYGjO (ORCPT + 5 others); Mon, 25 Jun 2018 02:39:14 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:38770 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751556AbeFYGjM (ORCPT ); Mon, 25 Jun 2018 02:39:12 -0400 Received: by mail-pf0-f194.google.com with SMTP id a1-v6so2145097pfi.5 for ; Sun, 24 Jun 2018 23:39:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=v+pBkqkPfhu5i8o1mMOVFUtxRY8tAdUdD+hhWdX/ikQ=; b=ImX21kbe8qgq0UwnD8rYMM6SUT04drjqYsPkGNI4gnkStYxl4O1QLEr2pk3Xnc9aMg qK2tWLCwft1rlOUKxjk/ePLv6MSI12UaC+RnamKDDXV0RLrWdFZkC0AVpaeXkrv1nEgb Tc9gm8sfN1SdpmPuHNPEZhItd+EnSTq6CWT5A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=v+pBkqkPfhu5i8o1mMOVFUtxRY8tAdUdD+hhWdX/ikQ=; b=unUxxaO4MSplfcc6O87I5tK6PPqB4SZdpH/VTHrx+1Y5QR1kfydDxPqaa59R+3kN8u riHRiDGT/mUslZ4645j8t0qsKSErszD5EMujxSZs8l23h9tLTy8vGZKGRvzil32yGAgM e/5o7wtkFdkIHKNQcY7KFle9YhzfOW3SjMudfqPnWeNRVJGDZ5d7EvUXOLqCYFYv1DRC 1KdziO1qBA7iRqPmwxKrG0bBkyejCTWeCsDhRmtbRTvydoiliEhulf/85w9oq2Z9Xuaj 6FlAqio5XOO5Rx5yGa8omL3rmDCZBPyESuLSKPscUAxvUJcThjEDc8nakxRE7tNmleMZ FDlg== X-Gm-Message-State: APt69E0NPcryW7Fu/A+OOTm8O90K+x3TVw4Pt9uhrmKr4hjgcf9WPwCw a4gDR5wZh35rEotkByTOOt0oAg== X-Received: by 2002:a63:6642:: with SMTP id a63-v6mr9423896pgc.408.1529908751882; Sun, 24 Jun 2018 23:39:11 -0700 (PDT) Received: from localhost.localdomain ([223.226.41.70]) by smtp.gmail.com with ESMTPSA id a10-v6sm18271742pgw.90.2018.06.24.23.39.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 24 Jun 2018 23:39:11 -0700 (PDT) From: Vinod Koul X-Google-Original-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 v3 1/5] dt-bindings: power: reset: Add qcom pon binding Date: Mon, 25 Jun 2018 12:08:36 +0530 Message-Id: <20180625063840.30173-2-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180625063840.30173-1-vkoul@kernel.org> References: <20180625063840.30173-1-vkoul@kernel.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The Power On driver 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 | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/reset/qcom,pon.txt -- 2.14.4 -- To unsubscribe from this list: send the line "unsubscribe devicetree" 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/Documentation/devicetree/bindings/power/reset/qcom,pon.txt b/Documentation/devicetree/bindings/power/reset/qcom,pon.txt new file mode 100644 index 000000000000..0dc24c9b93d5 --- /dev/null +++ b/Documentation/devicetree/bindings/power/reset/qcom,pon.txt @@ -0,0 +1,45 @@ +Qualcomm PON Driver + +The Power On driver for Qualcomm PM8xxx is MFD supporting pwrkey and +resin along with the Android reboot-mode. + +This DT node has pwrkey and resin as sub nodes. + +Required Properties: +-compatible: "qcom,pm8916-pon" +-reg: Specifies the physical address of the pon register + +Optional subnodes: +-prwrkey: Specifies the subnode pwrkey and should follow the + qcom,pm8xxx-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 + +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 = ; + }; + + resin { + compatible = "qcom,pm8941-resin"; + interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>; + debounce = <15625>; + bias-pull-up; + linux,code = ; + }; + }; From patchwork Mon Jun 25 06:38:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 139811 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp3622923lji; Sun, 24 Jun 2018 23:39:24 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL7/H7tzs2tPdj5Qkg20V3j6DfB43h4fwbdnEbOTZKkcA09/KIKNh1uTnCQcQ9Mpo/fzEo/ X-Received: by 2002:a17:902:1007:: with SMTP id b7-v6mr11023366pla.277.1529908764710; Sun, 24 Jun 2018 23:39:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529908764; cv=none; d=google.com; s=arc-20160816; b=nbL/7K26QHuo5PJnvGYl1Baf+CWjV4LgG/lN0NrDVVCuhWa7n9/gw2+DWkzESJA6rT +ihy4p3aUFeMiSjEhJbRkvDS1fPsOdOiXL3PmvcfjczKi1NG9hYYGOXH+fbGolm2pDhn DyM/ZALR9hFRjz4WR7YyZYCot/wJq7AheYhhmmURUu3cuzMsxq0OEoL0hycg+e9Yp2xr WCU25TUJ3lyq5aCRrGArWB2dMwCb748+uOdSD4FeqIFevSBBfOpEcy6z38aLkVFCQufe lxGcrbYOu0lg66rLZAtF8/OzMVbS/FWwvNB4kMiut41XZEZqopS+ByHaRam8Hyz5am/8 H2Lw== 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=Qekq3yOBBaRYCPBq9OvHroOJ6h6U8RSmUUiTm9acfSQ=; b=YE9rz0Q8iCX1kVYoB+S7Q+hbFftrI+QK5JXHjZg8X1RNl3BfuiHQNuKLtzeEalZJfE hXqCC1X15frZvoQ/z8T2/ff+w1pprUdB0ykfJGf6FsTa1sbiQ5NhZpwEDqDrOzcCOK+O BszORrR3yq4AYgqfpOmrQS906/D4+KGVP0GVWvCFTanRdyxJI8xo7YVMIjJ4iW8X4BAr yt69q9oeP0Eb+iR0ZIE+Y1n6L7A7UJvg8YFweZAnJ/OEePxrad9jxkmokyLQaYSSM+On dBEGUBHmXqsHh9nItZMk/nqZC7ZZxFwpjTm8RscoPPEhyekmGyIT/psdVk3zoOTFHigy a5Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=dygg1h1p; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 2-v6si14031102ple.192.2018.06.24.23.39.24; Sun, 24 Jun 2018 23:39:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-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=@linaro.org header.s=google header.b=dygg1h1p; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752415AbeFYGjW (ORCPT + 5 others); Mon, 25 Jun 2018 02:39:22 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:36081 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751310AbeFYGjV (ORCPT ); Mon, 25 Jun 2018 02:39:21 -0400 Received: by mail-pl0-f65.google.com with SMTP id a7-v6so6351986plp.3 for ; Sun, 24 Jun 2018 23:39:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hsymZGujnTOC21p3K1BXSAJIhupSLfP49NrblWoJeSk=; b=dygg1h1pES2pX30mBmwT8m0DiJrNE/NP4SkNtocBQH/DV5lKXUI0HLZGJo2s39uiSL ICtVxb7gBhetKcoTHZPwmkjtztSqGs6c69x949ta8Z8ii5Z05QyVyFE5jHRAItv0asy/ Sy20PUYGoZrgGK+BCqr4dfE3Dr44NaL/yDayw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hsymZGujnTOC21p3K1BXSAJIhupSLfP49NrblWoJeSk=; b=iMH7PShhnCx546Eh+rCiZX4rI/8+ZB9a1wTQkNpqIxi1ax4Nu/UrztrjnUDSGVfGLS 6ivHZsbsMUzQ0bmNEwG+iPsTY3gA3FILTMdz/gguHuMBiG04NV7O/6ktGJ0xEQYdLbD/ 9/Tdoc7QsCwWj41I6Q2a9/fQyo1ZxYwzQdPJNPEfESUJgIkiJ70LTIj26iMU/Sy88LDT tsGKYOESgsrmdrZAC9+t8mrN/qV++lMddiYtWfmAt3Vtl8+sF2a7jGPBvPn0lpswcHI7 qo/O52qepl+AGe0JxVE8uZbPnik2BbKOogxtJ2DV+mbGrPdXM4eeo23JTLHtvO4DkmCx exDA== X-Gm-Message-State: APt69E0tWZAZi8vUA49tGjwkGh86riNIk7wBImweNuTUqW70GmUsge+c b+uRZisbrAFatImRugocQbUgNQ== X-Received: by 2002:a17:902:a416:: with SMTP id p22-v6mr11231342plq.228.1529908760915; Sun, 24 Jun 2018 23:39:20 -0700 (PDT) Received: from localhost.localdomain ([223.226.41.70]) by smtp.gmail.com with ESMTPSA id a10-v6sm18271742pgw.90.2018.06.24.23.39.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 24 Jun 2018 23:39:20 -0700 (PDT) From: Vinod Koul X-Google-Original-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 v3 4/5] input: pm8941-pwrkey: Abstract register offsets and event code Date: Mon, 25 Jun 2018 12:08:39 +0530 Message-Id: <20180625063840.30173-5-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180625063840.30173-1-vkoul@kernel.org> References: <20180625063840.30173-1-vkoul@kernel.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@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 devicetree" 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 Mon Jun 25 06:38:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 139812 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp3622972lji; Sun, 24 Jun 2018 23:39:29 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJEnu4758gYLVprbdzAIpD3HqEK6PAK9iC2UEZRRt4ihsY8TXOosnwdsUKrkD+X1JJNcjF0 X-Received: by 2002:a63:9543:: with SMTP id t3-v6mr9408118pgn.77.1529908768918; Sun, 24 Jun 2018 23:39:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529908768; cv=none; d=google.com; s=arc-20160816; b=HEi3EPX5FjY0ITqnW4EUEVZpOfq7OKna9HkBzpfGvfCVoua6EPDQqIj/IaFNowB3IS iduL5ikG1G1A21AnR0y6ra2V5rzyEg9i6+k1GCkORcINx1TAgHQcRnOFMk0h1iM9lOmH U7Z0y8lAfd4T4HuhdDPsE03i0w2IJ72+8PoAh8+Y7EJ2OVj++xSRIGTuLhN9cEyu/K6N gxHGqxNDSgNEIKaIVAr5LlGnB8c7c6ft0Wl0YnVV3hN5yNBeG79Sv6Qf0orXnU3bqH3N 1ONitghY3GsJ9LUBORKwJKDE6mFQWtqigVf6W/e7i9GRPSVkw5XuTVF9tofL1ie6yHtT vJRw== 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=SFNFdq+jbIv9y3cGtOk1f6VHXJDchL8Rvbr0v7CYJ7k=; b=yPBvrl58i2+1zvzJ6M2ARND2tOinZT6og/HuRgVmLSHMtaNtnUrHNXBBDDHGa/vRYA 181JpYqxALhMvE3yQz+tjoNbFkYiD2AqmYAbpeaMjIoHZIvz7MfnzhJ/L54M8CXAVwfH ctKusPTD6aoOY9LNuQq0WzXZ4txGekfFqyGiDNzo8RnNlZhCmm2jCy5utvXTmwwZnL6n 6mEuOVBoA/x0HYs9jx2xeGgA7QzfyW84ns7WVPeDnMQkNqh9Ns5eUg+GRbdtLfft0qrI I7EeMwVbuNf5f5Disy0/vwzs6YEgFT0+2Z0gnFjEeH9anSPsGNdbRk4ytdwjK1vAxx/E +RXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=duSs07ln; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 2-v6si14031102ple.192.2018.06.24.23.39.28; Sun, 24 Jun 2018 23:39:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-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=@linaro.org header.s=google header.b=duSs07ln; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752433AbeFYGj1 (ORCPT + 5 others); Mon, 25 Jun 2018 02:39:27 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:35762 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752434AbeFYGjY (ORCPT ); Mon, 25 Jun 2018 02:39:24 -0400 Received: by mail-pf0-f193.google.com with SMTP id c22-v6so6007963pfi.2 for ; Sun, 24 Jun 2018 23:39:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fI+6BgZEhsA4dM7frmUHH5QPi/ZW/IK73/x82B0DImw=; b=duSs07lntIM7QsZ4mpt4Pu39ZeaOnhgMrt7zex7uQ8g7fx7mZzM5EJPnJE49tPUuNk 88TTwKpvkGMSEsSKYFDN7Ej9+FoOl0O24s7NY/eeyv4q177wh28bz9rFtf03Hx7gx62i 3gk/yp2ajrXwP6isbYQGEYHpHXe9JYdmOIMnU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fI+6BgZEhsA4dM7frmUHH5QPi/ZW/IK73/x82B0DImw=; b=Jt2Gexlr0oqSVvDb4rYi5ufta3dakXbxjC7TuQwlnTd5WXb40qL7f1VM+HiWc42zXh TEaViXWiuHB/1saVG1otNYKFMd/e1t4JBlx8BAZfxNeRs6lF27ilGafjoNTZ8VaGHfMQ wPXoYQ/ppG2JzLqURzsNjNtIJUQyni4sBWBSh5DjsiCyHJ0qQ7viPQ/PNVcF1IL7R/zK m6RrBXYeXVOCa7q3p/4I7DMN0tKsJR1mEXW+bBuUdo+SDVXrCOlcPjAIcHJxfbeeDs7m hsebIOb3BiWsLmKDgyLNOO668gca+VgZBsxVz6myGzjS/CVJtAPHmlYP/7qDpJi6tHb8 6WKw== X-Gm-Message-State: APt69E2OpDWHL/plp6CQyXAC6fwmw6d/Qden/xBMwCTAYeb1tV2aSh03 uyDQuUTPjQuLRm2EJEDwdOyr1A== X-Received: by 2002:a63:b543:: with SMTP id u3-v6mr9601003pgo.365.1529908763900; Sun, 24 Jun 2018 23:39:23 -0700 (PDT) Received: from localhost.localdomain ([223.226.41.70]) by smtp.gmail.com with ESMTPSA id a10-v6sm18271742pgw.90.2018.06.24.23.39.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 24 Jun 2018 23:39:23 -0700 (PDT) From: Vinod Koul X-Google-Original-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 v3 5/5] input: pm8941-pwrkey: Add resin entry Date: Mon, 25 Jun 2018 12:08:40 +0530 Message-Id: <20180625063840.30173-6-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180625063840.30173-1-vkoul@kernel.org> References: <20180625063840.30173-1-vkoul@kernel.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@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 devicetree" 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);