Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
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     /* serialize access to the device */
0021     struct mutex lock;
0022     struct device *dev;
0023     int state;
0024     /*
0025      * priv pointer is solely for serdev driver private data. We keep it
0026      * here because driver_data inside dev has been already used for iio and
0027      * struct serdev_device doesn't have one.
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