Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp88964iob; Thu, 12 May 2022 19:23:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8myo5mtKyAnOG4nWwVOJUcnpdcLNYUkkNOB+0jAKU9AVOGnFQjoYyUQG3dU2wjY6GmezH X-Received: by 2002:a17:906:7311:b0:6f4:da1c:2866 with SMTP id di17-20020a170906731100b006f4da1c2866mr2406231ejc.195.1652408598503; Thu, 12 May 2022 19:23:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652408598; cv=none; d=google.com; s=arc-20160816; b=Ex+BbzxcliD5qs2hOY7UQopB6ffLyJtxDo1OVNVUUqEvFKMl/F4kpwJrpRQ6lR6hzB HUS5FJSZJXPmcVXxczQ82OuwVix8kH9VsVcBair6uIb9oIYNA1fF6U8CpIS5ffykguOs iu3bH/MOTdZuGRPP+wf4h8jt5SBAYMCt25naM4BGssVW7gFd2VUO1FqApNd/0BQfpyKp 33V5FVnFK2IrOLkWbvNeaseRESB33Zw+dBbUSyROP/hncdWpYMlVZXRaG+X9URJyw5Yu mZt88+RykkD3U8xsmuzI8P6GA7hDbn/vz2IKYCf41M3Gq9QGiuVBi8/YJUJAI3vLgg6I 9OJQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rHLHpItlazo+UaJMdlnAGs/zpbzJsdOOF257QRYRuhY=; b=J+cS+G4MkNCHCpkGcN8+xP7RG7QkiPjlwUtzKaButlb2n0Q9zypKD5kPlANnOPKrY8 PLVQWyX5oIhUjcuDpbN0Hpk3zgA6ziWGlk/FK3uBceMLA2wMn5n1/LEzKTAvIuyy3t1K ArWNVmqUik/k/9U+Xv+Lge8t9LdB67Vt9Ebgcbk7+sqAPmw9o0sygzUMu+71QP0qaS21 NeENBFoKWoDTzVLz829k4e+qSDqcPTRYiPXrTamKz1ZRs3cSsHL3UEM2rWHE/zBusD5L JDj8X71luPCmyU/aHpV34WMEvc1uuFvoEMZxKAwznB4/AyYK9dTxzHpED4bE7I6SXSXP aUSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mPqiMrXe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o3-20020a170906974300b006df7eafe421si1028244ejy.127.2022.05.12.19.22.52; Thu, 12 May 2022 19:23:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mPqiMrXe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244223AbiELLIX (ORCPT + 99 others); Thu, 12 May 2022 07:08:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352949AbiELLIQ (ORCPT ); Thu, 12 May 2022 07:08:16 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91A125A149; Thu, 12 May 2022 04:08:14 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id j4so8385883lfh.8; Thu, 12 May 2022 04:08:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rHLHpItlazo+UaJMdlnAGs/zpbzJsdOOF257QRYRuhY=; b=mPqiMrXeK4HnnnYLILMVdVz6G+KLueUOtuBBRc8khXWG+VWTgokg2wmRpxEonf7fXj RaAO5LkIr3zSkwWZm/1NRClO29iKUaBiuPX8VqQ/nKB1rdDo3UZyBT/KUVL8OJ6SqeAO ctR3fT9GnBPiISnLEjEklkrOMXPGX0NgfgGC/15I18HyE0Tz6cVeeeCNRZOu+h9sqzTu 8Nhh6Fxt8WkugIdGBr8x9EtlC6jfjRLvA9ZDYED+jMHVDnRmG3onW98keh4xWx4VAsva YtlonFN5CfNNg0rnjzkZ4NWZ2wT/SBtaMLmBuGxABitF1imb1IzgTEfSV5iXh+y8/v5w FTzg== 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=rHLHpItlazo+UaJMdlnAGs/zpbzJsdOOF257QRYRuhY=; b=kWf3Dn+C6+sFXx6PmzPdclABJ01TEupCWmVzB+qc2SaGL0bf4iYvS9+VfLPfjbHRUS N5vrQ9Kl7YJwyxD72/xMhDSwX3oclw3ETcPH8P51q2ukAErWm4F9Myj76VaJN/DZJvxZ XTSYxgGLiOvb3z+x9LQSePfY5XYJ6WUyv60L3UeroCub9jnxrltO4bu+9/ytBJsywMbH zLLMJJ+oHW2kMSyueaYV97+3fCF5uFe1lVnpzWrNkg5f68L05pRQaiabNI+2qh1BEpPM r0x//pRNEy3BmG5nVG2TTIfnipyGgqJaZWJ+u8hQUyFoBcZIDNRmxHFD5QU+buRncPhF TGFQ== X-Gm-Message-State: AOAM531gD9s7gj53GzfXNUqEhYHXLO4xrG8/IEHtnKbXmv5NthaoTIcy KwWGuVAg4P8vz052BPWRSOtZaWZu2BkOEw== X-Received: by 2002:a05:6512:33a7:b0:473:ea35:e1d6 with SMTP id i7-20020a05651233a700b00473ea35e1d6mr24496586lfg.369.1652353692831; Thu, 12 May 2022 04:08:12 -0700 (PDT) Received: from nergzd-desktop.localdomain ([194.39.226.133]) by smtp.gmail.com with ESMTPSA id i25-20020a056512007900b004725b99d2fdsm734883lfo.164.2022.05.12.04.08.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 04:08:12 -0700 (PDT) From: Markuss Broks To: linux-kernel@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Markuss Broks , Konrad Dybcio , Marijn Suijten , AngeloGioacchino Del Regno , Song Qiang , Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Andy Gross , Bjorn Andersson , Liam Girdwood , Mark Brown , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH v3 2/5] proximity: vl53l0x: Prefer pre-initialized interrupt flags Date: Thu, 12 May 2022 14:07:54 +0300 Message-Id: <20220512110757.5297-3-markuss.broks@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220512110757.5297-1-markuss.broks@gmail.com> References: <20220512110757.5297-1-markuss.broks@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On some boards interrupt type might be different than falling edge, like hardcoded in driver. Leave interrupt flags as they were pre-configured from the device-tree. If they're not provided, default to falling edge interrupts. Signed-off-by: Markuss Broks --- drivers/iio/proximity/vl53l0x-i2c.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/iio/proximity/vl53l0x-i2c.c b/drivers/iio/proximity/vl53l0x-i2c.c index 661a79ea200d..12a3e2eff464 100644 --- a/drivers/iio/proximity/vl53l0x-i2c.c +++ b/drivers/iio/proximity/vl53l0x-i2c.c @@ -16,6 +16,7 @@ #include #include +#include #include #include @@ -57,11 +58,15 @@ static irqreturn_t vl53l0x_handle_irq(int irq, void *priv) static int vl53l0x_configure_irq(struct i2c_client *client, struct iio_dev *indio_dev) { + int irq_flags = irq_get_trigger_type(client->irq); struct vl53l0x_data *data = iio_priv(indio_dev); int ret; + if (!irq_flags) + irq_flags = IRQF_TRIGGER_FALLING; + ret = devm_request_irq(&client->dev, client->irq, vl53l0x_handle_irq, - IRQF_TRIGGER_FALLING, indio_dev->name, indio_dev); + irq_flags, indio_dev->name, indio_dev); if (ret) { dev_err(&client->dev, "devm_request_irq error: %d\n", ret); return ret; -- 2.36.1