1
2
3
4
5
6
7
8
9
10#ifndef _LINUX_I2C_H
11#define _LINUX_I2C_H
12
13#include <linux/acpi.h>
14#include <linux/mod_devicetable.h>
15#include <linux/device.h>
16#include <linux/sched.h>
17#include <linux/mutex.h>
18#include <linux/rtmutex.h>
19#include <linux/irqdomain.h>
20#include <linux/of.h>
21#include <linux/swab.h>
22#include <uapi/linux/i2c.h>
23
24extern struct bus_type i2c_bus_type;
25extern struct device_type i2c_adapter_type;
26extern struct device_type i2c_client_type;
27
28
29
30struct i2c_msg;
31struct i2c_algorithm;
32struct i2c_adapter;
33struct i2c_client;
34struct i2c_driver;
35struct i2c_device_identity;
36union i2c_smbus_data;
37struct i2c_board_info;
38enum i2c_slave_event;
39typedef int (*i2c_slave_cb_t)(struct i2c_client *client,
40 enum i2c_slave_event event, u8 *val);
41
42struct module;
43struct property_entry;
44
45#if IS_ENABLED(CONFIG_I2C)
46
47
48
49
50
51
52
53int i2c_transfer_buffer_flags(const struct i2c_client *client,
54 char *buf, int count, u16 flags);
55
56
57
58
59
60
61
62
63
64static inline int i2c_master_recv(const struct i2c_client *client,
65 char *buf, int count)
66{
67 return i2c_transfer_buffer_flags(client, buf, count, I2C_M_RD);
68};
69
70
71
72
73
74
75
76
77
78
79static inline int i2c_master_recv_dmasafe(const struct i2c_client *client,
80 char *buf, int count)
81{
82 return i2c_transfer_buffer_flags(client, buf, count,
83 I2C_M_RD | I2C_M_DMA_SAFE);
84};
85
86
87
88
89
90
91
92
93
94static inline int i2c_master_send(const struct i2c_client *client,
95 const char *buf, int count)
96{
97 return i2c_transfer_buffer_flags(client, (char *)buf, count, 0);
98};
99
100
101
102
103
104
105
106
107
108
109static inline int i2c_master_send_dmasafe(const struct i2c_client *client,
110 const char *buf, int count)
111{
112 return i2c_transfer_buffer_flags(client, (char *)buf, count,
113 I2C_M_DMA_SAFE);
114};
115
116
117
118int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num);
119
120int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num);
121
122
123
124
125
126
127s32 i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr,
128 unsigned short flags, char read_write, u8 command,
129 int protocol, union i2c_smbus_data *data);
130
131
132s32 __i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr,
133 unsigned short flags, char read_write, u8 command,
134 int protocol, union i2c_smbus_data *data);
135
136
137
138
139s32 i2c_smbus_read_byte(const struct i2c_client *client);
140s32 i2c_smbus_write_byte(const struct i2c_client *client, u8 value);
141s32 i2c_smbus_read_byte_data(const struct i2c_client *client, u8 command);
142s32 i2c_smbus_write_byte_data(const struct i2c_client *client,
143 u8 command, u8 value);
144s32 i2c_smbus_read_word_data(const struct i2c_client *client, u8 command);
145s32 i2c_smbus_write_word_data(const struct i2c_client *client,
146 u8 command, u16 value);
147
148static inline s32
149i2c_smbus_read_word_swapped(const struct i2c_client *client, u8 command)
150{
151 s32 value = i2c_smbus_read_word_data(client, command);
152
153 return (value < 0) ? value : swab16(value);
154}
155
156static inline s32
157i2c_smbus_write_word_swapped(const struct i2c_client *client,
158 u8 command, u16 value)
159{
160 return i2c_smbus_write_word_data(client, command, swab16(value));
161}
162
163
164s32 i2c_smbus_read_block_data(const struct i2c_client *client,
165 u8 command, u8 *values);
166s32 i2c_smbus_write_block_data(const struct i2c_client *client,
167 u8 command, u8 length, const u8 *values);
168
169s32 i2c_smbus_read_i2c_block_data(const struct i2c_client *client,
170 u8 command, u8 length, u8 *values);
171s32 i2c_smbus_write_i2c_block_data(const struct i2c_client *client,
172 u8 command, u8 length, const u8 *values);
173s32 i2c_smbus_read_i2c_block_data_or_emulated(const struct i2c_client *client,
174 u8 command, u8 length,
175 u8 *values);
176int i2c_get_device_id(const struct i2c_client *client,
177 struct i2c_device_identity *id);
178#endif
179
180
181
182
183
184
185
186struct i2c_device_identity {
187 u16 manufacturer_id;
188#define I2C_DEVICE_ID_NXP_SEMICONDUCTORS 0
189#define I2C_DEVICE_ID_NXP_SEMICONDUCTORS_1 1
190#define I2C_DEVICE_ID_NXP_SEMICONDUCTORS_2 2
191#define I2C_DEVICE_ID_NXP_SEMICONDUCTORS_3 3
192#define I2C_DEVICE_ID_RAMTRON_INTERNATIONAL 4
193#define I2C_DEVICE_ID_ANALOG_DEVICES 5
194#define I2C_DEVICE_ID_STMICROELECTRONICS 6
195#define I2C_DEVICE_ID_ON_SEMICONDUCTOR 7
196#define I2C_DEVICE_ID_SPRINTEK_CORPORATION 8
197#define I2C_DEVICE_ID_ESPROS_PHOTONICS_AG 9
198#define I2C_DEVICE_ID_FUJITSU_SEMICONDUCTOR 10
199#define I2C_DEVICE_ID_FLIR 11
200#define I2C_DEVICE_ID_O2MICRO 12
201#define I2C_DEVICE_ID_ATMEL 13
202#define I2C_DEVICE_ID_NONE 0xffff
203 u16 part_id;
204 u8 die_revision;
205};
206
207enum i2c_alert_protocol {
208 I2C_PROTOCOL_SMBUS_ALERT,
209 I2C_PROTOCOL_SMBUS_HOST_NOTIFY,
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
248struct i2c_driver {
249 unsigned int class;
250
251
252 int (*probe)(struct i2c_client *client, const struct i2c_device_id *id);
253 int (*remove)(struct i2c_client *client);
254
255
256
257
258 int (*probe_new)(struct i2c_client *client);
259
260
261 void (*shutdown)(struct i2c_client *client);
262
263
264
265
266
267
268
269
270 void (*alert)(struct i2c_client *client, enum i2c_alert_protocol protocol,
271 unsigned int data);
272
273
274
275
276 int (*command)(struct i2c_client *client, unsigned int cmd, void *arg);
277
278 struct device_driver driver;
279 const struct i2c_device_id *id_table;
280
281
282 int (*detect)(struct i2c_client *client, struct i2c_board_info *info);
283 const unsigned short *address_list;
284 struct list_head clients;
285
286 bool disable_i2c_core_irq_mapping;
287};
288#define to_i2c_driver(d) container_of(d, struct i2c_driver, driver)
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309struct i2c_client {
310 unsigned short flags;
311#define I2C_CLIENT_PEC 0x04
312#define I2C_CLIENT_TEN 0x10
313
314#define I2C_CLIENT_SLAVE 0x20
315#define I2C_CLIENT_HOST_NOTIFY 0x40
316#define I2C_CLIENT_WAKE 0x80
317#define I2C_CLIENT_SCCB 0x9000
318
319
320 unsigned short addr;
321
322
323 char name[I2C_NAME_SIZE];
324 struct i2c_adapter *adapter;
325 struct device dev;
326 int init_irq;
327 int irq;
328 struct list_head detected;
329#if IS_ENABLED(CONFIG_I2C_SLAVE)
330 i2c_slave_cb_t slave_cb;
331#endif
332};
333#define to_i2c_client(d) container_of(d, struct i2c_client, dev)
334
335struct i2c_client *i2c_verify_client(struct device *dev);
336struct i2c_adapter *i2c_verify_adapter(struct device *dev);
337const struct i2c_device_id *i2c_match_id(const struct i2c_device_id *id,
338 const struct i2c_client *client);
339
340static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj)
341{
342 struct device * const dev = container_of(kobj, struct device, kobj);
343 return to_i2c_client(dev);
344}
345
346static inline void *i2c_get_clientdata(const struct i2c_client *dev)
347{
348 return dev_get_drvdata(&dev->dev);
349}
350
351static inline void i2c_set_clientdata(struct i2c_client *dev, void *data)
352{
353 dev_set_drvdata(&dev->dev, data);
354}
355
356
357
358#if IS_ENABLED(CONFIG_I2C_SLAVE)
359enum i2c_slave_event {
360 I2C_SLAVE_READ_REQUESTED,
361 I2C_SLAVE_WRITE_REQUESTED,
362 I2C_SLAVE_READ_PROCESSED,
363 I2C_SLAVE_WRITE_RECEIVED,
364 I2C_SLAVE_STOP,
365};
366
367int i2c_slave_register(struct i2c_client *client, i2c_slave_cb_t slave_cb);
368int i2c_slave_unregister(struct i2c_client *client);
369bool i2c_detect_slave_mode(struct device *dev);
370
371static inline int i2c_slave_event(struct i2c_client *client,
372 enum i2c_slave_event event, u8 *val)
373{
374 return client->slave_cb(client, event, val);
375}
376#else
377static inline bool i2c_detect_slave_mode(struct device *dev) { return false; }
378#endif
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405struct i2c_board_info {
406 char type[I2C_NAME_SIZE];
407 unsigned short flags;
408 unsigned short addr;
409 const char *dev_name;
410 void *platform_data;
411 struct device_node *of_node;
412 struct fwnode_handle *fwnode;
413 const struct property_entry *properties;
414 const struct resource *resources;
415 unsigned int num_resources;
416 int irq;
417};
418
419
420
421
422
423
424
425
426
427
428
429#define I2C_BOARD_INFO(dev_type, dev_addr) \
430 .type = dev_type, .addr = (dev_addr)
431
432
433#if IS_ENABLED(CONFIG_I2C)
434
435
436
437
438struct i2c_client *
439i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info);
440
441struct i2c_client *
442i2c_new_client_device(struct i2c_adapter *adap, struct i2c_board_info const *info);
443
444
445
446
447
448
449
450struct i2c_client *
451i2c_new_scanned_device(struct i2c_adapter *adap,
452 struct i2c_board_info *info,
453 unsigned short const *addr_list,
454 int (*probe)(struct i2c_adapter *adap, unsigned short addr));
455
456struct i2c_client *
457i2c_new_probed_device(struct i2c_adapter *adap,
458 struct i2c_board_info *info,
459 unsigned short const *addr_list,
460 int (*probe)(struct i2c_adapter *adap, unsigned short addr));
461
462
463int i2c_probe_func_quick_read(struct i2c_adapter *adap, unsigned short addr);
464
465struct i2c_client *
466i2c_new_dummy_device(struct i2c_adapter *adapter, u16 address);
467
468struct i2c_client *
469devm_i2c_new_dummy_device(struct device *dev, struct i2c_adapter *adap, u16 address);
470
471struct i2c_client *
472i2c_new_ancillary_device(struct i2c_client *client,
473 const char *name,
474 u16 default_addr);
475
476void i2c_unregister_device(struct i2c_client *client);
477#endif
478
479
480
481
482
483#ifdef CONFIG_I2C_BOARDINFO
484int
485i2c_register_board_info(int busnum, struct i2c_board_info const *info,
486 unsigned n);
487#else
488static inline int
489i2c_register_board_info(int busnum, struct i2c_board_info const *info,
490 unsigned n)
491{
492 return 0;
493}
494#endif
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522struct i2c_algorithm {
523
524
525
526
527
528
529
530
531
532 int (*master_xfer)(struct i2c_adapter *adap, struct i2c_msg *msgs,
533 int num);
534 int (*master_xfer_atomic)(struct i2c_adapter *adap,
535 struct i2c_msg *msgs, int num);
536 int (*smbus_xfer)(struct i2c_adapter *adap, u16 addr,
537 unsigned short flags, char read_write,
538 u8 command, int size, union i2c_smbus_data *data);
539 int (*smbus_xfer_atomic)(struct i2c_adapter *adap, u16 addr,
540 unsigned short flags, char read_write,
541 u8 command, int size, union i2c_smbus_data *data);
542
543
544 u32 (*functionality)(struct i2c_adapter *adap);
545
546#if IS_ENABLED(CONFIG_I2C_SLAVE)
547 int (*reg_slave)(struct i2c_client *client);
548 int (*unreg_slave)(struct i2c_client *client);
549#endif
550};
551
552
553
554
555
556
557
558
559
560struct i2c_lock_operations {
561 void (*lock_bus)(struct i2c_adapter *adapter, unsigned int flags);
562 int (*trylock_bus)(struct i2c_adapter *adapter, unsigned int flags);
563 void (*unlock_bus)(struct i2c_adapter *adapter, unsigned int flags);
564};
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579struct i2c_timings {
580 u32 bus_freq_hz;
581 u32 scl_rise_ns;
582 u32 scl_fall_ns;
583 u32 scl_int_delay_ns;
584 u32 sda_fall_ns;
585 u32 sda_hold_ns;
586 u32 digital_filter_width_ns;
587 u32 analog_filter_cutoff_freq_hz;
588};
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613struct i2c_bus_recovery_info {
614 int (*recover_bus)(struct i2c_adapter *adap);
615
616 int (*get_scl)(struct i2c_adapter *adap);
617 void (*set_scl)(struct i2c_adapter *adap, int val);
618 int (*get_sda)(struct i2c_adapter *adap);
619 void (*set_sda)(struct i2c_adapter *adap, int val);
620 int (*get_bus_free)(struct i2c_adapter *adap);
621
622 void (*prepare_recovery)(struct i2c_adapter *adap);
623 void (*unprepare_recovery)(struct i2c_adapter *adap);
624
625
626 struct gpio_desc *scl_gpiod;
627 struct gpio_desc *sda_gpiod;
628};
629
630int i2c_recover_bus(struct i2c_adapter *adap);
631
632
633int i2c_generic_scl_recovery(struct i2c_adapter *adap);
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656struct i2c_adapter_quirks {
657 u64 flags;
658 int max_num_msgs;
659 u16 max_write_len;
660 u16 max_read_len;
661 u16 max_comb_1st_msg_len;
662 u16 max_comb_2nd_msg_len;
663};
664
665
666#define I2C_AQ_COMB BIT(0)
667
668#define I2C_AQ_COMB_WRITE_FIRST BIT(1)
669
670#define I2C_AQ_COMB_READ_SECOND BIT(2)
671
672#define I2C_AQ_COMB_SAME_ADDR BIT(3)
673
674#define I2C_AQ_COMB_WRITE_THEN_READ (I2C_AQ_COMB | I2C_AQ_COMB_WRITE_FIRST | \
675 I2C_AQ_COMB_READ_SECOND | I2C_AQ_COMB_SAME_ADDR)
676
677#define I2C_AQ_NO_CLK_STRETCH BIT(4)
678
679#define I2C_AQ_NO_ZERO_LEN_READ BIT(5)
680#define I2C_AQ_NO_ZERO_LEN_WRITE BIT(6)
681#define I2C_AQ_NO_ZERO_LEN (I2C_AQ_NO_ZERO_LEN_READ | I2C_AQ_NO_ZERO_LEN_WRITE)
682
683
684
685
686
687struct i2c_adapter {
688 struct module *owner;
689 unsigned int class;
690 const struct i2c_algorithm *algo;
691 void *algo_data;
692
693
694 const struct i2c_lock_operations *lock_ops;
695 struct rt_mutex bus_lock;
696 struct rt_mutex mux_lock;
697
698 int timeout;
699 int retries;
700 struct device dev;
701 unsigned long locked_flags;
702#define I2C_ALF_IS_SUSPENDED 0
703#define I2C_ALF_SUSPEND_REPORTED 1
704
705 int nr;
706 char name[48];
707 struct completion dev_released;
708
709 struct mutex userspace_clients_lock;
710 struct list_head userspace_clients;
711
712 struct i2c_bus_recovery_info *bus_recovery_info;
713 const struct i2c_adapter_quirks *quirks;
714
715 struct irq_domain *host_notify_domain;
716};
717#define to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev)
718
719static inline void *i2c_get_adapdata(const struct i2c_adapter *adap)
720{
721 return dev_get_drvdata(&adap->dev);
722}
723
724static inline void i2c_set_adapdata(struct i2c_adapter *adap, void *data)
725{
726 dev_set_drvdata(&adap->dev, data);
727}
728
729static inline struct i2c_adapter *
730i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter)
731{
732#if IS_ENABLED(CONFIG_I2C_MUX)
733 struct device *parent = adapter->dev.parent;
734
735 if (parent != NULL && parent->type == &i2c_adapter_type)
736 return to_i2c_adapter(parent);
737 else
738#endif
739 return NULL;
740}
741
742int i2c_for_each_dev(void *data, int (*fn)(struct device *dev, void *data));
743
744
745#define I2C_LOCK_ROOT_ADAPTER BIT(0)
746#define I2C_LOCK_SEGMENT BIT(1)
747
748
749
750
751
752
753
754static inline void
755i2c_lock_bus(struct i2c_adapter *adapter, unsigned int flags)
756{
757 adapter->lock_ops->lock_bus(adapter, flags);
758}
759
760
761
762
763
764
765
766
767
768static inline int
769i2c_trylock_bus(struct i2c_adapter *adapter, unsigned int flags)
770{
771 return adapter->lock_ops->trylock_bus(adapter, flags);
772}
773
774
775
776
777
778
779
780static inline void
781i2c_unlock_bus(struct i2c_adapter *adapter, unsigned int flags)
782{
783 adapter->lock_ops->unlock_bus(adapter, flags);
784}
785
786
787
788
789
790
791
792
793
794
795
796static inline void i2c_mark_adapter_suspended(struct i2c_adapter *adap)
797{
798 i2c_lock_bus(adap, I2C_LOCK_ROOT_ADAPTER);
799 set_bit(I2C_ALF_IS_SUSPENDED, &adap->locked_flags);
800 i2c_unlock_bus(adap, I2C_LOCK_ROOT_ADAPTER);
801}
802
803
804
805
806
807
808
809
810
811static inline void i2c_mark_adapter_resumed(struct i2c_adapter *adap)
812{
813 i2c_lock_bus(adap, I2C_LOCK_ROOT_ADAPTER);
814 clear_bit(I2C_ALF_IS_SUSPENDED, &adap->locked_flags);
815 i2c_unlock_bus(adap, I2C_LOCK_ROOT_ADAPTER);
816}
817
818
819#define I2C_CLASS_HWMON (1<<0)
820#define I2C_CLASS_DDC (1<<3)
821#define I2C_CLASS_SPD (1<<7)
822
823#define I2C_CLASS_DEPRECATED (1<<8)
824
825
826#define I2C_CLIENT_END 0xfffeU
827
828
829#define I2C_ADDRS(addr, addrs...) \
830 ((const unsigned short []){ addr, ## addrs, I2C_CLIENT_END })
831
832
833
834
835
836
837#if IS_ENABLED(CONFIG_I2C)
838int i2c_add_adapter(struct i2c_adapter *adap);
839void i2c_del_adapter(struct i2c_adapter *adap);
840int i2c_add_numbered_adapter(struct i2c_adapter *adap);
841
842int i2c_register_driver(struct module *owner, struct i2c_driver *driver);
843void i2c_del_driver(struct i2c_driver *driver);
844
845
846#define i2c_add_driver(driver) \
847 i2c_register_driver(THIS_MODULE, driver)
848
849static inline bool i2c_client_has_driver(struct i2c_client *client)
850{
851 return !IS_ERR_OR_NULL(client) && client->dev.driver;
852}
853
854
855
856void i2c_clients_command(struct i2c_adapter *adap,
857 unsigned int cmd, void *arg);
858
859struct i2c_adapter *i2c_get_adapter(int nr);
860void i2c_put_adapter(struct i2c_adapter *adap);
861unsigned int i2c_adapter_depth(struct i2c_adapter *adapter);
862
863void i2c_parse_fw_timings(struct device *dev, struct i2c_timings *t, bool use_defaults);
864
865
866static inline u32 i2c_get_functionality(struct i2c_adapter *adap)
867{
868 return adap->algo->functionality(adap);
869}
870
871
872static inline int i2c_check_functionality(struct i2c_adapter *adap, u32 func)
873{
874 return (func & i2c_get_functionality(adap)) == func;
875}
876
877
878
879
880
881
882
883
884static inline bool i2c_check_quirks(struct i2c_adapter *adap, u64 quirks)
885{
886 if (!adap->quirks)
887 return false;
888 return (adap->quirks->flags & quirks) == quirks;
889}
890
891
892static inline int i2c_adapter_id(struct i2c_adapter *adap)
893{
894 return adap->nr;
895}
896
897static inline u8 i2c_8bit_addr_from_msg(const struct i2c_msg *msg)
898{
899 return (msg->addr << 1) | (msg->flags & I2C_M_RD ? 1 : 0);
900}
901
902u8 *i2c_get_dma_safe_msg_buf(struct i2c_msg *msg, unsigned int threshold);
903void i2c_put_dma_safe_msg_buf(u8 *buf, struct i2c_msg *msg, bool xferred);
904
905int i2c_handle_smbus_host_notify(struct i2c_adapter *adap, unsigned short addr);
906
907
908
909
910
911
912
913
914#define module_i2c_driver(__i2c_driver) \
915 module_driver(__i2c_driver, i2c_add_driver, \
916 i2c_del_driver)
917
918
919
920
921
922
923
924
925
926#define builtin_i2c_driver(__i2c_driver) \
927 builtin_driver(__i2c_driver, i2c_add_driver)
928
929#endif
930
931#if IS_ENABLED(CONFIG_OF)
932
933struct i2c_client *of_find_i2c_device_by_node(struct device_node *node);
934
935
936struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node);
937
938
939struct i2c_adapter *of_get_i2c_adapter_by_node(struct device_node *node);
940
941const struct of_device_id
942*i2c_of_match_device(const struct of_device_id *matches,
943 struct i2c_client *client);
944
945int of_i2c_get_board_info(struct device *dev, struct device_node *node,
946 struct i2c_board_info *info);
947
948#else
949
950static inline struct i2c_client *of_find_i2c_device_by_node(struct device_node *node)
951{
952 return NULL;
953}
954
955static inline struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node)
956{
957 return NULL;
958}
959
960static inline struct i2c_adapter *of_get_i2c_adapter_by_node(struct device_node *node)
961{
962 return NULL;
963}
964
965static inline const struct of_device_id
966*i2c_of_match_device(const struct of_device_id *matches,
967 struct i2c_client *client)
968{
969 return NULL;
970}
971
972static inline int of_i2c_get_board_info(struct device *dev,
973 struct device_node *node,
974 struct i2c_board_info *info)
975{
976 return -ENOTSUPP;
977}
978
979#endif
980
981struct acpi_resource;
982struct acpi_resource_i2c_serialbus;
983
984#if IS_ENABLED(CONFIG_ACPI)
985bool i2c_acpi_get_i2c_resource(struct acpi_resource *ares,
986 struct acpi_resource_i2c_serialbus **i2c);
987u32 i2c_acpi_find_bus_speed(struct device *dev);
988struct i2c_client *i2c_acpi_new_device(struct device *dev, int index,
989 struct i2c_board_info *info);
990struct i2c_adapter *i2c_acpi_find_adapter_by_handle(acpi_handle handle);
991#else
992static inline bool i2c_acpi_get_i2c_resource(struct acpi_resource *ares,
993 struct acpi_resource_i2c_serialbus **i2c)
994{
995 return false;
996}
997static inline u32 i2c_acpi_find_bus_speed(struct device *dev)
998{
999 return 0;
1000}
1001static inline struct i2c_client *i2c_acpi_new_device(struct device *dev,
1002 int index, struct i2c_board_info *info)
1003{
1004 return NULL;
1005}
1006static inline struct i2c_adapter *i2c_acpi_find_adapter_by_handle(acpi_handle handle)
1007{
1008 return NULL;
1009}
1010#endif
1011
1012#endif
1013