diff options
Diffstat (limited to 'include/linux/iio/iio.h')
-rw-r--r-- | include/linux/iio/iio.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index c0ae76ac4e0b..7806c24e5bc8 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h | |||
@@ -618,4 +618,20 @@ static inline struct dentry *iio_get_debugfs_dentry(struct iio_dev *indio_dev) | |||
618 | }; | 618 | }; |
619 | #endif | 619 | #endif |
620 | 620 | ||
621 | /** | ||
622 | * IIO_DEGREE_TO_RAD() - Convert degree to rad | ||
623 | * @deg: A value in degree | ||
624 | * | ||
625 | * Returns the given value converted from degree to rad | ||
626 | */ | ||
627 | #define IIO_DEGREE_TO_RAD(deg) (((deg) * 314159ULL + 9000000ULL) / 18000000ULL) | ||
628 | |||
629 | /** | ||
630 | * IIO_G_TO_M_S_2() - Convert g to meter / second**2 | ||
631 | * @g: A value in g | ||
632 | * | ||
633 | * Returns the given value converted from g to meter / second**2 | ||
634 | */ | ||
635 | #define IIO_G_TO_M_S_2(g) ((g) * 980665ULL / 100000ULL) | ||
636 | |||
621 | #endif /* _INDUSTRIAL_IO_H_ */ | 637 | #endif /* _INDUSTRIAL_IO_H_ */ |