~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/media/media-devnode.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/media/media-devnode.h (Version linux-6.12-rc7) and /include/media/media-devnode.h (Version linux-4.19.322)


** Warning: Cannot open xref database.

  1 /* SPDX-License-Identifier: GPL-2.0-only */         1 
  2 /*                                                
  3  * Media device node                              
  4  *                                                
  5  * Copyright (C) 2010 Nokia Corporation           
  6  *                                                
  7  * Contacts: Laurent Pinchart <laurent.pinchar    
  8  *           Sakari Ailus <sakari.ailus@iki.fi    
  9  *                                                
 10  * --                                             
 11  *                                                
 12  * Common functions for media-related drivers     
 13  * device nodes.                                  
 14  */                                               
 15                                                   
 16 #ifndef _MEDIA_DEVNODE_H                          
 17 #define _MEDIA_DEVNODE_H                          
 18                                                   
 19 #include <linux/poll.h>                           
 20 #include <linux/fs.h>                             
 21 #include <linux/device.h>                         
 22 #include <linux/cdev.h>                           
 23                                                   
 24 struct media_device;                              
 25                                                   
 26 /*                                                
 27  * Flag to mark the media_devnode struct as re    
 28  * this flag directly, it will be set and clea    
 29  * media_devnode_unregister.                      
 30  */                                               
 31 #define MEDIA_FLAG_REGISTERED   0                 
 32                                                   
 33 /**                                               
 34  * struct media_file_operations - Media device    
 35  *                                                
 36  * @owner: should be filled with %THIS_MODULE     
 37  * @read: pointer to the function that impleme    
 38  * @write: pointer to the function that implem    
 39  * @poll: pointer to the function that impleme    
 40  * @ioctl: pointer to the function that implem    
 41  * @compat_ioctl: pointer to the function that    
 42  *      calls to the ioctl() syscall on a Kern    
 43  * @open: pointer to the function that impleme    
 44  * @release: pointer to the function that will    
 45  *      by the @open function.                    
 46  */                                               
 47 struct media_file_operations {                    
 48         struct module *owner;                     
 49         ssize_t (*read) (struct file *, char _    
 50         ssize_t (*write) (struct file *, const    
 51         __poll_t (*poll) (struct file *, struc    
 52         long (*ioctl) (struct file *, unsigned    
 53         long (*compat_ioctl) (struct file *, u    
 54         int (*open) (struct file *);              
 55         int (*release) (struct file *);           
 56 };                                                
 57                                                   
 58 /**                                               
 59  * struct media_devnode - Media device node       
 60  * @media_dev:  pointer to struct &media_devic    
 61  * @fops:       pointer to struct &media_file_    
 62  * @dev:        pointer to struct &device cont    
 63  * @cdev:       struct cdev pointer character     
 64  * @parent:     parent device                     
 65  * @minor:      device node minor number          
 66  * @flags:      flags, combination of the ``ME    
 67  * @release:    release callback called at the    
 68  *              routine at media-device.c.        
 69  *                                                
 70  * This structure represents a media-related d    
 71  *                                                
 72  * The @parent is a physical device. It must b    
 73  * before registering the node.                   
 74  */                                               
 75 struct media_devnode {                            
 76         struct media_device *media_dev;           
 77                                                   
 78         /* device ops */                          
 79         const struct media_file_operations *fo    
 80                                                   
 81         /* sysfs */                               
 82         struct device dev;              /* med    
 83         struct cdev cdev;               /* cha    
 84         struct device *parent;          /* dev    
 85                                                   
 86         /* device info */                         
 87         int minor;                                
 88         unsigned long flags;            /* Use    
 89                                                   
 90         /* callbacks */                           
 91         void (*release)(struct media_devnode *    
 92 };                                                
 93                                                   
 94 /* dev to media_devnode */                        
 95 #define to_media_devnode(cd) container_of(cd,     
 96                                                   
 97 /**                                               
 98  * media_devnode_register - register a media d    
 99  *                                                
100  * @mdev: struct media_device we want to regis    
101  * @devnode: media device node structure we wa    
102  * @owner: should be filled with %THIS_MODULE     
103  *                                                
104  * The registration code assigns minor numbers    
105  * with the kernel. An error is returned if no    
106  * or if the registration of the device node f    
107  *                                                
108  * Zero is returned on success.                   
109  *                                                
110  * Note that if the media_devnode_register cal    
111  * the media_devnode structure is *not* called    
112  * freeing any data.                              
113  */                                               
114 int __must_check media_devnode_register(struct    
115                                         struct    
116                                         struct    
117                                                   
118 /**                                               
119  * media_devnode_unregister_prepare - clear th    
120  * @devnode: the device node to prepare for un    
121  *                                                
122  * This clears the passed device register bit.    
123  * with errors. Should be called before media_    
124  * races with unregister and device file open     
125  *                                                
126  * This function can safely be called if the d    
127  * registered or has already been unregistered    
128  */                                               
129 void media_devnode_unregister_prepare(struct m    
130                                                   
131 /**                                               
132  * media_devnode_unregister - unregister a med    
133  * @devnode: the device node to unregister        
134  *                                                
135  * This unregisters the passed device. Future     
136  * errors.                                        
137  *                                                
138  * Should be called after media_devnode_unregi    
139  */                                               
140 void media_devnode_unregister(struct media_dev    
141                                                   
142 /**                                               
143  * media_devnode_data - returns a pointer to t    
144  *                                                
145  * @filp: pointer to struct &file                 
146  */                                               
147 static inline struct media_devnode *media_devn    
148 {                                                 
149         return filp->private_data;                
150 }                                                 
151                                                   
152 /**                                               
153  * media_devnode_is_registered - returns true     
154  *      false otherwise.                          
155  *                                                
156  * @devnode: pointer to struct &media_devnode.    
157  *                                                
158  * Note: If mdev is NULL, it also returns fals    
159  */                                               
160 static inline int media_devnode_is_registered(    
161 {                                                 
162         if (!devnode)                             
163                 return false;                     
164                                                   
165         return test_bit(MEDIA_FLAG_REGISTERED,    
166 }                                                 
167                                                   
168 #endif /* _MEDIA_DEVNODE_H */                     
169                                                   

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php