Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp21370807ybl; Mon, 6 Jan 2020 03:19:16 -0800 (PST) X-Google-Smtp-Source: APXvYqwrYVbdfhRktXLH3kXwIZGiaMheJvrC+nHhCduuEIE/lduWJNTuRJHZxIjAi0UWL5aUfvPN X-Received: by 2002:a05:6830:1481:: with SMTP id s1mr98470006otq.66.1578309556850; Mon, 06 Jan 2020 03:19:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578309556; cv=none; d=google.com; s=arc-20160816; b=abS+NOw5NZYA6a7bbMNHsKYXgDjRjkeqinRdVekgaEBss7M1tnSo5xgzZ9EpWuFYRj zjPYQ3mbnXj5s4+5dUK01T6psd1tjpbeD0d+WDfeBJxK4OktY2zsPRKQNMLd9gCu/m1U +oxGHge9XQurEHUZVt34r/Et17bp0qtHTjbaJTnl0ytYBo2Zj4l1mK5tqW1xaJyMK8gk B8LUPhClojD/L/8/0Yv6Ao+KeAhCCkYiaE9jWvkxJgi5KwIH3t60Ig7WrY+Av+aB26s8 607YkoLeZIFcxGQT1OrrIktnrqsAEDGCptxh25OKPGbON8gT3kVKgEyxPrrJibd+Ldf6 f/xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:in-reply-to :content-transfer-encoding:mime-version:subject:from:message-id:date :dkim-signature; bh=03E2SlDfVKYadf5+03eIf1R8huA9OuDhcd3L3flDD64=; b=OQcZE0f8CiJvHoYFypTnSIk+YpQhbs9bDqeeHFoCIu/ful9mKiS6zpQKHPrtkTBGuz yEp3mfZH6WCY1y6M+rFcU3U+tBm6I57Xe5FgMUMg8Kgu33ZVrfv4I6xJNKGVlraxKOI0 gRKz2OFEi8oGrPErRHemR9V+8o2bx03edKQIayGxg0ticG0ziaJaoAPh1rigdwAZHedo 7k5D5QvVnJdy1yBQKKnhrvwY4YIsUFbv4veCXceSPpvfvj0R4yuHuF8ZMDfjFOXa8qZq kaYDPrewKFoz4Ru4o7o2jAtx05e19eZqnJuiL51GOD1I3asSptWJSQu+B7+SLZ/e3SlZ 9ycw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rere.qmqm.pl header.s=1 header.b="Yt1hd/P1"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l186si30699449oib.226.2020.01.06.03.19.03; Mon, 06 Jan 2020 03:19:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@rere.qmqm.pl header.s=1 header.b="Yt1hd/P1"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726545AbgAFLR5 (ORCPT + 99 others); Mon, 6 Jan 2020 06:17:57 -0500 Received: from rere.qmqm.pl ([91.227.64.183]:38503 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726155AbgAFLR5 (ORCPT ); Mon, 6 Jan 2020 06:17:57 -0500 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 47rtKG4HMwz81; Mon, 6 Jan 2020 12:17:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1578309475; bh=CCLxX53RZtZFK1gL18DyCLhrUoZctB9AHHRdjY+vBfA=; h=Date:From:Subject:In-Reply-To:To:Cc:From; b=Yt1hd/P1LEG9U6ev3oKFIA553MlvGDLb9N3rar36dJeyTGq9REJFgJunUMOMg4tbu vXRMz56q2lB7PE/jY8T0qa5Tjfnq7F/RbNqh0bJ35+8knC/vlbZkc+ZdvarD8l4trp k2CwTZgxVCSa8ESdZvIgYbUmCyvB5LTfpgyS8rqHn9Nc1qJTMFOjsyZ7IANmkNa648 1oykxDDx4pw25S6qQ2uIy97VDe7QuppMvAbWr7idiW4qLuoMaEXufCj+LZBKSa65Wx HXbITfpzmyGrZFSIJtlES2HXUHpHGTCJudcojX0TC0p1N1c+vZc+baH9c/H6VdjbpZ ZortkXZJwCTjA== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.101.4 at mail Date: Mon, 06 Jan 2020 12:17:54 +0100 Message-Id: From: =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= Subject: [PATCH v2] iio: imu/mpu6050: support dual-edge IRQ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In-Reply-To: To: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Jean-Baptiste Maneyrol Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make mpu6050 usable on platforms which provide only any-edge interrupts. This also covers shared interrupt case. Signed-off-by: Michał Mirosław --- v2: just remove the dev_warn() message Signed-off-by: Michał Mirosław --- drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 2 +- drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c index 0686e41bb8a1..b3d138091f89 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c @@ -1241,7 +1241,7 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name, irq_type = irqd_get_trigger_type(desc); if (!irq_type) irq_type = IRQF_TRIGGER_RISING; - if (irq_type == IRQF_TRIGGER_RISING) + if (irq_type & IRQF_TRIGGER_RISING) // rising or both-edge st->irq_mask = INV_MPU6050_ACTIVE_HIGH; else if (irq_type == IRQF_TRIGGER_FALLING) st->irq_mask = INV_MPU6050_ACTIVE_LOW; diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c index 10d16ec5104b..a4dc2c4a3ca5 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c @@ -183,11 +183,8 @@ irqreturn_t inv_mpu6050_read_fifo(int irq, void *p) "failed to ack interrupt\n"); goto flush_fifo; } - if (!(int_status & INV_MPU6050_BIT_RAW_DATA_RDY_INT)) { - dev_warn(regmap_get_device(st->map), - "spurious interrupt with status 0x%x\n", int_status); + if (!(int_status & INV_MPU6050_BIT_RAW_DATA_RDY_INT)) goto end_session; - } if (!(st->chip_config.accl_fifo_enable | st->chip_config.gyro_fifo_enable | -- 2.20.1