Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3685960lfo; Mon, 23 May 2022 11:24:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6LnZtE9C04na5iuNCOJfgtnypxJrwNVOssMkndt7ITv0uAbtgDZtqhHQOyDMmUb7VwK12 X-Received: by 2002:a17:90b:3a8b:b0:1e0:548:1490 with SMTP id om11-20020a17090b3a8b00b001e005481490mr319362pjb.144.1653330258969; Mon, 23 May 2022 11:24:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653330258; cv=none; d=google.com; s=arc-20160816; b=M8SInfAYV2Z6kGVPMDFQq0vY0cWhtW5Zn09NQPrv7dpA5viFGewVZXHgBEAKfZdgW8 N0SpkdcCKuhCNnoPUB4Y2WLzY828IdnRZASQscsG1jHBa+7cdCINWaBtHhNyckQETjfO VB4nd770EsIeywEpGubN7cvZboTtAUw8jnge56ot3kYsw/gOHbrOEGHCfPRdz3nqGUyz IcMbfidXMKWBEI4fiX2a8sqSt1nMTCQ+I7hHgpNWSKB3zzcx2zfpKZPuW2Z2kNG0JISD G+anCpA6479S4dPe0iapXnQ8RRzAg+fJ/qlKUPu2T7d98o8pn5I521YwRYY5CvxRUS50 uaBw== 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=MD9dB0Nyl4jTQwL5w2wHGmlrVavwFofaqAonwgsDVRy7z5RefTJ5WNJX8tmHsYdfV7 VvoffoVjD8xbRTRLjk9mCzbr5pSDIx2OVkKvDiiNtAkB+vZjheMJ0/Upwh7kjeqi++EY FnUWFug3UapMTaiLLnc/1cwj9gbBB/TlnSYwn7PjGxZvqMSMTHB+a7AmppV5Vh9PNrZb W7idLHV78BoCmCnurHP7/TvC0LqiJKGFlhg/6KPuF/5EPjgYNP3zc4dI7DyK4ATOVqzz N4LZjhiDAV59Y9Ax0BpEwF7CUnQe7yN5qoC/kWl1+mnKU28yob+1n+olUSzUQ0R0HDzH j5HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ID1ZtevM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id w2-20020a170902d70200b00158aac8cd3asi9301848ply.351.2022.05.23.11.24.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 11:24:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ID1ZtevM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A0AA619FB30; Mon, 23 May 2022 11:23:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242475AbiEWSSw (ORCPT + 99 others); Mon, 23 May 2022 14:18:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245626AbiEWSSU (ORCPT ); Mon, 23 May 2022 14:18:20 -0400 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDCFE583A3; Mon, 23 May 2022 10:56:59 -0700 (PDT) Received: by mail-lj1-x232.google.com with SMTP id v9so8851076lja.12; Mon, 23 May 2022 10:56:59 -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=ID1ZtevMyDy5Qbuki5QKrfxdd/wuL0XRHhsoSqPjnc87EuQ5o1lyEh+3xbxqq5Pk67 BurmVIrgtSBm+BjR7HYJv9AbSEncu8y0u49Z88Az0CpO6ypYQtN0+p+n2BQsn65jRjAE L5ukMgXs0Erg4gdHkYh8nTxnK4bLfU+nZ3x4erpy26qMiu9XDNu9RiRELSfvGZWzdgWr gs01zwXqGoXcO/tbIOvb9vXklmG9KRsgTPfWttbq8L3/oSqAxpb3pwGY5Kmaifrf17JU lnIJHbD2HNvb15wcfWNi17gjQl7JRLXy7zvdh/Tzk+qVgUWi2H0v3PG2w6Gmu4PPmFs3 UN4g== 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=U8omCxwgqg9gbeSSr+UkWhA17vVPtbr6kzTpYvyVQU525TePW2nhPh3qtBXl1+hkZZ vkwepMD521rdkOZSdtwuuwadfHQzuPDtL3ta5kpUiCRODe0e7RxwFzE5qhEFv2tfwpEG gDizwmbztoyo3AlZrZpOxeb3eMzGEUS8fuDvLg5Xrs3V+mvdebVq3JUv6zPYVJFhOxhB rNmCEK6GKWkopSAITvprZes8zkPGL9DI7gfCy8PDZh8ffBBRm9IkMD4AmQuzvvrN7mB1 EmiSKVJX8yZwIMZaJwF6VlZbBwMOo20c+aun6yP1dtLDWWnoH5ruHW58cfNICgE7fkc2 oZnw== X-Gm-Message-State: AOAM530KZB+AhszWKevlNQ24lv9wdvNJNTuhKsPVgd7O51uyl5W2Qqqa VQDZt/sQy1tyPuQkFgCIg7T/kqRhGoluIA== X-Received: by 2002:a05:651c:509:b0:253:e965:65c6 with SMTP id o9-20020a05651c050900b00253e96565c6mr4384049ljp.264.1653328473707; Mon, 23 May 2022 10:54:33 -0700 (PDT) Received: from nergzd-desktop.localdomain ([194.39.226.133]) by smtp.gmail.com with ESMTPSA id x9-20020a056512078900b0047255d211f9sm2087743lfr.296.2022.05.23.10.54.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 10:54:33 -0700 (PDT) From: Markuss Broks To: linux-kernel@vger.kernel.org, jic23@kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Markuss Broks , Konrad Dybcio , Marijn Suijten , AngeloGioacchino Del Regno , Song Qiang , 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 2/5] proximity: vl53l0x: Prefer pre-initialized interrupt flags Date: Mon, 23 May 2022 20:53:41 +0300 Message-Id: <20220523175344.5845-3-markuss.broks@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523175344.5845-1-markuss.broks@gmail.com> References: <20220523175344.5845-1-markuss.broks@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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