From patchwork Wed Apr 10 15:59:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 787506 Delivered-To: patch@linaro.org Received: by 2002:adf:fdd2:0:b0:346:15ad:a2a with SMTP id i18csp761311wrs; Wed, 10 Apr 2024 09:00:04 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU2CAoZBpKO+0UGgkpgeBu59gwcxKHLqRtxM+aSFXai+W369eMW2ltrBN2KAOmtgP3C4XV+hXQ/UZa7KI1dyUq+ X-Google-Smtp-Source: AGHT+IEdogT98KewIXlOdU/Uq7bBxBNKl6YREg0k+h7cdMnCxkPcNJL4XSbj6mFIw0v+asIIQhmR X-Received: by 2002:a05:6402:5415:b0:56e:6381:39f8 with SMTP id ev21-20020a056402541500b0056e638139f8mr73297edb.11.1712764803965; Wed, 10 Apr 2024 09:00:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712764803; cv=none; d=google.com; s=arc-20160816; b=Y8nqNhDsMCtyPFo2AJALeXW6n9Wh70zS8FU73cPKA3PojSBArTxDZJ6IHtfFfHRgXQ Iz9TdDXvQCTA0vcwsdpH2aHlvJc0CEP4Nudp5hFOdDv0XoDBFe8CQy0uhcVjTHTyX7V3 7EE1x1m+6nTzuNgj12elfDo7x1N2MbMzEzv1t2zAQf3KlfM3M2IIqcVnHZTx/S20iJC9 Im+bQ+2Y74KJpkkEyry5XN6cbMg+zDF1/eVSR2sUwYWlNDTWR+mhryNUoayaWXchgNdw QmG2N4o35th0gCo+ilE1nsDYB2vj6AUJxk57yes8jxazi4OJFYVK95Ofr+zb5f1pitaL T6LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:cc:to:in-reply-to:references :message-id:content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=5tG9OEKHZ9GG9A3n0H5H0kdpfyuBggnADdmpWFzu+8Y=; fh=w3XPBZeqJntfsjap7BOyGXw8YYuVBSjaYDJQjQgdAcA=; b=MIW/hRQQlYQiMxm0ZbE8pwoFMsOW1TX/p8aLz+g7/lGBrpwnlxfb9/4nwX9TcrM17h e5XfumZayRnTX7flClL7St9/bnkN1I3ERa5pKBhV/gqQfheuvjjvuXb1b7CcgpemQI4f 4ZkEez7IK0uhf7JZcbP8YzoKEkvscFFxfyhwvGhl/FmbnuBBBD3ndTPwRmxP7SE22GOG bemHyfHmze3c9Azo+AyVxvtZGbiHIRPHh6x/j2dqdX03InggY35wcAXZpubk5U/qVb4B 19O8RjIknNUn/BiJM1CqXUiSrDQYe8Xc7Nek01Dcon9IrohAE22lLineaOCVzT4/2ENn XXSQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K0Jb33PP; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id q7-20020a056402518700b0056e66e7c7ebsi2803565edd.416.2024.04.10.09.00.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 09:00:03 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K0Jb33PP; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 246B6881AF; Wed, 10 Apr 2024 17:59:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="K0Jb33PP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 183B988180; Wed, 10 Apr 2024 17:59:50 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3BEC787F52 for ; Wed, 10 Apr 2024 17:59:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=neil.armstrong@linaro.org Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-344047ac7e4so2665074f8f.0 for ; Wed, 10 Apr 2024 08:59:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712764788; x=1713369588; darn=lists.denx.de; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=5tG9OEKHZ9GG9A3n0H5H0kdpfyuBggnADdmpWFzu+8Y=; b=K0Jb33PPtokFHiyREe9SB2cNWP9mV1cSGkifas4w18ViY7+/Rg6alVM/XrXiN96H9V VBdgqs45ZRxcv+p7MOzYY5Pk3ElNPPONdyOC4S7z2EXJl2t1z2ZHCJR1PUHIYD/rkkIT Q8VJzuTdCH4kWbova59gRmXP2ezb149swbhjAHWJp725sgYAWkk81Fkgi7afGYFVKHGL 70DALs9sL4Iz9E2MGZPsHxHLYd28TCX/IojZq1lCjKnxUy+loipJ0bhVEdLpj3F2PQOx GKlyP8NZmQwOOxLI7KfkGCxmDLOan99phrtCRS342DczaDH3FQXyn/KGsXbWWoirUwa2 Xp6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712764788; x=1713369588; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5tG9OEKHZ9GG9A3n0H5H0kdpfyuBggnADdmpWFzu+8Y=; b=F9rM00RnzbcSe1ve0Y/W0XSwp+94lbmULnVOaDgtoGxwMyM9mOL+D/DeLYB0j6LmF7 +1X1xd+WT4Xgn1oExOE1I8Pjir4TjU45rzBQfxKQPVMsKdxDqWsYC89AfEjL2a549Got hKFyok/K6TB2sevjGZZyBRFLblH90JYckhEQTwMV2O0vzPknQD93+SrAB4Ho3VQJLhht 7PSk1wCTTW2aDgsaXNDeIXSUJisof6xnZfImbe9BIOr/rX/45QDFqvqvJaaCDGsPXUVg XLog8yC73QRYlA8VDRSz5QiA5ghh2fmg1KF22CXjMavjtiCSjTYcLvR0Fak27cUiZjRV efnw== X-Gm-Message-State: AOJu0Yyqv5v8bGeW37H7MGahnC4/wEhMV4XtPnk+zVuhJolD1Ls8dDm3 6Ca3zmGVowXbIDRVKcnGWRpezcThBYDXBIXbWuY5kLM6M/jTmf3QWTSnksK9Y98= X-Received: by 2002:a5d:6651:0:b0:346:8111:c762 with SMTP id f17-20020a5d6651000000b003468111c762mr59967wrw.22.1712764787615; Wed, 10 Apr 2024 08:59:47 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id p13-20020a5d638d000000b00343ad4bca7dsm14039431wru.85.2024.04.10.08.59.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 08:59:47 -0700 (PDT) From: Neil Armstrong Date: Wed, 10 Apr 2024 17:59:43 +0200 Subject: [PATCH v2 1/3] gpio: qcom_pmic_gpio: add support for pm8550-gpio MIME-Version: 1.0 Message-Id: <20240410-topic-sm8x50-spmi-clients-v2-1-783e20d66c25@linaro.org> References: <20240410-topic-sm8x50-spmi-clients-v2-0-783e20d66c25@linaro.org> In-Reply-To: <20240410-topic-sm8x50-spmi-clients-v2-0-783e20d66c25@linaro.org> To: Caleb Connolly , Sumit Garg , Tom Rini Cc: u-boot@lists.denx.de, u-boot-qcom@groups.io, Neil Armstrong X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1891; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=xkMJDuFEMyhRf5H8OJG4VW0ni9nAowsKz123H//kizI=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBmFrdxyyYOw8EVWybjN7u98DK5rYewYOINkXcZT23Y GLbljjCJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZha3cQAKCRB33NvayMhJ0fDyD/ 9uKT1e1wNKCeAd7wA+uPTNMbX+DsH0rehBRGUY0RSfwPqBgkMB9vOD8FQT/Wm0zTwzixp/w40nDSAn 1QOYY4hOvg8nssuG4JTcu7yHvXBFExI5C+J/A7fmgk5/CpdQ4wubSbqR9X83dSmj/yy5QqPN+p3iPR SsR/kdJtzI9zt+Qx2vRkcDdMSwFZJbybKSKjMkLdhf9POxVxNh18Ql/J6g2vj+cay55YV5mLwZj5lX nvNb4DFKQ6iYhyBQB9S1No7iugZOJfLa5wKuZZQvSrrXF1WzHepooztd5Q+YcWn+j2gFXeZE1KTpDs +WIY952RIqnZv4Y0h+FAFBUBS11Xzp5WF88sn3vZa+Ei3XvQMp1eLMEn4x65uamIPpwUnE0apAo89z ByX1VlJoE7nGMo0+okBRmKeoNglG4R2XXeJaoIKpeAZ6sXuDvRmbkLIdUVUc55voBze7FyU0/8Spv/ gehKZzno0tu/sHtz3IUGz8ALyOI2Vsv3mXFjDEkNETr8sOJOvMOeDNW283r483u/8LKGXh5LKu/U1I ycuKE1w2qpJRXbuZOV55+7vL66prd9gZLS/kIliO7BebxDUvSUg/Hlcl1CVVsbTzbN0P3MrrrHU+tO eq5Z3DmoQIdtNxxryJCLtPOhBTNiYS+sEFgdAwQ5xqMXBImMExdjoN4CuR3A== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Add support for PM8550 GPIO controller variant, keep read-only until the GPIO and Pinctrl setup is fixed for new PMICs. Signed-off-by: Neil Armstrong --- drivers/gpio/qcom_pmic_gpio.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/qcom_pmic_gpio.c b/drivers/gpio/qcom_pmic_gpio.c index 14a8210522b..dfb70faf94b 100644 --- a/drivers/gpio/qcom_pmic_gpio.c +++ b/drivers/gpio/qcom_pmic_gpio.c @@ -35,6 +35,8 @@ #define REG_SUBTYPE_GPIOC_8CH 0xd #define REG_SUBTYPE_GPIO_LV 0x10 #define REG_SUBTYPE_GPIO_MV 0x11 +#define REG_SUBTYPE_GPIO_LV_VIN2 0x12 +#define REG_SUBTYPE_GPIO_MV_VIN3 0x13 #define REG_STATUS 0x08 #define REG_STATUS_VAL_MASK 0x1 @@ -322,9 +324,20 @@ static int qcom_gpio_probe(struct udevice *dev) return log_msg_ret("bad type", -ENXIO); val = pmic_reg_read(plat->pmic, plat->pid + REG_SUBTYPE); - if (val != REG_SUBTYPE_GPIO_4CH && val != REG_SUBTYPE_GPIOC_4CH && - val != REG_SUBTYPE_GPIO_LV && val != REG_SUBTYPE_GPIO_MV) + switch (val) { + case REG_SUBTYPE_GPIO_4CH: + case REG_SUBTYPE_GPIOC_4CH: + plat->lv_mv_type = false; + break; + case REG_SUBTYPE_GPIO_LV: + case REG_SUBTYPE_GPIO_MV: + case REG_SUBTYPE_GPIO_LV_VIN2: + case REG_SUBTYPE_GPIO_MV_VIN3: + plat->lv_mv_type = true; + break; + default: return log_msg_ret("bad subtype", -ENXIO); + } plat->lv_mv_type = val == REG_SUBTYPE_GPIO_LV || val == REG_SUBTYPE_GPIO_MV; @@ -351,6 +364,7 @@ static const struct udevice_id qcom_gpio_ids[] = { { .compatible = "qcom,pm8994-gpio" }, /* 22 GPIO's */ { .compatible = "qcom,pm8998-gpio", .data = QCOM_PMIC_QUIRK_READONLY }, { .compatible = "qcom,pms405-gpio" }, + { .compatible = "qcom,pm8550-gpio", .data = QCOM_PMIC_QUIRK_READONLY }, { } }; From patchwork Wed Apr 10 15:59:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 787507 Delivered-To: patch@linaro.org Received: by 2002:adf:fdd2:0:b0:346:15ad:a2a with SMTP id i18csp761417wrs; Wed, 10 Apr 2024 09:00:16 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU5zK5yGPziXW5idVwX7KlImydZmJg4yvb60RAZRkkSW1ZxT4WirLUJryHSGwUXo6wMF/Hu3ocxRi1kJ5zGgkA3 X-Google-Smtp-Source: AGHT+IGPU/1zsAljwkeqFPMBZL5CoCp/4pxe1RiCAQNcYumIV4Be4chpJUt98vYSFIaVIn0LdlCg X-Received: by 2002:a17:907:3d92:b0:a4e:9a13:5090 with SMTP id he18-20020a1709073d9200b00a4e9a135090mr75558ejc.9.1712764815830; Wed, 10 Apr 2024 09:00:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712764815; cv=none; d=google.com; s=arc-20160816; b=A6iC6PkV61s2jkqZlMGJIb4Q1mTybB0C1gGK2wlAP+LVR7mqu3u8tNsg92bSbZzFHS rcM4PJ8t3jKM9BodVbZIO6jJg37Mk9obtnpoJHNF9d8A3uyUFIkRjTRaYmLBO/8G3u66 +iZ1qpyFTu+bNAhoixEzggtQIDSvOVLQJLIugwHPUd9xIJzuVcbxKzadhgUfHG81M2/c Fi87QNTfK0KVHrvpTe2580+YoPqhMM0WoC8gWMWpCas3lUDnTrPmZssG5g8KD+aYN6zN 6NeirMWj0uX82Nbk5EYBeUb0Ijp97tJfttrdy0WLz9tRMWTgtR4V+4PFb3UimRU2j95R axdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:cc:to:in-reply-to:references :message-id:content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=jBSNxz5F9Gk1/5Z3CGIi5kb5sg8VWXyRTlXhpfzbQLI=; fh=w3XPBZeqJntfsjap7BOyGXw8YYuVBSjaYDJQjQgdAcA=; b=pmVlAOLJtpp4O76DIm2+85xLRxil6BYZxMYkjakTOL1nYZNNfTKuUth83t8/zB+4BM h+D7qySqda5Ka4qxzR2w5mi+hWHyBE9xMbZBsARuwR85DRcT0g1ipv31Ug/Nv+wLi+/S CEa6j0svExEesnTPYgwdvT7H3hND0IHhRK5ikgUCxCAQ2t4ht5u0xb3VHh6wR5tYPAMy /o65fkb0ZL05bGRRY+pcUyNdWaEpuuoim6zv4eV89jukLOGZH35MvDL1WsZXP3LxsMqq BgozGbpx5k9NiYQ2NJb0okccF7ksAG3WzVcoPSerZj4/pPmb6NFi35MF7lfZLWfN6il4 ymZw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="nYQ/0lJr"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id x17-20020a170906135100b00a4e28b1068bsi5828125ejb.780.2024.04.10.09.00.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 09:00:15 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="nYQ/0lJr"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9C3CA88176; Wed, 10 Apr 2024 17:59:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="nYQ/0lJr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B7351881B9; Wed, 10 Apr 2024 17:59:51 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 31BBC8815B for ; Wed, 10 Apr 2024 17:59:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=neil.armstrong@linaro.org Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-344047ac7e4so2665083f8f.0 for ; Wed, 10 Apr 2024 08:59:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712764789; x=1713369589; darn=lists.denx.de; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=jBSNxz5F9Gk1/5Z3CGIi5kb5sg8VWXyRTlXhpfzbQLI=; b=nYQ/0lJr+a5/oBUsPJVN6AIrh7j2X9Tb3HdHxBhW1Ub5q2DBCDiMzmShd1u/4BjmJq U16S4IAQd/Rut8nBgIZNqga0rUfBUkGGhfbBmoB8AFhv5ScaUZHGU4tkYoPxE+52OJZL ed85dJQT+zfWHWWYNnZkgodLArXWA/DI/FV5bE60OCdm4uj33ZRS0QFKTsKpEWFYBhIn IdxMOpkvT6GtFTqVSW2Q1VakgFDX7B17noNH9k2geDRbvqMIPdzyCAuGNPQsz5aklhnN 1c5Sk39ZsMGiRNFaUWSznWW2oDA9ozu4/bH2PJbo+g61YVICtZa83HZ2yG30aTNQjumH qcFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712764789; x=1713369589; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jBSNxz5F9Gk1/5Z3CGIi5kb5sg8VWXyRTlXhpfzbQLI=; b=L63Q7FWYJDfNS76cuwQvBWCjLwrlBCfjGpNdRKCJL4OKl96rwzmzIwXXJg1pp7wO77 KdWcAxiUbNIgkm96fEvlbxJyR8F6JBFfQWZv2pziZlsTZkxDGTEUlUZq7lZNbp8YoLkH gQpyVjnIwjkzWVBWbCR82fa5pjfFcMEySijMKWtwG4et+W+2ZhI+HOUa9ro+87nkBcGh X4NpKG17i0WJ4lqM5SG7La6Glb1wgXMB7FVLq7ePa/UNhK6ekAH8FoyDq4Lw6bpIOWL/ j9Hb8mTj+iiGiNM7Kyf+KDtsDQedlYIlPr8KasnTNdaCWslCcVmGzdGMJyzbjARF+dDb F7bA== X-Gm-Message-State: AOJu0Yxa8WNVfS2oJee1jksQLCkDzMBh1ID5m/B3Cx+ZXngaSus+4ejV h8O5Q4SePn60+V4Lvbqppca4jbeA8QqTfJPnnVYtH9/0/ohYHP9SKtZBlxYQbws= X-Received: by 2002:adf:fd4b:0:b0:343:6b42:b3bb with SMTP id h11-20020adffd4b000000b003436b42b3bbmr37580wrs.31.1712764788303; Wed, 10 Apr 2024 08:59:48 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id p13-20020a5d638d000000b00343ad4bca7dsm14039431wru.85.2024.04.10.08.59.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 08:59:48 -0700 (PDT) From: Neil Armstrong Date: Wed, 10 Apr 2024 17:59:44 +0200 Subject: [PATCH v2 2/3] button: qcom-pmic: move node name checks to btn_data struct MIME-Version: 1.0 Message-Id: <20240410-topic-sm8x50-spmi-clients-v2-2-783e20d66c25@linaro.org> References: <20240410-topic-sm8x50-spmi-clients-v2-0-783e20d66c25@linaro.org> In-Reply-To: <20240410-topic-sm8x50-spmi-clients-v2-0-783e20d66c25@linaro.org> To: Caleb Connolly , Sumit Garg , Tom Rini Cc: u-boot@lists.denx.de, u-boot-qcom@groups.io, Neil Armstrong X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=4681; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=JuJX938A0kKhn4aUDQEOACwit9CMWv30OBUpj8p+Arg=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBmFrdxaSQstkC1wcbToRFwG68nyvuoabvOXXPYKw0n S+0UKq+JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZha3cQAKCRB33NvayMhJ0ZckEA DBJ7+8cu1Yst6HGdS36ZaXu3WdIxo1mADlH3yvVZLKQt8QQDPuifRBCG0grDqRPPJYX3Nt6SqF9Yk6 30w9+L2lQi+vYsH9SDj8T4FLYeXT/EDnV/sBDM6EDptl397zqvkY5bNhAt873SCbTO3btct6GKsMMA qOnEsUcnQ97vQYj5ugOIOn2jC1XA28nciffzXrOuu5HO9XM7VTxruwI+SprgCclbYHjOfDe4NmTQ8L 81ryjUGVxoIv2ivHT6OSQpgMPDIwrALZw4Y2UNUMftM76sk+H3o5ueztpuiey4sveKYu60+acZeOw1 O6AsdelaAFqkFvbPqzHg5MilwsIXjLycIlc1hBhqG7jNl3q4e6rijwURitcDjcK6V0t89R5ChXIIrI B4/JmG/lDNw/5aOeM+3iLkebaEd2M0fTM69T4BJg8VkULjYyHJgwZumSqJSAMTHoCrGgAizdq9+vnx 21QmqXAgC3+NNdzMJBOUBRbe9JCHyNJUB9wR9OGCWDUaZCpzgroOzmQlqbAV7HRXAwmfUG8GK1A8UO gXuX0HzLzAbeRYIwnc+SOjv5APKbwmVGnG7xh49AMf4OdJ1L68tOSCh3Bn1ogfeeGTYPVfNf9w0kgR 5WC9Y+si3Jp1qJJE1K4H63LpGQd6ctnoscNA8dtulLp9WIyq2qT/Nh+HTeUg== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Move node name checks to a proper data struct with all information for the supported subnodes. Replace the key offset defines with the Linux driver ones. Signed-off-by: Neil Armstrong --- drivers/button/button-qcom-pmic.c | 84 ++++++++++++++++++++++++++------------- 1 file changed, 56 insertions(+), 28 deletions(-) diff --git a/drivers/button/button-qcom-pmic.c b/drivers/button/button-qcom-pmic.c index bad445efa86..f6da958097c 100644 --- a/drivers/button/button-qcom-pmic.c +++ b/drivers/button/button-qcom-pmic.c @@ -19,6 +19,13 @@ #define REG_TYPE 0x4 #define REG_SUBTYPE 0x5 +struct qcom_pmic_btn_data { + char *compatible; + unsigned int status_bit; + int code; + char *label; +}; + struct qcom_pmic_btn_priv { u32 base; u32 status_bit; @@ -27,11 +34,8 @@ struct qcom_pmic_btn_priv { }; #define PON_INT_RT_STS 0x10 -#define KPDPWR_ON_INT_BIT 0 -#define RESIN_ON_INT_BIT 1 - -#define NODE_IS_PWRKEY(node) (!strncmp(ofnode_get_name(node), "pwrkey", strlen("pwrkey"))) -#define NODE_IS_RESIN(node) (!strncmp(ofnode_get_name(node), "resin", strlen("resin"))) +#define PON_KPDPWR_N_SET 0 +#define PON_RESIN_N_SET 1 static enum button_state_t qcom_pwrkey_get_state(struct udevice *dev) { @@ -52,10 +56,39 @@ static int qcom_pwrkey_get_code(struct udevice *dev) return priv->code; } +static const struct qcom_pmic_btn_data qcom_pmic_btn_data_table[] = { + { + .compatible = "qcom,pm8941-pwrkey", + .status_bit = PON_KPDPWR_N_SET, + .code = KEY_ENTER, + .label = "pwrkey", + }, + { + .compatible = "qcom,pm8941-resin", + .status_bit = PON_RESIN_N_SET, + .code = KEY_DOWN, + .label = "vol_down", + }, +}; + +static const struct qcom_pmic_btn_data *button_qcom_pmic_match(ofnode node) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(qcom_pmic_btn_data_table); ++i) { + if (ofnode_device_is_compatible(node, + qcom_pmic_btn_data_table[i].compatible)) + return &qcom_pmic_btn_data_table[i]; + } + + return NULL; +} + static int qcom_pwrkey_probe(struct udevice *dev) { struct button_uc_plat *uc_plat = dev_get_uclass_plat(dev); struct qcom_pmic_btn_priv *priv = dev_get_priv(dev); + const struct qcom_pmic_btn_data *btn_data; ofnode node = dev_ofnode(dev); int ret; u64 base; @@ -64,6 +97,14 @@ static int qcom_pwrkey_probe(struct udevice *dev) if (!uc_plat->label) return 0; + /* Get the data for the node compatible */ + btn_data = button_qcom_pmic_match(node); + if (!btn_data) + return -EINVAL; + + priv->status_bit = btn_data->status_bit; + priv->code = btn_data->code; + /* the pwrkey and resin nodes are children of the "pon" node, get the * PMIC device to use in pmic_reg_* calls. */ @@ -87,23 +128,10 @@ static int qcom_pwrkey_probe(struct udevice *dev) ret = pmic_reg_read(priv->pmic, priv->base + REG_SUBTYPE); if (ret < 0 || (ret & 0x7) == 0) { - printf("%s: unexpected PMCI function subtype %d\n", dev->name, ret); + printf("%s: unexpected PMIC function subtype %d\n", dev->name, ret); return -ENXIO; } - if (NODE_IS_PWRKEY(node)) { - priv->status_bit = 0; - priv->code = KEY_ENTER; - } else if (NODE_IS_RESIN(node)) { - priv->status_bit = 1; - priv->code = KEY_DOWN; - } else { - /* Should not get here! */ - printf("Invalid pon node '%s' should be 'pwrkey' or 'resin'\n", - ofnode_get_name(node)); - return -EINVAL; - } - return 0; } @@ -114,12 +142,20 @@ static int button_qcom_pmic_bind(struct udevice *parent) int ret; dev_for_each_subnode(node, parent) { + const struct qcom_pmic_btn_data *btn_data; struct button_uc_plat *uc_plat; const char *label; if (!ofnode_is_enabled(node)) continue; + /* Get the data for the node compatible */ + btn_data = button_qcom_pmic_match(node); + if (!btn_data) { + debug("Unknown button node '%s'\n", ofnode_get_name(node)); + continue; + } + ret = device_bind_driver_to_node(parent, "qcom_pwrkey", ofnode_get_name(node), node, &dev); @@ -128,15 +164,7 @@ static int button_qcom_pmic_bind(struct udevice *parent) return ret; } uc_plat = dev_get_uclass_plat(dev); - if (NODE_IS_PWRKEY(node)) { - uc_plat->label = "pwrkey"; - } else if (NODE_IS_RESIN(node)) { - uc_plat->label = "vol_down"; - } else { - debug("Unknown button node '%s' should be 'pwrkey' or 'resin'\n", - ofnode_get_name(node)); - device_unbind(dev); - } + uc_plat->label = btn_data->label; } return 0; From patchwork Wed Apr 10 15:59:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 787508 Delivered-To: patch@linaro.org Received: by 2002:adf:fdd2:0:b0:346:15ad:a2a with SMTP id i18csp761540wrs; Wed, 10 Apr 2024 09:00:27 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV3PIZkkWLyf4YDbqDk2GSIjrwh7UA1FrIHJuDw/EACnC1hz7BBDX177NcVWg4aC6pzyrbLkCBqPEnV/LfOkz1V X-Google-Smtp-Source: AGHT+IFpCXOZ/4GEhf5TIpXLgGqrO9ULGH+UK1anLhsqsKfqoskuibpyrNxHh4l7gNC/Ggy+Z0VP X-Received: by 2002:a17:907:6d1f:b0:a52:1820:103b with SMTP id sa31-20020a1709076d1f00b00a521820103bmr523195ejc.2.1712764827158; Wed, 10 Apr 2024 09:00:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712764827; cv=none; d=google.com; s=arc-20160816; b=KotfftqABCS8iYYqrssnkdpqEUOoijyTAsQ5sz0eAItKlluH2+TOlT1ZoQEurKFAcs KmNQDyrGb4J/R5HWReuzMbeywwG4XPEICnFZrCbz0N390JCVRxv+dwAMizoBLy7KHVBJ mm/C+85PeG4OcN3DnoqUlqobVn5zbSO3PkMcELr7sznnf0jqA17oQ8G0mI7TOw9X8ux7 rjM/t1LK5gC2D6LinoDHZRYJW3hL2WHvQ81DTg9I5svcWoHniHp6h3wzEGsXWY/EhrAS l6TUb/GnALaMbsBAiSURAk5VBPpoqZsAX/pnJ+AtaY+QUage8ARckNNOB5fAvj0uBdqL 4XkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:cc:to:in-reply-to:references :message-id:content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=3FZxgBrC8KxfYtQvW62bs/elUi8gPOkzQrUnPtR7gPk=; fh=w3XPBZeqJntfsjap7BOyGXw8YYuVBSjaYDJQjQgdAcA=; b=nPKDwTWNReHXpeuL2HfN4mG+as5FJONNUh3LpWv0h9o3/F50Nue9X3x31O0n1xozAN DfgeMZ/hiCjpEWuzmG7CMlVfPLOlJ/97uqVIf4FGcdGFuExvm4XAamlQsmrgVFu8V7A6 N04Cm50V2Bh2R1QmEeTXodusN9DG0lvrF0ec6SlirbZMengb7SkjUc+ua2FBD4yPCLzi h2B3rA05ZdO+7hlR0pdrGuy0HxihIc3SV3YExGQ8OfVTe0TAVIdReUmxxLv8IHuSiBbU d6Xy3e9E3eJSW2upF27DIih+8MVHCwDDsQqtqfuViSy4RaTYsx1OvbZiPA1jNH5Cx3p7 PDag==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L21kE0R3; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id hd16-20020a170907969000b00a4e3dc7d36esi6382917ejc.77.2024.04.10.09.00.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 09:00:27 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L21kE0R3; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 10F61881C1; Wed, 10 Apr 2024 17:59:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="L21kE0R3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D0CD68815B; Wed, 10 Apr 2024 17:59:51 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E043481EEF for ; Wed, 10 Apr 2024 17:59:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=neil.armstrong@linaro.org Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-343e7c20686so3884561f8f.1 for ; Wed, 10 Apr 2024 08:59:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712764789; x=1713369589; darn=lists.denx.de; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=3FZxgBrC8KxfYtQvW62bs/elUi8gPOkzQrUnPtR7gPk=; b=L21kE0R3+/c/iL4PCZQa471Q2AzEtb2lm3Pz4uPEMcnG9GzaC7JPH7htKIvH9NFDTI Cp2U/Y7TR1uXAgD4jyp5Z+3JHJsO/VcttVejIpoG8kjvKFVvds5vd7of8D6FsXYTCgIM oXS/tUITxAYzKSR+Dd8jqfPmthmCnGVwRd9tAjTU9lMUa157Tf3BD6HMC3lty+MdOiU0 s6ntauI/fEcfG+kItMorlAA6I/K/4WTnd/IjfF99qokvj7YVAwTJD5c84XY1ndEAEtgJ PjS3rEFDf5VcM4k/LHYPVXG2y77J5WLqT+AqR0yr77u3vB+WXP17UkNZkXqy2HjIHYzv sNnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712764789; x=1713369589; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3FZxgBrC8KxfYtQvW62bs/elUi8gPOkzQrUnPtR7gPk=; b=wQsQz02jUGlU1ZQ+nZWekm945HypYUs+ONsjvSq7OqbEoQRo4p83Jx2PTAAfqozGGP NVn1a5mfIEdM6HrR0HPdFZDnApOQn5ryceY/hvlNM0QwZn34bWQ+cnefnn6+S3eapG3a Ms5Z2Z03SXVxZw4yjkrymi9a+DcCFA0nAFlf+QcSrJ8iA9Z3zKTukng65S3BxwUXbNkL uOXHa+qrNvWOUxP0WoZeUDT4oER5TiWMblCMDkMN024IFSbgq2zQVXerUrjuTCbP26Iq 9MB58saSz5bj+xhV+hQx6oIOPlcc78uli9KMzeQ2HKRrZgqA6l08+XVhD6Ng7wpxeAQL Nu7w== X-Gm-Message-State: AOJu0YzTfDgyyFBmcWfZVss80ci3FVn9MQSMFC1w1YBbkymJHtyH08rc 3Y22Edfo/CLsW5QWygHKip4IzxR1lkdv7VBB24T5e0G/U9o/+PdDr+8gQvjUYNxDHdOkjMcm4hR TpLk= X-Received: by 2002:adf:e98a:0:b0:343:af1f:491f with SMTP id h10-20020adfe98a000000b00343af1f491fmr2258665wrm.14.1712764789039; Wed, 10 Apr 2024 08:59:49 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id p13-20020a5d638d000000b00343ad4bca7dsm14039431wru.85.2024.04.10.08.59.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 08:59:48 -0700 (PDT) From: Neil Armstrong Date: Wed, 10 Apr 2024 17:59:45 +0200 Subject: [PATCH v2 3/3] button: qcom-pmic: add support for pmk8350 button configs MIME-Version: 1.0 Message-Id: <20240410-topic-sm8x50-spmi-clients-v2-3-783e20d66c25@linaro.org> References: <20240410-topic-sm8x50-spmi-clients-v2-0-783e20d66c25@linaro.org> In-Reply-To: <20240410-topic-sm8x50-spmi-clients-v2-0-783e20d66c25@linaro.org> To: Caleb Connolly , Sumit Garg , Tom Rini Cc: u-boot@lists.denx.de, u-boot-qcom@groups.io, Neil Armstrong X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1572; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=deSMcSYkix4cJpASgfIcHwoL3jgHF+QbOb+NbvbmeAY=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBmFrdx88MDbDc8D/dj5xRXNcc8lb/aZioCuPGwgq9O FS+Gk3iJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZha3cQAKCRB33NvayMhJ0ewmD/ 41FQ/F15gW26ElSbcgSNuGtraylI6LZJoBtnEHAW1KZ6w1w8WUqqawF559pX43THB6J78Jhnh3qtj6 jtMRFobDqJJvL6rvSGOzZnTBzV2tX1/RhL06HgR6CCb0gk2KaQj763v3LKfdk+AaxD67pDhmWIQzWX Ryo+9nBxfc913p5d6/67B0d5H+rFQAzQauULehewBbkwCvMR1mIbbsk0JkPmd4pmqlKRmXMxkw3Lxr 08UlmDaedv+njv00mctJ4FUeoMRmgrcqwz2oKmgJRbbwDUQxJr5v6VKaXUNAkAI1jIe/V/nnQtVQzs ai7eCJj+86rzJ62o8AUswcDTWsWDoK4qUAVc09LyzOdPtd6KDNKsIfdAgnW4z8OVa82wop4fTQou0p 7pwIiN2Pf8cKlK2cyKNWgtEATBZfrhb8s3T9AHFjfYhhxXm322amyN8T4FZ6ny/bJmdXwyv22nXZOf yhn9sOhGT2eSlXeH6rIJINZPoEmldaemna+pwPKuAxbFQqbzikmw0Js2MPwWWetpMmHWQq+rLaUZCA u26+JK296uHSnG1YyjO4Ees1I8VEueamq+03W0qLZjGExjTYxrTwKtUA2+4adcNeKh92ELV+0yHraL ejeomCieI7zaDdjN0PTW6E5aynYwROXmiRBlgSuCR83jmM8vGVqMTNGoXJmw== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Finally add the entries for the qcom,pmk8350-pwrkey and qcom,pmk8350-resin found on PMICs used with SM8350 and later SoCs. Signed-off-by: Neil Armstrong --- drivers/button/button-qcom-pmic.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/button/button-qcom-pmic.c b/drivers/button/button-qcom-pmic.c index f6da958097c..ad7fed3ddaa 100644 --- a/drivers/button/button-qcom-pmic.c +++ b/drivers/button/button-qcom-pmic.c @@ -36,6 +36,8 @@ struct qcom_pmic_btn_priv { #define PON_INT_RT_STS 0x10 #define PON_KPDPWR_N_SET 0 #define PON_RESIN_N_SET 1 +#define PON_GEN3_RESIN_N_SET 6 +#define PON_GEN3_KPDPWR_N_SET 7 static enum button_state_t qcom_pwrkey_get_state(struct udevice *dev) { @@ -69,6 +71,18 @@ static const struct qcom_pmic_btn_data qcom_pmic_btn_data_table[] = { .code = KEY_DOWN, .label = "vol_down", }, + { + .compatible = "qcom,pmk8350-pwrkey", + .status_bit = PON_GEN3_KPDPWR_N_SET, + .code = KEY_ENTER, + .label = "pwrkey", + }, + { + .compatible = "qcom,pmk8350-resin", + .status_bit = PON_GEN3_RESIN_N_SET, + .code = KEY_DOWN, + .label = "vol_down", + }, }; static const struct qcom_pmic_btn_data *button_qcom_pmic_match(ofnode node) @@ -179,6 +193,7 @@ static const struct udevice_id qcom_pwrkey_ids[] = { { .compatible = "qcom,pm8916-pon" }, { .compatible = "qcom,pm8941-pon" }, { .compatible = "qcom,pm8998-pon" }, + { .compatible = "qcom,pmk8350-pon" }, { } };