Lines Matching refs:device
32 struct device;
108 struct device *dev_root;
114 int (*match)(struct device *dev, struct device_driver *drv);
115 int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
116 int (*probe)(struct device *dev);
117 int (*remove)(struct device *dev);
118 void (*shutdown)(struct device *dev);
120 int (*online)(struct device *dev);
121 int (*offline)(struct device *dev);
123 int (*suspend)(struct device *dev, pm_message_t state);
124 int (*resume)(struct device *dev);
147 struct device *start,
149 struct device *subsys_dev_iter_next(struct subsys_dev_iter *iter);
152 int bus_for_each_dev(struct bus_type *bus, struct device *start, void *data,
153 int (*fn)(struct device *dev, void *data));
154 struct device *bus_find_device(struct bus_type *bus, struct device *start,
156 int (*match)(struct device *dev, void *data));
157 struct device *bus_find_device_by_name(struct bus_type *bus,
158 struct device *start,
160 struct device *subsys_find_device_by_id(struct bus_type *bus, unsigned int id,
161 struct device *hint);
165 int (*compare)(const struct device *a,
166 const struct device *b));
272 int (*probe) (struct device *dev);
273 int (*remove) (struct device *dev);
274 void (*shutdown) (struct device *dev);
275 int (*suspend) (struct device *dev, pm_message_t state);
276 int (*resume) (struct device *dev);
318 struct device *start,
320 int (*fn)(struct device *dev,
322 struct device *driver_find_device(struct device_driver *drv,
323 struct device *start, void *data,
324 int (*match)(struct device *dev, void *data));
343 int (*add_dev)(struct device *dev, struct subsys_interface *sif);
344 void (*remove_dev)(struct device *dev, struct subsys_interface *sif);
391 int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env);
392 char *(*devnode)(struct device *dev, umode_t *mode);
395 void (*dev_release)(struct device *dev);
397 int (*suspend)(struct device *dev, pm_message_t state);
398 int (*resume)(struct device *dev);
401 const void *(*namespace)(struct device *dev);
430 int class_compat_create_link(struct class_compat *cls, struct device *dev,
431 struct device *device_link);
432 void class_compat_remove_link(struct class_compat *cls, struct device *dev,
433 struct device *device_link);
437 struct device *start,
439 extern struct device *class_dev_iter_next(struct class_dev_iter *iter);
442 extern int class_for_each_device(struct class *class, struct device *start,
444 int (*fn)(struct device *dev, void *data));
445 extern struct device *class_find_device(struct class *class,
446 struct device *start, const void *data,
447 int (*match)(struct device *, const void *));
503 int (*add_dev) (struct device *, struct class_interface *);
504 void (*remove_dev) (struct device *, struct class_interface *);
535 int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
536 char *(*devnode)(struct device *dev, umode_t *mode,
538 void (*release)(struct device *dev);
546 ssize_t (*show)(struct device *dev, struct device_attribute *attr,
548 ssize_t (*store)(struct device *dev, struct device_attribute *attr,
557 ssize_t device_show_ulong(struct device *dev, struct device_attribute *attr,
559 ssize_t device_store_ulong(struct device *dev, struct device_attribute *attr,
561 ssize_t device_show_int(struct device *dev, struct device_attribute *attr,
563 ssize_t device_store_int(struct device *dev, struct device_attribute *attr,
565 ssize_t device_show_bool(struct device *dev, struct device_attribute *attr,
567 ssize_t device_store_bool(struct device *dev, struct device_attribute *attr,
591 extern int device_create_file(struct device *device,
593 extern void device_remove_file(struct device *dev,
595 extern bool device_remove_file_self(struct device *dev,
597 extern int __must_check device_create_bin_file(struct device *dev,
599 extern void device_remove_bin_file(struct device *dev,
603 typedef void (*dr_release_t)(struct device *dev, void *res);
604 typedef int (*dr_match_t)(struct device *dev, void *res, void *match_data);
622 extern void devres_for_each_res(struct device *dev, dr_release_t release,
624 void (*fn)(struct device *, void *, void *),
627 extern void devres_add(struct device *dev, void *res);
628 extern void *devres_find(struct device *dev, dr_release_t release,
630 extern void *devres_get(struct device *dev, void *new_res,
632 extern void *devres_remove(struct device *dev, dr_release_t release,
634 extern int devres_destroy(struct device *dev, dr_release_t release,
636 extern int devres_release(struct device *dev, dr_release_t release,
640 extern void * __must_check devres_open_group(struct device *dev, void *id,
642 extern void devres_close_group(struct device *dev, void *id);
643 extern void devres_remove_group(struct device *dev, void *id);
644 extern int devres_release_group(struct device *dev, void *id);
647 extern void *devm_kmalloc(struct device *dev, size_t size, gfp_t gfp);
649 char *devm_kvasprintf(struct device *dev, gfp_t gfp, const char *fmt,
652 char *devm_kasprintf(struct device *dev, gfp_t gfp, const char *fmt, ...);
653 static inline void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp) in devm_kzalloc()
657 static inline void *devm_kmalloc_array(struct device *dev, in devm_kmalloc_array()
664 static inline void *devm_kcalloc(struct device *dev, in devm_kcalloc()
669 extern void devm_kfree(struct device *dev, void *p);
670 extern char *devm_kstrdup(struct device *dev, const char *s, gfp_t gfp);
671 extern void *devm_kmemdup(struct device *dev, const void *src, size_t len,
674 extern unsigned long devm_get_free_pages(struct device *dev,
676 extern void devm_free_pages(struct device *dev, unsigned long addr);
678 void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res);
681 int devm_add_action(struct device *dev, void (*action)(void *), void *data);
682 void devm_remove_action(struct device *dev, void (*action)(void *), void *data);
764 struct device { struct
765 struct device *parent; argument
834 void (*release)(struct device *dev); argument
841 static inline struct device *kobj_to_dev(struct kobject *kobj) in kobj_to_dev() argument
843 return container_of(kobj, struct device, kobj); in kobj_to_dev()
849 static inline const char *dev_name(const struct device *dev) in dev_name()
859 int dev_set_name(struct device *dev, const char *name, ...);
862 static inline int dev_to_node(struct device *dev) in dev_to_node()
866 static inline void set_dev_node(struct device *dev, int node) in set_dev_node()
871 static inline int dev_to_node(struct device *dev) in dev_to_node()
875 static inline void set_dev_node(struct device *dev, int node) in set_dev_node()
880 static inline struct irq_domain *dev_get_msi_domain(const struct device *dev) in dev_get_msi_domain()
889 static inline void dev_set_msi_domain(struct device *dev, struct irq_domain *d) in dev_set_msi_domain()
896 static inline void *dev_get_drvdata(const struct device *dev) in dev_get_drvdata()
901 static inline void dev_set_drvdata(struct device *dev, void *data) in dev_set_drvdata()
906 static inline struct pm_subsys_data *dev_to_psd(struct device *dev) in dev_to_psd()
911 static inline unsigned int dev_get_uevent_suppress(const struct device *dev) in dev_get_uevent_suppress()
916 static inline void dev_set_uevent_suppress(struct device *dev, int val) in dev_set_uevent_suppress()
921 static inline int device_is_registered(struct device *dev) in device_is_registered()
926 static inline void device_enable_async_suspend(struct device *dev) in device_enable_async_suspend()
932 static inline void device_disable_async_suspend(struct device *dev) in device_disable_async_suspend()
938 static inline bool device_async_suspend_enabled(struct device *dev) in device_async_suspend_enabled()
943 static inline void pm_suspend_ignore_children(struct device *dev, bool enable) in pm_suspend_ignore_children()
948 static inline void dev_pm_syscore_device(struct device *dev, bool val) in dev_pm_syscore_device()
955 static inline void device_lock(struct device *dev) in device_lock()
960 static inline int device_trylock(struct device *dev) in device_trylock()
965 static inline void device_unlock(struct device *dev) in device_unlock()
970 static inline void device_lock_assert(struct device *dev) in device_lock_assert()
975 static inline struct device_node *dev_of_node(struct device *dev) in dev_of_node()
987 extern int __must_check device_register(struct device *dev);
988 extern void device_unregister(struct device *dev);
989 extern void device_initialize(struct device *dev);
990 extern int __must_check device_add(struct device *dev);
991 extern void device_del(struct device *dev);
992 extern int device_for_each_child(struct device *dev, void *data,
993 int (*fn)(struct device *dev, void *data));
994 extern int device_for_each_child_reverse(struct device *dev, void *data,
995 int (*fn)(struct device *dev, void *data));
996 extern struct device *device_find_child(struct device *dev, void *data,
997 int (*match)(struct device *dev, void *data));
998 extern int device_rename(struct device *dev, const char *new_name);
999 extern int device_move(struct device *dev, struct device *new_parent,
1001 extern const char *device_get_devnode(struct device *dev,
1005 static inline bool device_supports_offline(struct device *dev) in device_supports_offline()
1013 extern int device_offline(struct device *dev);
1014 extern int device_online(struct device *dev);
1015 extern void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode);
1016 extern void set_secondary_fwnode(struct device *dev, struct fwnode_handle *fwnode);
1021 extern struct device *__root_device_register(const char *name,
1028 extern void root_device_unregister(struct device *root);
1030 static inline void *dev_get_platdata(const struct device *dev) in dev_get_platdata()
1039 extern int __must_check device_bind_driver(struct device *dev);
1040 extern void device_release_driver(struct device *dev);
1041 extern int __must_check device_attach(struct device *dev);
1043 extern void device_initial_probe(struct device *dev);
1044 extern int __must_check device_reprobe(struct device *dev);
1050 struct device *device_create_vargs(struct class *cls, struct device *parent,
1054 struct device *device_create(struct class *cls, struct device *parent,
1058 struct device *device_create_with_groups(struct class *cls,
1059 struct device *parent, dev_t devt, void *drvdata,
1070 extern int (*platform_notify)(struct device *dev);
1072 extern int (*platform_notify_remove)(struct device *dev);
1079 extern struct device *get_device(struct device *dev);
1080 extern void put_device(struct device *dev);
1083 extern int devtmpfs_create_node(struct device *dev);
1084 extern int devtmpfs_delete_node(struct device *dev);
1087 static inline int devtmpfs_create_node(struct device *dev) { return 0; } in devtmpfs_create_node()
1088 static inline int devtmpfs_delete_node(struct device *dev) { return 0; } in devtmpfs_delete_node()
1096 extern const char *dev_driver_string(const struct device *dev);
1102 int dev_vprintk_emit(int level, const struct device *dev,
1105 int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...);
1108 void dev_printk(const char *level, const struct device *dev,
1111 void dev_emerg(const struct device *dev, const char *fmt, ...);
1113 void dev_alert(const struct device *dev, const char *fmt, ...);
1115 void dev_crit(const struct device *dev, const char *fmt, ...);
1117 void dev_err(const struct device *dev, const char *fmt, ...);
1119 void dev_warn(const struct device *dev, const char *fmt, ...);
1121 void dev_notice(const struct device *dev, const char *fmt, ...);
1123 void _dev_info(const struct device *dev, const char *fmt, ...);
1128 int dev_vprintk_emit(int level, const struct device *dev, in dev_vprintk_emit()
1132 int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...) in dev_printk_emit()
1135 static inline void __dev_printk(const char *level, const struct device *dev, in __dev_printk()
1139 void dev_printk(const char *level, const struct device *dev, in dev_printk()
1144 void dev_emerg(const struct device *dev, const char *fmt, ...) in dev_emerg()
1147 void dev_crit(const struct device *dev, const char *fmt, ...) in dev_crit()
1150 void dev_alert(const struct device *dev, const char *fmt, ...) in dev_alert()
1153 void dev_err(const struct device *dev, const char *fmt, ...) in dev_err()
1156 void dev_warn(const struct device *dev, const char *fmt, ...) in dev_warn()
1159 void dev_notice(const struct device *dev, const char *fmt, ...) in dev_notice()
1162 void _dev_info(const struct device *dev, const char *fmt, ...) in _dev_info()