18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * STMicroelectronics uvis25 sensor driver
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright 2017 STMicroelectronics Inc.
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#ifndef ST_UVIS25_H
118c2ecf20Sopenharmony_ci#define ST_UVIS25_H
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#define ST_UVIS25_DEV_NAME		"uvis25"
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci#include <linux/iio/iio.h>
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci/**
188c2ecf20Sopenharmony_ci * struct st_uvis25_hw - ST UVIS25 sensor instance
198c2ecf20Sopenharmony_ci * @regmap: Register map of the device.
208c2ecf20Sopenharmony_ci * @trig: The trigger in use by the driver.
218c2ecf20Sopenharmony_ci * @enabled: Status of the sensor (false->off, true->on).
228c2ecf20Sopenharmony_ci * @irq: Device interrupt line (I2C or SPI).
238c2ecf20Sopenharmony_ci */
248c2ecf20Sopenharmony_cistruct st_uvis25_hw {
258c2ecf20Sopenharmony_ci	struct regmap *regmap;
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci	struct iio_trigger *trig;
288c2ecf20Sopenharmony_ci	bool enabled;
298c2ecf20Sopenharmony_ci	int irq;
308c2ecf20Sopenharmony_ci	/* Ensure timestamp is naturally aligned */
318c2ecf20Sopenharmony_ci	struct {
328c2ecf20Sopenharmony_ci		u8 chan;
338c2ecf20Sopenharmony_ci		s64 ts __aligned(8);
348c2ecf20Sopenharmony_ci	} scan;
358c2ecf20Sopenharmony_ci};
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ciextern const struct dev_pm_ops st_uvis25_pm_ops;
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ciint st_uvis25_probe(struct device *dev, int irq, struct regmap *regmap);
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci#endif /* ST_UVIS25_H */
42