Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp700433imu; Tue, 20 Nov 2018 05:41:52 -0800 (PST) X-Google-Smtp-Source: AFSGD/WlWAm/HnANI1kjBC5MXgjEyK1/yA4VeM/3JoPT7qt6Er85a+9DeYtBs1MPaQHzrZQiiIVR X-Received: by 2002:a63:81c7:: with SMTP id t190mr1940362pgd.393.1542721312557; Tue, 20 Nov 2018 05:41:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542721312; cv=none; d=google.com; s=arc-20160816; b=mbAKPZV5LNFssy1EXtBBnisvxH1MjnuegRKd+NNR6kK+KPmEv7k5hoQ6W/8z6HAHze YlLLCAfnaGjlvV0gkba9b1teVNOELRJmXaF5OxalfH+8cGEFKgMBy7lBMNPCuQUx8gC/ IznRfq3C7HJkYBMiojFkGjSpxrYxgVgbOl2NdukwJSuolfGE5KPSeYbz6YCMp9LxzJg7 lUK/im0352eYVevhlHlfmJjO0h5xnYuOdW3yfrV13Nu8H3BrlPcrF1KkFovrWW4FpIea yaDtLAEmQ3jakg8BxBhtU4SpaCvmDEmE2kU6BqMe/CoPBCH54Y7NKa3mTWT7d3Kox4/j u/Sg== 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:date:subject:cc:to:from :dkim-signature; bh=nmnEbWBrxg7vL8jw6YxuuzUlYQ5AMTGgBKEryzY0enE=; b=wZHoYXm6BE+X06fDR2kh/2OOacfYklOpbeVY8fBtH2VAZeX0dESOFMips5v/FYcEYQ Hp3kHBR8Ehk5gLmcXeNdoHpqOFSVzqZSTTfaqjSqUtzvfq7sBLXO1wB3JYXKtp1oVCQc vlCUYdajoCZzZE/BKgpMiy40KgFaPEkbos3lXYbM+N1bG7+ieECVw4JwDdQPgecT41wB NN/lSQkMWmPzKtcc7nk0dUrkh4gkV6LG6dr6xHKEXAVnE+xsh7wb881T+Y0cGJjzJ0v7 AaDmLHOHQBNDQE0HyQMJby6igcfFI0e3/tViN1oEOvQtgnCIwQMXIEGIms7veZOjC01C e7lA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=qvTWc1lR; 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 y12si15541544pgh.289.2018.11.20.05.41.36; Tue, 20 Nov 2018 05:41:52 -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=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=qvTWc1lR; 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 S1728415AbeKUAJ4 (ORCPT + 99 others); Tue, 20 Nov 2018 19:09:56 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:35280 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728125AbeKUAJz (ORCPT ); Tue, 20 Nov 2018 19:09:55 -0500 Received: by mail-wm1-f67.google.com with SMTP id c126so2283187wmh.0 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=IrlON6acYO/3eI2kT+gQ+Xm9LUYpZWZV2+NDqu0wdJGB8qzuqU6QfXG7gv73FPTApX osaLtm3hbYH9QRDRIwqL1K5OXv154M+3Ts2htNOi1EwFYXTy6axqpGaN5AJG0SSze/n0 jzXEfGhUCRjG0aNgiArJc3dZebi+oWEY/bBKwLnzhtA0Cx9rfX5iWG5zI/eELlZQJrZU jrASCBurD9trjgIDWM6i49IDzabBb1oraYaKbfmWyVA1LnwTK7Jj1gr4KALB/21IWloE aeMdqVMvjLXFDu8SSOz6fm0fkwEMfnm0o/E8FuEhSbc0ib7XtOQjAhX7p1M7BOPb03xf wifQ== X-Gm-Message-State: AGRZ1gLNLGBTQsCcjPKKnJxbNX+lv0FGTno5oZXftrslbf/KYVoxs6rQ eIiqVTUqlsnLAAcF5RVjaG+DbQ== 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=20Kleine-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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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; } -- 2.19.1