mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 14:41:22 -05:00
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>
This commit is contained in:
committed by
Sebastian Reichel
parent
12a1185a06
commit
bc7d3a0f92
@@ -50,14 +50,14 @@ static irqreturn_t max77705_chgin_irq(int irq, void *irq_drv_data)
|
||||
}
|
||||
|
||||
static const struct regmap_irq max77705_charger_irqs[] = {
|
||||
{ .mask = MAX77705_BYP_IM, },
|
||||
{ .mask = MAX77705_INP_LIMIT_IM, },
|
||||
{ .mask = MAX77705_BATP_IM, },
|
||||
{ .mask = MAX77705_BAT_IM, },
|
||||
{ .mask = MAX77705_CHG_IM, },
|
||||
{ .mask = MAX77705_WCIN_IM, },
|
||||
{ .mask = MAX77705_CHGIN_IM, },
|
||||
{ .mask = MAX77705_AICL_IM, },
|
||||
REGMAP_IRQ_REG_LINE(MAX77705_BYP_I, BITS_PER_BYTE),
|
||||
REGMAP_IRQ_REG_LINE(MAX77705_INP_LIMIT_I, BITS_PER_BYTE),
|
||||
REGMAP_IRQ_REG_LINE(MAX77705_BATP_I, BITS_PER_BYTE),
|
||||
REGMAP_IRQ_REG_LINE(MAX77705_BAT_I, BITS_PER_BYTE),
|
||||
REGMAP_IRQ_REG_LINE(MAX77705_CHG_I, BITS_PER_BYTE),
|
||||
REGMAP_IRQ_REG_LINE(MAX77705_WCIN_I, BITS_PER_BYTE),
|
||||
REGMAP_IRQ_REG_LINE(MAX77705_CHGIN_I, BITS_PER_BYTE),
|
||||
REGMAP_IRQ_REG_LINE(MAX77705_AICL_I, BITS_PER_BYTE),
|
||||
};
|
||||
|
||||
static struct regmap_irq_chip max77705_charger_irq_chip = {
|
||||
|
||||
@@ -12,34 +12,24 @@
|
||||
#include <linux/regmap.h>
|
||||
|
||||
/* MAX77705_CHG_REG_CHG_INT */
|
||||
#define MAX77705_BYP_I BIT(0)
|
||||
#define MAX77705_INP_LIMIT_I BIT(1)
|
||||
#define MAX77705_BATP_I BIT(2)
|
||||
#define MAX77705_BAT_I BIT(3)
|
||||
#define MAX77705_CHG_I BIT(4)
|
||||
#define MAX77705_WCIN_I BIT(5)
|
||||
#define MAX77705_CHGIN_I BIT(6)
|
||||
#define MAX77705_AICL_I BIT(7)
|
||||
|
||||
/* MAX77705_CHG_REG_CHG_INT_MASK */
|
||||
#define MAX77705_BYP_IM BIT(0)
|
||||
#define MAX77705_INP_LIMIT_IM BIT(1)
|
||||
#define MAX77705_BATP_IM BIT(2)
|
||||
#define MAX77705_BAT_IM BIT(3)
|
||||
#define MAX77705_CHG_IM BIT(4)
|
||||
#define MAX77705_WCIN_IM BIT(5)
|
||||
#define MAX77705_CHGIN_IM BIT(6)
|
||||
#define MAX77705_AICL_IM BIT(7)
|
||||
#define MAX77705_BYP_I (0)
|
||||
#define MAX77705_INP_LIMIT_I (1)
|
||||
#define MAX77705_BATP_I (2)
|
||||
#define MAX77705_BAT_I (3)
|
||||
#define MAX77705_CHG_I (4)
|
||||
#define MAX77705_WCIN_I (5)
|
||||
#define MAX77705_CHGIN_I (6)
|
||||
#define MAX77705_AICL_I (7)
|
||||
|
||||
/* MAX77705_CHG_REG_CHG_INT_OK */
|
||||
#define MAX77705_BYP_OK BIT(0)
|
||||
#define MAX77705_DISQBAT_OK BIT(1)
|
||||
#define MAX77705_BATP_OK BIT(2)
|
||||
#define MAX77705_BAT_OK BIT(3)
|
||||
#define MAX77705_CHG_OK BIT(4)
|
||||
#define MAX77705_WCIN_OK BIT(5)
|
||||
#define MAX77705_CHGIN_OK BIT(6)
|
||||
#define MAX77705_AICL_OK BIT(7)
|
||||
#define MAX77705_BYP_OK BIT(MAX77705_BYP_I)
|
||||
#define MAX77705_DISQBAT_OK BIT(MAX77705_INP_LIMIT_I)
|
||||
#define MAX77705_BATP_OK BIT(MAX77705_BATP_I)
|
||||
#define MAX77705_BAT_OK BIT(MAX77705_BAT_I)
|
||||
#define MAX77705_CHG_OK BIT(MAX77705_CHG_I)
|
||||
#define MAX77705_WCIN_OK BIT(MAX77705_WCIN_I)
|
||||
#define MAX77705_CHGIN_OK BIT(MAX77705_CHGIN_I)
|
||||
#define MAX77705_AICL_OK BIT(MAX77705_AICL_I)
|
||||
|
||||
/* MAX77705_CHG_REG_DETAILS_00 */
|
||||
#define MAX77705_BATP_DTLS BIT(0)
|
||||
|
||||
Reference in New Issue
Block a user