[PATCH v4 0/6] iio: light: vcnl4000: drop enum ID table and use device-managed register

Erikas Bitovtas posted 6 patches 2 months ago
drivers/iio/light/vcnl4000.c | 276 +++++++++++++++++++------------------------
1 file changed, 123 insertions(+), 153 deletions(-)
[PATCH v4 0/6] iio: light: vcnl4000: drop enum ID table and use device-managed register
Posted by Erikas Bitovtas 2 months ago
This patch series drops the enum ID table for device enumeration and
instead adds pointers to chip ID structs directly. Necessary
information about the device is then taken from i2c_get_match_data()
call. This removes the association between enum ID table and struct
table and allows for easier addition and removal of new devices.

Along with that, an iio_device_register() call is replaced with its
device-managed counterpart, to ensure that device is unregistered
automatically.

No functional changes are intended.

Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
---
Changes in v4:
- Removed trailing comma from device tree entries.
- Link to v3: https://patch.msgid.link/20260410-vcnl4000-drop-enum-v3-0-2ea2bc6f5dfb@gmail.com

Changes in v3:
- Reordered the commit for moving device tree entries into one line
  after the commit dropping enum table.
- After a failed iio_device_register(), added
  pm_runtime_set_suspended().
- Reordered device-managed IIO device register to come before setting
  autosuspend, as it was before this patch series.
- Link to v2: https://patch.msgid.link/20260405-vcnl4000-drop-enum-v2-0-7c8dc98c3974@gmail.com

Changes in v2:
- Moved device tree table entries into one line.
- Moved power state function in probe into a device-managed action.
- Replaced call to pm_runtime_set_active() and pm_runtime_enable() with
  its device-managed counterpart.
- Removed vcnl4000_remove function(), as all the clean up is done by
  device-managed functions.
- Link to v1: https://lore.kernel.org/r/20260401-vcnl4000-drop-enum-v1-0-ffd201f0c848@gmail.com

To: Jonathan Cameron <jic23@kernel.org>
To: David Lechner <dlechner@baylibre.com>
To: Nuno Sá <nuno.sa@analog.com>
To: Andy Shevchenko <andy@kernel.org>
Cc: linux-iio@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

---
Erikas Bitovtas (6):
      iio: light: vcnl4000: validate device by prod ID instead of table ID
      iio: light: vcnl4000: drop enum id table in favor of chip structs
      iio: light: vcnl4000: move device tree entries into one line
      iio: light: vcnl4000: move power state function into device-managed action
      iio: light: vcnl4000: make pm_runtime_enable() device-managed
      iio: light: vcnl4000: register an IIO device with a device-managed function

 drivers/iio/light/vcnl4000.c | 276 +++++++++++++++++++------------------------
 1 file changed, 123 insertions(+), 153 deletions(-)
---
base-commit: b82346a4da00ed70466d8e02e9ab384db6d1f83a
change-id: 20260401-vcnl4000-drop-enum-0238061fcff8

Best regards,
--  
Erikas Bitovtas <xerikasxx@gmail.com>

Re: [PATCH v4 0/6] iio: light: vcnl4000: drop enum ID table and use device-managed register
Posted by Jonathan Cameron 1 month, 3 weeks ago
On Tue, 14 Apr 2026 15:37:16 +0300
Erikas Bitovtas <xerikasxx@gmail.com> wrote:

> This patch series drops the enum ID table for device enumeration and
> instead adds pointers to chip ID structs directly. Necessary
> information about the device is then taken from i2c_get_match_data()
> call. This removes the association between enum ID table and struct
> table and allows for easier addition and removal of new devices.
> 
> Along with that, an iio_device_register() call is replaced with its
> device-managed counterpart, to ensure that device is unregistered
> automatically.
> 
> No functional changes are intended.
> 
> Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
Applied to the testing branch of iio.git which I'll rebase on rc1 once
available and then push out for linux-next to pick up.

Thanks,

Jonathan