struct device *dev;
 };
 
+struct regmap_test_param {
+       enum regcache_type cache;
+       enum regmap_endian val_endian;
+};
+
 static void get_changed_bytes(void *orig, void *new, size_t size)
 {
        char *o = orig;
        .val_bits = sizeof(unsigned int) * 8,
 };
 
-struct regcache_types {
-       enum regcache_type type;
-       const char *name;
-};
+static const char *regcache_type_name(enum regcache_type type)
+{
+       switch (type) {
+       case REGCACHE_NONE:
+               return "none";
+       case REGCACHE_FLAT:
+               return "flat";
+       case REGCACHE_RBTREE:
+               return "rbtree";
+       case REGCACHE_MAPLE:
+               return "maple";
+       default:
+               return NULL;
+       }
+}
+
+static const char *regmap_endian_name(enum regmap_endian endian)
+{
+       switch (endian) {
+       case REGMAP_ENDIAN_BIG:
+               return "big";
+       case REGMAP_ENDIAN_LITTLE:
+               return "little";
+       case REGMAP_ENDIAN_DEFAULT:
+               return "default";
+       case REGMAP_ENDIAN_NATIVE:
+               return "native";
+       default:
+               return NULL;
+       }
+}
 
-static void case_to_desc(const struct regcache_types *t, char *desc)
+static void param_to_desc(const struct regmap_test_param *param, char *desc)
 {
-       strcpy(desc, t->name);
+       snprintf(desc, KUNIT_PARAM_DESC_SIZE, "%s-%s",
+                regcache_type_name(param->cache),
+                regmap_endian_name(param->val_endian));
 }
 
-static const struct regcache_types regcache_types_list[] = {
-       { REGCACHE_NONE, "none" },
-       { REGCACHE_FLAT, "flat" },
-       { REGCACHE_RBTREE, "rbtree" },
-       { REGCACHE_MAPLE, "maple" },
+static const struct regmap_test_param regcache_types_list[] = {
+       { .cache = REGCACHE_NONE },
+       { .cache = REGCACHE_FLAT },
+       { .cache = REGCACHE_RBTREE },
+       { .cache = REGCACHE_MAPLE },
 };
 
-KUNIT_ARRAY_PARAM(regcache_types, regcache_types_list, case_to_desc);
+KUNIT_ARRAY_PARAM(regcache_types, regcache_types_list, param_to_desc);
 
-static const struct regcache_types real_cache_types_list[] = {
-       { REGCACHE_FLAT, "flat" },
-       { REGCACHE_RBTREE, "rbtree" },
-       { REGCACHE_MAPLE, "maple" },
+static const struct regmap_test_param real_cache_types_list[] = {
+       { .cache = REGCACHE_FLAT },
+       { .cache = REGCACHE_RBTREE },
+       { .cache = REGCACHE_MAPLE },
 };
 
-KUNIT_ARRAY_PARAM(real_cache_types, real_cache_types_list, case_to_desc);
+KUNIT_ARRAY_PARAM(real_cache_types, real_cache_types_list, param_to_desc);
 
-static const struct regcache_types sparse_cache_types_list[] = {
-       { REGCACHE_RBTREE, "rbtree" },
-       { REGCACHE_MAPLE, "maple" },
+static const struct regmap_test_param sparse_cache_types_list[] = {
+       { .cache = REGCACHE_RBTREE },
+       { .cache = REGCACHE_MAPLE },
 };
 
-KUNIT_ARRAY_PARAM(sparse_cache_types, sparse_cache_types_list, case_to_desc);
+KUNIT_ARRAY_PARAM(sparse_cache_types, sparse_cache_types_list, param_to_desc);
 
 static struct regmap *gen_regmap(struct kunit *test,
                                 struct regmap_config *config,
                                 struct regmap_ram_data **data)
 {
+       const struct regmap_test_param *param = test->param_value;
        struct regmap_test_priv *priv = test->priv;
        unsigned int *buf;
        struct regmap *ret;
        int i;
        struct reg_default *defaults;
 
+       config->cache_type = param->cache;
        config->disable_locking = config->cache_type == REGCACHE_RBTREE ||
                                        config->cache_type == REGCACHE_MAPLE;
 
 
 static void basic_read_write(struct kunit *test)
 {
-       struct regcache_types *t = (struct regcache_types *)test->param_value;
        struct regmap *map;
        struct regmap_config config;
        struct regmap_ram_data *data;
        unsigned int val, rval;
 
        config = test_regmap_config;
-       config.cache_type = t->type;
 
        map = gen_regmap(test, &config, &data);
        KUNIT_ASSERT_FALSE(test, IS_ERR(map));
        KUNIT_EXPECT_EQ(test, val, rval);
 
        /* If using a cache the cache satisfied the read */
-       KUNIT_EXPECT_EQ(test, t->type == REGCACHE_NONE, data->read[0]);
+       KUNIT_EXPECT_EQ(test, config.cache_type == REGCACHE_NONE, data->read[0]);
 
        regmap_exit(map);
 }
 
 static void bulk_write(struct kunit *test)
 {
-       struct regcache_types *t = (struct regcache_types *)test->param_value;
        struct regmap *map;
        struct regmap_config config;
        struct regmap_ram_data *data;
        int i;
 
        config = test_regmap_config;
-       config.cache_type = t->type;
 
        map = gen_regmap(test, &config, &data);
        KUNIT_ASSERT_FALSE(test, IS_ERR(map));
 
        /* If using a cache the cache satisfied the read */
        for (i = 0; i < BLOCK_TEST_SIZE; i++)
-               KUNIT_EXPECT_EQ(test, t->type == REGCACHE_NONE, data->read[i]);
+               KUNIT_EXPECT_EQ(test, config.cache_type == REGCACHE_NONE, data->read[i]);
 
        regmap_exit(map);
 }
 
 static void bulk_read(struct kunit *test)
 {
-       struct regcache_types *t = (struct regcache_types *)test->param_value;
        struct regmap *map;
        struct regmap_config config;
        struct regmap_ram_data *data;
        int i;
 
        config = test_regmap_config;
-       config.cache_type = t->type;
 
        map = gen_regmap(test, &config, &data);
        KUNIT_ASSERT_FALSE(test, IS_ERR(map));
 
        /* If using a cache the cache satisfied the read */
        for (i = 0; i < BLOCK_TEST_SIZE; i++)
-               KUNIT_EXPECT_EQ(test, t->type == REGCACHE_NONE, data->read[i]);
+               KUNIT_EXPECT_EQ(test, config.cache_type == REGCACHE_NONE, data->read[i]);
 
        regmap_exit(map);
 }
 
 static void write_readonly(struct kunit *test)
 {
-       struct regcache_types *t = (struct regcache_types *)test->param_value;
        struct regmap *map;
        struct regmap_config config;
        struct regmap_ram_data *data;
        int i;
 
        config = test_regmap_config;
-       config.cache_type = t->type;
        config.num_reg_defaults = BLOCK_TEST_SIZE;
        config.writeable_reg = reg_5_false;
 
 
 static void read_writeonly(struct kunit *test)
 {
-       struct regcache_types *t = (struct regcache_types *)test->param_value;
        struct regmap *map;
        struct regmap_config config;
        struct regmap_ram_data *data;
        int i;
 
        config = test_regmap_config;
-       config.cache_type = t->type;
        config.readable_reg = reg_5_false;
 
        map = gen_regmap(test, &config, &data);
         * fail if we aren't using the flat cache.
         */
        for (i = 0; i < BLOCK_TEST_SIZE; i++) {
-               if (t->type != REGCACHE_FLAT) {
+               if (config.cache_type != REGCACHE_FLAT) {
                        KUNIT_EXPECT_EQ(test, i != 5,
                                        regmap_read(map, i, &val) == 0);
                } else {
 
 static void reg_defaults(struct kunit *test)
 {
-       struct regcache_types *t = (struct regcache_types *)test->param_value;
        struct regmap *map;
        struct regmap_config config;
        struct regmap_ram_data *data;
        int i;
 
        config = test_regmap_config;
-       config.cache_type = t->type;
        config.num_reg_defaults = BLOCK_TEST_SIZE;
 
        map = gen_regmap(test, &config, &data);
 
        /* The data should have been read from cache if there was one */
        for (i = 0; i < BLOCK_TEST_SIZE; i++)
-               KUNIT_EXPECT_EQ(test, t->type == REGCACHE_NONE, data->read[i]);
+               KUNIT_EXPECT_EQ(test, config.cache_type == REGCACHE_NONE, data->read[i]);
 }
 
 static void reg_defaults_read_dev(struct kunit *test)
 {
-       struct regcache_types *t = (struct regcache_types *)test->param_value;
        struct regmap *map;
        struct regmap_config config;
        struct regmap_ram_data *data;
        int i;
 
        config = test_regmap_config;
-       config.cache_type = t->type;
        config.num_reg_defaults_raw = BLOCK_TEST_SIZE;
 
        map = gen_regmap(test, &config, &data);
 
        /* We should have read the cache defaults back from the map */
        for (i = 0; i < BLOCK_TEST_SIZE; i++) {
-               KUNIT_EXPECT_EQ(test, t->type != REGCACHE_NONE, data->read[i]);
+               KUNIT_EXPECT_EQ(test, config.cache_type != REGCACHE_NONE, data->read[i]);
                data->read[i] = false;
        }
 
 
        /* The data should have been read from cache if there was one */
        for (i = 0; i < BLOCK_TEST_SIZE; i++)
-               KUNIT_EXPECT_EQ(test, t->type == REGCACHE_NONE, data->read[i]);
+               KUNIT_EXPECT_EQ(test, config.cache_type == REGCACHE_NONE, data->read[i]);
 }
 
 static void register_patch(struct kunit *test)
 {
-       struct regcache_types *t = (struct regcache_types *)test->param_value;
        struct regmap *map;
        struct regmap_config config;
        struct regmap_ram_data *data;
 
        /* We need defaults so readback works */
        config = test_regmap_config;
-       config.cache_type = t->type;
        config.num_reg_defaults = BLOCK_TEST_SIZE;
 
        map = gen_regmap(test, &config, &data);
 
 static void stride(struct kunit *test)
 {
-       struct regcache_types *t = (struct regcache_types *)test->param_value;
        struct regmap *map;
        struct regmap_config config;
        struct regmap_ram_data *data;
        int i;
 
        config = test_regmap_config;
-       config.cache_type = t->type;
        config.reg_stride = 2;
        config.num_reg_defaults = BLOCK_TEST_SIZE / 2;
 
                } else {
                        KUNIT_EXPECT_EQ(test, 0, regmap_read(map, i, &rval));
                        KUNIT_EXPECT_EQ(test, data->vals[i], rval);
-                       KUNIT_EXPECT_EQ(test, t->type == REGCACHE_NONE,
+                       KUNIT_EXPECT_EQ(test, config.cache_type == REGCACHE_NONE,
                                        data->read[i]);
 
                        KUNIT_EXPECT_EQ(test, 0, regmap_write(map, i, rval));
 
 static void basic_ranges(struct kunit *test)
 {
-       struct regcache_types *t = (struct regcache_types *)test->param_value;
        struct regmap *map;
        struct regmap_config config;
        struct regmap_ram_data *data;
        int i;
 
        config = test_regmap_config;
-       config.cache_type = t->type;
        config.volatile_reg = test_range_all_volatile;
        config.ranges = &test_range;
        config.num_ranges = 1;
 /* Try to stress dynamic creation of cache data structures */
 static void stress_insert(struct kunit *test)
 {
-       struct regcache_types *t = (struct regcache_types *)test->param_value;
        struct regmap *map;
        struct regmap_config config;
        struct regmap_ram_data *data;
        int i;
 
        config = test_regmap_config;
-       config.cache_type = t->type;
        config.max_register = 300;
 
        map = gen_regmap(test, &config, &data);
        for (i = 0; i < config.max_register; i ++) {
                KUNIT_EXPECT_EQ(test, 0, regmap_read(map, i, &rval));
                KUNIT_EXPECT_EQ(test, rval, vals[i]);
-               KUNIT_EXPECT_EQ(test, t->type == REGCACHE_NONE, data->read[i]);
+               KUNIT_EXPECT_EQ(test, config.cache_type == REGCACHE_NONE, data->read[i]);
        }
 
        regmap_exit(map);
 
 static void cache_bypass(struct kunit *test)
 {
-       struct regcache_types *t = (struct regcache_types *)test->param_value;
        struct regmap *map;
        struct regmap_config config;
        struct regmap_ram_data *data;
        unsigned int val, rval;
 
        config = test_regmap_config;
-       config.cache_type = t->type;
 
        map = gen_regmap(test, &config, &data);
        KUNIT_ASSERT_FALSE(test, IS_ERR(map));
 
 static void cache_sync(struct kunit *test)
 {
-       struct regcache_types *t = (struct regcache_types *)test->param_value;
        struct regmap *map;
        struct regmap_config config;
        struct regmap_ram_data *data;
        int i;
 
        config = test_regmap_config;
-       config.cache_type = t->type;
 
        map = gen_regmap(test, &config, &data);
        KUNIT_ASSERT_FALSE(test, IS_ERR(map));
 
 static void cache_sync_defaults(struct kunit *test)
 {
-       struct regcache_types *t = (struct regcache_types *)test->param_value;
        struct regmap *map;
        struct regmap_config config;
        struct regmap_ram_data *data;
        int i;
 
        config = test_regmap_config;
-       config.cache_type = t->type;
        config.num_reg_defaults = BLOCK_TEST_SIZE;
 
        map = gen_regmap(test, &config, &data);
 
 static void cache_sync_readonly(struct kunit *test)
 {
-       struct regcache_types *t = (struct regcache_types *)test->param_value;
        struct regmap *map;
        struct regmap_config config;
        struct regmap_ram_data *data;
        int i;
 
        config = test_regmap_config;
-       config.cache_type = t->type;
        config.writeable_reg = reg_5_false;
 
        map = gen_regmap(test, &config, &data);
 
 static void cache_sync_patch(struct kunit *test)
 {
-       struct regcache_types *t = (struct regcache_types *)test->param_value;
        struct regmap *map;
        struct regmap_config config;
        struct regmap_ram_data *data;
 
        /* We need defaults so readback works */
        config = test_regmap_config;
-       config.cache_type = t->type;
        config.num_reg_defaults = BLOCK_TEST_SIZE;
 
        map = gen_regmap(test, &config, &data);
 
 static void cache_drop(struct kunit *test)
 {
-       struct regcache_types *t = (struct regcache_types *)test->param_value;
        struct regmap *map;
        struct regmap_config config;
        struct regmap_ram_data *data;
        int i;
 
        config = test_regmap_config;
-       config.cache_type = t->type;
        config.num_reg_defaults = BLOCK_TEST_SIZE;
 
        map = gen_regmap(test, &config, &data);
 
 static void cache_present(struct kunit *test)
 {
-       struct regcache_types *t = (struct regcache_types *)test->param_value;
        struct regmap *map;
        struct regmap_config config;
        struct regmap_ram_data *data;
        int i;
 
        config = test_regmap_config;
-       config.cache_type = t->type;
 
        map = gen_regmap(test, &config, &data);
        KUNIT_ASSERT_FALSE(test, IS_ERR(map));
 /* Check that caching the window register works with sync */
 static void cache_range_window_reg(struct kunit *test)
 {
-       struct regcache_types *t = (struct regcache_types *)test->param_value;
        struct regmap *map;
        struct regmap_config config;
        struct regmap_ram_data *data;
        int i;
 
        config = test_regmap_config;
-       config.cache_type = t->type;
        config.volatile_reg = test_range_window_volatile;
        config.ranges = &test_range;
        config.num_ranges = 1;
        KUNIT_ASSERT_EQ(test, val, 2);
 }
 
-struct raw_test_types {
-       const char *name;
-
-       enum regcache_type cache_type;
-       enum regmap_endian val_endian;
-};
-
-static void raw_to_desc(const struct raw_test_types *t, char *desc)
-{
-       strcpy(desc, t->name);
-}
-
-static const struct raw_test_types raw_types_list[] = {
-       { "none-little",   REGCACHE_NONE,   REGMAP_ENDIAN_LITTLE },
-       { "none-big",      REGCACHE_NONE,   REGMAP_ENDIAN_BIG },
-       { "flat-little",   REGCACHE_FLAT,   REGMAP_ENDIAN_LITTLE },
-       { "flat-big",      REGCACHE_FLAT,   REGMAP_ENDIAN_BIG },
-       { "rbtree-little", REGCACHE_RBTREE, REGMAP_ENDIAN_LITTLE },
-       { "rbtree-big",    REGCACHE_RBTREE, REGMAP_ENDIAN_BIG },
-       { "maple-little",  REGCACHE_MAPLE,  REGMAP_ENDIAN_LITTLE },
-       { "maple-big",     REGCACHE_MAPLE,  REGMAP_ENDIAN_BIG },
+static const struct regmap_test_param raw_types_list[] = {
+       { .cache = REGCACHE_NONE,   .val_endian = REGMAP_ENDIAN_LITTLE },
+       { .cache = REGCACHE_NONE,   .val_endian = REGMAP_ENDIAN_BIG },
+       { .cache = REGCACHE_FLAT,   .val_endian = REGMAP_ENDIAN_LITTLE },
+       { .cache = REGCACHE_FLAT,   .val_endian = REGMAP_ENDIAN_BIG },
+       { .cache = REGCACHE_RBTREE, .val_endian = REGMAP_ENDIAN_LITTLE },
+       { .cache = REGCACHE_RBTREE, .val_endian = REGMAP_ENDIAN_BIG },
+       { .cache = REGCACHE_MAPLE,  .val_endian = REGMAP_ENDIAN_LITTLE },
+       { .cache = REGCACHE_MAPLE,  .val_endian = REGMAP_ENDIAN_BIG },
 };
 
-KUNIT_ARRAY_PARAM(raw_test_types, raw_types_list, raw_to_desc);
+KUNIT_ARRAY_PARAM(raw_test_types, raw_types_list, param_to_desc);
 
-static const struct raw_test_types raw_cache_types_list[] = {
-       { "flat-little",   REGCACHE_FLAT,   REGMAP_ENDIAN_LITTLE },
-       { "flat-big",      REGCACHE_FLAT,   REGMAP_ENDIAN_BIG },
-       { "rbtree-little", REGCACHE_RBTREE, REGMAP_ENDIAN_LITTLE },
-       { "rbtree-big",    REGCACHE_RBTREE, REGMAP_ENDIAN_BIG },
-       { "maple-little",  REGCACHE_MAPLE,  REGMAP_ENDIAN_LITTLE },
-       { "maple-big",     REGCACHE_MAPLE,  REGMAP_ENDIAN_BIG },
+static const struct regmap_test_param raw_cache_types_list[] = {
+       { .cache = REGCACHE_FLAT,   .val_endian = REGMAP_ENDIAN_LITTLE },
+       { .cache = REGCACHE_FLAT,   .val_endian = REGMAP_ENDIAN_BIG },
+       { .cache = REGCACHE_RBTREE, .val_endian = REGMAP_ENDIAN_LITTLE },
+       { .cache = REGCACHE_RBTREE, .val_endian = REGMAP_ENDIAN_BIG },
+       { .cache = REGCACHE_MAPLE,  .val_endian = REGMAP_ENDIAN_LITTLE },
+       { .cache = REGCACHE_MAPLE,  .val_endian = REGMAP_ENDIAN_BIG },
 };
 
-KUNIT_ARRAY_PARAM(raw_test_cache_types, raw_cache_types_list, raw_to_desc);
+KUNIT_ARRAY_PARAM(raw_test_cache_types, raw_cache_types_list, param_to_desc);
 
 static const struct regmap_config raw_regmap_config = {
        .max_register = BLOCK_TEST_SIZE,
 
 static struct regmap *gen_raw_regmap(struct kunit *test,
                                     struct regmap_config *config,
-                                    struct raw_test_types *test_type,
                                     struct regmap_ram_data **data)
 {
        struct regmap_test_priv *priv = test->priv;
+       const struct regmap_test_param *param = test->param_value;
        u16 *buf;
        struct regmap *ret;
        size_t size = (config->max_register + 1) * config->reg_bits / 8;
        int i;
        struct reg_default *defaults;
 
-       config->cache_type = test_type->cache_type;
-       config->val_format_endian = test_type->val_endian;
+       config->cache_type = param->cache;
+       config->val_format_endian = param->val_endian;
        config->disable_locking = config->cache_type == REGCACHE_RBTREE ||
                                        config->cache_type == REGCACHE_MAPLE;
 
 
        for (i = 0; i < config->num_reg_defaults; i++) {
                defaults[i].reg = i;
-               switch (test_type->val_endian) {
+               switch (param->val_endian) {
                case REGMAP_ENDIAN_LITTLE:
                        defaults[i].def = le16_to_cpu(buf[i]);
                        break;
 
 static void raw_read_defaults_single(struct kunit *test)
 {
-       struct raw_test_types *t = (struct raw_test_types *)test->param_value;
        struct regmap *map;
        struct regmap_config config;
        struct regmap_ram_data *data;
 
        config = raw_regmap_config;
 
-       map = gen_raw_regmap(test, &config, t, &data);
+       map = gen_raw_regmap(test, &config, &data);
        KUNIT_ASSERT_FALSE(test, IS_ERR(map));
        if (IS_ERR(map))
                return;
 
 static void raw_read_defaults(struct kunit *test)
 {
-       struct raw_test_types *t = (struct raw_test_types *)test->param_value;
        struct regmap *map;
        struct regmap_config config;
        struct regmap_ram_data *data;
 
        config = raw_regmap_config;
 
-       map = gen_raw_regmap(test, &config, t, &data);
+       map = gen_raw_regmap(test, &config, &data);
        KUNIT_ASSERT_FALSE(test, IS_ERR(map));
        if (IS_ERR(map))
                return;
 
 static void raw_write_read_single(struct kunit *test)
 {
-       struct raw_test_types *t = (struct raw_test_types *)test->param_value;
        struct regmap *map;
        struct regmap_config config;
        struct regmap_ram_data *data;
 
        config = raw_regmap_config;
 
-       map = gen_raw_regmap(test, &config, t, &data);
+       map = gen_raw_regmap(test, &config, &data);
        KUNIT_ASSERT_FALSE(test, IS_ERR(map));
        if (IS_ERR(map))
                return;
 
 static void raw_write(struct kunit *test)
 {
-       struct raw_test_types *t = (struct raw_test_types *)test->param_value;
        struct regmap *map;
        struct regmap_config config;
        struct regmap_ram_data *data;
 
        config = raw_regmap_config;
 
-       map = gen_raw_regmap(test, &config, t, &data);
+       map = gen_raw_regmap(test, &config, &data);
        KUNIT_ASSERT_FALSE(test, IS_ERR(map));
        if (IS_ERR(map))
                return;
 
 static void raw_noinc_write(struct kunit *test)
 {
-       struct raw_test_types *t = (struct raw_test_types *)test->param_value;
        struct regmap *map;
        struct regmap_config config;
        struct regmap_ram_data *data;
        config.writeable_noinc_reg = reg_zero;
        config.readable_noinc_reg = reg_zero;
 
-       map = gen_raw_regmap(test, &config, t, &data);
+       map = gen_raw_regmap(test, &config, &data);
        KUNIT_ASSERT_FALSE(test, IS_ERR(map));
        if (IS_ERR(map))
                return;
 
 static void raw_sync(struct kunit *test)
 {
-       struct raw_test_types *t = (struct raw_test_types *)test->param_value;
        struct regmap *map;
        struct regmap_config config;
        struct regmap_ram_data *data;
 
        config = raw_regmap_config;
 
-       map = gen_raw_regmap(test, &config, t, &data);
+       map = gen_raw_regmap(test, &config, &data);
        KUNIT_ASSERT_FALSE(test, IS_ERR(map));
        if (IS_ERR(map))
                return;
 
 static void raw_ranges(struct kunit *test)
 {
-       struct raw_test_types *t = (struct raw_test_types *)test->param_value;
        struct regmap *map;
        struct regmap_config config;
        struct regmap_ram_data *data;
        config.num_ranges = 1;
        config.max_register = test_range.range_max;
 
-       map = gen_raw_regmap(test, &config, t, &data);
+       map = gen_raw_regmap(test, &config, &data);
        KUNIT_ASSERT_FALSE(test, IS_ERR(map));
        if (IS_ERR(map))
                return;