Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / drivers / iio / chemical / sps30.h
bloba58ee43cf45d9f6733e34f4a987c168b945ea32f
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _SPS30_H
3 #define _SPS30_H
5 #include <linux/types.h>
7 struct sps30_state;
8 struct sps30_ops {
9 int (*start_meas)(struct sps30_state *state);
10 int (*stop_meas)(struct sps30_state *state);
11 int (*read_meas)(struct sps30_state *state, __be32 *meas, size_t num);
12 int (*reset)(struct sps30_state *state);
13 int (*clean_fan)(struct sps30_state *state);
14 int (*read_cleaning_period)(struct sps30_state *state, __be32 *period);
15 int (*write_cleaning_period)(struct sps30_state *state, __be32 period);
16 int (*show_info)(struct sps30_state *state);
19 struct sps30_state {
20 /* serialize access to the device */
21 struct mutex lock;
22 struct device *dev;
23 int state;
25 * priv pointer is solely for serdev driver private data. We keep it
26 * here because driver_data inside dev has been already used for iio and
27 * struct serdev_device doesn't have one.
29 void *priv;
30 const struct sps30_ops *ops;
33 int sps30_probe(struct device *dev, const char *name, void *priv, const struct sps30_ops *ops);
35 #endif