Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp471115rdb; Thu, 19 Oct 2023 09:23:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHDZH5NS/rA89l726c54wo3dDYJd0LiIOZJ3JBGPkEkuDeyTNXaGDFty1uQBB1tVCPk7VMx X-Received: by 2002:a05:6a00:17a3:b0:6b8:780:94e5 with SMTP id s35-20020a056a0017a300b006b8078094e5mr2634696pfg.18.1697732603823; Thu, 19 Oct 2023 09:23:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697732603; cv=none; d=google.com; s=arc-20160816; b=jOSQTlv9l392Jj/18n+kjSeGpWJ1Q2hv7QZH7eI2gU2jox+rNSwPCusoatZSiQDqxf mw9JQBXpccnKWDc6Vrg7WPBlx3Jgd4+m+jQxX4A9uy98w+9s+NP7BlsS2Zxot/3mNhh0 dUptkbYWkRbWVz49qedKNctfmz8jbezS5O/nPCAi5skUN/11aRwH4iwktz1mrbbYTuY6 26PIQJDInNOI/LvRXtp9IuZ33LbrQJY5ouGUCqONjVb0IF6JOPqUxY1Z1gRE2GooAGir QhSUsHyuFQEqN8a5pID2TCn3kkZdwn6TU+cQ/RYBmDroiYHv40XyAEDVi2zw0bXCyMuW 2FEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:ui-outboundreport:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=y2P6/e04/mEtz1Qe7yc5Sh5SdTuivu5KJhXpTpSxV4Y=; fh=gCF8Lee5qUHP2H8Ryla+pYPepFzsaqFUhBO2CiLnY8Q=; b=WUSVfaKPwCGBOVcfeDVFYyFd1pq9XDJ4E/j3C9DHaUZLyglWp0UgLFpdkL6ZBP3bQE 3wK1hJaU7WcQ9ed468NAHg92YT5u82zX14BbKnBVGvZ74qoQfppUjBZtWLq5BhNGWmDs d6FIRWooGQprs/pUIUcFfuqGkcVex4oX+sKMRnwr37WCJ3WeAUzW6VOUKQ0Z0OrL+RwQ WiJ+sdd4v7gwvgUSkoSOGo6sQFz2iTn6v8rk2N8LNzDj61oyQ2nlXC7IZjvXJDDjPCkH fPzuoVXsPe2YLCnv1WzQraFgli54UYWX9/HLKL2Ltzs7y/TthkmEbP4Qwp8RtsxHJS8Y +urQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id h15-20020a056a001a4f00b006b6119c4695si5143978pfv.380.2023.10.19.09.23.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 09:23:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id BC7FC834B51F; Thu, 19 Oct 2023 09:23:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235471AbjJSQXK (ORCPT + 99 others); Thu, 19 Oct 2023 12:23:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235353AbjJSQXH (ORCPT ); Thu, 19 Oct 2023 12:23:07 -0400 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C411126; Thu, 19 Oct 2023 09:23:04 -0700 (PDT) Received: from anderl.fritz.box ([31.220.118.173]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MI41P-1qhhIJ1jV9-00FFCj; Thu, 19 Oct 2023 18:22:44 +0200 From: Andreas Klinger To: Jonathan Cameron Cc: Andreas Klinger , Lars-Peter Clausen , Angel Iglesias , Andy Shevchenko , Linus Walleij , Sergei Korolev , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] iio: bmp280: fix eoc interrupt usage Date: Thu, 19 Oct 2023 18:22:09 +0200 Message-Id: <20231019162209.18872-1-ak@it-klinger.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231018152816.56589-1-ak@it-klinger.de> References: <20231018152816.56589-1-ak@it-klinger.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:szfII3NCiC1EDuhf3omFrXIz/cNi2TIlI4+gtPHfiVxW8Fr3RRU A3SHtJJkNIjimHQwGtAxpIM5AgL6iQ7pLpR1kMvnAUpUmhtm6FUZW+LsxX1/ixWfZLWwBnQ 25UxdYIbXBvB8lZvwqr8CaYi3hxbtlbKQTC3RIsnahpV0KVGJZNco/edonb/kQmBitzCiaO ZQGtljFqheROANFTPSltw== UI-OutboundReport: notjunk:1;M01:P0:M7o/P3M8TVQ=;S9p6l4NGE8yMZljoTUIhQ1jwF69 hsJPccZddHvEpUPNCutkfHHm/nQlEtbnBDuHUDJMXdGgDYJzmnYGDYLjqUhKg7xE9/UXGDqRS 2y0d+A4PM7trNx6qdEIOzCCxPM09HHJTgsBdvatPLCBqgfMtJn8ji5Z5RqFQ95bDISwn8/aSU DVFMMOPgBdwj03gVnG/u26KEpX7SqrUUgaERN8e6dIAiUCCZ0XIkGr57weT52Q88d87Gt40TX ZBqQGPO0TJcq3g04CS1fXqRhhvDgYux976onOqJoIxCcmpEwpvll5EZDhDAzhpFYBd1ZJ/P+2 0gsgfiTQMQjiYZ5rIUTqzav105QJXj9eKbW63yGHMcdoDCy33J4G5eASD516zRFZbglSgfcI8 wppfpPCtfqp0JQOLkSSyXJu/xriZ3/DNdhKuxmr+chlvHB28/f5UPECe+dpNJOJtkSYEEXCEe CjM70RnukbrefvZM8wxA2vupCSh+EjYmqmW91LKEDfRQ/SgNmZikd66b8zqeuM4t3hk2/Sm5F xd/6dChFdcEz2RhAqiVpbWXqx52popAqCl0bD1PSS3oHEi2PDi6swgt2C6UkmUe78d1+FJV7a 56oqMmhOg7x/N/jY8DwIn69sLi4zr4DY7CAh9ncuCqJaAgWh2DMJFEzbIlTYqn534uZVZBNAH rpX8huRWb8lBRe7J9pTnVQ5JvYKqkGExrkv7zVfP0UHx2Dw6v7dlyihoWrebWPpozsvPSkZnD bfmKyEWT0TJz1aCIeJjG3O+/Y2akH/2hAEi4F32jVlB/UV79YxGXwU7CojBdr2MvDsqkrsjBW Z8N2DvNV4cbkCAmcOchX1M69WiW/kIu+yO7QqzK2dLAn8fwmS98nPbPfmOqNi3sXtSLCnxLJY 2WrR7CD1lIPrYZA== X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 19 Oct 2023 09:23:20 -0700 (PDT) Only the bmp085 can have an End-Of-Conversion (EOC) interrupt. But the bmp085 and bmp180 share the same chip id. Therefore it's necessary to distinguish the case in which the interrupt is set. Fix the if statement so that only when the interrupt is set and the chip id is recognized the interrupt is requested. This bug exists since the support of EOC interrupt was introduced. Fixes: aae953949651 ("iio: pressure: bmp280: add support for BMP085 EOC interrupt") Also add a link to bmp085 datasheet for reference. Suggested-by: Sergei Korolev Reviewed-by: Linus Walleij Signed-off-by: Andreas Klinger --- v1 -> v2: Remove extra space (seen by Andy) drivers/iio/pressure/bmp280-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c index 6089f3f9d8f4..ef9b3c4f2340 100644 --- a/drivers/iio/pressure/bmp280-core.c +++ b/drivers/iio/pressure/bmp280-core.c @@ -9,6 +9,7 @@ * Driver for Bosch Sensortec BMP180 and BMP280 digital pressure sensor. * * Datasheet: + * https://www.sparkfun.com/datasheets/Components/General/BST-BMP085-DS000-05.pdf * https://cdn-shop.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf * https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmp280-ds001.pdf * https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bme280-ds002.pdf @@ -2179,7 +2180,7 @@ int bmp280_common_probe(struct device *dev, * however as it happens, the BMP085 shares the chip ID of BMP180 * so we look for an IRQ if we have that. */ - if (irq > 0 || (chip_id == BMP180_CHIP_ID)) { + if (irq > 0 && (chip_id == BMP180_CHIP_ID)) { ret = bmp085_fetch_eoc_irq(dev, name, irq, data); if (ret) return ret; -- 2.39.2