* [PATCH v2] iio: accel: Change adxl345 depend to negate adxl35x
@ 2025-11-12 22:06 Jorge Marques
2025-12-07 19:40 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Jorge Marques @ 2025-11-12 22:06 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko
Cc: linux-iio, linux-kernel, gastmaier, Jorge Marques
Change 'depends on INPUT_ADXL34X=n' to '!(INPUT_ADXL34X)' to allow both
drivers to be compiled as modules. The user then can use the blacklist
to block loading one.
Signed-off-by: Jorge Marques <jorge.marques@analog.com>
---
There are two drivers for the compatible:
- adi,adxl345
* IIO:
drivers/iio/accel/adxl345_core.c
drivers/iio/accel/adxl345_spi.c
drivers/iio/accel/adxl345_i2c.c
* Inputs:
drivers/input/misc/adxl34x-spi.c
drivers/input/misc/adxl34x-i2c.c
To disallows both being complied, the depends INPUT_ADXL34X=n
was added to ADXL345 symbols. However, it should be possible to compile
both as modules, then blacklist one of them in the /etc/modprobe.d/blacklist.conf
file. This patch changes the rule to !(INPUT_ADXL34X) to allow both as
modules, but still disallow INPUT_ADXL34X to be built-in and ADXL345 as
module.
The following compatibles are not shared between both drivers:
* IIO:
adi,adxl375 spi/i2c
* Inputs:
adi,adxl34x i2c
---
Changes in v2:
- Added warning to Kconfig for users to not add both to the kernel.
A similar patch will be sent to the input subsystem.
- Link to v1: https://lore.kernel.org/r/20251031-adxl345-allow-adxl34x-mod-v1-1-cd65749ba89c@analog.com
---
drivers/iio/accel/Kconfig | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/accel/Kconfig b/drivers/iio/accel/Kconfig
index 76911278fb217..3d3f8d8673dde 100644
--- a/drivers/iio/accel/Kconfig
+++ b/drivers/iio/accel/Kconfig
@@ -64,7 +64,7 @@ config ADXL345
config ADXL345_I2C
tristate "Analog Devices ADXL345 3-Axis Digital Accelerometer I2C Driver"
- depends on INPUT_ADXL34X=n
+ depends on !INPUT_ADXL34X
depends on I2C
select ADXL345
select REGMAP_I2C
@@ -74,11 +74,12 @@ config ADXL345_I2C
To compile this driver as a module, choose M here: the module
will be called adxl345_i2c and you will also get adxl345_core
- for the core module.
+ for the core module. INPUT_ADXL34X share compatibles with this
+ driver, do not add both modules to the kernel.
config ADXL345_SPI
tristate "Analog Devices ADXL345 3-Axis Digital Accelerometer SPI Driver"
- depends on INPUT_ADXL34X=n
+ depends on !INPUT_ADXL34X
depends on SPI
select ADXL345
select REGMAP_SPI
@@ -88,7 +89,8 @@ config ADXL345_SPI
To compile this driver as a module, choose M here: the module
will be called adxl345_spi and you will also get adxl345_core
- for the core module.
+ for the core module. INPUT_ADXL34X share compatibles with this
+ driver, do not add both modules to the kernel.
config ADXL355
tristate
---
base-commit: 70437bbd7529e9860fb7f0c92a89e0e6abaa994e
change-id: 20251031-adxl345-allow-adxl34x-mod-8c3b11cb54c6
Best regards,
--
Jorge Marques <jorge.marques@analog.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v2] iio: accel: Change adxl345 depend to negate adxl35x
2025-11-12 22:06 [PATCH v2] iio: accel: Change adxl345 depend to negate adxl35x Jorge Marques
@ 2025-12-07 19:40 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2025-12-07 19:40 UTC (permalink / raw)
To: Jorge Marques
Cc: David Lechner, Nuno Sá,
Andy Shevchenko, linux-iio, linux-kernel, gastmaier
On Wed, 12 Nov 2025 23:06:38 +0100
Jorge Marques <jorge.marques@analog.com> wrote:
> Change 'depends on INPUT_ADXL34X=n' to '!(INPUT_ADXL34X)' to allow both
> drivers to be compiled as modules. The user then can use the blacklist
> to block loading one.
>
> Signed-off-by: Jorge Marques <jorge.marques@analog.com>
Applied to my local branch that I'll just push out as testing until
I can rebase on rc1.
Thanks
Jonathan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-12-07 19:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-12 22:06 [PATCH v2] iio: accel: Change adxl345 depend to negate adxl35x Jorge Marques
2025-12-07 19:40 ` Jonathan Cameron
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®