mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] Input: regulator-haptic - drop platform data support and style fixes
@ 2026-11-12  6:51 Dmitry Torokhov
  2026-11-12  6:51 ` [PATCH 1/2] Input: regulator-haptic - drop platform data support Dmitry Torokhov
  2026-11-12  6:51 ` [PATCH 2/2] Input: regulator-haptic - fix coding style issues Dmitry Torokhov
  0 siblings, 2 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2026-11-12  6:51 UTC (permalink / raw)
  To: Jaewon Kim, Hyunhee Kim, Chanwoo Choi
  Cc: Krzysztof Kozlowski, Pankaj Dubey, Jonathan Cameron, linux-input,
	linux-kernel

This short series removes unused legacy platform data support and its
header file from the regulator-haptic driver (as all users configure the
device via Device Tree) and fixes minor coding style issues.

Thanks.

Dmitry Torokhov (2):
  Input: regulator-haptic - drop platform data support
  Input: regulator-haptic - fix coding style issues

 drivers/input/misc/regulator-haptic.c         | 29 ++++++-------------
 .../linux/platform_data/regulator-haptic.h    | 26 -----------------
 2 files changed, 9 insertions(+), 46 deletions(-)
 delete mode 100644 include/linux/platform_data/regulator-haptic.h

-- 
2.56.0.567.gdb80ae8cd5-goog


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] Input: regulator-haptic - drop platform data support
  2026-11-12  6:51 [PATCH 0/2] Input: regulator-haptic - drop platform data support and style fixes Dmitry Torokhov
@ 2026-11-12  6:51 ` Dmitry Torokhov
  2026-11-12  6:51 ` [PATCH 2/2] Input: regulator-haptic - fix coding style issues Dmitry Torokhov
  1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2026-11-12  6:51 UTC (permalink / raw)
  To: Jaewon Kim, Hyunhee Kim, Chanwoo Choi
  Cc: Krzysztof Kozlowski, Pankaj Dubey, Jonathan Cameron, linux-input,
	linux-kernel

All users configure regulator-haptic devices via Device Tree, and there
are no in-tree board files providing platform data. Remove platform data
support, call regulator_haptic_parse_dt() directly from the probe
routine, and remove the unused header file.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/misc/regulator-haptic.c         | 20 ++++----------
 .../linux/platform_data/regulator-haptic.h    | 26 -------------------
 2 files changed, 5 insertions(+), 41 deletions(-)
 delete mode 100644 include/linux/platform_data/regulator-haptic.h

diff --git a/drivers/input/misc/regulator-haptic.c b/drivers/input/misc/regulator-haptic.c
index b1aa3488ed6c..d99f716ef44b 100644
--- a/drivers/input/misc/regulator-haptic.c
+++ b/drivers/input/misc/regulator-haptic.c
@@ -10,7 +10,6 @@
 #include <linux/input.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/platform_data/regulator-haptic.h>
 #include <linux/platform_device.h>
 #include <linux/regulator/consumer.h>
 #include <linux/slab.h>
@@ -112,8 +111,8 @@ static void regulator_haptic_close(struct input_dev *input)
 	regulator_haptic_set_voltage(haptic, 0);
 }
 
-static int __maybe_unused
-regulator_haptic_parse_dt(struct device *dev, struct regulator_haptic *haptic)
+static int regulator_haptic_parse_dt(struct device *dev,
+				     struct regulator_haptic *haptic)
 {
 	struct device_node *node;
 	int error;
@@ -141,7 +140,6 @@ regulator_haptic_parse_dt(struct device *dev, struct regulator_haptic *haptic)
 
 static int regulator_haptic_probe(struct platform_device *pdev)
 {
-	const struct regulator_haptic_data *pdata = dev_get_platdata(&pdev->dev);
 	struct regulator_haptic *haptic;
 	struct input_dev *input_dev;
 	int error;
@@ -155,17 +153,9 @@ static int regulator_haptic_probe(struct platform_device *pdev)
 	mutex_init(&haptic->mutex);
 	INIT_WORK(&haptic->work, regulator_haptic_work);
 
-	if (pdata) {
-		haptic->max_volt = pdata->max_volt;
-		haptic->min_volt = pdata->min_volt;
-	} else if (IS_ENABLED(CONFIG_OF)) {
-		error = regulator_haptic_parse_dt(&pdev->dev, haptic);
-		if (error)
-			return error;
-	} else {
-		dev_err(&pdev->dev, "Missing platform data\n");
-		return -EINVAL;
-	}
+	error = regulator_haptic_parse_dt(&pdev->dev, haptic);
+	if (error)
+		return error;
 
 	haptic->regulator = devm_regulator_get_exclusive(&pdev->dev, "haptic");
 	if (IS_ERR(haptic->regulator)) {
diff --git a/include/linux/platform_data/regulator-haptic.h b/include/linux/platform_data/regulator-haptic.h
deleted file mode 100644
index 4213e1b01316..000000000000
--- a/include/linux/platform_data/regulator-haptic.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * Regulator Haptic Platform Data
- *
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- * Author: Jaewon Kim <jaewon02.kim@samsung.com>
- * Author: Hyunhee Kim <hyunhee.kim@samsung.com>
- */
-
-#ifndef _REGULATOR_HAPTIC_H
-#define _REGULATOR_HAPTIC_H
-
-/*
- * struct regulator_haptic_data - Platform device data
- *
- * @max_volt: maximum voltage value supplied to the haptic motor.
- *		<The unit of the voltage is a micro>
- * @min_volt: minimum voltage value supplied to the haptic motor.
- *		<The unit of the voltage is a micro>
- */
-struct regulator_haptic_data {
-	unsigned int max_volt;
-	unsigned int min_volt;
-};
-
-#endif /* _REGULATOR_HAPTIC_H */
-- 
2.56.0.567.gdb80ae8cd5-goog


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] Input: regulator-haptic - fix coding style issues
  2026-11-12  6:51 [PATCH 0/2] Input: regulator-haptic - drop platform data support and style fixes Dmitry Torokhov
  2026-11-12  6:51 ` [PATCH 1/2] Input: regulator-haptic - drop platform data support Dmitry Torokhov
@ 2026-11-12  6:51 ` Dmitry Torokhov
  1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2026-11-12  6:51 UTC (permalink / raw)
  To: Jaewon Kim, Hyunhee Kim, Chanwoo Choi
  Cc: Krzysztof Kozlowski, Pankaj Dubey, Jonathan Cameron, linux-input,
	linux-kernel

Fix minor coding style issues across the driver: add a comment
explaining mutex purpose, drop an unnecessary blank line after an open
brace, align function arguments with the open parenthesis, fix
whitespace in conditional checks, and use a space instead of a tab in
a return statement.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/misc/regulator-haptic.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/input/misc/regulator-haptic.c b/drivers/input/misc/regulator-haptic.c
index d99f716ef44b..4ede90195366 100644
--- a/drivers/input/misc/regulator-haptic.c
+++ b/drivers/input/misc/regulator-haptic.c
@@ -23,7 +23,7 @@ struct regulator_haptic {
 	struct regulator *regulator;
 
 	struct work_struct work;
-	struct mutex mutex;
+	struct mutex mutex; /* serializes voltage updates and suspend/resume */
 
 	bool active;
 	bool suspended;
@@ -38,7 +38,6 @@ static int regulator_haptic_toggle(struct regulator_haptic *haptic, bool on)
 	int error;
 
 	if (haptic->active != on) {
-
 		error = on ? regulator_enable(haptic->regulator) :
 			     regulator_disable(haptic->regulator);
 		if (error) {
@@ -55,7 +54,7 @@ static int regulator_haptic_toggle(struct regulator_haptic *haptic, bool on)
 }
 
 static int regulator_haptic_set_voltage(struct regulator_haptic *haptic,
-					 unsigned int magnitude)
+					unsigned int magnitude)
 {
 	u64 volt_mag_multi;
 	unsigned int intensity;
@@ -118,7 +117,7 @@ static int regulator_haptic_parse_dt(struct device *dev,
 	int error;
 
 	node = dev->of_node;
-	if(!node) {
+	if (!node) {
 		dev_err(dev, "Missing device tree data\n");
 		return -EINVAL;
 	}
@@ -165,7 +164,7 @@ static int regulator_haptic_probe(struct platform_device *pdev)
 
 	input_dev = devm_input_allocate_device(&pdev->dev);
 	if (!input_dev)
-		return	-ENOMEM;
+		return -ENOMEM;
 
 	haptic->input_dev = input_dev;
 	haptic->input_dev->name = "regulator-haptic";
-- 
2.56.0.567.gdb80ae8cd5-goog


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-12  6:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-12  6:51 [PATCH 0/2] Input: regulator-haptic - drop platform data support and style fixes Dmitry Torokhov
2026-11-12  6:51 ` [PATCH 1/2] Input: regulator-haptic - drop platform data support Dmitry Torokhov
2026-11-12  6:51 ` [PATCH 2/2] Input: regulator-haptic - fix coding style issues Dmitry Torokhov

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®