]> git.baikalelectronics.ru Git - kernel.git/commitdiff
regulator: da9211: Move buck modes into header file
authorAnand K Mistry <amistry@google.com>
Thu, 2 Jul 2020 03:15:22 +0000 (13:15 +1000)
committerMark Brown <broonie@kernel.org>
Thu, 2 Jul 2020 15:20:57 +0000 (16:20 +0100)
This will allow device trees to make use of these constants.

Signed-off-by: Anand K Mistry <amistry@google.com>
Link: https://lore.kernel.org/r/20200702131350.1.I96e67ab7b4568287eb939e8a572cbc03e87f1aa0@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/da9211-regulator.c
include/dt-bindings/regulator/dlg,da9211-regulator.h [new file with mode: 0644]

index 2ea4362ffa5c5c559a60c1fd73ae5c5df74cc911..1f9b75b413467b44ee593990b939d9a040f2aef6 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/gpio/consumer.h>
 #include <linux/regulator/of_regulator.h>
 #include <linux/regulator/da9211.h>
+#include <dt-bindings/regulator/dlg,da9211-regulator.h>
 #include "da9211-regulator.h"
 
 /* DEVICE IDs */
 #define DA9213_DEVICE_ID       0x23
 #define DA9215_DEVICE_ID       0x24
 
-#define DA9211_BUCK_MODE_SLEEP 1
-#define DA9211_BUCK_MODE_SYNC  2
-#define DA9211_BUCK_MODE_AUTO  3
-
 /* DA9211 REGULATOR IDs */
 #define DA9211_ID_BUCKA        0
 #define DA9211_ID_BUCKB        1
diff --git a/include/dt-bindings/regulator/dlg,da9211-regulator.h b/include/dt-bindings/regulator/dlg,da9211-regulator.h
new file mode 100644 (file)
index 0000000..cdce2d5
--- /dev/null
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef _DT_BINDINGS_REGULATOR_DLG_DA9211_H
+#define _DT_BINDINGS_REGULATOR_DLG_DA9211_H
+
+/*
+ * These buck mode constants may be used to specify values in device tree
+ * properties (e.g. regulator-initial-mode, regulator-allowed-modes).
+ * A description of the following modes is in the manufacturers datasheet.
+ */
+
+#define DA9211_BUCK_MODE_SLEEP         1
+#define DA9211_BUCK_MODE_SYNC          2
+#define DA9211_BUCK_MODE_AUTO          3
+
+#endif