Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8564342imu; Tue, 4 Dec 2018 10:17:28 -0800 (PST) X-Google-Smtp-Source: AFSGD/UhjsQAlHQPluUY9O8CbtYAhvpa2UPxfpbJlDWg5ut2K8uA52GRfuVMHhdbJui8TrGdg79P X-Received: by 2002:a17:902:c5:: with SMTP id a63mr21402563pla.267.1543947448830; Tue, 04 Dec 2018 10:17:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543947448; cv=none; d=google.com; s=arc-20160816; b=Uy4WzkWzvlF3kvvNOuPYItQ+mC5dZ262xi0F4sz/P07vNUHlrNT347MhLws4NGckYY fFAJo3tCXkWF88TxyEqLZZSNZemuwsF4IuRNI+4mnpJRiaeM8XuRjIPiRxKUZetJgFby cdUNz/JHdZBCvQul77ddd7xCASM5FogVIxJyJgbu8cZNVKCWLs0URJYs3yPGqeutTYST LdWI1J8WjtUoQvc1Ode6Y7cwCuru8vqgJOW1LAq1kWMKZ4vr+Ohr8odNFR1u96lh3JMh zw52B730tsjrT3lpTG8WngzJW9St9rySgqP67YU7EWBwobdVuFAxVeHFWGHbTNNWwkDP ImmQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=9PfOlnn1f4fKIRQOM4y1sfcAwAKRvx4cSG/oBf5oTFo=; b=rd0VvN5/LXoILkmWrz1GYtjoXngLpe2D7LB0El0G4oNRKBHAXaz/AhmIqxDOTKnxBs YPlOxAupisFcd0pflBEnlWNlLTMMwX2uYthQMwP6be7xiucUCdFneZgIpXwc+9iA0LfQ RdkUiOW6WosoeJOTOJXV83QZdWfrc3CcgA00HDWMTvITn/rgl0O8fPFVpYiiNmWZ94qo 7+GVigspMcXfNtvwBu5q2G37gLxhunYpirKWhtkCiYa4MRnv0idX+Yizlk88g0g56Ara om8VSPlXPMOdgnLuHN4VbTqK8B1RuNUbOTEBNBnoCIVtI09MY1V2G56cci/q6psdLU7K wrEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=vKicm5Jn; 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 x128si18696544pfb.128.2018.12.04.10.17.13; Tue, 04 Dec 2018 10:17:28 -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=vKicm5Jn; 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 S1726006AbeLDSP6 (ORCPT + 99 others); Tue, 4 Dec 2018 13:15:58 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:36330 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725797AbeLDSP6 (ORCPT ); Tue, 4 Dec 2018 13:15:58 -0500 Received: by mail-wm1-f68.google.com with SMTP id a18so10371430wmj.1 for ; Tue, 04 Dec 2018 10:15: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:mime-version :content-transfer-encoding; bh=9PfOlnn1f4fKIRQOM4y1sfcAwAKRvx4cSG/oBf5oTFo=; b=vKicm5Jn9RzceO/lkcOPMygQJ3ycuZ16L95jXTrC9u9VsXYxmM9KbMDZvOPY2kFM3Q Cv5W7/51tcrmTnp5iHhClhR5hpfeqi+4QueXBWzOAUpyO+m+whJeOuCCC/m2GLTb79Rm ZUu7XFiUBlLEjIrVpswdbVZlHrFjw1x4LGNlxVLADirf/HWZcSAfEnglUMLGNPos7XYt xyCD35Oc/xR1fF60IWk3q24dWz1U14FC4aP92IFUO/3MdiMV+kCrOhq+dyI3dojhFsKr Z1fagvjh+lh3rhBf3/RwrOnKmQE9j9YV6V7Y/goaxWuyhH7nNvCawgLmamgyrtWObL5x J1JQ== 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=9PfOlnn1f4fKIRQOM4y1sfcAwAKRvx4cSG/oBf5oTFo=; b=Jvv2yotCm6+gWqMDOskiZ0CvrVj9S+3idUIyqaQOv/PFE+umS2fTu/HHQ0kKfsspWw 9Jn0FmY/EYS0TcpRJ89Jvt33ygYghDYflltINNIEYdr7jiZPi9mJvUMeQ0RG0eF3cf3s zak4XnGyaUV+ye/lsQhTeROr5NA+2eEFIaDPLBSxVK6lJ+VTGLRbQS2k1oPnaAU22xWi 9Sq8ShTt6uTcyhHeQLYw3SyJcBYDyriKoIkm2uJk8CHoBU5hWX86ycF0ZPpQ61+2mq5q +jtpBdfpC9//vRhdp+bj02bWk2pkU0Bd62oHQqo3JWahCVZfz0EGh/aqxg0HO6/F2ViP V71A== X-Gm-Message-State: AA+aEWbns+RpLjyr9Yn+ZQSRg+xWuMpTmWX9FW6QACEHGak1j/DY3zRw /Yh1CSBpqTbnTeB9RYonp1ZXqg== X-Received: by 2002:a1c:ef08:: with SMTP id n8mr14216454wmh.114.1543947356561; Tue, 04 Dec 2018 10:15:56 -0800 (PST) Received: from debian-brgl.home ([2a01:cb1d:af:5b00:6d6c:8493:1ab5:dad7]) by smtp.gmail.com with ESMTPSA id l20sm37942897wrb.93.2018.12.04.10.15.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Dec 2018 10:15:55 -0800 (PST) From: Bartosz Golaszewski To: Mark Brown , Greg Kroah-Hartman , "Rafael J . Wysocki" Cc: linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 0/1] regmap-irq: support chips with separate mask bits for irq edges Date: Tue, 4 Dec 2018 19:15:49 +0100 Message-Id: <20181204181550.29122-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.19.1 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 I'm working on an MFD driver (and its accompanying drivers in various subsystems) for a simple low-power PMIC which exposes a single GPIO line. It has a couple of interrupts all bunched together in two registers and all of them but the one for GPIO are controlled by single mask bits. The GPIO interrupt is configured with two separate bits - one for rising edge and one for falling edge interrupts. Since the device is relatively simple I would really like to avoid having to write the entire irq_chip boiler code if regmap_irq_chip would be perfect in this case. We already have the type mask fields in struct regmap_irq. This patch proposes a simple change that reuses them. If the mask_base and type_base offsets are the same, the enable callback will use the bits written to the type buffer by the set_type callback to only enable the requested edge interrupt. Bartosz Golaszewski (1): regmap: irq: handle HW using separate mask bits for edges drivers/base/regmap/regmap-irq.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) -- 2.19.1