mfd: da9063: Use regmap_reg_range
authorMarek Vasut <marek.vasut@gmail.com>
Mon, 11 Jun 2018 11:58:40 +0000 (13:58 +0200)
committerLee Jones <lee.jones@linaro.org>
Wed, 4 Jul 2018 06:15:45 +0000 (07:15 +0100)
Convert the regmap_range tables to use regmap_reg_range() macro.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/da9063-i2c.c

index 29456e807ed43816ab30ee0b84f3acd6ffdae9aa..e9797153bc19aed3f352400c1a50a149e23512c2 100644 (file)
 #include <linux/regulator/of_regulator.h>
 
 static const struct regmap_range da9063_ad_readable_ranges[] = {
-       {
-               .range_min = DA9063_REG_PAGE_CON,
-               .range_max = DA9063_AD_REG_SECOND_D,
-       }, {
-               .range_min = DA9063_REG_SEQ,
-               .range_max = DA9063_REG_ID_32_31,
-       }, {
-               .range_min = DA9063_REG_SEQ_A,
-               .range_max = DA9063_REG_AUTO3_LOW,
-       }, {
-               .range_min = DA9063_REG_T_OFFSET,
-               .range_max = DA9063_AD_REG_GP_ID_19,
-       }, {
-               .range_min = DA9063_REG_CHIP_ID,
-               .range_max = DA9063_REG_CHIP_VARIANT,
-       },
+       regmap_reg_range(DA9063_REG_PAGE_CON, DA9063_AD_REG_SECOND_D),
+       regmap_reg_range(DA9063_REG_SEQ, DA9063_REG_ID_32_31),
+       regmap_reg_range(DA9063_REG_SEQ_A, DA9063_REG_AUTO3_LOW),
+       regmap_reg_range(DA9063_REG_T_OFFSET, DA9063_AD_REG_GP_ID_19),
+       regmap_reg_range(DA9063_REG_CHIP_ID, DA9063_REG_CHIP_VARIANT),
 };
 
 static const struct regmap_range da9063_ad_writeable_ranges[] = {
-       {
-               .range_min = DA9063_REG_PAGE_CON,
-               .range_max = DA9063_REG_PAGE_CON,
-       }, {
-               .range_min = DA9063_REG_FAULT_LOG,
-               .range_max = DA9063_REG_VSYS_MON,
-       }, {
-               .range_min = DA9063_REG_COUNT_S,
-               .range_max = DA9063_AD_REG_ALARM_Y,
-       }, {
-               .range_min = DA9063_REG_SEQ,
-               .range_max = DA9063_REG_ID_32_31,
-       }, {
-               .range_min = DA9063_REG_SEQ_A,
-               .range_max = DA9063_REG_AUTO3_LOW,
-       }, {
-               .range_min = DA9063_REG_CONFIG_I,
-               .range_max = DA9063_AD_REG_MON_REG_4,
-       }, {
-               .range_min = DA9063_AD_REG_GP_ID_0,
-               .range_max = DA9063_AD_REG_GP_ID_19,
-       },
+       regmap_reg_range(DA9063_REG_PAGE_CON, DA9063_REG_PAGE_CON),
+       regmap_reg_range(DA9063_REG_FAULT_LOG, DA9063_REG_VSYS_MON),
+       regmap_reg_range(DA9063_REG_COUNT_S, DA9063_AD_REG_ALARM_Y),
+       regmap_reg_range(DA9063_REG_SEQ, DA9063_REG_ID_32_31),
+       regmap_reg_range(DA9063_REG_SEQ_A, DA9063_REG_AUTO3_LOW),
+       regmap_reg_range(DA9063_REG_CONFIG_I, DA9063_AD_REG_MON_REG_4),
+       regmap_reg_range(DA9063_AD_REG_GP_ID_0, DA9063_AD_REG_GP_ID_19),
 };
 
 static const struct regmap_range da9063_ad_volatile_ranges[] = {
-       {
-               .range_min = DA9063_REG_PAGE_CON,
-               .range_max = DA9063_REG_EVENT_D,
-       }, {
-               .range_min = DA9063_REG_CONTROL_A,
-               .range_max = DA9063_REG_CONTROL_B,
-       }, {
-               .range_min = DA9063_REG_CONTROL_E,
-               .range_max = DA9063_REG_CONTROL_F,
-       }, {
-               .range_min = DA9063_REG_BCORE2_CONT,
-               .range_max = DA9063_REG_LDO11_CONT,
-       }, {
-               .range_min = DA9063_REG_DVC_1,
-               .range_max = DA9063_REG_ADC_MAN,
-       }, {
-               .range_min = DA9063_REG_ADC_RES_L,
-               .range_max = DA9063_AD_REG_SECOND_D,
-       }, {
-               .range_min = DA9063_REG_SEQ,
-               .range_max = DA9063_REG_SEQ,
-       }, {
-               .range_min = DA9063_REG_EN_32K,
-               .range_max = DA9063_REG_EN_32K,
-       }, {
-               .range_min = DA9063_AD_REG_MON_REG_5,
-               .range_max = DA9063_AD_REG_MON_REG_6,
-       },
+       regmap_reg_range(DA9063_REG_PAGE_CON, DA9063_REG_EVENT_D),
+       regmap_reg_range(DA9063_REG_CONTROL_A, DA9063_REG_CONTROL_B),
+       regmap_reg_range(DA9063_REG_CONTROL_E, DA9063_REG_CONTROL_F),
+       regmap_reg_range(DA9063_REG_BCORE2_CONT, DA9063_REG_LDO11_CONT),
+       regmap_reg_range(DA9063_REG_DVC_1, DA9063_REG_ADC_MAN),
+       regmap_reg_range(DA9063_REG_ADC_RES_L, DA9063_AD_REG_SECOND_D),
+       regmap_reg_range(DA9063_REG_SEQ, DA9063_REG_SEQ),
+       regmap_reg_range(DA9063_REG_EN_32K, DA9063_REG_EN_32K),
+       regmap_reg_range(DA9063_AD_REG_MON_REG_5, DA9063_AD_REG_MON_REG_6),
 };
 
 static const struct regmap_access_table da9063_ad_readable_table = {
@@ -119,78 +74,33 @@ static const struct regmap_access_table da9063_ad_volatile_table = {
 };
 
 static const struct regmap_range da9063_bb_readable_ranges[] = {
-       {
-               .range_min = DA9063_REG_PAGE_CON,
-               .range_max = DA9063_BB_REG_SECOND_D,
-       }, {
-               .range_min = DA9063_REG_SEQ,
-               .range_max = DA9063_REG_ID_32_31,
-       }, {
-               .range_min = DA9063_REG_SEQ_A,
-               .range_max = DA9063_REG_AUTO3_LOW,
-       }, {
-               .range_min = DA9063_REG_T_OFFSET,
-               .range_max = DA9063_BB_REG_GP_ID_19,
-       }, {
-               .range_min = DA9063_REG_CHIP_ID,
-               .range_max = DA9063_REG_CHIP_VARIANT,
-       },
+       regmap_reg_range(DA9063_REG_PAGE_CON, DA9063_BB_REG_SECOND_D),
+       regmap_reg_range(DA9063_REG_SEQ, DA9063_REG_ID_32_31),
+       regmap_reg_range(DA9063_REG_SEQ_A, DA9063_REG_AUTO3_LOW),
+       regmap_reg_range(DA9063_REG_T_OFFSET, DA9063_BB_REG_GP_ID_19),
+       regmap_reg_range(DA9063_REG_CHIP_ID, DA9063_REG_CHIP_VARIANT),
 };
 
 static const struct regmap_range da9063_bb_writeable_ranges[] = {
-       {
-               .range_min = DA9063_REG_PAGE_CON,
-               .range_max = DA9063_REG_PAGE_CON,
-       }, {
-               .range_min = DA9063_REG_FAULT_LOG,
-               .range_max = DA9063_REG_VSYS_MON,
-       }, {
-               .range_min = DA9063_REG_COUNT_S,
-               .range_max = DA9063_BB_REG_ALARM_Y,
-       }, {
-               .range_min = DA9063_REG_SEQ,
-               .range_max = DA9063_REG_ID_32_31,
-       }, {
-               .range_min = DA9063_REG_SEQ_A,
-               .range_max = DA9063_REG_AUTO3_LOW,
-       }, {
-               .range_min = DA9063_REG_CONFIG_I,
-               .range_max = DA9063_BB_REG_MON_REG_4,
-       }, {
-               .range_min = DA9063_BB_REG_GP_ID_0,
-               .range_max = DA9063_BB_REG_GP_ID_19,
-       },
+       regmap_reg_range(DA9063_REG_PAGE_CON, DA9063_REG_PAGE_CON),
+       regmap_reg_range(DA9063_REG_FAULT_LOG, DA9063_REG_VSYS_MON),
+       regmap_reg_range(DA9063_REG_COUNT_S, DA9063_BB_REG_ALARM_Y),
+       regmap_reg_range(DA9063_REG_SEQ, DA9063_REG_ID_32_31),
+       regmap_reg_range(DA9063_REG_SEQ_A, DA9063_REG_AUTO3_LOW),
+       regmap_reg_range(DA9063_REG_CONFIG_I, DA9063_BB_REG_MON_REG_4),
+       regmap_reg_range(DA9063_BB_REG_GP_ID_0, DA9063_BB_REG_GP_ID_19),
 };
 
 static const struct regmap_range da9063_bb_volatile_ranges[] = {
-       {
-               .range_min = DA9063_REG_PAGE_CON,
-               .range_max = DA9063_REG_EVENT_D,
-       }, {
-               .range_min = DA9063_REG_CONTROL_A,
-               .range_max = DA9063_REG_CONTROL_B,
-       }, {
-               .range_min = DA9063_REG_CONTROL_E,
-               .range_max = DA9063_REG_CONTROL_F,
-       }, {
-               .range_min = DA9063_REG_BCORE2_CONT,
-               .range_max = DA9063_REG_LDO11_CONT,
-       }, {
-               .range_min = DA9063_REG_DVC_1,
-               .range_max = DA9063_REG_ADC_MAN,
-       }, {
-               .range_min = DA9063_REG_ADC_RES_L,
-               .range_max = DA9063_BB_REG_SECOND_D,
-       }, {
-               .range_min = DA9063_REG_SEQ,
-               .range_max = DA9063_REG_SEQ,
-       }, {
-               .range_min = DA9063_REG_EN_32K,
-               .range_max = DA9063_REG_EN_32K,
-       }, {
-               .range_min = DA9063_BB_REG_MON_REG_5,
-               .range_max = DA9063_BB_REG_MON_REG_6,
-       },
+       regmap_reg_range(DA9063_REG_PAGE_CON, DA9063_REG_EVENT_D),
+       regmap_reg_range(DA9063_REG_CONTROL_A, DA9063_REG_CONTROL_B),
+       regmap_reg_range(DA9063_REG_CONTROL_E, DA9063_REG_CONTROL_F),
+       regmap_reg_range(DA9063_REG_BCORE2_CONT, DA9063_REG_LDO11_CONT),
+       regmap_reg_range(DA9063_REG_DVC_1, DA9063_REG_ADC_MAN),
+       regmap_reg_range(DA9063_REG_ADC_RES_L, DA9063_BB_REG_SECOND_D),
+       regmap_reg_range(DA9063_REG_SEQ, DA9063_REG_SEQ),
+       regmap_reg_range(DA9063_REG_EN_32K, DA9063_REG_EN_32K),
+       regmap_reg_range(DA9063_BB_REG_MON_REG_5, DA9063_BB_REG_MON_REG_6),
 };
 
 static const struct regmap_access_table da9063_bb_readable_table = {