lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1540894081-31270-2-git-send-email-tony.xie@rock-chips.com>
Date:   Tue, 30 Oct 2018 18:07:56 +0800
From:   Tony Xie <tony.xie@...k-chips.com>
To:     heiko@...ech.de
Cc:     broonie@...nel.org, lee.jones@...aro.org, robh+dt@...nel.org,
        mark.rutland@....com, a.zummo@...ertech.it,
        alexandre.belloni@...tlin.com, sboyd@...nel.org,
        linux-clk@...r.kernel.org, linux-rtc@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org,
        linux-rockchip@...ts.infradead.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, chenjh@...k-chips.com,
        xsf@...k-chips.com, zhangqing@...k-chips.com,
        huangtao@...k-chips.com, tony.xie@...k-chips.com
Subject: [PATCH v6 1/6] regmap: add a new macro:REGMAP_IRQ_REG_LINE(_id, _reg_bits)

if there are lots of irqs for a device and the register addresses for these
irqs is continuous, we can use this macro to initialize regmap_irq value.

Signed-off-by: Tony Xie <tony.xie@...k-chips.com>
---
 include/linux/regmap.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 4f38068..a468b81 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -1047,6 +1047,12 @@ struct regmap_irq {
 #define REGMAP_IRQ_REG(_irq, _off, _mask)		\
 	[_irq] = { .reg_offset = (_off), .mask = (_mask) }
 
+#define REGMAP_IRQ_REG_LINE(_id, _reg_bits) \
+	[_id] = {				\
+		.mask = BIT((_id) % (_reg_bits)),	\
+		.reg_offset = (_id) / (_reg_bits),	\
+	}
+
 /**
  * struct regmap_irq_chip - Description of a generic regmap irq_chip.
  *
-- 
1.9.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ