linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jorge Marques <jorge.marques@analog.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: <linux-input@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Jorge Marques <jorge.marques@analog.com>
Subject: [PATCH] Input: adxl34x: Add warning on shared compatible with adxl345
Date: Wed, 12 Nov 2025 23:26:49 +0100	[thread overview]
Message-ID: <20251112-input-adxl34x-v1-1-b7e21b3cea59@analog.com> (raw)

INPUT_ADXL34X and ADXL345 share compatibles, previously it
wasn't possible to compile ADXL345 if INPUT_ADXL34X was enabled.
Changed to allow both as modules instead, then the user should blacklist
to block loading one, if his config selects both.

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.
So patch
https://lore.kernel.org/linux-iio/20251112-adxl345-allow-adxl34x-mod-v2-1-5b1561eae5a0@analog.com/T/#u
changes the rule to !(INPUT_ADXL34X) to allow both as modules, but still
disallow INPUT_ADXL34X to be built-in and ADXL345 as module.

Add warning to the input Kconfig to inform users.
---
 drivers/input/misc/Kconfig | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index cc2558630..df5c425c9 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -769,7 +769,9 @@ config INPUT_ADXL34X_I2C
 	  Say Y here if you have ADXL345/6 hooked to an I2C bus.
 
 	  To compile this driver as a module, choose M here: the
-	  module will be called adxl34x-i2c.
+	  module will be called adxl34x-i2c. ADXL345 share compatibles
+	  with this driver, choosing Y won't allow to select ADXL345.
+	  Do not add both modules to the kernel.
 
 config INPUT_ADXL34X_SPI
 	tristate "support SPI bus connection"
@@ -779,7 +781,9 @@ config INPUT_ADXL34X_SPI
 	  Say Y here if you have ADXL345/6 hooked to a SPI bus.
 
 	  To compile this driver as a module, choose M here: the
-	  module will be called adxl34x-spi.
+	  module will be called adxl34x-spi. ADXL345 share compatibles
+	  with this driver, choosing Y won't allow to select ADXL345.
+	  Do not add both modules to the kernel.
 
 config INPUT_IBM_PANEL
 	tristate "IBM Operation Panel driver"

---
base-commit: a311c777f2987e6ddba2d2dd2f82f2135d65f8aa
change-id: 20251112-input-adxl34x-1972753e2c62
prerequisite-message-id: 20251031-adxl345-allow-adxl34x-mod-v1-1-cd65749ba89c@analog.com
prerequisite-patch-id: ee005752c4daeb450e458f20d9de0ce7b24743ca

Best regards,
-- 
Jorge Marques <jorge.marques@analog.com>


                 reply	other threads:[~2025-11-12 22:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20251112-input-adxl34x-v1-1-b7e21b3cea59@analog.com \
    --to=jorge.marques@analog.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.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;
as well as URLs for NNTP newsgroup(s).