summaryrefslogtreecommitdiff
path: root/include/linux/rational.h
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2021-07-05 11:20:30 -0400
committerTom Rini <[email protected]>2021-07-05 11:20:30 -0400
commit6194b45a83bde42cd2f404123823e5b326702001 (patch)
treeeef0284dfb378d20ee3a21577d3f7abb4f127fd5 /include/linux/rational.h
parent840658b093976390e9537724f802281c9c8439f5 (diff)
parent03b61ffe5a780d6e8301df16e4e60b3dcd1d0b66 (diff)
Merge branch 'next'
Diffstat (limited to 'include/linux/rational.h')
-rw-r--r--include/linux/rational.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/rational.h b/include/linux/rational.h
new file mode 100644
index 00000000000..33f5f5fc3e3
--- /dev/null
+++ b/include/linux/rational.h
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * rational fractions
+ *
+ * Copyright (C) 2009 emlix GmbH, Oskar Schirmer <[email protected]>
+ *
+ * helper functions when coping with rational numbers,
+ * e.g. when calculating optimum numerator/denominator pairs for
+ * pll configuration taking into account restricted register size
+ */
+
+#ifndef _LINUX_RATIONAL_H
+#define _LINUX_RATIONAL_H
+
+void rational_best_approximation(
+ unsigned long given_numerator, unsigned long given_denominator,
+ unsigned long max_numerator, unsigned long max_denominator,
+ unsigned long *best_numerator, unsigned long *best_denominator);
+
+#endif /* _LINUX_RATIONAL_H */