History

iio: afe: rescale: expose scale processing function

In preparation for the addition of kunit tests, expose the logic responsible for combining channel scales.

Liam Beguin committed 4 years ago

Commit bc437f71 parent b59c0412 files · +60 −37Browse files

Showing the changes to include (1 of 2 files). Show all

Unified · Split

include/linux/iio/afe/rescale.h+32−0
@@ -0,0 +1,32 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Copyright (C) 2018 Axentia Technologies AB
4 */
5
6#ifndef __IIO_RESCALE_H__
7#define __IIO_RESCALE_H__
8
9#include <linux/types.h>
10#include <linux/iio/iio.h>
11
12struct device;
13struct rescale;
14
15struct rescale_cfg {
16 enum iio_chan_type type;
17 int (*props)(struct device *dev, struct rescale *rescale);
18};
19
20struct 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};
29
30int rescale_process_scale(struct rescale *rescale, int scale_type,
31 int *val, int *val2);
32#endif /* __IIO_RESCALE_H__ */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t