From: Svyatoslav Ryhel <clamor95@gmail.com>
To: Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Svyatoslav Ryhel <clamor95@gmail.com>
Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: [PATCH v1 3/7] regulator: lp872x: Fold driver header into driver file
Date: Tue, 6 Oct 2026 18:44:27 +0300 [thread overview]
Message-ID: <20261006154431.318936-4-clamor95@gmail.com> (raw)
In-Reply-To: <20261006154431.318936-1-clamor95@gmail.com>
Remove need in header file in preparation for pdata probing removal.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
drivers/regulator/lp872x.c | 54 +++++++++++++++++++-
include/linux/regulator/lp872x.h | 86 --------------------------------
2 files changed, 53 insertions(+), 87 deletions(-)
delete mode 100644 include/linux/regulator/lp872x.h
diff --git a/drivers/regulator/lp872x.c b/drivers/regulator/lp872x.c
index 5b2faddd8110f..13dce4dcdbe14 100644
--- a/drivers/regulator/lp872x.c
+++ b/drivers/regulator/lp872x.c
@@ -12,10 +12,10 @@
#include <linux/err.h>
#include <linux/gpio/consumer.h>
#include <linux/delay.h>
-#include <linux/regulator/lp872x.h>
#include <linux/regulator/driver.h>
#include <linux/platform_device.h>
#include <linux/of.h>
+#include <linux/regulator/machine.h>
#include <linux/regulator/of_regulator.h>
/* Registers : LP8720/8725 shared */
@@ -92,11 +92,63 @@
/* dump registers in regmap-debugfs */
#define MAX_REGISTERS 0x0F
+#define LP872X_MAX_REGULATORS 9
+
+#define LP8720_ENABLE_DELAY 200
+#define LP8725_ENABLE_DELAY 30000
+
enum lp872x_id {
LP8720,
LP8725,
};
+enum lp872x_regulator_id {
+ LP8720_ID_BASE,
+ LP8720_ID_LDO1 = LP8720_ID_BASE,
+ LP8720_ID_LDO2,
+ LP8720_ID_LDO3,
+ LP8720_ID_LDO4,
+ LP8720_ID_LDO5,
+ LP8720_ID_BUCK,
+
+ LP8725_ID_BASE,
+ LP8725_ID_LDO1 = LP8725_ID_BASE,
+ LP8725_ID_LDO2,
+ LP8725_ID_LDO3,
+ LP8725_ID_LDO4,
+ LP8725_ID_LDO5,
+ LP8725_ID_LILO1,
+ LP8725_ID_LILO2,
+ LP8725_ID_BUCK1,
+ LP8725_ID_BUCK2,
+
+ LP872X_ID_MAX,
+};
+
+enum lp872x_dvs_sel {
+ SEL_V1,
+ SEL_V2,
+};
+
+struct lp872x_dvs {
+ struct gpio_desc *gpio;
+ enum lp872x_dvs_sel vsel;
+ enum gpiod_flags init_state;
+};
+
+struct lp872x_regulator_data {
+ enum lp872x_regulator_id id;
+ struct regulator_init_data *init_data;
+};
+
+struct lp872x_platform_data {
+ u8 general_config;
+ bool update_config;
+ struct lp872x_regulator_data regulator_data[LP872X_MAX_REGULATORS];
+ struct lp872x_dvs *dvs;
+ struct gpio_desc *enable_gpio;
+};
+
struct lp872x {
struct regmap *regmap;
struct device *dev;
diff --git a/include/linux/regulator/lp872x.h b/include/linux/regulator/lp872x.h
deleted file mode 100644
index b62e45aa1dd36..0000000000000
--- a/include/linux/regulator/lp872x.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * Copyright 2012 Texas Instruments
- *
- * Author: Milo(Woogyom) Kim <milo.kim@ti.com>
- */
-
-#ifndef __LP872X_REGULATOR_H__
-#define __LP872X_REGULATOR_H__
-
-#include <linux/regulator/machine.h>
-#include <linux/platform_device.h>
-#include <linux/gpio/consumer.h>
-
-#define LP872X_MAX_REGULATORS 9
-
-#define LP8720_ENABLE_DELAY 200
-#define LP8725_ENABLE_DELAY 30000
-
-enum lp872x_regulator_id {
- LP8720_ID_BASE,
- LP8720_ID_LDO1 = LP8720_ID_BASE,
- LP8720_ID_LDO2,
- LP8720_ID_LDO3,
- LP8720_ID_LDO4,
- LP8720_ID_LDO5,
- LP8720_ID_BUCK,
-
- LP8725_ID_BASE,
- LP8725_ID_LDO1 = LP8725_ID_BASE,
- LP8725_ID_LDO2,
- LP8725_ID_LDO3,
- LP8725_ID_LDO4,
- LP8725_ID_LDO5,
- LP8725_ID_LILO1,
- LP8725_ID_LILO2,
- LP8725_ID_BUCK1,
- LP8725_ID_BUCK2,
-
- LP872X_ID_MAX,
-};
-
-enum lp872x_dvs_sel {
- SEL_V1,
- SEL_V2,
-};
-
-/**
- * lp872x_dvs
- * @gpio : gpio descriptor for dvs control
- * @vsel : dvs selector for buck v1 or buck v2 register
- * @init_state : initial dvs pin state
- */
-struct lp872x_dvs {
- struct gpio_desc *gpio;
- enum lp872x_dvs_sel vsel;
- enum gpiod_flags init_state;
-};
-
-/**
- * lp872x_regdata
- * @id : regulator id
- * @init_data : init data for each regulator
- */
-struct lp872x_regulator_data {
- enum lp872x_regulator_id id;
- struct regulator_init_data *init_data;
-};
-
-/**
- * lp872x_platform_data
- * @general_config : the value of LP872X_GENERAL_CFG register
- * @update_config : if LP872X_GENERAL_CFG register is updated, set true
- * @regulator_data : platform regulator id and init data
- * @dvs : dvs data for buck voltage control
- * @enable_gpio : gpio descriptor for enable control
- */
-struct lp872x_platform_data {
- u8 general_config;
- bool update_config;
- struct lp872x_regulator_data regulator_data[LP872X_MAX_REGULATORS];
- struct lp872x_dvs *dvs;
- struct gpio_desc *enable_gpio;
-};
-
-#endif
--
2.53.0
next prev parent reply other threads:[~2026-10-06 15:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-06 15:44 [PATCH v1 0/7] lp872x: remove platform_data based probing and adjustments Svyatoslav Ryhel
2026-10-06 15:44 ` [PATCH v1 1/7] regulator: dt-bindings: ti,lp872x: Convert to DT schema Svyatoslav Ryhel
2026-10-06 15:44 ` [PATCH v1 2/7] regulator: dt-bindings: ti,lp872x: Document input supplies Svyatoslav Ryhel
2026-10-06 15:44 ` Svyatoslav Ryhel [this message]
2026-10-06 15:44 ` [PATCH v1 4/7] regulator: lp872x: Remove redundant regmap wrappers Svyatoslav Ryhel
2026-10-06 15:44 ` [PATCH v1 5/7] regulator: lp872x: Remove platform_data based probing Svyatoslav Ryhel
2026-10-06 15:44 ` [PATCH v1 6/7] regulator: lp872x: Add support for input and regulator power supplies Svyatoslav Ryhel
2026-10-06 15:44 ` [PATCH v1 7/7] regulator: lp872x: Use macro to fill regulator descriptor Svyatoslav Ryhel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261006154431.318936-4-clamor95@gmail.com \
--to=clamor95@gmail.com \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®