From nobody Mon Jun 15 07:24:46 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4E73C433EF for ; Tue, 3 May 2022 01:08:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229647AbiECBLs (ORCPT ); Mon, 2 May 2022 21:11:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbiECBLq (ORCPT ); Mon, 2 May 2022 21:11:46 -0400 Received: from mail-il1-f181.google.com (mail-il1-f181.google.com [209.85.166.181]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FF3D5F4A for ; Mon, 2 May 2022 18:08:07 -0700 (PDT) Received: by mail-il1-f181.google.com with SMTP id l15so3561066ilh.3 for ; Mon, 02 May 2022 18:08:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wYFtzIrfueBMYkfnReff/T+IPaO8wkd6Eu3COpG1jyw=; b=ID3tXj1Uzg9g8JCj0ITrp9Wpw+TuEF/qu/STWO0fQaoemE/EQYBL/dFn0sJ2fonLXL A/rvUHwOoFGebEOKpPiP5frTx2F65JPrfGjRrl/tqgg9aqsv0us8Hp3FlU/ZNIdJgCn8 ud7TkuEK3uOTyQFg070R4spw/3mMZd/jVI0AQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wYFtzIrfueBMYkfnReff/T+IPaO8wkd6Eu3COpG1jyw=; b=pqfMQMNWJkjpUPs5ghskRq0pZiCTtv+r4lkmrl+gPlvAGxAkLK6d/11hx11A/UOv94 LhcYdEO0pCxNYGDmC7X54aQ7xS5SiruPL2pUG3+pdambX37Aq++zqiMhauqF3JLQbBCx D7BZrcNCfJe319ZD8POALDGkh1TD9urEijkhWN6EUj6I0bMuJRKohnW8U3rjoeUc9Hdo Y6tZtCaQy7tCtMa53zP0Z9wCJfnK0zNat76TCET6QfMoeZGZjWYcdnX5DiF9NYEtIXkx PyahfhaWXtTIdGGuNwp7StqpCJq4AIAnpqo9KxKhtIe3IEu2BG2/vQHKqpIGJBjweMBM xC7w== X-Gm-Message-State: AOAM531zat8Uir3O4uVKvEIgMoamL1C8DlxC8egW4JUjbcD84dwf94rS n4e3gjOffn+xK6vaef91XybnG2BrNGrFtw== X-Google-Smtp-Source: ABdhPJzKVlYRARLnwIRKFb/PA/der9oV6KC/mTyJjBcp3p2GzSbu2BXrgotfzjLD+hU4yZnnbAMsJg== X-Received: by 2002:a63:2c4a:0:b0:3c1:df82:cf0e with SMTP id s71-20020a632c4a000000b003c1df82cf0emr9971548pgs.474.1651538519296; Mon, 02 May 2022 17:41:59 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:201:15e:c760:9a04:7fbe]) by smtp.gmail.com with ESMTPSA id i10-20020aa78b4a000000b0050dc7628177sm5258794pfd.81.2022.05.02.17.41.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 17:41:58 -0700 (PDT) From: Stephen Boyd To: Jonathan Cameron Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, Gwendal Grignou , Rob Herring , Krzysztof Kozlowski Subject: [PATCH 1/2] dt-bindings: iio: sx9324: Add CS idle/sleep mode Date: Mon, 2 May 2022 17:41:55 -0700 Message-Id: <20220503004156.3559940-2-swboyd@chromium.org> X-Mailer: git-send-email 2.36.0.464.gb9c8b46e94-goog In-Reply-To: <20220503004156.3559940-1-swboyd@chromium.org> References: <20220503004156.3559940-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" We need to configure the sleep and idle mode of the CS pins for this device. Add a DT property to do this so pins are in a proper state during sleep (either hi-z, grounded, or pulled up to vdd). Cc: Gwendal Grignou Signed-off-by: Stephen Boyd Reviewed-by: Gwendal Grignou --- .../devicetree/bindings/iio/proximity/semtech,sx9324.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/iio/proximity/semtech,sx9324= .yaml b/Documentation/devicetree/bindings/iio/proximity/semtech,sx9324.yaml index d265eb5258c8..6cec3481c8b2 100644 --- a/Documentation/devicetree/bindings/iio/proximity/semtech,sx9324.yaml +++ b/Documentation/devicetree/bindings/iio/proximity/semtech,sx9324.yaml @@ -126,6 +126,14 @@ properties: UINT_MAX (4294967295) represents infinite. Other values represent 1-1/N. =20 + semtech,cs-idle-sleep: + description: + State of CS pins during sleep mode and idle time. + enum: + - hz + - gnd + - vdd + semtech,int-comp-resistor: description: Internal resistor setting for compensation. --=20 https://chromeos.dev From nobody Mon Jun 15 07:24:46 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47408C433EF for ; Tue, 3 May 2022 01:26:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229764AbiECB3q (ORCPT ); Mon, 2 May 2022 21:29:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229560AbiECB3o (ORCPT ); Mon, 2 May 2022 21:29:44 -0400 Received: from mail-oa1-x2b.google.com (mail-oa1-x2b.google.com [IPv6:2001:4860:4864:20::2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10E27E015 for ; Mon, 2 May 2022 18:26:14 -0700 (PDT) Received: by mail-oa1-x2b.google.com with SMTP id 586e51a60fabf-d39f741ba0so15934345fac.13 for ; Mon, 02 May 2022 18:26:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nv/pSU+ZnWDELhz2wWC2INCxu/xtfe1TYKUv0ZzQucw=; b=SkVXXA94ffty5Mj2aWgSITnefdw4+ZrE8qSiePjbp7oHo9p4AVtJpl/Gk/HSyBfLe3 3U6/cE8XNuzDetJ7BhMOVn7t4JgeZQOaEREfYgRLl8L2X8QuSwLDpCSqVLiv+fEWpIoq CrbYGst4DY2aRwIJIPspUfF6mvcmaba+HBuqQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nv/pSU+ZnWDELhz2wWC2INCxu/xtfe1TYKUv0ZzQucw=; b=oJueZNVtvP6SfPKDCQvtl1AIa39aLgrgenhXzPcpcEhTFJ1ikgyfwNX2yKrdg1v2tv LMEZN8YfXOxE0ZsTSwWoJQa4voY+MaNzvYghB0gSG4qfzu51Opt4a0fbRguls/8qr8iu 13danYPR/Cj9fSz3wTITOv6gpwR2H8S+lgjAPFExKRxwQQhl4Wok8KvTBpYv3u72bXmj 73xbOTfjcy51fUH8r6RLqFo6g8PrHEjBhSXLGNpIDW5eEHdzCy8EtIuc4L7V3jQ9Dy8V nVMSrf8eNhfBNt3FvKZTNhWa41bWEfQ6d6knfIYgxvaHhjYQshmVIvjGuUA9WRYk0Rak mIqQ== X-Gm-Message-State: AOAM5311l1mqN8AruImg96+WS8e8zABnhYtwGSWThtwHBYPFRZ92HZyY S8KY5uCfj4aySkvBeidqSOYXzAMsUEi3TQ== X-Google-Smtp-Source: ABdhPJz/hTWbt/I+UklgPRM/+6nN30JLRNTr2NxDCJCIBWJO3cx3gUrIinxBCPZLQnJkMWkFxuaaFQ== X-Received: by 2002:a17:90a:ab81:b0:1ca:8a76:cdda with SMTP id n1-20020a17090aab8100b001ca8a76cddamr2016709pjq.26.1651538520161; Mon, 02 May 2022 17:42:00 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:201:15e:c760:9a04:7fbe]) by smtp.gmail.com with ESMTPSA id i10-20020aa78b4a000000b0050dc7628177sm5258794pfd.81.2022.05.02.17.41.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 17:41:59 -0700 (PDT) From: Stephen Boyd To: Jonathan Cameron Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, Gwendal Grignou , Rob Herring , Krzysztof Kozlowski Subject: [PATCH 2/2] iio: sx9324: Add setting for CS idle mode Date: Mon, 2 May 2022 17:41:56 -0700 Message-Id: <20220503004156.3559940-3-swboyd@chromium.org> X-Mailer: git-send-email 2.36.0.464.gb9c8b46e94-goog In-Reply-To: <20220503004156.3559940-1-swboyd@chromium.org> References: <20220503004156.3559940-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Based on device tree setting, set the CS idle mode. Cc: Gwendal Grignou Signed-off-by: Stephen Boyd Reviewed-by: Gwendal Grignou --- drivers/iio/proximity/sx9324.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/iio/proximity/sx9324.c b/drivers/iio/proximity/sx9324.c index 7f367f63e362..79683f0d4e9a 100644 --- a/drivers/iio/proximity/sx9324.c +++ b/drivers/iio/proximity/sx9324.c @@ -57,6 +57,11 @@ GENMASK(SX9324_REG_AFE_CTRL0_RINT_SHIFT + 1, \ SX9324_REG_AFE_CTRL0_RINT_SHIFT) #define SX9324_REG_AFE_CTRL0_RINT_LOWEST 0x00 +#define SX9324_REG_AFE_CTRL0_CSIDLE_SHIFT 4 +#define SX9324_REG_AFE_CTRL0_CSIDLE_MASK \ + GENMASK(SX9324_REG_AFE_CTRL0_CSIDLE_SHIFT + 1, \ + SX9324_REG_AFE_CTRL0_CSIDLE_SHIFT) +#define SX9324_REG_AFE_CTRL0_RINT_LOWEST 0x00 #define SX9324_REG_AFE_CTRL1 0x21 #define SX9324_REG_AFE_CTRL2 0x22 #define SX9324_REG_AFE_CTRL3 0x23 @@ -872,6 +877,8 @@ sx9324_get_default_reg(struct device *dev, int idx, { static const char * const sx9324_rints[] =3D { "lowest", "low", "high", "highest" }; + static const char * const sx9324_csidle[] =3D { "hz", "hz", "gnd", + "vdd" }; #define SX9324_PIN_DEF "semtech,ph0-pin" #define SX9324_RESOLUTION_DEF "semtech,ph01-resolution" #define SX9324_PROXRAW_DEF "semtech,ph01-proxraw-strength" @@ -901,6 +908,15 @@ sx9324_get_default_reg(struct device *dev, int idx, reg_def->def =3D raw; break; case SX9324_REG_AFE_CTRL0: + ret =3D device_property_read_string(dev, + "semtech,cs-idle-sleep", &res); + if (!ret) + ret =3D match_string(sx9324_csidle, ARRAY_SIZE(sx9324_csidle), res); + if (ret >=3D 0) { + reg_def->def &=3D ~SX9324_REG_AFE_CTRL0_CSIDLE_MASK; + reg_def->def |=3D ret << SX9324_REG_AFE_CTRL0_CSIDLE_SHIFT; + } + ret =3D device_property_read_string(dev, "semtech,int-comp-resistor", &res); if (ret) --=20 https://chromeos.dev