From patchwork Wed Nov 25 06:08:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 332369 Delivered-To: patch@linaro.org Received: by 2002:a92:5e16:0:0:0:0:0 with SMTP id s22csp176944ilb; Tue, 24 Nov 2020 22:09:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJxGyKtqmjKTlyA1SMgXT+7KfX3Rr1fEA9DZ1WAO1HigtRupQPz7fAyqEo+DAls+0W/ADWUT X-Received: by 2002:aa7:ca41:: with SMTP id j1mr2000951edt.295.1606284575155; Tue, 24 Nov 2020 22:09:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606284575; cv=none; d=google.com; s=arc-20160816; b=IIR8+5Pb4a7tc6EdHLh5hI7rjHKelnhSue5O1axqcYJg64ErF5aAw/aHSfaGyXi/dl /4PAya9+Aa3OpT12Q+3t97fuGmB1eIOtwRNIppxQcKJaskJi4xfveZ0n2/SUVR6+a8Zi QAFgJ0fqnTZCfvEe05FG3CAh19Vllao0o+5AvkV4BDLVP1vNpz3+9ffviMeGEe1JJe1X atbtaaQEliAe27tgz1JzxMs93vj1Nu5i2EKJgkrhpMECulcaBTXx0wA/npbPCSC/dn4e 3lAo3Rastl3Rxq9JyFm+qBCfM0khdrH2iey0F3lrsEh7M/rre8WbaxHLAz8dfIo4KSjq efMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=VaBKKtVpxSZ3Ss3dI1KLi4Zn07ADzR3ErIEYv2rzINA=; b=nLFKKNfFcWZQ7ADpFjeG0pRPjR9PI4Asdk8lZrym8pGWefDZgN3ydNQPdTt9j4VZLL AL/XyCuhmZcM3A8bGziuBt4VJlrBkqjhm3x1MXmQG78bXPsKOXgrQFC4sqCyWDmcAH0e f9+31Wb8eKK+zqzM+2/D4l6odQeWFGjPOeMxvRvu0sUdXjMBHxkUGKroURR3ZuV8LiSW LiqfXwiqQZodGBYlWPmCqLZ11Rq6D0WdFla8KhAwizetpvcfdeTCM8bwCAblQUV7mb/C Izysb0EDlEdsuUbdIZS66TnTJ7d8dLfZ40ZsjkZPYHbDzh7v51rMVNN2c3AtQcX5c+jR 53uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZPWNeabs; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c2si602759edu.115.2020.11.24.22.09.34; Tue, 24 Nov 2020 22:09:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZPWNeabs; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727611AbgKYGIl (ORCPT + 15 others); Wed, 25 Nov 2020 01:08:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727474AbgKYGIl (ORCPT ); Wed, 25 Nov 2020 01:08:41 -0500 Received: from mail-ot1-x341.google.com (mail-ot1-x341.google.com [IPv6:2607:f8b0:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 432B0C0613D6 for ; Tue, 24 Nov 2020 22:08:41 -0800 (PST) Received: by mail-ot1-x341.google.com with SMTP id f12so1214230oto.10 for ; Tue, 24 Nov 2020 22:08:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=VaBKKtVpxSZ3Ss3dI1KLi4Zn07ADzR3ErIEYv2rzINA=; b=ZPWNeabsa3es0f5hvmx5rpmvmadljn1fx39W2nxEFiM6S1awRNFuoojfNdTjaXefcx qdlVfthusC/ycUW1ZAt4iwkKKweZOwN9uNKXrMlpNR/68vbZCsifsgwdjjvChJ39QxBt 7nmpFeV+pRmJrNPi0GsuseRXiiepBWPrlyTPRkUz+eKzn90HVvd/6Qx2UQZW241R+ZWU SMnuvCO4V4FwJbAMlfr2GVEuMpNIqJ/91m8erkPv2wXks6m+BOk1SnBWBJfdXKTkj+2Z ByERmMqbyE7hFS+PU4aIHFss8Dw+MvLG5Lxl2hoaKNhFvphZQxJ8YAj2JerX8Z7tNTU+ p5oA== 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:mime-version :content-transfer-encoding; bh=VaBKKtVpxSZ3Ss3dI1KLi4Zn07ADzR3ErIEYv2rzINA=; b=iVvYXUNYHSp+87TmJKUgvyuyKI47xAcHLObaahauiGSbFSuTNpolxlgiyPLYHj/9gG ymiHYS9HMldC7WukCcxlJTuMWAItnJB1SlvEWmFpfoYdowviwx4ZueZTdZwPbgNBV39b TLibod+/zhBWAph9yXyTrRFU1pSZvZGfWNhIz/qHYoDsBRJBzoEZwTVzo2HruRIBfHRA LntvgXIQutvbqOKQb8ZBl0A7i7gL35CckK/1c5By8H3AgmL1vFUD7AliPt1v0g8M0P0I 3lVuRjgMhTWLp9g/f28TIznWkOIBnJNrMW8fYJV+tmEKJ14f21hI79bghWNbyaMB1ccQ 1JEA== X-Gm-Message-State: AOAM531Wh6Dtw1+x99mY4dMHWzaydPqNvMlt71nZtbm3+re5nfoOeBkj nyqE0kKS06xG5MEfDexwXXFifg== X-Received: by 2002:a9d:6212:: with SMTP id g18mr1704768otj.89.1606284520272; Tue, 24 Nov 2020 22:08:40 -0800 (PST) Received: from builder.lan (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id x9sm765968otk.9.2020.11.24.22.08.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 22:08:39 -0800 (PST) From: Bjorn Andersson To: Andy Gross , Bjorn Andersson , Rob Herring , Steev Klimaszewski , Shawn Guo Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] arm64: dts: qcom: c630: Expose LID events Date: Wed, 25 Nov 2020 00:08:38 -0600 Message-Id: <20201125060838.165576-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The LID state can be read from GPIO 124 and the "tablet mode" from GPIO 95, expose these to the system using gpio-keys and mark the falling edge of the LID state as a wakeup-source - to wake the system from suspend. Signed-off-by: Bjorn Andersson --- .../boot/dts/qcom/sdm850-lenovo-yoga-c630.dts | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) -- 2.29.2 Acked-by: Shawn Guo Tested-by: Steev Klimaszewski diff --git a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts index bb314973eb0c..f956dbf664c1 100644 --- a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts +++ b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts @@ -8,6 +8,8 @@ /dts-v1/; #include +#include +#include #include #include #include @@ -21,6 +23,27 @@ / { aliases { hsuart0 = &uart6; }; + + gpio-keys { + compatible = "gpio-keys"; + + pinctrl-names = "default"; + pinctrl-0 = <&lid_pin_active>, <&mode_pin_active>; + + lid { + gpios = <&tlmm 124 GPIO_ACTIVE_HIGH>; + linux,input-type = ; + linux,code = ; + wakeup-source; + wakeup-event-action = ; + }; + + mode { + gpios = <&tlmm 95 GPIO_ACTIVE_HIGH>; + linux,input-type = ; + linux,code = ; + }; + }; }; &adsp_pas { @@ -466,6 +489,22 @@ wcd_intr_default: wcd_intr_default { bias-pull-down; drive-strength = <2>; }; + + lid_pin_active: lid-pin { + pins = "gpio124"; + function = "gpio"; + + input-enable; + bias-disable; + }; + + mode_pin_active: mode-pin { + pins = "gpio95"; + function = "gpio"; + + input-enable; + bias-disable; + }; }; &uart6 {