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