public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/3] iio: reduce acpi.h usage
@ 2024-09-03 21:28 Andy Shevchenko
  2024-09-03 21:28 ` [PATCH v1 1/3] iio: imu: fxos8700: Drop unused acpi.h Andy Shevchenko
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Andy Shevchenko @ 2024-09-03 21:28 UTC (permalink / raw)
  To: Andy Shevchenko, Jonathan Cameron, linux-iio, linux-kernel
  Cc: Jonathan Cameron, Lars-Peter Clausen

Reduce acpi.h usage (partially, more will come).

Andy Shevchenko (3):
  iio: imu: fxos8700: Drop unused acpi.h
  iio: proximity: sx_common: Unexport
    sx_common_get_raw_register_config()
  iio: proximity: sx_common: Drop unused acpi.h

 drivers/iio/imu/fxos8700_core.c   |  1 -
 drivers/iio/proximity/sx9324.c    | 20 ++++++++++++++++++++
 drivers/iio/proximity/sx9360.c    |  1 -
 drivers/iio/proximity/sx_common.c | 21 ---------------------
 drivers/iio/proximity/sx_common.h |  4 ----
 5 files changed, 20 insertions(+), 27 deletions(-)

-- 
2.43.0.rc1.1336.g36b5255a03ac


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

* [PATCH v1 1/3] iio: imu: fxos8700: Drop unused acpi.h
  2024-09-03 21:28 [PATCH v1 0/3] iio: reduce acpi.h usage Andy Shevchenko
@ 2024-09-03 21:28 ` Andy Shevchenko
  2024-09-03 21:28 ` [PATCH v1 2/3] iio: proximity: sx_common: Unexport sx_common_get_raw_register_config() Andy Shevchenko
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2024-09-03 21:28 UTC (permalink / raw)
  To: Andy Shevchenko, Jonathan Cameron, linux-iio, linux-kernel
  Cc: Jonathan Cameron, Lars-Peter Clausen

There are drivers that do not need acpi.h, drop unused inclusion.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/iio/imu/fxos8700_core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/iio/imu/fxos8700_core.c b/drivers/iio/imu/fxos8700_core.c
index 6d189c4b9ff9..281ebfd9c15a 100644
--- a/drivers/iio/imu/fxos8700_core.c
+++ b/drivers/iio/imu/fxos8700_core.c
@@ -8,7 +8,6 @@
  */
 #include <linux/module.h>
 #include <linux/regmap.h>
-#include <linux/acpi.h>
 #include <linux/bitops.h>
 #include <linux/bitfield.h>
 
-- 
2.43.0.rc1.1336.g36b5255a03ac


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

* [PATCH v1 2/3] iio: proximity: sx_common: Unexport sx_common_get_raw_register_config()
  2024-09-03 21:28 [PATCH v1 0/3] iio: reduce acpi.h usage Andy Shevchenko
  2024-09-03 21:28 ` [PATCH v1 1/3] iio: imu: fxos8700: Drop unused acpi.h Andy Shevchenko
@ 2024-09-03 21:28 ` Andy Shevchenko
  2024-09-03 21:28 ` [PATCH v1 3/3] iio: proximity: sx_common: Drop unused acpi.h Andy Shevchenko
  2024-09-07 15:24 ` [PATCH v1 0/3] iio: reduce acpi.h usage Jonathan Cameron
  3 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2024-09-03 21:28 UTC (permalink / raw)
  To: Andy Shevchenko, Jonathan Cameron, linux-iio, linux-kernel
  Cc: Jonathan Cameron, Lars-Peter Clausen

sx_common_get_raw_register_config() is used in a single driver,
move it there.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/iio/proximity/sx9324.c    | 20 ++++++++++++++++++++
 drivers/iio/proximity/sx_common.c | 21 ---------------------
 drivers/iio/proximity/sx_common.h |  3 ---
 3 files changed, 20 insertions(+), 24 deletions(-)

diff --git a/drivers/iio/proximity/sx9324.c b/drivers/iio/proximity/sx9324.c
index 629f83c37d59..40747d7f6e7e 100644
--- a/drivers/iio/proximity/sx9324.c
+++ b/drivers/iio/proximity/sx9324.c
@@ -868,6 +868,26 @@ static u8 sx9324_parse_phase_prop(struct device *dev,
 	return raw;
 }
 
+static void sx_common_get_raw_register_config(struct device *dev,
+					      struct sx_common_reg_default *reg_def)
+{
+#ifdef CONFIG_ACPI
+	struct acpi_device *adev = ACPI_COMPANION(dev);
+	u32 raw = 0, ret;
+	char prop[80];
+
+	if (!reg_def->property || !adev)
+		return;
+
+	snprintf(prop, ARRAY_SIZE(prop), "%s,reg_%s", acpi_device_hid(adev), reg_def->property);
+	ret = device_property_read_u32(dev, prop, &raw);
+	if (ret)
+		return;
+
+	reg_def->def = raw;
+#endif
+}
+
 static const struct sx_common_reg_default *
 sx9324_get_default_reg(struct device *dev, int idx,
 		       struct sx_common_reg_default *reg_def)
diff --git a/drivers/iio/proximity/sx_common.c b/drivers/iio/proximity/sx_common.c
index 71aa6dced7d3..bcf502e02342 100644
--- a/drivers/iio/proximity/sx_common.c
+++ b/drivers/iio/proximity/sx_common.c
@@ -421,27 +421,6 @@ static const struct iio_buffer_setup_ops sx_common_buffer_setup_ops = {
 	.postdisable = sx_common_buffer_postdisable,
 };
 
-void sx_common_get_raw_register_config(struct device *dev,
-				       struct sx_common_reg_default *reg_def)
-{
-#ifdef CONFIG_ACPI
-	struct acpi_device *adev = ACPI_COMPANION(dev);
-	u32 raw = 0, ret;
-	char prop[80];
-
-	if (!reg_def->property || !adev)
-		return;
-
-	snprintf(prop, ARRAY_SIZE(prop), "%s,reg_%s", acpi_device_hid(adev), reg_def->property);
-	ret = device_property_read_u32(dev, prop, &raw);
-	if (ret)
-		return;
-
-	reg_def->def = raw;
-#endif
-}
-EXPORT_SYMBOL_NS_GPL(sx_common_get_raw_register_config, SEMTECH_PROX);
-
 #define SX_COMMON_SOFT_RESET				0xde
 
 static int sx_common_init_device(struct device *dev, struct iio_dev *indio_dev)
diff --git a/drivers/iio/proximity/sx_common.h b/drivers/iio/proximity/sx_common.h
index 101b90e52ff2..175505eaae7b 100644
--- a/drivers/iio/proximity/sx_common.h
+++ b/drivers/iio/proximity/sx_common.h
@@ -150,9 +150,6 @@ int sx_common_probe(struct i2c_client *client,
 		    const struct sx_common_chip_info *chip_info,
 		    const struct regmap_config *regmap_config);
 
-void sx_common_get_raw_register_config(struct device *dev,
-				       struct sx_common_reg_default *reg_def);
-
 /* 3 is the number of events defined by a single phase. */
 extern const struct iio_event_spec sx_common_events[3];
 
-- 
2.43.0.rc1.1336.g36b5255a03ac


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

* [PATCH v1 3/3] iio: proximity: sx_common: Drop unused acpi.h
  2024-09-03 21:28 [PATCH v1 0/3] iio: reduce acpi.h usage Andy Shevchenko
  2024-09-03 21:28 ` [PATCH v1 1/3] iio: imu: fxos8700: Drop unused acpi.h Andy Shevchenko
  2024-09-03 21:28 ` [PATCH v1 2/3] iio: proximity: sx_common: Unexport sx_common_get_raw_register_config() Andy Shevchenko
@ 2024-09-03 21:28 ` Andy Shevchenko
  2024-09-07 15:24 ` [PATCH v1 0/3] iio: reduce acpi.h usage Jonathan Cameron
  3 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2024-09-03 21:28 UTC (permalink / raw)
  To: Andy Shevchenko, Jonathan Cameron, linux-iio, linux-kernel
  Cc: Jonathan Cameron, Lars-Peter Clausen

There are drivers that do not need acpi.h, drop unused inclusion.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/iio/proximity/sx9360.c    | 1 -
 drivers/iio/proximity/sx_common.h | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/iio/proximity/sx9360.c b/drivers/iio/proximity/sx9360.c
index 2b90bf45a201..07551e0decbd 100644
--- a/drivers/iio/proximity/sx9360.c
+++ b/drivers/iio/proximity/sx9360.c
@@ -7,7 +7,6 @@
  * https://edit.wpgdadawant.com/uploads/news_file/program/2019/30184/tech_files/program_30184_suggest_other_file.pdf
  */
 
-#include <linux/acpi.h>
 #include <linux/bits.h>
 #include <linux/bitfield.h>
 #include <linux/delay.h>
diff --git a/drivers/iio/proximity/sx_common.h b/drivers/iio/proximity/sx_common.h
index 175505eaae7b..da53268201a9 100644
--- a/drivers/iio/proximity/sx_common.h
+++ b/drivers/iio/proximity/sx_common.h
@@ -8,7 +8,6 @@
 #ifndef IIO_SX_COMMON_H
 #define IIO_SX_COMMON_H
 
-#include <linux/acpi.h>
 #include <linux/iio/iio.h>
 #include <linux/iio/types.h>
 #include <linux/regulator/consumer.h>
-- 
2.43.0.rc1.1336.g36b5255a03ac


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

* Re: [PATCH v1 0/3] iio: reduce acpi.h usage
  2024-09-03 21:28 [PATCH v1 0/3] iio: reduce acpi.h usage Andy Shevchenko
                   ` (2 preceding siblings ...)
  2024-09-03 21:28 ` [PATCH v1 3/3] iio: proximity: sx_common: Drop unused acpi.h Andy Shevchenko
@ 2024-09-07 15:24 ` Jonathan Cameron
  2024-09-09  9:21   ` Andy Shevchenko
  3 siblings, 1 reply; 6+ messages in thread
From: Jonathan Cameron @ 2024-09-07 15:24 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Jonathan Cameron, linux-iio, linux-kernel, Lars-Peter Clausen

On Wed,  4 Sep 2024 00:28:19 +0300
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> Reduce acpi.h usage (partially, more will come).
LGTM
Applied to the togreg branch of iio.git and pushed out as testing.
Probably next cycle material though given timing,

Jonathan

> 
> Andy Shevchenko (3):
>   iio: imu: fxos8700: Drop unused acpi.h
>   iio: proximity: sx_common: Unexport
>     sx_common_get_raw_register_config()
>   iio: proximity: sx_common: Drop unused acpi.h
> 
>  drivers/iio/imu/fxos8700_core.c   |  1 -
>  drivers/iio/proximity/sx9324.c    | 20 ++++++++++++++++++++
>  drivers/iio/proximity/sx9360.c    |  1 -
>  drivers/iio/proximity/sx_common.c | 21 ---------------------
>  drivers/iio/proximity/sx_common.h |  4 ----
>  5 files changed, 20 insertions(+), 27 deletions(-)
> 


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

* Re: [PATCH v1 0/3] iio: reduce acpi.h usage
  2024-09-07 15:24 ` [PATCH v1 0/3] iio: reduce acpi.h usage Jonathan Cameron
@ 2024-09-09  9:21   ` Andy Shevchenko
  0 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2024-09-09  9:21 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Jonathan Cameron, linux-iio, linux-kernel, Lars-Peter Clausen

On Sat, Sep 07, 2024 at 04:24:28PM +0100, Jonathan Cameron wrote:
> On Wed,  4 Sep 2024 00:28:19 +0300
> Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> 
> > Reduce acpi.h usage (partially, more will come).
> LGTM
> Applied to the togreg branch of iio.git and pushed out as testing.
> Probably next cycle material though given timing,

Sure, thanks!

-- 
With Best Regards,
Andy Shevchenko



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

end of thread, other threads:[~2024-09-09  9:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-03 21:28 [PATCH v1 0/3] iio: reduce acpi.h usage Andy Shevchenko
2024-09-03 21:28 ` [PATCH v1 1/3] iio: imu: fxos8700: Drop unused acpi.h Andy Shevchenko
2024-09-03 21:28 ` [PATCH v1 2/3] iio: proximity: sx_common: Unexport sx_common_get_raw_register_config() Andy Shevchenko
2024-09-03 21:28 ` [PATCH v1 3/3] iio: proximity: sx_common: Drop unused acpi.h Andy Shevchenko
2024-09-07 15:24 ` [PATCH v1 0/3] iio: reduce acpi.h usage Jonathan Cameron
2024-09-09  9:21   ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox