Skip to content

Commit bc7d3a0

Browse files
Dzmitry Sankouskisre
authored andcommitted
power: supply: max77705_charger: use REGMAP_IRQ_REG_LINE macro
Refactor regmap_irq declarations with REGMAP_IRQ_REG_LINE saves a few lines on definitions. Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
1 parent 12a1185 commit bc7d3a0

2 files changed

Lines changed: 24 additions & 34 deletions

File tree

drivers/power/supply/max77705_charger.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ static irqreturn_t max77705_chgin_irq(int irq, void *irq_drv_data)
5050
}
5151

5252
static const struct regmap_irq max77705_charger_irqs[] = {
53-
{ .mask = MAX77705_BYP_IM, },
54-
{ .mask = MAX77705_INP_LIMIT_IM, },
55-
{ .mask = MAX77705_BATP_IM, },
56-
{ .mask = MAX77705_BAT_IM, },
57-
{ .mask = MAX77705_CHG_IM, },
58-
{ .mask = MAX77705_WCIN_IM, },
59-
{ .mask = MAX77705_CHGIN_IM, },
60-
{ .mask = MAX77705_AICL_IM, },
53+
REGMAP_IRQ_REG_LINE(MAX77705_BYP_I, BITS_PER_BYTE),
54+
REGMAP_IRQ_REG_LINE(MAX77705_INP_LIMIT_I, BITS_PER_BYTE),
55+
REGMAP_IRQ_REG_LINE(MAX77705_BATP_I, BITS_PER_BYTE),
56+
REGMAP_IRQ_REG_LINE(MAX77705_BAT_I, BITS_PER_BYTE),
57+
REGMAP_IRQ_REG_LINE(MAX77705_CHG_I, BITS_PER_BYTE),
58+
REGMAP_IRQ_REG_LINE(MAX77705_WCIN_I, BITS_PER_BYTE),
59+
REGMAP_IRQ_REG_LINE(MAX77705_CHGIN_I, BITS_PER_BYTE),
60+
REGMAP_IRQ_REG_LINE(MAX77705_AICL_I, BITS_PER_BYTE),
6161
};
6262

6363
static struct regmap_irq_chip max77705_charger_irq_chip = {

include/linux/power/max77705_charger.h

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,24 @@
1212
#include <linux/regmap.h>
1313

1414
/* MAX77705_CHG_REG_CHG_INT */
15-
#define MAX77705_BYP_I BIT(0)
16-
#define MAX77705_INP_LIMIT_I BIT(1)
17-
#define MAX77705_BATP_I BIT(2)
18-
#define MAX77705_BAT_I BIT(3)
19-
#define MAX77705_CHG_I BIT(4)
20-
#define MAX77705_WCIN_I BIT(5)
21-
#define MAX77705_CHGIN_I BIT(6)
22-
#define MAX77705_AICL_I BIT(7)
23-
24-
/* MAX77705_CHG_REG_CHG_INT_MASK */
25-
#define MAX77705_BYP_IM BIT(0)
26-
#define MAX77705_INP_LIMIT_IM BIT(1)
27-
#define MAX77705_BATP_IM BIT(2)
28-
#define MAX77705_BAT_IM BIT(3)
29-
#define MAX77705_CHG_IM BIT(4)
30-
#define MAX77705_WCIN_IM BIT(5)
31-
#define MAX77705_CHGIN_IM BIT(6)
32-
#define MAX77705_AICL_IM BIT(7)
15+
#define MAX77705_BYP_I (0)
16+
#define MAX77705_INP_LIMIT_I (1)
17+
#define MAX77705_BATP_I (2)
18+
#define MAX77705_BAT_I (3)
19+
#define MAX77705_CHG_I (4)
20+
#define MAX77705_WCIN_I (5)
21+
#define MAX77705_CHGIN_I (6)
22+
#define MAX77705_AICL_I (7)
3323

3424
/* MAX77705_CHG_REG_CHG_INT_OK */
35-
#define MAX77705_BYP_OK BIT(0)
36-
#define MAX77705_DISQBAT_OK BIT(1)
37-
#define MAX77705_BATP_OK BIT(2)
38-
#define MAX77705_BAT_OK BIT(3)
39-
#define MAX77705_CHG_OK BIT(4)
40-
#define MAX77705_WCIN_OK BIT(5)
41-
#define MAX77705_CHGIN_OK BIT(6)
42-
#define MAX77705_AICL_OK BIT(7)
25+
#define MAX77705_BYP_OK BIT(MAX77705_BYP_I)
26+
#define MAX77705_DISQBAT_OK BIT(MAX77705_INP_LIMIT_I)
27+
#define MAX77705_BATP_OK BIT(MAX77705_BATP_I)
28+
#define MAX77705_BAT_OK BIT(MAX77705_BAT_I)
29+
#define MAX77705_CHG_OK BIT(MAX77705_CHG_I)
30+
#define MAX77705_WCIN_OK BIT(MAX77705_WCIN_I)
31+
#define MAX77705_CHGIN_OK BIT(MAX77705_CHGIN_I)
32+
#define MAX77705_AICL_OK BIT(MAX77705_AICL_I)
4333

4434
/* MAX77705_CHG_REG_DETAILS_00 */
4535
#define MAX77705_BATP_DTLS BIT(0)

0 commit comments

Comments
 (0)