0001
0002 #ifndef _SPS30_H
0003 #define _SPS30_H
0004
0005 #include <linux/types.h>
0006
0007 struct sps30_state;
0008 struct sps30_ops {
0009 int (*start_meas)(struct sps30_state *state);
0010 int (*stop_meas)(struct sps30_state *state);
0011 int (*read_meas)(struct sps30_state *state, __be32 *meas, size_t num);
0012 int (*reset)(struct sps30_state *state);
0013 int (*clean_fan)(struct sps30_state *state);
0014 int (*read_cleaning_period)(struct sps30_state *state, __be32 *period);
0015 int (*write_cleaning_period)(struct sps30_state *state, __be32 period);
0016 int (*show_info)(struct sps30_state *state);
0017 };
0018
0019 struct sps30_state {
0020
0021 struct mutex lock;
0022 struct device *dev;
0023 int state;
0024
0025
0026
0027
0028
0029 void *priv;
0030 const struct sps30_ops *ops;
0031 };
0032
0033 int sps30_probe(struct device *dev, const char *name, void *priv, const struct sps30_ops *ops);
0034
0035 #endif