xref: /dflybsd-src/sys/dev/drm/include/linux/sysfs.h (revision 15dba7a934ccec493b5479b70a07107f7689c597)
1*15dba7a9SFrançois Tigeot /*
2*15dba7a9SFrançois Tigeot  * Copyright (c) 2018 François Tigeot <ftigeot@wolfpond.org>
3*15dba7a9SFrançois Tigeot  * All rights reserved.
4*15dba7a9SFrançois Tigeot  *
5*15dba7a9SFrançois Tigeot  * Redistribution and use in source and binary forms, with or without
6*15dba7a9SFrançois Tigeot  * modification, are permitted provided that the following conditions
7*15dba7a9SFrançois Tigeot  * are met:
8*15dba7a9SFrançois Tigeot  * 1. Redistributions of source code must retain the above copyright
9*15dba7a9SFrançois Tigeot  *    notice unmodified, this list of conditions, and the following
10*15dba7a9SFrançois Tigeot  *    disclaimer.
11*15dba7a9SFrançois Tigeot  * 2. Redistributions in binary form must reproduce the above copyright
12*15dba7a9SFrançois Tigeot  *    notice, this list of conditions and the following disclaimer in the
13*15dba7a9SFrançois Tigeot  *    documentation and/or other materials provided with the distribution.
14*15dba7a9SFrançois Tigeot  *
15*15dba7a9SFrançois Tigeot  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16*15dba7a9SFrançois Tigeot  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17*15dba7a9SFrançois Tigeot  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18*15dba7a9SFrançois Tigeot  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19*15dba7a9SFrançois Tigeot  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20*15dba7a9SFrançois Tigeot  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21*15dba7a9SFrançois Tigeot  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22*15dba7a9SFrançois Tigeot  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23*15dba7a9SFrançois Tigeot  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24*15dba7a9SFrançois Tigeot  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*15dba7a9SFrançois Tigeot  */
26*15dba7a9SFrançois Tigeot 
27*15dba7a9SFrançois Tigeot #ifndef _LINUX_SYSFS_H_
28*15dba7a9SFrançois Tigeot #define _LINUX_SYSFS_H_
29*15dba7a9SFrançois Tigeot 
30*15dba7a9SFrançois Tigeot #include <linux/compiler.h>
31*15dba7a9SFrançois Tigeot #include <linux/errno.h>
32*15dba7a9SFrançois Tigeot #include <linux/list.h>
33*15dba7a9SFrançois Tigeot #include <linux/lockdep.h>
34*15dba7a9SFrançois Tigeot #include <linux/atomic.h>
35*15dba7a9SFrançois Tigeot 
36*15dba7a9SFrançois Tigeot struct kobject;
37*15dba7a9SFrançois Tigeot 
38*15dba7a9SFrançois Tigeot struct attribute {
39*15dba7a9SFrançois Tigeot 	const char *name;
40*15dba7a9SFrançois Tigeot 	umode_t	mode;
41*15dba7a9SFrançois Tigeot };
42*15dba7a9SFrançois Tigeot 
43*15dba7a9SFrançois Tigeot struct sysfs_ops {
44*15dba7a9SFrançois Tigeot 	ssize_t	(*show)(struct kobject *, struct attribute *,char *);
45*15dba7a9SFrançois Tigeot 	ssize_t	(*store)(struct kobject *,struct attribute *,const char *, size_t);
46*15dba7a9SFrançois Tigeot };
47*15dba7a9SFrançois Tigeot 
48*15dba7a9SFrançois Tigeot #endif	/* _LINUX_SYSFS_H_ */
49