Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp701945iob; Thu, 12 May 2022 02:53:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeLUgmDwN371u+qYLuwq5HHAIXj8DNRGvqFqsqQ4jMagT45UuLmRXV8OzaNRliDSu6CFOA X-Received: by 2002:a63:7d4a:0:b0:398:dad:6963 with SMTP id m10-20020a637d4a000000b003980dad6963mr24435285pgn.329.1652349197298; Thu, 12 May 2022 02:53:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652349197; cv=none; d=google.com; s=arc-20160816; b=vLPhSurU3uLR0Pa63BBVOA9ZBs1WTX+5NA2sIj3OTQw9kVuJ95OKP7upfGzhf/wJWI cpVVQSbKb11oe4z035Py7UM5RVRSaJvMKQ0zj72Pvb3MuSRJnHEaCGBS50/fgskK/VR7 eGaOxS6VhalV2TvV8Z+Vw3lLiW26i8Hzc00pko4O+NYfHYcIojrR+bs3rsFi8gt/EkIV JyjVHSMr1j26lg/UcMOI3PE/KAFk+rqh+mtUUaBG9vXlheRxG31xeeo9z+TTUz2TMZ5/ eKqnRysKKsVQ76413g2cNNpGtYT5u8RazknP4qgdIa9IwRNXsOeSbjTptjoUdDkUwIlL vQiQ== 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=f6sP9MF85LQx8etkhW8eLxgPVA9IUY3TDzhnSN1EZPw=; b=F51731EChd6HW9ydeAHD6sPMjIb+zF55a+KridZwxzEvhXeibPNq99zBcWW1QZBFZK uaqWXbCIjeMiDbhJb403UEmFmjUJlTmCiWVebYu6UjzwUJQ+g/K4W+IHMhGip6sFkhnz /tlCln1uI7cR5dU36EyK6lU3c6FF/3gDOt5k9+EAok6QAWuqKuqvu7n71qAOTtA+lZpd zTlCgoBqooLplWSk8RZeCjsrj/H3pV1LgDG8oc6Kx8tftTstQ/dmwMRKivfM9QI8txVi 3YgX0TRUqBpin+1hs7qBdMJUz5maFqL8lHIFK3fKy2V+KeFk5e/KPVu8nowT4Y5/tnXN 7MJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YdVL6LTN; 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 x1-20020a170902ec8100b001567d82c09asi6817536plg.174.2022.05.12.02.53.04; Thu, 12 May 2022 02:53:17 -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=YdVL6LTN; 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 S1348385AbiEKVsJ (ORCPT + 99 others); Wed, 11 May 2022 17:48:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348356AbiEKVsC (ORCPT ); Wed, 11 May 2022 17:48:02 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED3E23A713; Wed, 11 May 2022 14:48:01 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id b18so5809921lfv.9; Wed, 11 May 2022 14:48:01 -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=f6sP9MF85LQx8etkhW8eLxgPVA9IUY3TDzhnSN1EZPw=; b=YdVL6LTNJ4dkgB022mJ/gKM2nagkNpdgVkfKhfYl8vSc5F/ohVlcqOAObbEVCLvIX7 Y4bYVAcyPhixmN/+Xt5xiWmeyvNWEWfhoCTZ3rfAXx3guPKg2mrGE/Bg8ZMKR9O15SA4 JJsZJeu5ADIjdIA4mR6TUv2mwOvbk9Pr9MEJ7YUPpIsf1pS9Tt+V35DUflCnpHCQ7H/r EDXCCdODgGr7YeeiGJetPyiZaL3kJmQ6P5N9DBwZyuMNnf6NmpNzhOChqOPvZ3QgclcL KkcrXVnx6BqY9WI/BFTgW+9srPwJJGxnPROZt8VyWB24GW//ekz/Fnd6mew+bOcUIcbH mh+Q== 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=f6sP9MF85LQx8etkhW8eLxgPVA9IUY3TDzhnSN1EZPw=; b=CgdijX9/EmQDqIxSVSvMDwc8FtCZdR5XRfiaMq7xx1vPTH8dgoo4BQqbZu+qjDFq3E OLPm5JK/es6BDiUhUM6csA7FQDySw1lJsME6T6jxUKy70ofNMbvHulZFQj23x53XSEPH 4BCWBBJRQhEScdrQsW7YE+SuCPjt2SBpYWBGcyn3jLgUpYQXnFel1mYfbCgwMqPDkl7S NnjTWiBrmXlIimT1Ub4lfvLjyLYwWl1yctoFyPLcKEwAMANj8+ZQtidFEcBFPBl8r710 9coTP8kV2F2d1jwCfZa0G+gn49CMk3Jh9sMTDIiXJyQcnLDljbXQaM05YZekT9E4b32i Ht6Q== X-Gm-Message-State: AOAM532AyGvpyIHFjo/iMmYAfdiglgpw60NelIH0/VJhYhTkISNd/5Xd VGOiCXgeFVWDARdnc/+uOSi3IQHucbu5cA== X-Received: by 2002:a05:6512:3c8:b0:474:2645:f42b with SMTP id w8-20020a05651203c800b004742645f42bmr12726743lfp.126.1652305680084; Wed, 11 May 2022 14:48:00 -0700 (PDT) Received: from nergzd-desktop.localdomain ([194.39.226.133]) by smtp.gmail.com with ESMTPSA id 7-20020ac25687000000b0047255d211afsm458891lfr.222.2022.05.11.14.47.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 May 2022 14:47:59 -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 v2 2/5] proximity: vl53l0x: Prefer already initialized interrupt flags Date: Thu, 12 May 2022 00:47:14 +0300 Message-Id: <20220511214718.50879-3-markuss.broks@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220511214718.50879-1-markuss.broks@gmail.com> References: <20220511214718.50879-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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/iio/proximity/vl53l0x-i2c.c b/drivers/iio/proximity/vl53l0x-i2c.c index 661a79ea200d..ef2c063dfa1c 100644 --- a/drivers/iio/proximity/vl53l0x-i2c.c +++ b/drivers/iio/proximity/vl53l0x-i2c.c @@ -57,11 +57,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