Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1854388ybl; Sat, 11 Jan 2020 04:11:57 -0800 (PST) X-Google-Smtp-Source: APXvYqzE5u0fpJbWrnOKQPF3kySjv7C1t1VLFfvPzVUJW7e6juqKmhHhBmkynAmJdIOOvyvKEA53 X-Received: by 2002:aca:fcd0:: with SMTP id a199mr5831999oii.143.1578744717735; Sat, 11 Jan 2020 04:11:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578744717; cv=none; d=google.com; s=arc-20160816; b=ky/j/QJ2yiqw0gfS79wmcJxODI5spBCDTQF1YS6TK0rCZKW8bqyZpdCT4kDLe76h6G DCaaX/VJo6md1YJX0+ksI6U1BcMfxZ/EewCpcU03GgZvxCPna12YEY5VS5H1tehiXzZz UYw2H4xYMr4Am0m802QCJulh8eqahP2N031hnyKYqWbBoC+worK92WEA5CzBJwVosnqC 0OUZeu4alDFoSj64XfuKoOWXLFBBEjBNwWGxfjKdKZD//E1rmTmYK1iLoimMI00AGxpj UU9wopgW9pq8dC0RbDOzIMFC5BJNr9k49u5CfRiQop713HG2CRqY2Q7ti+iodyKCs4o5 +zvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=JgtK9GQ5wkVrKkOvzQYXELwYOjcFaCj7HD+Aw/jSLpU=; b=lXBlWA21XsOU/2zD93VEalKbQTH66rHaL9ma9MHpNkpvuonrCEJaDRkAfUnmHvBgKa Wo7Jmlt18mzPBO6CzjSEQLFYlvkug/MVFLlXEpQttoCZUVSsZOHRsXpOHM2kKGmzQsst /9BHbKXnXNY+r8f99v1sxwZJ+gRQwH2gnRStwqzN2piSdtQ2Fj6hDIP3uaBah3Ia2EJM cQwORdKBT5wrdV6n8b6w2Q5ZBphWp+ZGyIm31ljm100wukNOXNvj2JGyhSxCCAnuJS2W /b8hSHqne7P1wNjQREgtSMpZXWYFiBJN+356yNsMOa0yy8x5GCjOOjxOvHjKKN57Seap eidQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="W90fwS/7"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z18si3546748otq.121.2020.01.11.04.11.46; Sat, 11 Jan 2020 04:11:57 -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=@kernel.org header.s=default header.b="W90fwS/7"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729601AbgAKMKw (ORCPT + 99 others); Sat, 11 Jan 2020 07:10:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:37374 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726609AbgAKMKw (ORCPT ); Sat, 11 Jan 2020 07:10:52 -0500 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8228520678; Sat, 11 Jan 2020 12:10:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578744651; bh=6Gv+nt5Z9CLF/Y0YWRCq4mKnmsj8Xz+0ADRolnCe4D0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=W90fwS/7eymyrDtXV+FlTF9c0Iti4GHjkNKW8Z/NoKJO7RMeK11dmhdfQ3YSsl7ra RfCR9ukJiov+tgBOS6GtobfQig/nO0wwNhri3uM/LuoyrGubXJPYruKS+8JdGR03m8 tfT5GVgepgI9r+rPLYTbGkE/WoXzLpsS6X9YrCyQ= Date: Sat, 11 Jan 2020 12:10:47 +0000 From: Jonathan Cameron To: =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= Cc: Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Jean-Baptiste Maneyrol , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] iio: imu/mpu6050: support dual-edge IRQ Message-ID: <20200111121047.79e16365@archlinux> In-Reply-To: References: X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 06 Jan 2020 12:17:54 +0100 Micha=C5=82 Miros=C5=82aw wrote: > Make mpu6050 usable on platforms which provide only any-edge interrupts. > This also covers shared interrupt case. So this had me confused for a bit because I assumed we were trying to make a level interrupt providing device work with edge interrupts. Seems device supports a pulsed mode and the driver supports this. Why do we want to detect on both edges? Do you have a crazy board with this shared and some devices using the rising edge and some the fallin= g one? For shared case it should return that it did not handle the interrupt to allow spurious interrupt detection to work... Jonathan >=20 > Signed-off-by: Micha=C5=82 Miros=C5=82aw >=20 > --- > v2: > just remove the dev_warn() message >=20 > Signed-off-by: Micha=C5=82 Miros=C5=82aw > --- > 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(-) >=20 > 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 i= rq, const char *name, > irq_type =3D irqd_get_trigger_type(desc); > if (!irq_type) > irq_type =3D IRQF_TRIGGER_RISING; > - if (irq_type =3D=3D IRQF_TRIGGER_RISING) > + if (irq_type & IRQF_TRIGGER_RISING) // rising or both-edge > st->irq_mask =3D INV_MPU6050_ACTIVE_HIGH; > else if (irq_type =3D=3D IRQF_TRIGGER_FALLING) > st->irq_mask =3D 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; > - } > =20 > if (!(st->chip_config.accl_fifo_enable | > st->chip_config.gyro_fifo_enable |