drm/panel-edp: Add STA 116QHD024002
[drm/drm-misc.git] / include / linux / iio / afe / rescale.h
blob6eecb435488f111cabb0728d8e252a688890f529
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * Copyright (C) 2018 Axentia Technologies AB
4 */
6 #ifndef __IIO_RESCALE_H__
7 #define __IIO_RESCALE_H__
9 #include <linux/types.h>
10 #include <linux/iio/iio.h>
12 struct device;
13 struct rescale;
15 struct rescale_cfg {
16 enum iio_chan_type type;
17 int (*props)(struct device *dev, struct rescale *rescale);
20 struct rescale {
21 const struct rescale_cfg *cfg;
22 struct iio_channel *source;
23 struct iio_chan_spec chan;
24 struct iio_chan_spec_ext_info *ext_info;
25 bool chan_processed;
26 s32 numerator;
27 s32 denominator;
28 s32 offset;
31 int rescale_process_scale(struct rescale *rescale, int scale_type,
32 int *val, int *val2);
33 int rescale_process_offset(struct rescale *rescale, int scale_type,
34 int scale, int scale2, int schan_off,
35 int *val, int *val2);
36 #endif /* __IIO_RESCALE_H__ */