From patchwork Tue Feb 19 16:06:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 1044756 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="sBwQjTHT"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 443lwz1Cwyz9s21 for ; Wed, 20 Feb 2019 03:06:59 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728630AbfBSQG6 (ORCPT ); Tue, 19 Feb 2019 11:06:58 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:44542 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725885AbfBSQG5 (ORCPT ); Tue, 19 Feb 2019 11:06:57 -0500 Received: by mail-wr1-f68.google.com with SMTP id w2so7979321wrt.11 for ; Tue, 19 Feb 2019 08:06:56 -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:mime-version :content-transfer-encoding; bh=7s4eDmqcVrJit+LRNz/3DTAZJVvDNlWByMSZ7/sgKQ0=; b=sBwQjTHTUad96tqXQ19VixTG8equAaSgvO9R99ygJbZT+h74UDZ5wjzsQURo3tJ+qM 2LFUexxGD3rjFyS6fbtpmtTsWPAm09UcFHsUnAPHqsDwKMkPcQL7ppNdt3S/NQtxX7BE ZRYtmBVYUe9lQ6ppBtkwUAEgFnNyq/pxYNpjVR9oyctuOHjNHbFmXezjqnHp4WYr68pY p8+KRjd6+mEcxHn5w7aCKxVqs+PCsvyHZFRz2i3kluGDgN7T1X4O0ep8tbfiNyW1874q aDr4mS9d5oT7vcvHOk9RrUQnDdGZ/9zL0lMSvFTuW2hTUtT451NUlaBSsv86Trcmd1ss f3Gw== 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:mime-version :content-transfer-encoding; bh=7s4eDmqcVrJit+LRNz/3DTAZJVvDNlWByMSZ7/sgKQ0=; b=nLaEDzhSHfHkg8icwrP+SJFU85hq4TTPHbzleXQX9t+Zi1TsbUfdq5yp9N3yCUkTiR Xzfd8SGsdI3pHbDwza4bvSctAvcsep/xyl3CYqrhPfRz7cp85K7En83BdhOG+mm6fOZe 7CVL/1zmeEHfRTFmWcQjCv1C1N4bOGMAGae/3KIM97On7nrQRnPykCCNysya8Ly495xT hwAtLF9lS4sWuxTFAS410gsb7NleW+GR6zqRZAYRkwoS5o9wy/hPPup/vODBo+kfUCYg MovI5Rqw1SSJacGpHhxdM3RoCdmEDBbgdiQeK+037WmIzKCGxdxLQwOPae99LwMhv+zx 3/NQ== X-Gm-Message-State: AHQUAuakWuGZaHlWRxzb+GTXET9gMInMSSz/nIJyMm0PJNYpJsYkToV+ 0xBPDpenETKWOP0KGAp5gw1agQ== X-Google-Smtp-Source: AHgI3Ibu006gCFFU8Jrjp0vF5YcczrijRkjyZex9+wQbWHRu8l3vLw6K1KLC7tDkSI9Yak26bslVyw== X-Received: by 2002:adf:ef4a:: with SMTP id c10mr21210682wrp.180.1550592415724; Tue, 19 Feb 2019 08:06:55 -0800 (PST) Received: from debian-brgl.home ([2a01:cb1d:af:5b00:6d6c:8493:1ab5:dad7]) by smtp.gmail.com with ESMTPSA id h17sm12161381wrq.17.2019.02.19.08.06.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Feb 2019 08:06:54 -0800 (PST) From: Bartosz Golaszewski To: Linus Walleij , Thomas Gleixner , Marc Zyngier , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?b?w7ZuaWc=?= Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v6 0/7] gpio: mockup: improve the user-space testing interface Date: Tue, 19 Feb 2019 17:06:43 +0100 Message-Id: <20190219160650.9614-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.20.1 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 Marc, as discussed. This is hopefully the last version. The irq_set_type() callback now only accepts edge triggers. v1 -> v2: - instead of providing the irq_sim_get_type() helper, move the irq type logic into the simulator and provide a helper that allows users to specify the type of the fired interrupt v2 -> v3: - switch back to having irq_sim_type() and put the line state logic into the GPIO testing module v3 -> v4: - drop irq_sim_get_type() and use a notifier chain instead so that any change in type configuration can be pushed out to interested users - change the locking mechanism in gpio-mockup to a spinlock as we can't take a mutex when a hardirq-safe spinlock in irq_desc is being held when the irq_set_type() callback is called - refuse to set any other type than falling or rising edge in irq_set_config v4 -> v5: - drop the notifier, use irqd_set_trigger_type() instead v5 -> v6: - same as v5, but we're now validating the trigger type and only allow edge triggers Bartosz Golaszewski (7): irq/irq_sim: add irq_set_type() callback gpio: mockup: add locking gpio: mockup: implement get_multiple() gpio: mockup: don't create the debugfs link named after the label gpio: mockup: change the type of 'offset' to unsigned int gpio: mockup: change the signature of unlocked get/set helpers gpio: mockup: rework debugfs interface drivers/gpio/gpio-mockup.c | 189 +++++++++++++++++++++++++++++++------ kernel/irq/irq_sim.c | 12 +++ 2 files changed, 174 insertions(+), 27 deletions(-)