Add very basic sysfs attributes for matrix type and the header file
This commit is contained in:
parent
9390d36338
commit
d9fcf6d8d7
|
@ -0,0 +1,30 @@
|
|||
#ifndef _KSUDOKU_H_
|
||||
#define _KSUDOKU_H_
|
||||
#include <linux/init.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/sysfs.h>
|
||||
|
||||
ssize_t is_valid_show(void);
|
||||
ssize_t is_valid_store(void);
|
||||
|
||||
ssize_t is_solved_show(void);
|
||||
ssize_t is_solved_store(void);
|
||||
|
||||
struct matrix_attribute {
|
||||
struct attribute attr;
|
||||
ssize_t (*show)(void);
|
||||
ssize_t (*store)(void);
|
||||
bool value;
|
||||
};
|
||||
|
||||
struct matrix {
|
||||
char matrix[81];
|
||||
};
|
||||
|
||||
#define MATRIX_ATTR_RO(_name) \
|
||||
struct matrix_attribute matrix_##_name = __ATTR_RO(_name)
|
||||
|
||||
#define MATRIX_ATTR_WO(_name) \
|
||||
struct matrix_attribute matrix_##_name = __ATTR_WO(_name)
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue