From patchwork Tue Nov 20 13:40:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 1000502 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="qvTWc1lR"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42zn0H6DzTz9sCh for ; Wed, 21 Nov 2018 00:40:47 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728125AbeKUAJ4 (ORCPT ); Tue, 20 Nov 2018 19:09:56 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:38356 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725843AbeKUAJz (ORCPT ); Tue, 20 Nov 2018 19:09:55 -0500 Received: by mail-wm1-f68.google.com with SMTP id k198so2291345wmd.3 for ; Tue, 20 Nov 2018 05:40:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nmnEbWBrxg7vL8jw6YxuuzUlYQ5AMTGgBKEryzY0enE=; b=qvTWc1lRZBfF6jKDFeXEVUHjKglpShD3SOlVQx0TEPCYMdGBK+O3Wi0BIvpSiZtSCT jBt8J4WFMK4zkjsXTb61cGyteX/aY1WPloYgtNKpyu8EUSq2cYEVEmN3I1jGvwfDJudB Wz3fJXxAGOq05q9lbkVwuzV/Z9QfBY+aVIPZ1UujqOYsQNLGgcvHXwaklXRvF6psArL+ kVALJj6Ft0eHd7cdRrxZC3sZAKP60dccxAQMt0cEI3UkoEaZHqeT+7A4xvJf0LSotvlu TagZ1EXjWhMdXSJUzvwB6ofK8FKFCTkE/emM3SiFdWJFf1ngiYpMrqz9jlq9UF76TjE6 uHlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nmnEbWBrxg7vL8jw6YxuuzUlYQ5AMTGgBKEryzY0enE=; b=InY3CvS+H1eD9nlgU95FXy+BZB29KLNwdfPy6/jeBp0mWwpNjyB/NuwsFfEwDZnQYJ gNZwZp/f4Z/7kr/rpKVCoGF3xq3orEOUr+NKUs1hsb2iz43LUJiWc0wjBGjIsJm0IDm0 HUa6w39ijH6QRI1+4g13wjDar7E2th65Zie0vaomlXxVgHMB2qPxSKOq6z6/hZYJPe/B juSRjgDbr+Z4QFMymvyeR28q+A2Mi/adDrncGgNHqdWKYLGD1XyTtn+Vj5SEggtmZtkt V1zy7jrzUNMLqUoTVk5cogg93i6UVlWcdB7ZirpXTaa55ueuxyfnUMWueAyxOoSimsRD Y/JQ== X-Gm-Message-State: AGRZ1gIJdUbdqSbzaL5Y68VHp5ePFHRITIpR2bJ1fbIOmdxipGO//uDA XBG+LJZ7sIY2MuIqPNlxOIBSXA== X-Google-Smtp-Source: AFSGD/WPPSbwlhUZHarQ6057OZYheWiUKvei0lG/L7uBh4GXdda2VLuL09I2CY+A66m8aIseGuwUYA== X-Received: by 2002:a1c:38c5:: with SMTP id f188-v6mr2197204wma.19.1542721241912; Tue, 20 Nov 2018 05:40:41 -0800 (PST) Received: from debian-brgl.home (lfbn-mar-1-609-89.w90-118.abo.wanadoo.fr. [90.118.185.89]) by smtp.gmail.com with ESMTPSA id j129-v6sm36962901wmb.47.2018.11.20.05.40.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Nov 2018 05:40:41 -0800 (PST) From: Bartosz Golaszewski To: Thomas Gleixner , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Linus Walleij Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 2/2] gpio: mockup: use irq_sim_fire_edge() Date: Tue, 20 Nov 2018 14:40:32 +0100 Message-Id: <20181120134032.31645-3-brgl@bgdev.pl> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181120134032.31645-1-brgl@bgdev.pl> References: <20181120134032.31645-1-brgl@bgdev.pl> MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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); return size; }