Lines Matching refs:config
52 static struct regmap *gen_regmap(struct regmap_config *config, in gen_regmap() argument
57 size_t size = (config->max_register + 1) * sizeof(unsigned int); in gen_regmap()
61 config->disable_locking = config->cache_type == REGCACHE_RBTREE || in gen_regmap()
62 config->cache_type == REGCACHE_MAPLE; in gen_regmap()
75 if (config->num_reg_defaults) { in gen_regmap()
76 defaults = kcalloc(config->num_reg_defaults, in gen_regmap()
81 config->reg_defaults = defaults; in gen_regmap()
83 for (i = 0; i < config->num_reg_defaults; i++) { in gen_regmap()
84 defaults[i].reg = i * config->reg_stride; in gen_regmap()
85 defaults[i].def = buf[i * config->reg_stride]; in gen_regmap()
89 ret = regmap_init_ram(config, *data); in gen_regmap()
107 struct regmap_config config; in basic_read_write() local
111 config = test_regmap_config; in basic_read_write()
112 config.cache_type = t->type; in basic_read_write()
114 map = gen_regmap(&config, &data); in basic_read_write()
136 struct regmap_config config; in bulk_write() local
141 config = test_regmap_config; in bulk_write()
142 config.cache_type = t->type; in bulk_write()
144 map = gen_regmap(&config, &data); in bulk_write()
173 struct regmap_config config; in bulk_read() local
178 config = test_regmap_config; in bulk_read()
179 config.cache_type = t->type; in bulk_read()
181 map = gen_regmap(&config, &data); in bulk_read()
206 struct regmap_config config; in write_readonly() local
211 config = test_regmap_config; in write_readonly()
212 config.cache_type = t->type; in write_readonly()
213 config.num_reg_defaults = BLOCK_TEST_SIZE; in write_readonly()
214 config.writeable_reg = reg_5_false; in write_readonly()
216 map = gen_regmap(&config, &data); in write_readonly()
241 struct regmap_config config; in read_writeonly() local
246 config = test_regmap_config; in read_writeonly()
247 config.cache_type = t->type; in read_writeonly()
248 config.readable_reg = reg_5_false; in read_writeonly()
250 map = gen_regmap(&config, &data); in read_writeonly()
281 struct regmap_config config; in reg_defaults() local
286 config = test_regmap_config; in reg_defaults()
287 config.cache_type = t->type; in reg_defaults()
288 config.num_reg_defaults = BLOCK_TEST_SIZE; in reg_defaults()
290 map = gen_regmap(&config, &data); in reg_defaults()
309 struct regmap_config config; in reg_defaults_read_dev() local
314 config = test_regmap_config; in reg_defaults_read_dev()
315 config.cache_type = t->type; in reg_defaults_read_dev()
316 config.num_reg_defaults_raw = BLOCK_TEST_SIZE; in reg_defaults_read_dev()
318 map = gen_regmap(&config, &data); in reg_defaults_read_dev()
343 struct regmap_config config; in register_patch() local
350 config = test_regmap_config; in register_patch()
351 config.cache_type = t->type; in register_patch()
352 config.num_reg_defaults = BLOCK_TEST_SIZE; in register_patch()
354 map = gen_regmap(&config, &data); in register_patch()
395 struct regmap_config config; in stride() local
400 config = test_regmap_config; in stride()
401 config.cache_type = t->type; in stride()
402 config.reg_stride = 2; in stride()
403 config.num_reg_defaults = BLOCK_TEST_SIZE / 2; in stride()
405 map = gen_regmap(&config, &data); in stride()
461 struct regmap_config config; in basic_ranges() local
466 config = test_regmap_config; in basic_ranges()
467 config.cache_type = t->type; in basic_ranges()
468 config.volatile_reg = test_range_volatile; in basic_ranges()
469 config.ranges = &test_range; in basic_ranges()
470 config.num_ranges = 1; in basic_ranges()
471 config.max_register = test_range.range_max; in basic_ranges()
473 map = gen_regmap(&config, &data); in basic_ranges()
533 struct regmap_config config; in stress_insert() local
539 config = test_regmap_config; in stress_insert()
540 config.cache_type = t->type; in stress_insert()
541 config.max_register = 300; in stress_insert()
543 map = gen_regmap(&config, &data); in stress_insert()
548 vals = kunit_kcalloc(test, sizeof(unsigned long), config.max_register, in stress_insert()
551 buf_sz = sizeof(unsigned long) * config.max_register; in stress_insert()
556 for (i = 0; i < config.max_register; i += 100) in stress_insert()
558 for (i = 0; i < config.max_register; i += 50) in stress_insert()
560 for (i = 0; i < config.max_register; i += 25) in stress_insert()
562 for (i = 0; i < config.max_register; i += 10) in stress_insert()
564 for (i = 0; i < config.max_register; i += 5) in stress_insert()
566 for (i = 0; i < config.max_register; i += 3) in stress_insert()
568 for (i = 0; i < config.max_register; i += 2) in stress_insert()
570 for (i = 0; i < config.max_register; i++) in stress_insert()
574 for (i = 0; i < config.max_register; i ++) { in stress_insert()
587 struct regmap_config config; in cache_bypass() local
591 config = test_regmap_config; in cache_bypass()
592 config.cache_type = t->type; in cache_bypass()
594 map = gen_regmap(&config, &data); in cache_bypass()
625 struct regmap_config config; in cache_sync() local
630 config = test_regmap_config; in cache_sync()
631 config.cache_type = t->type; in cache_sync()
633 map = gen_regmap(&config, &data); in cache_sync()
663 struct regmap_config config; in cache_sync_defaults() local
668 config = test_regmap_config; in cache_sync_defaults()
669 config.cache_type = t->type; in cache_sync_defaults()
670 config.num_reg_defaults = BLOCK_TEST_SIZE; in cache_sync_defaults()
672 map = gen_regmap(&config, &data); in cache_sync_defaults()
699 struct regmap_config config; in cache_sync_readonly() local
704 config = test_regmap_config; in cache_sync_readonly()
705 config.cache_type = t->type; in cache_sync_readonly()
706 config.writeable_reg = reg_5_false; in cache_sync_readonly()
708 map = gen_regmap(&config, &data); in cache_sync_readonly()
740 struct regmap_config config; in cache_sync_patch() local
747 config = test_regmap_config; in cache_sync_patch()
748 config.cache_type = t->type; in cache_sync_patch()
749 config.num_reg_defaults = BLOCK_TEST_SIZE; in cache_sync_patch()
751 map = gen_regmap(&config, &data); in cache_sync_patch()
801 struct regmap_config config; in cache_drop() local
806 config = test_regmap_config; in cache_drop()
807 config.cache_type = t->type; in cache_drop()
808 config.num_reg_defaults = BLOCK_TEST_SIZE; in cache_drop()
810 map = gen_regmap(&config, &data); in cache_drop()
843 struct regmap_config config; in cache_present() local
848 config = test_regmap_config; in cache_present()
849 config.cache_type = t->type; in cache_present()
851 map = gen_regmap(&config, &data); in cache_present()
922 static struct regmap *gen_raw_regmap(struct regmap_config *config, in gen_raw_regmap() argument
928 size_t size = (config->max_register + 1) * config->reg_bits / 8; in gen_raw_regmap()
932 config->cache_type = test_type->cache_type; in gen_raw_regmap()
933 config->val_format_endian = test_type->val_endian; in gen_raw_regmap()
934 config->disable_locking = config->cache_type == REGCACHE_RBTREE || in gen_raw_regmap()
935 config->cache_type == REGCACHE_MAPLE; in gen_raw_regmap()
948 config->num_reg_defaults = config->max_register + 1; in gen_raw_regmap()
949 defaults = kcalloc(config->num_reg_defaults, in gen_raw_regmap()
954 config->reg_defaults = defaults; in gen_raw_regmap()
956 for (i = 0; i < config->num_reg_defaults; i++) { in gen_raw_regmap()
974 if (config->cache_type == REGCACHE_NONE) in gen_raw_regmap()
975 config->num_reg_defaults = 0; in gen_raw_regmap()
977 ret = regmap_init_raw_ram(config, *data); in gen_raw_regmap()
990 struct regmap_config config; in raw_read_defaults_single() local
995 config = raw_regmap_config; in raw_read_defaults_single()
997 map = gen_raw_regmap(&config, t, &data); in raw_read_defaults_single()
1003 for (i = 0; i < config.max_register + 1; i++) { in raw_read_defaults_single()
1005 KUNIT_EXPECT_EQ(test, config.reg_defaults[i].def, rval); in raw_read_defaults_single()
1015 struct regmap_config config; in raw_read_defaults() local
1022 config = raw_regmap_config; in raw_read_defaults()
1024 map = gen_raw_regmap(&config, t, &data); in raw_read_defaults()
1029 val_len = sizeof(*rval) * (config.max_register + 1); in raw_read_defaults()
1037 for (i = 0; i < config.max_register + 1; i++) { in raw_read_defaults()
1038 def = config.reg_defaults[i].def; in raw_read_defaults()
1039 if (config.val_format_endian == REGMAP_ENDIAN_BIG) { in raw_read_defaults()
1054 struct regmap_config config; in raw_write_read_single() local
1059 config = raw_regmap_config; in raw_write_read_single()
1061 map = gen_raw_regmap(&config, t, &data); in raw_write_read_single()
1080 struct regmap_config config; in raw_write() local
1087 config = raw_regmap_config; in raw_write()
1089 map = gen_raw_regmap(&config, t, &data); in raw_write()
1102 for (i = 0; i < config.max_register + 1; i++) { in raw_write()
1108 if (config.val_format_endian == REGMAP_ENDIAN_BIG) { in raw_write()
1117 KUNIT_EXPECT_EQ(test, config.reg_defaults[i].def, rval); in raw_write()
1132 struct regmap_config config; in raw_sync() local
1139 config = raw_regmap_config; in raw_sync()
1141 map = gen_raw_regmap(&config, t, &data); in raw_sync()
1153 if (config.val_format_endian == REGMAP_ENDIAN_BIG) in raw_sync()
1161 for (i = 0; i < config.max_register + 1; i++) { in raw_sync()
1168 if (config.val_format_endian == REGMAP_ENDIAN_BIG) { in raw_sync()
1177 KUNIT_EXPECT_EQ(test, config.reg_defaults[i].def, rval); in raw_sync()
1186 for (i = 0; i < config.max_register + 1; i++) in raw_sync()