1#ifndef __LINUX_REGMAP_H
2#define __LINUX_REGMAP_H
3
4
5
6
7
8
9
10
11
12
13
14
15
16#include <linux/list.h>
17#include <linux/rbtree.h>
18#include <linux/delay.h>
19#include <linux/err.h>
20#include <linux/bug.h>
21#include <linux/lockdep.h>
22
23struct module;
24struct device;
25struct i2c_client;
26struct irq_domain;
27struct spi_device;
28struct spmi_device;
29struct regmap;
30struct regmap_range_cfg;
31struct regmap_field;
32struct snd_ac97;
33
34
35enum regcache_type {
36 REGCACHE_NONE,
37 REGCACHE_RBTREE,
38 REGCACHE_COMPRESSED,
39 REGCACHE_FLAT,
40};
41
42
43
44
45
46
47
48
49
50
51struct reg_default {
52 unsigned int reg;
53 unsigned int def;
54};
55
56
57
58
59
60
61
62
63
64
65
66struct reg_sequence {
67 unsigned int reg;
68 unsigned int def;
69 unsigned int delay_us;
70};
71
72#define regmap_update_bits(map, reg, mask, val) \
73 regmap_update_bits_base(map, reg, mask, val, NULL, false, false)
74#define regmap_update_bits_async(map, reg, mask, val)\
75 regmap_update_bits_base(map, reg, mask, val, NULL, true, false)
76#define regmap_update_bits_check(map, reg, mask, val, change)\
77 regmap_update_bits_base(map, reg, mask, val, change, false, false)
78#define regmap_update_bits_check_async(map, reg, mask, val, change)\
79 regmap_update_bits_base(map, reg, mask, val, change, true, false)
80
81#define regmap_write_bits(map, reg, mask, val) \
82 regmap_update_bits_base(map, reg, mask, val, NULL, false, true)
83
84#define regmap_field_write(field, val) \
85 regmap_field_update_bits_base(field, ~0, val, NULL, false, false)
86#define regmap_field_force_write(field, val) \
87 regmap_field_update_bits_base(field, ~0, val, NULL, false, true)
88#define regmap_field_update_bits(field, mask, val)\
89 regmap_field_update_bits_base(field, mask, val, NULL, false, false)
90#define regmap_field_force_update_bits(field, mask, val) \
91 regmap_field_update_bits_base(field, mask, val, NULL, false, true)
92
93#define regmap_fields_write(field, id, val) \
94 regmap_fields_update_bits_base(field, id, ~0, val, NULL, false, false)
95#define regmap_fields_force_write(field, id, val) \
96 regmap_fields_update_bits_base(field, id, ~0, val, NULL, false, true)
97#define regmap_fields_update_bits(field, id, mask, val)\
98 regmap_fields_update_bits_base(field, id, mask, val, NULL, false, false)
99#define regmap_fields_force_update_bits(field, id, mask, val) \
100 regmap_fields_update_bits_base(field, id, mask, val, NULL, false, true)
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121#define regmap_read_poll_timeout(map, addr, val, cond, sleep_us, timeout_us) \
122({ \
123 ktime_t timeout = ktime_add_us(ktime_get(), timeout_us); \
124 int pollret; \
125 might_sleep_if(sleep_us); \
126 for (;;) { \
127 pollret = regmap_read((map), (addr), &(val)); \
128 if (pollret) \
129 break; \
130 if (cond) \
131 break; \
132 if (timeout_us && ktime_compare(ktime_get(), timeout) > 0) { \
133 pollret = regmap_read((map), (addr), &(val)); \
134 break; \
135 } \
136 if (sleep_us) \
137 usleep_range((sleep_us >> 2) + 1, sleep_us); \
138 } \
139 pollret ?: ((cond) ? 0 : -ETIMEDOUT); \
140})
141
142#ifdef CONFIG_REGMAP
143
144enum regmap_endian {
145
146 REGMAP_ENDIAN_DEFAULT = 0,
147 REGMAP_ENDIAN_BIG,
148 REGMAP_ENDIAN_LITTLE,
149 REGMAP_ENDIAN_NATIVE,
150};
151
152
153
154
155
156
157
158
159struct regmap_range {
160 unsigned int range_min;
161 unsigned int range_max;
162};
163
164#define regmap_reg_range(low, high) { .range_min = low, .range_max = high, }
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179struct regmap_access_table {
180 const struct regmap_range *yes_ranges;
181 unsigned int n_yes_ranges;
182 const struct regmap_range *no_ranges;
183 unsigned int n_no_ranges;
184};
185
186typedef void (*regmap_lock)(void *);
187typedef void (*regmap_unlock)(void *);
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277struct regmap_config {
278 const char *name;
279
280 int reg_bits;
281 int reg_stride;
282 int pad_bits;
283 int val_bits;
284
285 bool (*writeable_reg)(struct device *dev, unsigned int reg);
286 bool (*readable_reg)(struct device *dev, unsigned int reg);
287 bool (*volatile_reg)(struct device *dev, unsigned int reg);
288 bool (*precious_reg)(struct device *dev, unsigned int reg);
289 regmap_lock lock;
290 regmap_unlock unlock;
291 void *lock_arg;
292
293 int (*reg_read)(void *context, unsigned int reg, unsigned int *val);
294 int (*reg_write)(void *context, unsigned int reg, unsigned int val);
295
296 bool fast_io;
297
298 unsigned int max_register;
299 const struct regmap_access_table *wr_table;
300 const struct regmap_access_table *rd_table;
301 const struct regmap_access_table *volatile_table;
302 const struct regmap_access_table *precious_table;
303 const struct reg_default *reg_defaults;
304 unsigned int num_reg_defaults;
305 enum regcache_type cache_type;
306 const void *reg_defaults_raw;
307 unsigned int num_reg_defaults_raw;
308
309 unsigned long read_flag_mask;
310 unsigned long write_flag_mask;
311
312 bool use_single_rw;
313 bool can_multi_write;
314
315 enum regmap_endian reg_format_endian;
316 enum regmap_endian val_format_endian;
317
318 const struct regmap_range_cfg *ranges;
319 unsigned int num_ranges;
320};
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342struct regmap_range_cfg {
343 const char *name;
344
345
346 unsigned int range_min;
347 unsigned int range_max;
348
349
350 unsigned int selector_reg;
351 unsigned int selector_mask;
352 int selector_shift;
353
354
355 unsigned int window_start;
356 unsigned int window_len;
357};
358
359struct regmap_async;
360
361typedef int (*regmap_hw_write)(void *context, const void *data,
362 size_t count);
363typedef int (*regmap_hw_gather_write)(void *context,
364 const void *reg, size_t reg_len,
365 const void *val, size_t val_len);
366typedef int (*regmap_hw_async_write)(void *context,
367 const void *reg, size_t reg_len,
368 const void *val, size_t val_len,
369 struct regmap_async *async);
370typedef int (*regmap_hw_read)(void *context,
371 const void *reg_buf, size_t reg_size,
372 void *val_buf, size_t val_size);
373typedef int (*regmap_hw_reg_read)(void *context, unsigned int reg,
374 unsigned int *val);
375typedef int (*regmap_hw_reg_write)(void *context, unsigned int reg,
376 unsigned int val);
377typedef int (*regmap_hw_reg_update_bits)(void *context, unsigned int reg,
378 unsigned int mask, unsigned int val);
379typedef struct regmap_async *(*regmap_hw_async_alloc)(void);
380typedef void (*regmap_hw_free_context)(void *context);
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417struct regmap_bus {
418 bool fast_io;
419 regmap_hw_write write;
420 regmap_hw_gather_write gather_write;
421 regmap_hw_async_write async_write;
422 regmap_hw_reg_write reg_write;
423 regmap_hw_reg_update_bits reg_update_bits;
424 regmap_hw_read read;
425 regmap_hw_reg_read reg_read;
426 regmap_hw_free_context free_context;
427 regmap_hw_async_alloc async_alloc;
428 u8 read_flag_mask;
429 enum regmap_endian reg_format_endian_default;
430 enum regmap_endian val_format_endian_default;
431 size_t max_raw_read;
432 size_t max_raw_write;
433};
434
435
436
437
438
439
440
441
442struct regmap *__regmap_init(struct device *dev,
443 const struct regmap_bus *bus,
444 void *bus_context,
445 const struct regmap_config *config,
446 struct lock_class_key *lock_key,
447 const char *lock_name);
448struct regmap *__regmap_init_i2c(struct i2c_client *i2c,
449 const struct regmap_config *config,
450 struct lock_class_key *lock_key,
451 const char *lock_name);
452struct regmap *__regmap_init_spi(struct spi_device *dev,
453 const struct regmap_config *config,
454 struct lock_class_key *lock_key,
455 const char *lock_name);
456struct regmap *__regmap_init_spmi_base(struct spmi_device *dev,
457 const struct regmap_config *config,
458 struct lock_class_key *lock_key,
459 const char *lock_name);
460struct regmap *__regmap_init_spmi_ext(struct spmi_device *dev,
461 const struct regmap_config *config,
462 struct lock_class_key *lock_key,
463 const char *lock_name);
464struct regmap *__regmap_init_mmio_clk(struct device *dev, const char *clk_id,
465 void __iomem *regs,
466 const struct regmap_config *config,
467 struct lock_class_key *lock_key,
468 const char *lock_name);
469struct regmap *__regmap_init_ac97(struct snd_ac97 *ac97,
470 const struct regmap_config *config,
471 struct lock_class_key *lock_key,
472 const char *lock_name);
473
474struct regmap *__devm_regmap_init(struct device *dev,
475 const struct regmap_bus *bus,
476 void *bus_context,
477 const struct regmap_config *config,
478 struct lock_class_key *lock_key,
479 const char *lock_name);
480struct regmap *__devm_regmap_init_i2c(struct i2c_client *i2c,
481 const struct regmap_config *config,
482 struct lock_class_key *lock_key,
483 const char *lock_name);
484struct regmap *__devm_regmap_init_spi(struct spi_device *dev,
485 const struct regmap_config *config,
486 struct lock_class_key *lock_key,
487 const char *lock_name);
488struct regmap *__devm_regmap_init_spmi_base(struct spmi_device *dev,
489 const struct regmap_config *config,
490 struct lock_class_key *lock_key,
491 const char *lock_name);
492struct regmap *__devm_regmap_init_spmi_ext(struct spmi_device *dev,
493 const struct regmap_config *config,
494 struct lock_class_key *lock_key,
495 const char *lock_name);
496struct regmap *__devm_regmap_init_mmio_clk(struct device *dev,
497 const char *clk_id,
498 void __iomem *regs,
499 const struct regmap_config *config,
500 struct lock_class_key *lock_key,
501 const char *lock_name);
502struct regmap *__devm_regmap_init_ac97(struct snd_ac97 *ac97,
503 const struct regmap_config *config,
504 struct lock_class_key *lock_key,
505 const char *lock_name);
506
507
508
509
510
511
512
513
514#ifdef CONFIG_LOCKDEP
515#define __regmap_lockdep_wrapper(fn, name, ...) \
516( \
517 ({ \
518 static struct lock_class_key _key; \
519 fn(__VA_ARGS__, &_key, \
520 KBUILD_BASENAME ":" \
521 __stringify(__LINE__) ":" \
522 "(" name ")->lock"); \
523 }) \
524)
525#else
526#define __regmap_lockdep_wrapper(fn, name, ...) fn(__VA_ARGS__, NULL, NULL)
527#endif
528
529
530
531
532
533
534
535
536
537
538
539
540
541#define regmap_init(dev, bus, bus_context, config) \
542 __regmap_lockdep_wrapper(__regmap_init, #config, \
543 dev, bus, bus_context, config)
544int regmap_attach_dev(struct device *dev, struct regmap *map,
545 const struct regmap_config *config);
546
547
548
549
550
551
552
553
554
555
556#define regmap_init_i2c(i2c, config) \
557 __regmap_lockdep_wrapper(__regmap_init_i2c, #config, \
558 i2c, config)
559
560
561
562
563
564
565
566
567
568
569#define regmap_init_spi(dev, config) \
570 __regmap_lockdep_wrapper(__regmap_init_spi, #config, \
571 dev, config)
572
573
574
575
576
577
578
579
580
581
582#define regmap_init_spmi_base(dev, config) \
583 __regmap_lockdep_wrapper(__regmap_init_spmi_base, #config, \
584 dev, config)
585
586
587
588
589
590
591
592
593
594
595#define regmap_init_spmi_ext(dev, config) \
596 __regmap_lockdep_wrapper(__regmap_init_spmi_ext, #config, \
597 dev, config)
598
599
600
601
602
603
604
605
606
607
608
609
610#define regmap_init_mmio_clk(dev, clk_id, regs, config) \
611 __regmap_lockdep_wrapper(__regmap_init_mmio_clk, #config, \
612 dev, clk_id, regs, config)
613
614
615
616
617
618
619
620
621
622
623
624#define regmap_init_mmio(dev, regs, config) \
625 regmap_init_mmio_clk(dev, NULL, regs, config)
626
627
628
629
630
631
632
633
634
635
636#define regmap_init_ac97(ac97, config) \
637 __regmap_lockdep_wrapper(__regmap_init_ac97, #config, \
638 ac97, config)
639bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg);
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654#define devm_regmap_init(dev, bus, bus_context, config) \
655 __regmap_lockdep_wrapper(__devm_regmap_init, #config, \
656 dev, bus, bus_context, config)
657
658
659
660
661
662
663
664
665
666
667
668#define devm_regmap_init_i2c(i2c, config) \
669 __regmap_lockdep_wrapper(__devm_regmap_init_i2c, #config, \
670 i2c, config)
671
672
673
674
675
676
677
678
679
680
681
682#define devm_regmap_init_spi(dev, config) \
683 __regmap_lockdep_wrapper(__devm_regmap_init_spi, #config, \
684 dev, config)
685
686
687
688
689
690
691
692
693
694
695
696#define devm_regmap_init_spmi_base(dev, config) \
697 __regmap_lockdep_wrapper(__devm_regmap_init_spmi_base, #config, \
698 dev, config)
699
700
701
702
703
704
705
706
707
708
709
710#define devm_regmap_init_spmi_ext(dev, config) \
711 __regmap_lockdep_wrapper(__devm_regmap_init_spmi_ext, #config, \
712 dev, config)
713
714
715
716
717
718
719
720
721
722
723
724
725
726#define devm_regmap_init_mmio_clk(dev, clk_id, regs, config) \
727 __regmap_lockdep_wrapper(__devm_regmap_init_mmio_clk, #config, \
728 dev, clk_id, regs, config)
729
730
731
732
733
734
735
736
737
738
739
740
741#define devm_regmap_init_mmio(dev, regs, config) \
742 devm_regmap_init_mmio_clk(dev, NULL, regs, config)
743
744
745
746
747
748
749
750
751
752
753
754#define devm_regmap_init_ac97(ac97, config) \
755 __regmap_lockdep_wrapper(__devm_regmap_init_ac97, #config, \
756 ac97, config)
757
758void regmap_exit(struct regmap *map);
759int regmap_reinit_cache(struct regmap *map,
760 const struct regmap_config *config);
761struct regmap *dev_get_regmap(struct device *dev, const char *name);
762struct device *regmap_get_device(struct regmap *map);
763int regmap_write(struct regmap *map, unsigned int reg, unsigned int val);
764int regmap_write_async(struct regmap *map, unsigned int reg, unsigned int val);
765int regmap_raw_write(struct regmap *map, unsigned int reg,
766 const void *val, size_t val_len);
767int regmap_bulk_write(struct regmap *map, unsigned int reg, const void *val,
768 size_t val_count);
769int regmap_multi_reg_write(struct regmap *map, const struct reg_sequence *regs,
770 int num_regs);
771int regmap_multi_reg_write_bypassed(struct regmap *map,
772 const struct reg_sequence *regs,
773 int num_regs);
774int regmap_raw_write_async(struct regmap *map, unsigned int reg,
775 const void *val, size_t val_len);
776int regmap_read(struct regmap *map, unsigned int reg, unsigned int *val);
777int regmap_raw_read(struct regmap *map, unsigned int reg,
778 void *val, size_t val_len);
779int regmap_bulk_read(struct regmap *map, unsigned int reg, void *val,
780 size_t val_count);
781int regmap_update_bits_base(struct regmap *map, unsigned int reg,
782 unsigned int mask, unsigned int val,
783 bool *change, bool async, bool force);
784int regmap_get_val_bytes(struct regmap *map);
785int regmap_get_max_register(struct regmap *map);
786int regmap_get_reg_stride(struct regmap *map);
787int regmap_async_complete(struct regmap *map);
788bool regmap_can_raw_write(struct regmap *map);
789size_t regmap_get_raw_read_max(struct regmap *map);
790size_t regmap_get_raw_write_max(struct regmap *map);
791
792int regcache_sync(struct regmap *map);
793int regcache_sync_region(struct regmap *map, unsigned int min,
794 unsigned int max);
795int regcache_drop_region(struct regmap *map, unsigned int min,
796 unsigned int max);
797void regcache_cache_only(struct regmap *map, bool enable);
798void regcache_cache_bypass(struct regmap *map, bool enable);
799void regcache_mark_dirty(struct regmap *map);
800
801bool regmap_check_range_table(struct regmap *map, unsigned int reg,
802 const struct regmap_access_table *table);
803
804int regmap_register_patch(struct regmap *map, const struct reg_sequence *regs,
805 int num_regs);
806int regmap_parse_val(struct regmap *map, const void *buf,
807 unsigned int *val);
808
809static inline bool regmap_reg_in_range(unsigned int reg,
810 const struct regmap_range *range)
811{
812 return reg >= range->range_min && reg <= range->range_max;
813}
814
815bool regmap_reg_in_ranges(unsigned int reg,
816 const struct regmap_range *ranges,
817 unsigned int nranges);
818
819
820
821
822
823
824
825
826
827
828struct reg_field {
829 unsigned int reg;
830 unsigned int lsb;
831 unsigned int msb;
832 unsigned int id_size;
833 unsigned int id_offset;
834};
835
836#define REG_FIELD(_reg, _lsb, _msb) { \
837 .reg = _reg, \
838 .lsb = _lsb, \
839 .msb = _msb, \
840 }
841
842struct regmap_field *regmap_field_alloc(struct regmap *regmap,
843 struct reg_field reg_field);
844void regmap_field_free(struct regmap_field *field);
845
846struct regmap_field *devm_regmap_field_alloc(struct device *dev,
847 struct regmap *regmap, struct reg_field reg_field);
848void devm_regmap_field_free(struct device *dev, struct regmap_field *field);
849
850int regmap_field_read(struct regmap_field *field, unsigned int *val);
851int regmap_field_update_bits_base(struct regmap_field *field,
852 unsigned int mask, unsigned int val,
853 bool *change, bool async, bool force);
854int regmap_fields_read(struct regmap_field *field, unsigned int id,
855 unsigned int *val);
856int regmap_fields_update_bits_base(struct regmap_field *field, unsigned int id,
857 unsigned int mask, unsigned int val,
858 bool *change, bool async, bool force);
859
860
861
862
863
864
865
866
867
868
869struct regmap_irq {
870 unsigned int reg_offset;
871 unsigned int mask;
872 unsigned int type_reg_offset;
873 unsigned int type_rising_mask;
874 unsigned int type_falling_mask;
875};
876
877#define REGMAP_IRQ_REG(_irq, _off, _mask) \
878 [_irq] = { .reg_offset = (_off), .mask = (_mask) }
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920struct regmap_irq_chip {
921 const char *name;
922
923 unsigned int status_base;
924 unsigned int mask_base;
925 unsigned int unmask_base;
926 unsigned int ack_base;
927 unsigned int wake_base;
928 unsigned int type_base;
929 unsigned int irq_reg_stride;
930 bool init_ack_masked:1;
931 bool mask_invert:1;
932 bool use_ack:1;
933 bool ack_invert:1;
934 bool wake_invert:1;
935 bool runtime_pm:1;
936 bool type_invert:1;
937
938 int num_regs;
939
940 const struct regmap_irq *irqs;
941 int num_irqs;
942
943 int num_type_reg;
944 unsigned int type_reg_stride;
945
946 int (*handle_pre_irq)(void *irq_drv_data);
947 int (*handle_post_irq)(void *irq_drv_data);
948 void *irq_drv_data;
949};
950
951struct regmap_irq_chip_data;
952
953int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,
954 int irq_base, const struct regmap_irq_chip *chip,
955 struct regmap_irq_chip_data **data);
956void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *data);
957
958int devm_regmap_add_irq_chip(struct device *dev, struct regmap *map, int irq,
959 int irq_flags, int irq_base,
960 const struct regmap_irq_chip *chip,
961 struct regmap_irq_chip_data **data);
962void devm_regmap_del_irq_chip(struct device *dev, int irq,
963 struct regmap_irq_chip_data *data);
964
965int regmap_irq_chip_get_base(struct regmap_irq_chip_data *data);
966int regmap_irq_get_virq(struct regmap_irq_chip_data *data, int irq);
967struct irq_domain *regmap_irq_get_domain(struct regmap_irq_chip_data *data);
968
969#else
970
971
972
973
974
975
976
977
978static inline int regmap_write(struct regmap *map, unsigned int reg,
979 unsigned int val)
980{
981 WARN_ONCE(1, "regmap API is disabled");
982 return -EINVAL;
983}
984
985static inline int regmap_write_async(struct regmap *map, unsigned int reg,
986 unsigned int val)
987{
988 WARN_ONCE(1, "regmap API is disabled");
989 return -EINVAL;
990}
991
992static inline int regmap_raw_write(struct regmap *map, unsigned int reg,
993 const void *val, size_t val_len)
994{
995 WARN_ONCE(1, "regmap API is disabled");
996 return -EINVAL;
997}
998
999static inline int regmap_raw_write_async(struct regmap *map, unsigned int reg,
1000 const void *val, size_t val_len)
1001{
1002 WARN_ONCE(1, "regmap API is disabled");
1003 return -EINVAL;
1004}
1005
1006static inline int regmap_bulk_write(struct regmap *map, unsigned int reg,
1007 const void *val, size_t val_count)
1008{
1009 WARN_ONCE(1, "regmap API is disabled");
1010 return -EINVAL;
1011}
1012
1013static inline int regmap_read(struct regmap *map, unsigned int reg,
1014 unsigned int *val)
1015{
1016 WARN_ONCE(1, "regmap API is disabled");
1017 return -EINVAL;
1018}
1019
1020static inline int regmap_raw_read(struct regmap *map, unsigned int reg,
1021 void *val, size_t val_len)
1022{
1023 WARN_ONCE(1, "regmap API is disabled");
1024 return -EINVAL;
1025}
1026
1027static inline int regmap_bulk_read(struct regmap *map, unsigned int reg,
1028 void *val, size_t val_count)
1029{
1030 WARN_ONCE(1, "regmap API is disabled");
1031 return -EINVAL;
1032}
1033
1034static inline int regmap_update_bits_base(struct regmap *map, unsigned int reg,
1035 unsigned int mask, unsigned int val,
1036 bool *change, bool async, bool force)
1037{
1038 WARN_ONCE(1, "regmap API is disabled");
1039 return -EINVAL;
1040}
1041
1042static inline int regmap_field_update_bits_base(struct regmap_field *field,
1043 unsigned int mask, unsigned int val,
1044 bool *change, bool async, bool force)
1045{
1046 WARN_ONCE(1, "regmap API is disabled");
1047 return -EINVAL;
1048}
1049
1050static inline int regmap_fields_update_bits_base(struct regmap_field *field,
1051 unsigned int id,
1052 unsigned int mask, unsigned int val,
1053 bool *change, bool async, bool force)
1054{
1055 WARN_ONCE(1, "regmap API is disabled");
1056 return -EINVAL;
1057}
1058
1059static inline int regmap_get_val_bytes(struct regmap *map)
1060{
1061 WARN_ONCE(1, "regmap API is disabled");
1062 return -EINVAL;
1063}
1064
1065static inline int regmap_get_max_register(struct regmap *map)
1066{
1067 WARN_ONCE(1, "regmap API is disabled");
1068 return -EINVAL;
1069}
1070
1071static inline int regmap_get_reg_stride(struct regmap *map)
1072{
1073 WARN_ONCE(1, "regmap API is disabled");
1074 return -EINVAL;
1075}
1076
1077static inline int regcache_sync(struct regmap *map)
1078{
1079 WARN_ONCE(1, "regmap API is disabled");
1080 return -EINVAL;
1081}
1082
1083static inline int regcache_sync_region(struct regmap *map, unsigned int min,
1084 unsigned int max)
1085{
1086 WARN_ONCE(1, "regmap API is disabled");
1087 return -EINVAL;
1088}
1089
1090static inline int regcache_drop_region(struct regmap *map, unsigned int min,
1091 unsigned int max)
1092{
1093 WARN_ONCE(1, "regmap API is disabled");
1094 return -EINVAL;
1095}
1096
1097static inline void regcache_cache_only(struct regmap *map, bool enable)
1098{
1099 WARN_ONCE(1, "regmap API is disabled");
1100}
1101
1102static inline void regcache_cache_bypass(struct regmap *map, bool enable)
1103{
1104 WARN_ONCE(1, "regmap API is disabled");
1105}
1106
1107static inline void regcache_mark_dirty(struct regmap *map)
1108{
1109 WARN_ONCE(1, "regmap API is disabled");
1110}
1111
1112static inline void regmap_async_complete(struct regmap *map)
1113{
1114 WARN_ONCE(1, "regmap API is disabled");
1115}
1116
1117static inline int regmap_register_patch(struct regmap *map,
1118 const struct reg_sequence *regs,
1119 int num_regs)
1120{
1121 WARN_ONCE(1, "regmap API is disabled");
1122 return -EINVAL;
1123}
1124
1125static inline int regmap_parse_val(struct regmap *map, const void *buf,
1126 unsigned int *val)
1127{
1128 WARN_ONCE(1, "regmap API is disabled");
1129 return -EINVAL;
1130}
1131
1132static inline struct regmap *dev_get_regmap(struct device *dev,
1133 const char *name)
1134{
1135 return NULL;
1136}
1137
1138static inline struct device *regmap_get_device(struct regmap *map)
1139{
1140 WARN_ONCE(1, "regmap API is disabled");
1141 return NULL;
1142}
1143
1144#endif
1145
1146#endif
1147