Lines Matching refs:device

36 struct device;
68 int (*add_dev)(struct device *dev, struct subsys_interface *sif);
69 void (*remove_dev)(struct device *dev, struct subsys_interface *sif);
92 int (*uevent)(const struct device *dev, struct kobj_uevent_env *env);
93 char *(*devnode)(const struct device *dev, umode_t *mode,
95 void (*release)(struct device *dev);
108 ssize_t (*show)(struct device *dev, struct device_attribute *attr,
110 ssize_t (*store)(struct device *dev, struct device_attribute *attr,
124 ssize_t device_show_ulong(struct device *dev, struct device_attribute *attr,
126 ssize_t device_store_ulong(struct device *dev, struct device_attribute *attr,
128 ssize_t device_show_int(struct device *dev, struct device_attribute *attr,
130 ssize_t device_store_int(struct device *dev, struct device_attribute *attr,
132 ssize_t device_show_bool(struct device *dev, struct device_attribute *attr,
134 ssize_t device_store_bool(struct device *dev, struct device_attribute *attr,
259 int device_create_file(struct device *device,
261 void device_remove_file(struct device *dev,
263 bool device_remove_file_self(struct device *dev,
265 int __must_check device_create_bin_file(struct device *dev,
267 void device_remove_bin_file(struct device *dev,
271 typedef void (*dr_release_t)(struct device *dev, void *res);
272 typedef int (*dr_match_t)(struct device *dev, void *res, void *match_data);
281 void devres_for_each_res(struct device *dev, dr_release_t release,
283 void (*fn)(struct device *, void *, void *),
286 void devres_add(struct device *dev, void *res);
287 void *devres_find(struct device *dev, dr_release_t release,
289 void *devres_get(struct device *dev, void *new_res,
291 void *devres_remove(struct device *dev, dr_release_t release,
293 int devres_destroy(struct device *dev, dr_release_t release,
295 int devres_release(struct device *dev, dr_release_t release,
299 void * __must_check devres_open_group(struct device *dev, void *id, gfp_t gfp);
300 void devres_close_group(struct device *dev, void *id);
301 void devres_remove_group(struct device *dev, void *id);
302 int devres_release_group(struct device *dev, void *id);
305 void *devm_kmalloc(struct device *dev, size_t size, gfp_t gfp) __alloc_size(2);
306 void *devm_krealloc(struct device *dev, void *ptr, size_t size,
308 __printf(3, 0) char *devm_kvasprintf(struct device *dev, gfp_t gfp,
310 __printf(3, 4) char *devm_kasprintf(struct device *dev, gfp_t gfp,
312 static inline void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp) in devm_kzalloc()
316 static inline void *devm_kmalloc_array(struct device *dev, in devm_kmalloc_array()
326 static inline void *devm_kcalloc(struct device *dev, in devm_kcalloc()
332 devm_krealloc_array(struct device *dev, void *p, size_t new_n, size_t new_size, gfp_t flags) in devm_krealloc_array()
342 void devm_kfree(struct device *dev, const void *p);
343 char *devm_kstrdup(struct device *dev, const char *s, gfp_t gfp) __malloc;
344 const char *devm_kstrdup_const(struct device *dev, const char *s, gfp_t gfp);
345 void *devm_kmemdup(struct device *dev, const void *src, size_t len, gfp_t gfp)
348 unsigned long devm_get_free_pages(struct device *dev,
350 void devm_free_pages(struct device *dev, unsigned long addr);
353 void __iomem *devm_ioremap_resource(struct device *dev,
355 void __iomem *devm_ioremap_resource_wc(struct device *dev,
358 void __iomem *devm_of_iomap(struct device *dev,
364 void __iomem *devm_ioremap_resource(struct device *dev, in devm_ioremap_resource()
371 void __iomem *devm_ioremap_resource_wc(struct device *dev, in devm_ioremap_resource_wc()
378 void __iomem *devm_of_iomap(struct device *dev, in devm_of_iomap()
388 void devm_remove_action(struct device *dev, void (*action)(void *), void *data);
389 void devm_release_action(struct device *dev, void (*action)(void *), void *data);
391 int __devm_add_action(struct device *dev, void (*action)(void *), void *data, const char *name);
395 static inline int __devm_add_action_or_reset(struct device *dev, void (*action)(void *), in __devm_add_action_or_reset()
424 void __percpu *__devm_alloc_percpu(struct device *dev, size_t size,
426 void devm_free_percpu(struct device *dev, void __percpu *pdata);
705 struct device { struct
707 struct device *parent; argument
787 void (*release)(struct device *dev); argument
825 struct device *supplier;
827 struct device *consumer;
829 struct device link_dev;
838 #define kobj_to_dev(__kobj) container_of_const(__kobj, struct device, kobj)
845 static inline bool device_iommu_mapped(struct device *dev) in device_iommu_mapped()
858 static inline const char *dev_name(const struct device *dev) in dev_name()
874 static inline const char *dev_bus_name(const struct device *dev) in dev_bus_name()
879 __printf(2, 3) int dev_set_name(struct device *dev, const char *name, ...);
882 static inline int dev_to_node(struct device *dev) in dev_to_node()
886 static inline void set_dev_node(struct device *dev, int node) in set_dev_node()
891 static inline int dev_to_node(struct device *dev) in dev_to_node()
895 static inline void set_dev_node(struct device *dev, int node) in set_dev_node()
900 static inline struct irq_domain *dev_get_msi_domain(const struct device *dev) in dev_get_msi_domain()
909 static inline void dev_set_msi_domain(struct device *dev, struct irq_domain *d) in dev_set_msi_domain()
916 static inline void *dev_get_drvdata(const struct device *dev) in dev_get_drvdata()
921 static inline void dev_set_drvdata(struct device *dev, void *data) in dev_set_drvdata()
926 static inline struct pm_subsys_data *dev_to_psd(struct device *dev) in dev_to_psd()
931 static inline unsigned int dev_get_uevent_suppress(const struct device *dev) in dev_get_uevent_suppress()
936 static inline void dev_set_uevent_suppress(struct device *dev, int val) in dev_set_uevent_suppress()
941 static inline int device_is_registered(struct device *dev) in device_is_registered()
946 static inline void device_enable_async_suspend(struct device *dev) in device_enable_async_suspend()
952 static inline void device_disable_async_suspend(struct device *dev) in device_disable_async_suspend()
958 static inline bool device_async_suspend_enabled(struct device *dev) in device_async_suspend_enabled()
963 static inline bool device_pm_not_required(struct device *dev) in device_pm_not_required()
968 static inline void device_set_pm_not_required(struct device *dev) in device_set_pm_not_required()
973 static inline void dev_pm_syscore_device(struct device *dev, bool val) in dev_pm_syscore_device()
980 static inline void dev_pm_set_driver_flags(struct device *dev, u32 flags) in dev_pm_set_driver_flags()
985 static inline bool dev_pm_test_driver_flags(struct device *dev, u32 flags) in dev_pm_test_driver_flags()
990 static inline void device_lock(struct device *dev) in device_lock()
995 static inline int device_lock_interruptible(struct device *dev) in device_lock_interruptible()
1000 static inline int device_trylock(struct device *dev) in device_trylock()
1005 static inline void device_unlock(struct device *dev) in device_unlock()
1010 DEFINE_GUARD(device, struct device *, device_lock(_T), device_unlock(_T)) in DEFINE_GUARD() argument
1012 static inline void device_lock_assert(struct device *dev) in DEFINE_GUARD()
1017 static inline struct device_node *dev_of_node(struct device *dev) in dev_of_node()
1024 static inline bool dev_has_sync_state(struct device *dev) in dev_has_sync_state()
1035 static inline void dev_set_removable(struct device *dev, in dev_set_removable()
1041 static inline bool dev_is_removable(struct device *dev) in dev_is_removable()
1046 static inline bool dev_removable_is_valid(struct device *dev) in dev_removable_is_valid()
1054 int __must_check device_register(struct device *dev);
1055 void device_unregister(struct device *dev);
1056 void device_initialize(struct device *dev);
1057 int __must_check device_add(struct device *dev);
1058 void device_del(struct device *dev);
1060 DEFINE_FREE(device_del, struct device *, if (_T) device_del(_T))
1062 int device_for_each_child(struct device *dev, void *data,
1063 int (*fn)(struct device *dev, void *data));
1064 int device_for_each_child_reverse(struct device *dev, void *data,
1065 int (*fn)(struct device *dev, void *data));
1066 struct device *device_find_child(struct device *dev, void *data,
1067 int (*match)(struct device *dev, void *data));
1068 struct device *device_find_child_by_name(struct device *parent,
1070 struct device *device_find_any_child(struct device *parent);
1072 int device_rename(struct device *dev, const char *new_name);
1073 int device_move(struct device *dev, struct device *new_parent,
1075 int device_change_owner(struct device *dev, kuid_t kuid, kgid_t kgid);
1076 int device_is_dependent(struct device *dev, void *target);
1078 static inline bool device_supports_offline(struct device *dev) in device_supports_offline()
1085 struct device *__d2 __maybe_unused = dev; \
1102 struct device *__d = dev; \
1121 struct device *__d __maybe_unused = dev; \
1129 int device_offline(struct device *dev);
1130 int device_online(struct device *dev);
1131 void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode);
1132 void set_secondary_fwnode(struct device *dev, struct fwnode_handle *fwnode);
1133 void device_set_of_node_from_dev(struct device *dev, const struct device *dev2);
1134 void device_set_node(struct device *dev, struct fwnode_handle *fwnode);
1136 static inline int dev_num_vf(struct device *dev) in dev_num_vf()
1146 struct device *__root_device_register(const char *name, struct module *owner);
1152 void root_device_unregister(struct device *root);
1154 static inline void *dev_get_platdata(const struct device *dev) in dev_get_platdata()
1164 struct device *dev);
1165 int __must_check device_bind_driver(struct device *dev);
1166 void device_release_driver(struct device *dev);
1167 int __must_check device_attach(struct device *dev);
1169 void device_initial_probe(struct device *dev);
1170 int __must_check device_reprobe(struct device *dev);
1172 bool device_is_bound(struct device *dev);
1177 __printf(5, 6) struct device *
1178 device_create(const struct class *cls, struct device *parent, dev_t devt,
1180 __printf(6, 7) struct device *
1181 device_create_with_groups(const struct class *cls, struct device *parent, dev_t devt,
1186 int __must_check device_add_groups(struct device *dev,
1188 void device_remove_groups(struct device *dev,
1191 static inline int __must_check device_add_group(struct device *dev, in device_add_group()
1199 static inline void device_remove_group(struct device *dev, in device_remove_group()
1207 int __must_check devm_device_add_groups(struct device *dev,
1209 int __must_check devm_device_add_group(struct device *dev,
1218 extern int (*platform_notify)(struct device *dev);
1220 extern int (*platform_notify_remove)(struct device *dev);
1227 struct device *get_device(struct device *dev);
1228 void put_device(struct device *dev);
1230 DEFINE_FREE(put_device, struct device *, if (_T) put_device(_T))
1232 bool kill_device(struct device *dev);
1244 const char *dev_driver_string(const struct device *dev);
1247 struct device_link *device_link_add(struct device *consumer,
1248 struct device *supplier, u32 flags);
1250 void device_link_remove(void *consumer, struct device *supplier);