From patchwork Tue Feb 19 16:06:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 1044757 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="Lxqk8665"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 443lx21Q7wz9s21 for ; Wed, 20 Feb 2019 03:07:02 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729018AbfBSQHA (ORCPT ); Tue, 19 Feb 2019 11:07:00 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:39235 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728333AbfBSQG6 (ORCPT ); Tue, 19 Feb 2019 11:06:58 -0500 Received: by mail-wr1-f65.google.com with SMTP id l5so21501884wrw.6 for ; Tue, 19 Feb 2019 08:06:57 -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=T/8pB33KMIJ5zXoSB9u9TfOpy7x+4rvO5Vd6nd9n/qY=; b=Lxqk8665bM0VzvGAQ62nwsFElvlMyPDJd627oEUO9Ezqk0SUdrdorFJizWOp4759m3 66tgLbF8MUYmGCXP7DNMEjcXNhFxIk+5v4EUQW7R0LQ7FVyWJXH6kV2kgvFcnymq1hDM gwTO2/18WStArOROg1MbvIl4UKNwaw5f8ML84/HvXixPRfoQfj3g9c+G4uJpqy1HsJnK 9KTpxG2q0lBohR+rvWa6rexsoVcr1sjKH4vCt0wGeS3PAex871DKKexM/jklKH8N8Ef4 jkS4tzr2QChPfZfxS3Ljl6ynwpJBG26+49Hqms+Fl+1UcFCgmA0f0IVRPl/89AvTby3G NwMA== 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=T/8pB33KMIJ5zXoSB9u9TfOpy7x+4rvO5Vd6nd9n/qY=; b=sPpwPupRcE9jvRbfxm01NWoAMwVW1EUF1Ap9WMOjbvp8or4++Tl5z2ir/rpL+PWD4q lsdyDAfB55Sm02FCAcz3ubEoTocj2mNeEpa8XQH9ckzrdzL4ZsgMV4WwRO2BQmGTypSj ZQLv6oqmlw1uTcxiSS4xKYnFsEj0yWvs1OOqwrwXntmI/sJgWV8BNr5NgCJjkxiHCCmm noeaKzPg2F339yoA8v8gHq8tq6mi8E/gDe2ioVplsFBLV8s3hwaIzWv6hiwxJfgvfn7Z UsyzIllVexFAJxygvzTrOn2SONrazye46Oy2vGJscoI+49i+veDOL+b2iU903oBdJ5Gk wEdw== X-Gm-Message-State: AHQUAuYmAZvLmD7ce/QVpm+c6coWmTmCT7YXrqsr8XC9EnX3L9qxZM/H LXQroDEUC9HpjX6fEMKtUe4c2UM9geE= X-Google-Smtp-Source: AHgI3IZBdUvC2jfzpcSkpdA7/RXbHqOvqiUkHCs3JINhn5uytsWY7FcAipkREv1DHgyu2igeeqwyGg== X-Received: by 2002:a5d:4710:: with SMTP id y16mr6977237wrq.305.1550592416959; Tue, 19 Feb 2019 08:06:56 -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.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Feb 2019 08:06:56 -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 1/7] irq/irq_sim: add irq_set_type() callback Date: Tue, 19 Feb 2019 17:06:44 +0100 Message-Id: <20190219160650.9614-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190219160650.9614-1-brgl@bgdev.pl> References: <20190219160650.9614-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 Implement the irq_set_type() callback and call irqd_set_trigger_type() internally so that users interested in the configured trigger type can later retrieve it using irqd_get_trigger_type(). We only support edge trigger types. Signed-off-by: Bartosz Golaszewski Acked-by: Marc Zyngier --- kernel/irq/irq_sim.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/kernel/irq/irq_sim.c b/kernel/irq/irq_sim.c index 98a20e1594ce..b992f88c5613 100644 --- a/kernel/irq/irq_sim.c +++ b/kernel/irq/irq_sim.c @@ -25,10 +25,22 @@ static void irq_sim_irqunmask(struct irq_data *data) irq_ctx->enabled = true; } +static int irq_sim_set_type(struct irq_data *data, unsigned int type) +{ + /* We only support rising and falling edge trigger types. */ + if (type & ~IRQ_TYPE_EDGE_BOTH) + return -EINVAL; + + irqd_set_trigger_type(data, type); + + return 0; +} + static struct irq_chip irq_sim_irqchip = { .name = "irq_sim", .irq_mask = irq_sim_irqmask, .irq_unmask = irq_sim_irqunmask, + .irq_set_type = irq_sim_set_type, }; static void irq_sim_handle_irq(struct irq_work *work)