Lines Matching refs:device
35 struct device;
66 int (*add_dev)(struct device *dev, struct subsys_interface *sif);
67 void (*remove_dev)(struct device *dev, struct subsys_interface *sif);
90 int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
91 char *(*devnode)(struct device *dev, umode_t *mode,
93 void (*release)(struct device *dev);
101 ssize_t (*show)(struct device *dev, struct device_attribute *attr,
103 ssize_t (*store)(struct device *dev, struct device_attribute *attr,
112 ssize_t device_show_ulong(struct device *dev, struct device_attribute *attr,
114 ssize_t device_store_ulong(struct device *dev, struct device_attribute *attr,
116 ssize_t device_show_int(struct device *dev, struct device_attribute *attr,
118 ssize_t device_store_int(struct device *dev, struct device_attribute *attr,
120 ssize_t device_show_bool(struct device *dev, struct device_attribute *attr,
122 ssize_t device_store_bool(struct device *dev, struct device_attribute *attr,
153 int device_create_file(struct device *device,
155 void device_remove_file(struct device *dev,
157 bool device_remove_file_self(struct device *dev,
159 int __must_check device_create_bin_file(struct device *dev,
161 void device_remove_bin_file(struct device *dev,
165 typedef void (*dr_release_t)(struct device *dev, void *res);
166 typedef int (*dr_match_t)(struct device *dev, void *res, void *match_data);
184 void devres_for_each_res(struct device *dev, dr_release_t release,
186 void (*fn)(struct device *, void *, void *),
189 void devres_add(struct device *dev, void *res);
190 void *devres_find(struct device *dev, dr_release_t release,
192 void *devres_get(struct device *dev, void *new_res,
194 void *devres_remove(struct device *dev, dr_release_t release,
196 int devres_destroy(struct device *dev, dr_release_t release,
198 int devres_release(struct device *dev, dr_release_t release,
202 void * __must_check devres_open_group(struct device *dev, void *id, gfp_t gfp);
203 void devres_close_group(struct device *dev, void *id);
204 void devres_remove_group(struct device *dev, void *id);
205 int devres_release_group(struct device *dev, void *id);
208 void *devm_kmalloc(struct device *dev, size_t size, gfp_t gfp) __malloc;
209 void *devm_krealloc(struct device *dev, void *ptr, size_t size,
211 __printf(3, 0) char *devm_kvasprintf(struct device *dev, gfp_t gfp,
213 __printf(3, 4) char *devm_kasprintf(struct device *dev, gfp_t gfp,
215 static inline void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp) in devm_kzalloc()
219 static inline void *devm_kmalloc_array(struct device *dev, in devm_kmalloc_array()
229 static inline void *devm_kcalloc(struct device *dev, in devm_kcalloc()
234 void devm_kfree(struct device *dev, const void *p);
235 char *devm_kstrdup(struct device *dev, const char *s, gfp_t gfp) __malloc;
236 const char *devm_kstrdup_const(struct device *dev, const char *s, gfp_t gfp);
237 void *devm_kmemdup(struct device *dev, const void *src, size_t len, gfp_t gfp);
239 unsigned long devm_get_free_pages(struct device *dev,
241 void devm_free_pages(struct device *dev, unsigned long addr);
243 void __iomem *devm_ioremap_resource(struct device *dev,
245 void __iomem *devm_ioremap_resource_wc(struct device *dev,
248 void __iomem *devm_of_iomap(struct device *dev,
253 int devm_add_action(struct device *dev, void (*action)(void *), void *data);
254 void devm_remove_action(struct device *dev, void (*action)(void *), void *data);
255 void devm_release_action(struct device *dev, void (*action)(void *), void *data);
257 static inline int devm_add_action_or_reset(struct device *dev, in devm_add_action_or_reset()
284 void __percpu *__devm_alloc_percpu(struct device *dev, size_t size,
286 void devm_free_percpu(struct device *dev, void __percpu *pdata);
461 struct device { struct
463 struct device *parent; argument
543 void (*release)(struct device *dev); argument
576 struct device *supplier;
578 struct device *consumer;
580 struct device link_dev;
591 static inline struct device *kobj_to_dev(struct kobject *kobj) in kobj_to_dev()
593 return container_of(kobj, struct device, kobj); in kobj_to_dev()
601 static inline bool device_iommu_mapped(struct device *dev) in device_iommu_mapped()
609 static inline const char *dev_name(const struct device *dev) in dev_name()
618 __printf(2, 3) int dev_set_name(struct device *dev, const char *name, ...);
621 static inline int dev_to_node(struct device *dev) in dev_to_node()
625 static inline void set_dev_node(struct device *dev, int node) in set_dev_node()
630 static inline int dev_to_node(struct device *dev) in dev_to_node()
634 static inline void set_dev_node(struct device *dev, int node) in set_dev_node()
639 static inline struct irq_domain *dev_get_msi_domain(const struct device *dev) in dev_get_msi_domain()
648 static inline void dev_set_msi_domain(struct device *dev, struct irq_domain *d) in dev_set_msi_domain()
655 static inline void *dev_get_drvdata(const struct device *dev) in dev_get_drvdata()
660 static inline void dev_set_drvdata(struct device *dev, void *data) in dev_set_drvdata()
665 static inline struct pm_subsys_data *dev_to_psd(struct device *dev) in dev_to_psd()
670 static inline unsigned int dev_get_uevent_suppress(const struct device *dev) in dev_get_uevent_suppress()
675 static inline void dev_set_uevent_suppress(struct device *dev, int val) in dev_set_uevent_suppress()
680 static inline int device_is_registered(struct device *dev) in device_is_registered()
685 static inline void device_enable_async_suspend(struct device *dev) in device_enable_async_suspend()
691 static inline void device_disable_async_suspend(struct device *dev) in device_disable_async_suspend()
697 static inline bool device_async_suspend_enabled(struct device *dev) in device_async_suspend_enabled()
702 static inline bool device_pm_not_required(struct device *dev) in device_pm_not_required()
707 static inline void device_set_pm_not_required(struct device *dev) in device_set_pm_not_required()
712 static inline void dev_pm_syscore_device(struct device *dev, bool val) in dev_pm_syscore_device()
719 static inline void dev_pm_set_driver_flags(struct device *dev, u32 flags) in dev_pm_set_driver_flags()
724 static inline bool dev_pm_test_driver_flags(struct device *dev, u32 flags) in dev_pm_test_driver_flags()
729 static inline void device_lock(struct device *dev) in device_lock()
734 static inline int device_lock_interruptible(struct device *dev) in device_lock_interruptible()
739 static inline int device_trylock(struct device *dev) in device_trylock()
744 static inline void device_unlock(struct device *dev) in device_unlock()
749 static inline void device_lock_assert(struct device *dev) in device_lock_assert()
754 static inline struct device_node *dev_of_node(struct device *dev) in dev_of_node()
761 static inline bool dev_has_sync_state(struct device *dev) in dev_has_sync_state()
775 int __must_check device_register(struct device *dev);
776 void device_unregister(struct device *dev);
777 void device_initialize(struct device *dev);
778 int __must_check device_add(struct device *dev);
779 void device_del(struct device *dev);
780 int device_for_each_child(struct device *dev, void *data,
781 int (*fn)(struct device *dev, void *data));
782 int device_for_each_child_reverse(struct device *dev, void *data,
783 int (*fn)(struct device *dev, void *data));
784 struct device *device_find_child(struct device *dev, void *data,
785 int (*match)(struct device *dev, void *data));
786 struct device *device_find_child_by_name(struct device *parent,
788 int device_rename(struct device *dev, const char *new_name);
789 int device_move(struct device *dev, struct device *new_parent,
791 int device_change_owner(struct device *dev, kuid_t kuid, kgid_t kgid);
792 const char *device_get_devnode(struct device *dev, umode_t *mode, kuid_t *uid,
794 int device_is_dependent(struct device *dev, void *target);
796 static inline bool device_supports_offline(struct device *dev) in device_supports_offline()
804 int device_offline(struct device *dev);
805 int device_online(struct device *dev);
806 void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode);
807 void set_secondary_fwnode(struct device *dev, struct fwnode_handle *fwnode);
808 void device_set_of_node_from_dev(struct device *dev, const struct device *dev2);
810 static inline int dev_num_vf(struct device *dev) in dev_num_vf()
820 struct device *__root_device_register(const char *name, struct module *owner);
826 void root_device_unregister(struct device *root);
828 static inline void *dev_get_platdata(const struct device *dev) in dev_get_platdata()
837 int __must_check device_bind_driver(struct device *dev);
838 void device_release_driver(struct device *dev);
839 int __must_check device_attach(struct device *dev);
841 void device_initial_probe(struct device *dev);
842 int __must_check device_reprobe(struct device *dev);
844 bool device_is_bound(struct device *dev);
849 __printf(5, 6) struct device *
850 device_create(struct class *cls, struct device *parent, dev_t devt,
852 __printf(6, 7) struct device *
853 device_create_with_groups(struct class *cls, struct device *parent, dev_t devt,
858 int __must_check device_add_groups(struct device *dev,
860 void device_remove_groups(struct device *dev,
863 static inline int __must_check device_add_group(struct device *dev, in device_add_group()
871 static inline void device_remove_group(struct device *dev, in device_remove_group()
879 int __must_check devm_device_add_groups(struct device *dev,
881 void devm_device_remove_groups(struct device *dev,
883 int __must_check devm_device_add_group(struct device *dev,
885 void devm_device_remove_group(struct device *dev,
894 extern int (*platform_notify)(struct device *dev);
896 extern int (*platform_notify_remove)(struct device *dev);
903 struct device *get_device(struct device *dev);
904 void put_device(struct device *dev);
905 bool kill_device(struct device *dev);
917 const char *dev_driver_string(const struct device *dev);
920 struct device_link *device_link_add(struct device *consumer,
921 struct device *supplier, u32 flags);
923 void device_link_remove(void *consumer, struct device *supplier);
928 int dev_err_probe(const struct device *dev, int err, const char *fmt, ...);