Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6806110imu; Mon, 3 Dec 2018 03:11:29 -0800 (PST) X-Google-Smtp-Source: AFSGD/WCf917zO/CTfyhgoHNpA+Y66AepgbybLWePLJvEjdhb8+wbQG87jcpRbOmaESrQLz0UhPI X-Received: by 2002:a17:902:b494:: with SMTP id y20mr15871230plr.178.1543835489734; Mon, 03 Dec 2018 03:11:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543835489; cv=none; d=google.com; s=arc-20160816; b=lpNySX/k/Nr2JbMeio6p7PUIPDhuWMHoH1KXyWz0JQa69vmAWAZ3K7PL4iv6tOaRY9 yBaP9afHn+6tIbBgF10wkQH3LWbHutWlf+/W5qk4s5b0E9mOhWp2XetFtAl6pCls2rJU CppUFYmVbuGDo+Lx4RBqu7KEEfC1O864LIlamtIWwdgtitMjkExHe5C7kj6mNtKIsYBx lH1/v5LRmK6VoGKjsVuyEuz0W7p+FDZSVrrT25fMmhIr3F1tdd/Fg5tnbHP9TbJVx+lO B9Tgdo+ibSEeWMHv1RJdmO8lgv+4s37wTH1d+5sV0l7AkJRmk7MCFcIiBp4DhrT5Dkpi VpSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=XQsW+4nUmFlrzto5qdZ2aFaRY8rsUYtQMpXpnrXKhpo=; b=YKg3C5WuZefxCsCrJTDtuvJjfUtayGp6JMKA6UkJmXL5nnNux7pfDUy+mcC+XbJI98 nO6R0pnIlFqW8qi13R900ubDjcADjXnsAg04/mVRJIGwAQcPVk5PmvBCAAHnQ/gOQ2bt t0AOr2ZkcdPb5k3vO1TtoLXqayGZDo9fqoDVQI5W7VfL+uQbKEG3kOnBM6mq2YPabwgR 5Psyc8Q3S1QEVkaF3zUgz74rD6qOF2UVjAuORD7deYyLwDwQXzghsg9DUIs3FSiHK7GV +W7AQhoZdJODp+M9ItB+P+IAKn4SCCU5upPFY+4H/fy64mXmSOWNG69auv/BzUxLuD/9 cPeA== ARC-Authentication-Results: i=1; mx.google.com; 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 t10si13390951plh.307.2018.12.03.03.11.14; Mon, 03 Dec 2018 03:11:29 -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; 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 S1726295AbeLCLJx (ORCPT + 99 others); Mon, 3 Dec 2018 06:09:53 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:60975 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725883AbeLCLJx (ORCPT ); Mon, 3 Dec 2018 06:09:53 -0500 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gTm6G-0001RA-DA; Mon, 03 Dec 2018 12:09:16 +0100 Received: from ukl by ptx.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1gTm6G-0005fY-4Z; Mon, 03 Dec 2018 12:09:16 +0100 Date: Mon, 3 Dec 2018 12:09:16 +0100 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Bartosz Golaszewski Cc: Thomas Gleixner , Linus Walleij , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Bartosz Golaszewski Subject: Re: [PATCH 2/2] gpio: mockup: use irq_sim_fire_edge() Message-ID: <20181203110916.eseh2udxvhi4lf3v@pengutronix.de> References: <20181120134032.31645-1-brgl@bgdev.pl> <20181120134032.31645-3-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20181120134032.31645-3-brgl@bgdev.pl> User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 20, 2018 at 02:40:32PM +0100, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > We now have a specialized variant of irq_sim_fire() - use it in > gpio-mockup so that we only generate events of types that were > requested with the LINEEVENT ioctl(). > > Signed-off-by: Bartosz Golaszewski > --- > drivers/gpio/gpio-mockup.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpio/gpio-mockup.c b/drivers/gpio/gpio-mockup.c > index a4c054cf9c5f..18563d2c7876 100644 > --- a/drivers/gpio/gpio-mockup.c > +++ b/drivers/gpio/gpio-mockup.c > @@ -199,7 +199,7 @@ static ssize_t gpio_mockup_event_write(struct file *file, > struct gpio_mockup_chip *chip; > struct seq_file *sfile; > struct gpio_desc *desc; > - int rv, val; > + int rv, val, edge; > > rv = kstrtoint_from_user(usr_buf, size, 0, &val); > if (rv) > @@ -213,7 +213,8 @@ static ssize_t gpio_mockup_event_write(struct file *file, > chip = priv->chip; > > gpiod_set_value_cansleep(desc, val); > - irq_sim_fire(&chip->irqsim, priv->offset); > + edge = val == 0 ? IRQ_TYPE_EDGE_FALLING : IRQ_TYPE_EDGE_RISING; > + irq_sim_fire_edge(&chip->irqsim, priv->offset, edge); If I write 0 twice into the debugfs file, does it fire two irqs or only one? I think it fires two but only one would be the right behaviour?! Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |