Commit e26f87e5 authored by Chen-Yu Tsai's avatar Chen-Yu Tsai Committed by Lee Jones

mfd: axp20x: Use DEFINE_RES_IRQ to declare resources for mfd_cells

Previously we were open coding the interrupts for the various mfd
cells. This made the code somewhat long due to pretty-formatting.

This patch convert those into one-line declarations with DEFINE_RES_IRQ,
making the code shorter and easier to read.
Signed-off-by: default avatarChen-Yu Tsai <wens@csie.org>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 531a469e
...@@ -181,17 +181,8 @@ static const struct resource axp20x_ac_power_supply_resources[] = { ...@@ -181,17 +181,8 @@ static const struct resource axp20x_ac_power_supply_resources[] = {
}; };
static const struct resource axp20x_pek_resources[] = { static const struct resource axp20x_pek_resources[] = {
{ DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_PEK_RIS_EDGE, "PEK_DBR"),
.name = "PEK_DBR", DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_PEK_FAL_EDGE, "PEK_DBF"),
.start = AXP20X_IRQ_PEK_RIS_EDGE,
.end = AXP20X_IRQ_PEK_RIS_EDGE,
.flags = IORESOURCE_IRQ,
}, {
.name = "PEK_DBF",
.start = AXP20X_IRQ_PEK_FAL_EDGE,
.end = AXP20X_IRQ_PEK_FAL_EDGE,
.flags = IORESOURCE_IRQ,
},
}; };
static const struct resource axp20x_usb_power_supply_resources[] = { static const struct resource axp20x_usb_power_supply_resources[] = {
...@@ -207,93 +198,32 @@ static const struct resource axp22x_usb_power_supply_resources[] = { ...@@ -207,93 +198,32 @@ static const struct resource axp22x_usb_power_supply_resources[] = {
}; };
static const struct resource axp22x_pek_resources[] = { static const struct resource axp22x_pek_resources[] = {
{ DEFINE_RES_IRQ_NAMED(AXP22X_IRQ_PEK_RIS_EDGE, "PEK_DBR"),
.name = "PEK_DBR", DEFINE_RES_IRQ_NAMED(AXP22X_IRQ_PEK_FAL_EDGE, "PEK_DBF"),
.start = AXP22X_IRQ_PEK_RIS_EDGE,
.end = AXP22X_IRQ_PEK_RIS_EDGE,
.flags = IORESOURCE_IRQ,
}, {
.name = "PEK_DBF",
.start = AXP22X_IRQ_PEK_FAL_EDGE,
.end = AXP22X_IRQ_PEK_FAL_EDGE,
.flags = IORESOURCE_IRQ,
},
}; };
static const struct resource axp288_power_button_resources[] = { static const struct resource axp288_power_button_resources[] = {
{ DEFINE_RES_IRQ_NAMED(AXP288_IRQ_POKP, "PEK_DBR"),
.name = "PEK_DBR", DEFINE_RES_IRQ_NAMED(AXP288_IRQ_POKN, "PEK_DBF"),
.start = AXP288_IRQ_POKP,
.end = AXP288_IRQ_POKP,
.flags = IORESOURCE_IRQ,
},
{
.name = "PEK_DBF",
.start = AXP288_IRQ_POKN,
.end = AXP288_IRQ_POKN,
.flags = IORESOURCE_IRQ,
},
}; };
static const struct resource axp288_fuel_gauge_resources[] = { static const struct resource axp288_fuel_gauge_resources[] = {
{ DEFINE_RES_IRQ(AXP288_IRQ_QWBTU),
.start = AXP288_IRQ_QWBTU, DEFINE_RES_IRQ(AXP288_IRQ_WBTU),
.end = AXP288_IRQ_QWBTU, DEFINE_RES_IRQ(AXP288_IRQ_QWBTO),
.flags = IORESOURCE_IRQ, DEFINE_RES_IRQ(AXP288_IRQ_WBTO),
}, DEFINE_RES_IRQ(AXP288_IRQ_WL2),
{ DEFINE_RES_IRQ(AXP288_IRQ_WL1),
.start = AXP288_IRQ_WBTU,
.end = AXP288_IRQ_WBTU,
.flags = IORESOURCE_IRQ,
},
{
.start = AXP288_IRQ_QWBTO,
.end = AXP288_IRQ_QWBTO,
.flags = IORESOURCE_IRQ,
},
{
.start = AXP288_IRQ_WBTO,
.end = AXP288_IRQ_WBTO,
.flags = IORESOURCE_IRQ,
},
{
.start = AXP288_IRQ_WL2,
.end = AXP288_IRQ_WL2,
.flags = IORESOURCE_IRQ,
},
{
.start = AXP288_IRQ_WL1,
.end = AXP288_IRQ_WL1,
.flags = IORESOURCE_IRQ,
},
}; };
static const struct resource axp803_pek_resources[] = { static const struct resource axp803_pek_resources[] = {
{ DEFINE_RES_IRQ_NAMED(AXP803_IRQ_PEK_RIS_EDGE, "PEK_DBR"),
.name = "PEK_DBR", DEFINE_RES_IRQ_NAMED(AXP803_IRQ_PEK_FAL_EDGE, "PEK_DBF"),
.start = AXP803_IRQ_PEK_RIS_EDGE,
.end = AXP803_IRQ_PEK_RIS_EDGE,
.flags = IORESOURCE_IRQ,
}, {
.name = "PEK_DBF",
.start = AXP803_IRQ_PEK_FAL_EDGE,
.end = AXP803_IRQ_PEK_FAL_EDGE,
.flags = IORESOURCE_IRQ,
},
}; };
static const struct resource axp809_pek_resources[] = { static const struct resource axp809_pek_resources[] = {
{ DEFINE_RES_IRQ_NAMED(AXP809_IRQ_PEK_RIS_EDGE, "PEK_DBR"),
.name = "PEK_DBR", DEFINE_RES_IRQ_NAMED(AXP809_IRQ_PEK_FAL_EDGE, "PEK_DBF"),
.start = AXP809_IRQ_PEK_RIS_EDGE,
.end = AXP809_IRQ_PEK_RIS_EDGE,
.flags = IORESOURCE_IRQ,
}, {
.name = "PEK_DBF",
.start = AXP809_IRQ_PEK_FAL_EDGE,
.end = AXP809_IRQ_PEK_FAL_EDGE,
.flags = IORESOURCE_IRQ,
},
}; };
static const struct regmap_config axp152_regmap_config = { static const struct regmap_config axp152_regmap_config = {
...@@ -738,83 +668,26 @@ static const struct mfd_cell axp152_cells[] = { ...@@ -738,83 +668,26 @@ static const struct mfd_cell axp152_cells[] = {
}; };
static const struct resource axp288_adc_resources[] = { static const struct resource axp288_adc_resources[] = {
{ DEFINE_RES_IRQ_NAMED(AXP288_IRQ_GPADC, "GPADC"),
.name = "GPADC",
.start = AXP288_IRQ_GPADC,
.end = AXP288_IRQ_GPADC,
.flags = IORESOURCE_IRQ,
},
}; };
static const struct resource axp288_extcon_resources[] = { static const struct resource axp288_extcon_resources[] = {
{ DEFINE_RES_IRQ(AXP288_IRQ_VBUS_FALL),
.start = AXP288_IRQ_VBUS_FALL, DEFINE_RES_IRQ(AXP288_IRQ_VBUS_RISE),
.end = AXP288_IRQ_VBUS_FALL, DEFINE_RES_IRQ(AXP288_IRQ_MV_CHNG),
.flags = IORESOURCE_IRQ, DEFINE_RES_IRQ(AXP288_IRQ_BC_USB_CHNG),
},
{
.start = AXP288_IRQ_VBUS_RISE,
.end = AXP288_IRQ_VBUS_RISE,
.flags = IORESOURCE_IRQ,
},
{
.start = AXP288_IRQ_MV_CHNG,
.end = AXP288_IRQ_MV_CHNG,
.flags = IORESOURCE_IRQ,
},
{
.start = AXP288_IRQ_BC_USB_CHNG,
.end = AXP288_IRQ_BC_USB_CHNG,
.flags = IORESOURCE_IRQ,
},
}; };
static const struct resource axp288_charger_resources[] = { static const struct resource axp288_charger_resources[] = {
{ DEFINE_RES_IRQ(AXP288_IRQ_OV),
.start = AXP288_IRQ_OV, DEFINE_RES_IRQ(AXP288_IRQ_DONE),
.end = AXP288_IRQ_OV, DEFINE_RES_IRQ(AXP288_IRQ_CHARGING),
.flags = IORESOURCE_IRQ, DEFINE_RES_IRQ(AXP288_IRQ_SAFE_QUIT),
}, DEFINE_RES_IRQ(AXP288_IRQ_SAFE_ENTER),
{ DEFINE_RES_IRQ(AXP288_IRQ_QCBTU),
.start = AXP288_IRQ_DONE, DEFINE_RES_IRQ(AXP288_IRQ_CBTU),
.end = AXP288_IRQ_DONE, DEFINE_RES_IRQ(AXP288_IRQ_QCBTO),
.flags = IORESOURCE_IRQ, DEFINE_RES_IRQ(AXP288_IRQ_CBTO),
},
{
.start = AXP288_IRQ_CHARGING,
.end = AXP288_IRQ_CHARGING,
.flags = IORESOURCE_IRQ,
},
{
.start = AXP288_IRQ_SAFE_QUIT,
.end = AXP288_IRQ_SAFE_QUIT,
.flags = IORESOURCE_IRQ,
},
{
.start = AXP288_IRQ_SAFE_ENTER,
.end = AXP288_IRQ_SAFE_ENTER,
.flags = IORESOURCE_IRQ,
},
{
.start = AXP288_IRQ_QCBTU,
.end = AXP288_IRQ_QCBTU,
.flags = IORESOURCE_IRQ,
},
{
.start = AXP288_IRQ_CBTU,
.end = AXP288_IRQ_CBTU,
.flags = IORESOURCE_IRQ,
},
{
.start = AXP288_IRQ_QCBTO,
.end = AXP288_IRQ_QCBTO,
.flags = IORESOURCE_IRQ,
},
{
.start = AXP288_IRQ_CBTO,
.end = AXP288_IRQ_CBTO,
.flags = IORESOURCE_IRQ,
},
}; };
static const struct mfd_cell axp288_cells[] = { static const struct mfd_cell axp288_cells[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment