[v2,1/3] ipa: libipa: camera_sensor_helper: Match multiple sensors per helper
diff mbox series

Message ID 20261022-mainline-imx676-v2-1-0b839f1001c0@ideasonboard.com
State New
Headers show
Series
  • libcamera: sensor: Add support for Sony IMX585 and IMX676
Related show

Commit Message

Jai Luthra Oct. 22, 2026, 3:48 p.m. UTC
Multiple sensors of the same family can often be supported by the same
helper. Currently we have to duplicate this by defining a new child
class and calling the REGISTER_CAMERA_SENSOR_HELPER macro again. Like
below:

class CameraSensorHelperImx327 : public CameraSensorHelperImx290
{
};
REGISTER_CAMERA_SENSOR_HELPER("imx327", CameraSensorHelperImx327)

Fix that by instead allowing registering the same camera sensor helper
class for multiple sensor names. Also update the macro to accept >= 1
names using variadic args.

Now that this is in place, convert the three users of
CameraSensorHelperImx290 to use this.

Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
---
 src/ipa/libipa/camera_sensor_helper.cpp | 98 +++++++++++++++------------------
 src/ipa/libipa/camera_sensor_helper.h   | 12 ++--
 2 files changed, 51 insertions(+), 59 deletions(-)

Comments

Kieran Bingham Oct. 22, 2026, 4:14 p.m. UTC | #1
Quoting Jai Luthra (2026-10-22 16:48:30)
> Multiple sensors of the same family can often be supported by the same
> helper. Currently we have to duplicate this by defining a new child
> class and calling the REGISTER_CAMERA_SENSOR_HELPER macro again. Like
> below:
> 
> class CameraSensorHelperImx327 : public CameraSensorHelperImx290
> {
> };
> REGISTER_CAMERA_SENSOR_HELPER("imx327", CameraSensorHelperImx327)
> 
> Fix that by instead allowing registering the same camera sensor helper
> class for multiple sensor names. Also update the macro to accept >= 1
> names using variadic args.
> 
> Now that this is in place, convert the three users of
> CameraSensorHelperImx290 to use this.

I'm fine with all that. It's a good starting point to reducing
duplication here.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> 
> Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
> ---
>  src/ipa/libipa/camera_sensor_helper.cpp | 98 +++++++++++++++------------------
>  src/ipa/libipa/camera_sensor_helper.h   | 12 ++--
>  2 files changed, 51 insertions(+), 59 deletions(-)
> 
> diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp
> index 359040ec7418..5fbeefaf5e90 100644
> --- a/src/ipa/libipa/camera_sensor_helper.cpp
> +++ b/src/ipa/libipa/camera_sensor_helper.cpp
> @@ -241,15 +241,15 @@ double CameraSensorHelper::quantizeGain(double _gain, double *quantizationGain)
>  
>  /**
>   * \brief Construct a camera sensor helper factory base
> - * \param[in] name Name of the camera sensor helper class
> + * \param[in] names Names of the camera sensors to match with the helper
>   *
>   * Creating an instance of the factory base registers it with the global list of
>   * factories, accessible through the factories() function.
>   *
> - * The factory \a name is used to look up factories and shall be unique.
> + * The factory \a names are used to look up factories and shall be unique.
>   */
> -CameraSensorHelperFactoryBase::CameraSensorHelperFactoryBase(const std::string name)
> -       : name_(name)
> +CameraSensorHelperFactoryBase::CameraSensorHelperFactoryBase(std::initializer_list<const char *> names)
> +    : names_(names.begin(), names.end())
>  {
>         registerType(this);
>  }
> @@ -269,7 +269,8 @@ std::unique_ptr<CameraSensorHelper> CameraSensorHelperFactoryBase::create(const
>                 CameraSensorHelperFactoryBase::factories();
>  
>         for (const CameraSensorHelperFactoryBase *factory : factories) {
> -               if (name != factory->name_)
> +               const auto &names = factory->names_;
> +               if (std::find(names.begin(), names.end(), name) == names.end())
>                         continue;
>  
>                 return factory->createInstance();
> @@ -345,8 +346,9 @@ std::vector<CameraSensorHelperFactoryBase *> &CameraSensorHelperFactoryBase::fac
>  /**
>   * \def REGISTER_CAMERA_SENSOR_HELPER
>   * \brief Register a camera sensor helper with the camera sensor helper factory
> - * \param[in] name Sensor model name used to register the class
>   * \param[in] helper Class name of CameraSensorHelper derived class to register
> + * \param[in] name Sensor model name used to register the class
> + * \param[in] ... More sensor model names that can be matched to this helper
>   *
>   * Register a CameraSensorHelper subclass with the factory and make it available
>   * to try and match sensors.
> @@ -468,7 +470,7 @@ public:
>                 return m * (1 << coarse) / (1.0 - (fine / d1) / d2);
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ar0144", CameraSensorHelperAr0144)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperAr0144, "ar0144")
>  
>  class CameraSensorHelperAr0521 : public CameraSensorHelper
>  {
> @@ -493,7 +495,7 @@ public:
>  private:
>         static constexpr double kStep_ = 16;
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ar0521", CameraSensorHelperAr0521)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperAr0521, "ar0521")
>  
>  class CameraSensorHelperGc05a2 : public CameraSensorHelper
>  {
> @@ -505,7 +507,7 @@ public:
>                 gain_ = AnalogueGainLinear{ 100, 0, 0, 1024 };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("gc05a2", CameraSensorHelperGc05a2)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperGc05a2, "gc05a2")
>  
>  class CameraSensorHelperGc08a3 : public CameraSensorHelper
>  {
> @@ -517,7 +519,7 @@ public:
>                 gain_ = AnalogueGainLinear{ 100, 0, 0, 1024 };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("gc08a3", CameraSensorHelperGc08a3)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperGc08a3, "gc08a3")
>  
>  class CameraSensorHelperHm1246 : public CameraSensorHelper
>  {
> @@ -527,7 +529,7 @@ public:
>                 gain_ = AnalogueGainLinear{ 1, 16, 0, 16 };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("hm1246", CameraSensorHelperHm1246)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperHm1246, "hm1246")
>  
>  class CameraSensorHelperImx214 : public CameraSensorHelper
>  {
> @@ -539,7 +541,7 @@ public:
>                 gain_ = AnalogueGainLinear{ 0, 512, -1, 512 };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("imx214", CameraSensorHelperImx214)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx214, "imx214")
>  
>  class CameraSensorHelperImx219 : public CameraSensorHelper
>  {
> @@ -551,7 +553,7 @@ public:
>                 gain_ = AnalogueGainLinear{ 0, 256, -1, 256 };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("imx219", CameraSensorHelperImx219)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx219, "imx219")
>  
>  class CameraSensorHelperImx258 : public CameraSensorHelper
>  {
> @@ -563,7 +565,7 @@ public:
>                 gain_ = AnalogueGainLinear{ 0, 512, -1, 512 };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("imx258", CameraSensorHelperImx258)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx258, "imx258")
>  
>  class CameraSensorHelperImx283 : public CameraSensorHelper
>  {
> @@ -575,7 +577,7 @@ public:
>                 gain_ = AnalogueGainLinear{ 0, 2048, -1, 2048 };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("imx283", CameraSensorHelperImx283)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx283, "imx283")
>  
>  class CameraSensorHelperImx290 : public CameraSensorHelper
>  {
> @@ -587,7 +589,7 @@ public:
>                 gain_ = AnalogueGainExp{ 1.0, expGainDb(0.3) };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("imx290", CameraSensorHelperImx290)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx290, "imx290", "imx327", "imx462")
>  
>  class CameraSensorHelperImx296 : public CameraSensorHelper
>  {
> @@ -597,12 +599,7 @@ public:
>                 gain_ = AnalogueGainExp{ 1.0, expGainDb(0.1) };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("imx296", CameraSensorHelperImx296)
> -
> -class CameraSensorHelperImx327 : public CameraSensorHelperImx290
> -{
> -};
> -REGISTER_CAMERA_SENSOR_HELPER("imx327", CameraSensorHelperImx327)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx296, "imx296")
>  
>  class CameraSensorHelperImx335 : public CameraSensorHelper
>  {
> @@ -614,7 +611,7 @@ public:
>                 gain_ = AnalogueGainExp{ 1.0, expGainDb(0.3) };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("imx335", CameraSensorHelperImx335)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx335, "imx335")
>  
>  class CameraSensorHelperImx355 : public CameraSensorHelper
>  {
> @@ -626,7 +623,7 @@ public:
>                 gain_ = AnalogueGainLinear{ 0, 1024, -1, 1024 };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("imx355", CameraSensorHelperImx355)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx355, "imx355")
>  
>  class CameraSensorHelperImx415 : public CameraSensorHelper
>  {
> @@ -636,12 +633,7 @@ public:
>                 gain_ = AnalogueGainExp{ 1.0, expGainDb(0.3) };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("imx415", CameraSensorHelperImx415)
> -
> -class CameraSensorHelperImx462 : public CameraSensorHelperImx290
> -{
> -};
> -REGISTER_CAMERA_SENSOR_HELPER("imx462", CameraSensorHelperImx462)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx415, "imx415")
>  
>  class CameraSensorHelperImx471 : public CameraSensorHelper
>  {
> @@ -654,7 +646,7 @@ public:
>                 gain_ = AnalogueGainLinear{ 0, 1024, -1, 1024 };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("imx471", CameraSensorHelperImx471)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx471, "imx471")
>  
>  class CameraSensorHelperImx477 : public CameraSensorHelper
>  {
> @@ -664,7 +656,7 @@ public:
>                 gain_ = AnalogueGainLinear{ 0, 1024, -1, 1024 };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("imx477", CameraSensorHelperImx477)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx477, "imx477")
>  
>  class CameraSensorHelperImx662 : public CameraSensorHelper
>  {
> @@ -676,7 +668,7 @@ public:
>                 gain_ = AnalogueGainExp{ 1.0, expGainDb(0.3) };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("imx662", CameraSensorHelperImx662)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx662, "imx662")
>  
>  class CameraSensorHelperImx678 : public CameraSensorHelper
>  {
> @@ -688,7 +680,7 @@ public:
>                 gain_ = AnalogueGainExp{ 1.0, expGainDb(0.3) };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("imx678", CameraSensorHelperImx678)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx678, "imx678")
>  
>  class CameraSensorHelperImx708 : public CameraSensorHelper
>  {
> @@ -699,7 +691,7 @@ public:
>                 gain_ = AnalogueGainLinear{ 0, 1024, -1, 1024 };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("imx708", CameraSensorHelperImx708)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx708, "imx708")
>  
>  class CameraSensorHelperOv01a10 : public CameraSensorHelper
>  {
> @@ -711,7 +703,7 @@ public:
>                 gain_ = AnalogueGainLinear{ 1, 0, 0, 256 };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov01a10", CameraSensorHelperOv01a10)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv01a10, "ov01a10")
>  
>  class CameraSensorHelperOv08d10 : public CameraSensorHelper
>  {
> @@ -723,7 +715,7 @@ public:
>                 gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov08d10", CameraSensorHelperOv08d10)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv08d10, "ov08d10")
>  
>  class CameraSensorHelperOv08x40 : public CameraSensorHelper
>  {
> @@ -734,7 +726,7 @@ public:
>                 gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov08x40", CameraSensorHelperOv08x40)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv08x40, "ov08x40")
>  
>  class CameraSensorHelperMira220 : public CameraSensorHelper
>  {
> @@ -746,7 +738,7 @@ public:
>                 gain_ = AnalogueGainLinear{ 0, 2048, -1, 2048 };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("mira220", CameraSensorHelperMira220)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperMira220, "mira220")
>  
>  class CameraSensorHelperOv2685 : public CameraSensorHelper
>  {
> @@ -760,7 +752,7 @@ public:
>                 gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov2685", CameraSensorHelperOv2685)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv2685, "ov2685")
>  
>  class CameraSensorHelperOv2740 : public CameraSensorHelper
>  {
> @@ -772,7 +764,7 @@ public:
>                 gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov2740", CameraSensorHelperOv2740)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv2740, "ov2740")
>  
>  class CameraSensorHelperOv4689 : public CameraSensorHelper
>  {
> @@ -784,7 +776,7 @@ public:
>                 gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov4689", CameraSensorHelperOv4689)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv4689, "ov4689")
>  
>  class CameraSensorHelperOv5640 : public CameraSensorHelper
>  {
> @@ -796,7 +788,7 @@ public:
>                 gain_ = AnalogueGainLinear{ 1, 0, 0, 16 };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov5640", CameraSensorHelperOv5640)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv5640, "ov5640")
>  
>  class CameraSensorHelperOv5647 : public CameraSensorHelper
>  {
> @@ -806,7 +798,7 @@ public:
>                 gain_ = AnalogueGainLinear{ 1, 0, 0, 16 };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov5647", CameraSensorHelperOv5647)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv5647, "ov5647")
>  
>  class CameraSensorHelperOv5670 : public CameraSensorHelper
>  {
> @@ -816,7 +808,7 @@ public:
>                 gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov5670", CameraSensorHelperOv5670)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv5670, "ov5670")
>  
>  class CameraSensorHelperOv5675 : public CameraSensorHelper
>  {
> @@ -828,7 +820,7 @@ public:
>                 gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov5675", CameraSensorHelperOv5675)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv5675, "ov5675")
>  
>  class CameraSensorHelperOv5693 : public CameraSensorHelper
>  {
> @@ -839,7 +831,7 @@ public:
>                 gain_ = AnalogueGainLinear{ 1, 0, 0, 16 };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov5693", CameraSensorHelperOv5693)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv5693, "ov5693")
>  
>  class CameraSensorHelperOv64a40 : public CameraSensorHelper
>  {
> @@ -849,7 +841,7 @@ public:
>                 gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov64a40", CameraSensorHelperOv64a40)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv64a40, "ov64a40")
>  
>  class CameraSensorHelperOv8858 : public CameraSensorHelper
>  {
> @@ -865,7 +857,7 @@ public:
>                 gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov8858", CameraSensorHelperOv8858)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv8858, "ov8858")
>  
>  class CameraSensorHelperOv8865 : public CameraSensorHelper
>  {
> @@ -875,7 +867,7 @@ public:
>                 gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov8865", CameraSensorHelperOv8865)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv8865, "ov8865")
>  
>  class CameraSensorHelperOv13858 : public CameraSensorHelper
>  {
> @@ -885,7 +877,7 @@ public:
>                 gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov13858", CameraSensorHelperOv13858)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv13858, "ov13858")
>  
>  class CameraSensorHelperVd55g1 : public CameraSensorHelper
>  {
> @@ -897,7 +889,7 @@ public:
>                 gain_ = AnalogueGainLinear{ 0, 32, -1, 32 };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("vd55g1", CameraSensorHelperVd55g1)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperVd55g1, "vd55g1")
>  
>  class CameraSensorHelperVd56g3 : public CameraSensorHelper
>  {
> @@ -909,7 +901,7 @@ public:
>                 gain_ = AnalogueGainLinear{ 0, 32, -1, 32 };
>         }
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("vd56g3", CameraSensorHelperVd56g3)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperVd56g3, "vd56g3")
>  
>  } /* namespace */
>  
> diff --git a/src/ipa/libipa/camera_sensor_helper.h b/src/ipa/libipa/camera_sensor_helper.h
> index bd3d0beec77f..bc53f1bfc80c 100644
> --- a/src/ipa/libipa/camera_sensor_helper.h
> +++ b/src/ipa/libipa/camera_sensor_helper.h
> @@ -54,7 +54,7 @@ private:
>  class CameraSensorHelperFactoryBase
>  {
>  public:
> -       CameraSensorHelperFactoryBase(const std::string name);
> +       CameraSensorHelperFactoryBase(std::initializer_list<const char *> names);
>         virtual ~CameraSensorHelperFactoryBase() = default;
>  
>         static std::unique_ptr<CameraSensorHelper> create(const std::string &name);
> @@ -68,15 +68,15 @@ private:
>  
>         virtual std::unique_ptr<CameraSensorHelper> createInstance() const = 0;
>  
> -       std::string name_;
> +       std::vector<std::string> names_;
>  };
>  
>  template<typename _Helper>
>  class CameraSensorHelperFactory final : public CameraSensorHelperFactoryBase
>  {
>  public:
> -       CameraSensorHelperFactory(const char *name)
> -               : CameraSensorHelperFactoryBase(name)
> +       CameraSensorHelperFactory(std::initializer_list<const char *> names)
> +               : CameraSensorHelperFactoryBase(names)
>         {
>         }
>  
> @@ -87,8 +87,8 @@ private:
>         }
>  };
>  
> -#define REGISTER_CAMERA_SENSOR_HELPER(name, helper) \
> -static CameraSensorHelperFactory<helper> global_##helper##Factory(name);
> +#define REGISTER_CAMERA_SENSOR_HELPER(helper, name, ...) \
> +static CameraSensorHelperFactory<helper> global_##helper##Factory({ name, __VA_ARGS__ });



>  
>  } /* namespace ipa */
>  
> 
> -- 
> 2.55.0
>
Laurent Pinchart Oct. 22, 2026, 4:29 p.m. UTC | #2
Hi Jai,

Thank you for the patch.

On Thu, Oct 22, 2026 at 09:18:30PM +0530, Jai Luthra wrote:
> Multiple sensors of the same family can often be supported by the same
> helper. Currently we have to duplicate this by defining a new child
> class and calling the REGISTER_CAMERA_SENSOR_HELPER macro again. Like
> below:
> 
> class CameraSensorHelperImx327 : public CameraSensorHelperImx290
> {
> };
> REGISTER_CAMERA_SENSOR_HELPER("imx327", CameraSensorHelperImx327)
> 
> Fix that by instead allowing registering the same camera sensor helper
> class for multiple sensor names. Also update the macro to accept >= 1
> names using variadic args.
> 
> Now that this is in place, convert the three users of
> CameraSensorHelperImx290 to use this.

I'm not sure this is a good idea. I understand the motivation, but
there's a parallel effort to merge the libipa camera sensor helpers with
the camera sensor properties in libcamera. Different sensors supported
by the same libipa helpers will have different properties (in particular
the pixel size). We would then need to undo this change, at least
partly.

That being said, there are sensors with different names that are
essentially the same device with a different process or pixel
architecture. For instance, the IMX462 appears to differ from the IMX290
by its sensitivity and maximum analog gain only. The analog gain limits
are retrieved directly from the kernel driver, so that's fine. Unless we
think we'll need to add sensitivity information to the sensor helpers (I
think it probably belongs to the tuning file instead), the two can
safely shared the same helper.

IMX327 is also similar, but documented to be limited to 60 fps (which
the kernel driver doesn't seem to take into account, to be
investigated). This is also not something that is modelled in the
helpers today, and limits are retrieved from the driver as for the
analog gain, so that's probably fine too.

In the camera sensor properties, the control delays are identical for
the IMX290 and IMX462, but not specified for the IMX327. I assume they
would be the same, but I haven't checked that.

All this to say that I understand why you've proposed this patch, and I
think it's probably fine for the IMX290, IMX327 and IMX462, but a single
helper for all Starvis 2 sensors is likely not what we'll need.

> Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
> ---
>  src/ipa/libipa/camera_sensor_helper.cpp | 98 +++++++++++++++------------------
>  src/ipa/libipa/camera_sensor_helper.h   | 12 ++--
>  2 files changed, 51 insertions(+), 59 deletions(-)
> 
> diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp
> index 359040ec7418..5fbeefaf5e90 100644
> --- a/src/ipa/libipa/camera_sensor_helper.cpp
> +++ b/src/ipa/libipa/camera_sensor_helper.cpp
> @@ -241,15 +241,15 @@ double CameraSensorHelper::quantizeGain(double _gain, double *quantizationGain)
>  
>  /**
>   * \brief Construct a camera sensor helper factory base
> - * \param[in] name Name of the camera sensor helper class
> + * \param[in] names Names of the camera sensors to match with the helper
>   *
>   * Creating an instance of the factory base registers it with the global list of
>   * factories, accessible through the factories() function.
>   *
> - * The factory \a name is used to look up factories and shall be unique.
> + * The factory \a names are used to look up factories and shall be unique.
>   */
> -CameraSensorHelperFactoryBase::CameraSensorHelperFactoryBase(const std::string name)
> -	: name_(name)
> +CameraSensorHelperFactoryBase::CameraSensorHelperFactoryBase(std::initializer_list<const char *> names)
> +    : names_(names.begin(), names.end())
>  {
>  	registerType(this);
>  }
> @@ -269,7 +269,8 @@ std::unique_ptr<CameraSensorHelper> CameraSensorHelperFactoryBase::create(const
>  		CameraSensorHelperFactoryBase::factories();
>  
>  	for (const CameraSensorHelperFactoryBase *factory : factories) {
> -		if (name != factory->name_)
> +		const auto &names = factory->names_;
> +		if (std::find(names.begin(), names.end(), name) == names.end())
>  			continue;
>  
>  		return factory->createInstance();
> @@ -345,8 +346,9 @@ std::vector<CameraSensorHelperFactoryBase *> &CameraSensorHelperFactoryBase::fac
>  /**
>   * \def REGISTER_CAMERA_SENSOR_HELPER
>   * \brief Register a camera sensor helper with the camera sensor helper factory
> - * \param[in] name Sensor model name used to register the class
>   * \param[in] helper Class name of CameraSensorHelper derived class to register
> + * \param[in] name Sensor model name used to register the class
> + * \param[in] ... More sensor model names that can be matched to this helper
>   *
>   * Register a CameraSensorHelper subclass with the factory and make it available
>   * to try and match sensors.
> @@ -468,7 +470,7 @@ public:
>  		return m * (1 << coarse) / (1.0 - (fine / d1) / d2);
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ar0144", CameraSensorHelperAr0144)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperAr0144, "ar0144")
>  
>  class CameraSensorHelperAr0521 : public CameraSensorHelper
>  {
> @@ -493,7 +495,7 @@ public:
>  private:
>  	static constexpr double kStep_ = 16;
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ar0521", CameraSensorHelperAr0521)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperAr0521, "ar0521")
>  
>  class CameraSensorHelperGc05a2 : public CameraSensorHelper
>  {
> @@ -505,7 +507,7 @@ public:
>  		gain_ = AnalogueGainLinear{ 100, 0, 0, 1024 };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("gc05a2", CameraSensorHelperGc05a2)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperGc05a2, "gc05a2")
>  
>  class CameraSensorHelperGc08a3 : public CameraSensorHelper
>  {
> @@ -517,7 +519,7 @@ public:
>  		gain_ = AnalogueGainLinear{ 100, 0, 0, 1024 };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("gc08a3", CameraSensorHelperGc08a3)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperGc08a3, "gc08a3")
>  
>  class CameraSensorHelperHm1246 : public CameraSensorHelper
>  {
> @@ -527,7 +529,7 @@ public:
>  		gain_ = AnalogueGainLinear{ 1, 16, 0, 16 };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("hm1246", CameraSensorHelperHm1246)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperHm1246, "hm1246")
>  
>  class CameraSensorHelperImx214 : public CameraSensorHelper
>  {
> @@ -539,7 +541,7 @@ public:
>  		gain_ = AnalogueGainLinear{ 0, 512, -1, 512 };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("imx214", CameraSensorHelperImx214)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx214, "imx214")
>  
>  class CameraSensorHelperImx219 : public CameraSensorHelper
>  {
> @@ -551,7 +553,7 @@ public:
>  		gain_ = AnalogueGainLinear{ 0, 256, -1, 256 };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("imx219", CameraSensorHelperImx219)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx219, "imx219")
>  
>  class CameraSensorHelperImx258 : public CameraSensorHelper
>  {
> @@ -563,7 +565,7 @@ public:
>  		gain_ = AnalogueGainLinear{ 0, 512, -1, 512 };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("imx258", CameraSensorHelperImx258)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx258, "imx258")
>  
>  class CameraSensorHelperImx283 : public CameraSensorHelper
>  {
> @@ -575,7 +577,7 @@ public:
>  		gain_ = AnalogueGainLinear{ 0, 2048, -1, 2048 };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("imx283", CameraSensorHelperImx283)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx283, "imx283")
>  
>  class CameraSensorHelperImx290 : public CameraSensorHelper
>  {
> @@ -587,7 +589,7 @@ public:
>  		gain_ = AnalogueGainExp{ 1.0, expGainDb(0.3) };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("imx290", CameraSensorHelperImx290)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx290, "imx290", "imx327", "imx462")
>  
>  class CameraSensorHelperImx296 : public CameraSensorHelper
>  {
> @@ -597,12 +599,7 @@ public:
>  		gain_ = AnalogueGainExp{ 1.0, expGainDb(0.1) };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("imx296", CameraSensorHelperImx296)
> -
> -class CameraSensorHelperImx327 : public CameraSensorHelperImx290
> -{
> -};
> -REGISTER_CAMERA_SENSOR_HELPER("imx327", CameraSensorHelperImx327)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx296, "imx296")
>  
>  class CameraSensorHelperImx335 : public CameraSensorHelper
>  {
> @@ -614,7 +611,7 @@ public:
>  		gain_ = AnalogueGainExp{ 1.0, expGainDb(0.3) };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("imx335", CameraSensorHelperImx335)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx335, "imx335")
>  
>  class CameraSensorHelperImx355 : public CameraSensorHelper
>  {
> @@ -626,7 +623,7 @@ public:
>  		gain_ = AnalogueGainLinear{ 0, 1024, -1, 1024 };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("imx355", CameraSensorHelperImx355)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx355, "imx355")
>  
>  class CameraSensorHelperImx415 : public CameraSensorHelper
>  {
> @@ -636,12 +633,7 @@ public:
>  		gain_ = AnalogueGainExp{ 1.0, expGainDb(0.3) };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("imx415", CameraSensorHelperImx415)
> -
> -class CameraSensorHelperImx462 : public CameraSensorHelperImx290
> -{
> -};
> -REGISTER_CAMERA_SENSOR_HELPER("imx462", CameraSensorHelperImx462)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx415, "imx415")
>  
>  class CameraSensorHelperImx471 : public CameraSensorHelper
>  {
> @@ -654,7 +646,7 @@ public:
>  		gain_ = AnalogueGainLinear{ 0, 1024, -1, 1024 };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("imx471", CameraSensorHelperImx471)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx471, "imx471")
>  
>  class CameraSensorHelperImx477 : public CameraSensorHelper
>  {
> @@ -664,7 +656,7 @@ public:
>  		gain_ = AnalogueGainLinear{ 0, 1024, -1, 1024 };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("imx477", CameraSensorHelperImx477)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx477, "imx477")
>  
>  class CameraSensorHelperImx662 : public CameraSensorHelper
>  {
> @@ -676,7 +668,7 @@ public:
>  		gain_ = AnalogueGainExp{ 1.0, expGainDb(0.3) };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("imx662", CameraSensorHelperImx662)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx662, "imx662")
>  
>  class CameraSensorHelperImx678 : public CameraSensorHelper
>  {
> @@ -688,7 +680,7 @@ public:
>  		gain_ = AnalogueGainExp{ 1.0, expGainDb(0.3) };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("imx678", CameraSensorHelperImx678)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx678, "imx678")
>  
>  class CameraSensorHelperImx708 : public CameraSensorHelper
>  {
> @@ -699,7 +691,7 @@ public:
>  		gain_ = AnalogueGainLinear{ 0, 1024, -1, 1024 };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("imx708", CameraSensorHelperImx708)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx708, "imx708")
>  
>  class CameraSensorHelperOv01a10 : public CameraSensorHelper
>  {
> @@ -711,7 +703,7 @@ public:
>  		gain_ = AnalogueGainLinear{ 1, 0, 0, 256 };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov01a10", CameraSensorHelperOv01a10)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv01a10, "ov01a10")
>  
>  class CameraSensorHelperOv08d10 : public CameraSensorHelper
>  {
> @@ -723,7 +715,7 @@ public:
>  		gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov08d10", CameraSensorHelperOv08d10)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv08d10, "ov08d10")
>  
>  class CameraSensorHelperOv08x40 : public CameraSensorHelper
>  {
> @@ -734,7 +726,7 @@ public:
>  		gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov08x40", CameraSensorHelperOv08x40)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv08x40, "ov08x40")
>  
>  class CameraSensorHelperMira220 : public CameraSensorHelper
>  {
> @@ -746,7 +738,7 @@ public:
>  		gain_ = AnalogueGainLinear{ 0, 2048, -1, 2048 };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("mira220", CameraSensorHelperMira220)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperMira220, "mira220")
>  
>  class CameraSensorHelperOv2685 : public CameraSensorHelper
>  {
> @@ -760,7 +752,7 @@ public:
>  		gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov2685", CameraSensorHelperOv2685)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv2685, "ov2685")
>  
>  class CameraSensorHelperOv2740 : public CameraSensorHelper
>  {
> @@ -772,7 +764,7 @@ public:
>  		gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov2740", CameraSensorHelperOv2740)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv2740, "ov2740")
>  
>  class CameraSensorHelperOv4689 : public CameraSensorHelper
>  {
> @@ -784,7 +776,7 @@ public:
>  		gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov4689", CameraSensorHelperOv4689)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv4689, "ov4689")
>  
>  class CameraSensorHelperOv5640 : public CameraSensorHelper
>  {
> @@ -796,7 +788,7 @@ public:
>  		gain_ = AnalogueGainLinear{ 1, 0, 0, 16 };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov5640", CameraSensorHelperOv5640)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv5640, "ov5640")
>  
>  class CameraSensorHelperOv5647 : public CameraSensorHelper
>  {
> @@ -806,7 +798,7 @@ public:
>  		gain_ = AnalogueGainLinear{ 1, 0, 0, 16 };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov5647", CameraSensorHelperOv5647)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv5647, "ov5647")
>  
>  class CameraSensorHelperOv5670 : public CameraSensorHelper
>  {
> @@ -816,7 +808,7 @@ public:
>  		gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov5670", CameraSensorHelperOv5670)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv5670, "ov5670")
>  
>  class CameraSensorHelperOv5675 : public CameraSensorHelper
>  {
> @@ -828,7 +820,7 @@ public:
>  		gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov5675", CameraSensorHelperOv5675)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv5675, "ov5675")
>  
>  class CameraSensorHelperOv5693 : public CameraSensorHelper
>  {
> @@ -839,7 +831,7 @@ public:
>  		gain_ = AnalogueGainLinear{ 1, 0, 0, 16 };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov5693", CameraSensorHelperOv5693)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv5693, "ov5693")
>  
>  class CameraSensorHelperOv64a40 : public CameraSensorHelper
>  {
> @@ -849,7 +841,7 @@ public:
>  		gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov64a40", CameraSensorHelperOv64a40)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv64a40, "ov64a40")
>  
>  class CameraSensorHelperOv8858 : public CameraSensorHelper
>  {
> @@ -865,7 +857,7 @@ public:
>  		gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov8858", CameraSensorHelperOv8858)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv8858, "ov8858")
>  
>  class CameraSensorHelperOv8865 : public CameraSensorHelper
>  {
> @@ -875,7 +867,7 @@ public:
>  		gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov8865", CameraSensorHelperOv8865)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv8865, "ov8865")
>  
>  class CameraSensorHelperOv13858 : public CameraSensorHelper
>  {
> @@ -885,7 +877,7 @@ public:
>  		gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("ov13858", CameraSensorHelperOv13858)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv13858, "ov13858")
>  
>  class CameraSensorHelperVd55g1 : public CameraSensorHelper
>  {
> @@ -897,7 +889,7 @@ public:
>  		gain_ = AnalogueGainLinear{ 0, 32, -1, 32 };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("vd55g1", CameraSensorHelperVd55g1)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperVd55g1, "vd55g1")
>  
>  class CameraSensorHelperVd56g3 : public CameraSensorHelper
>  {
> @@ -909,7 +901,7 @@ public:
>  		gain_ = AnalogueGainLinear{ 0, 32, -1, 32 };
>  	}
>  };
> -REGISTER_CAMERA_SENSOR_HELPER("vd56g3", CameraSensorHelperVd56g3)
> +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperVd56g3, "vd56g3")
>  
>  } /* namespace */
>  
> diff --git a/src/ipa/libipa/camera_sensor_helper.h b/src/ipa/libipa/camera_sensor_helper.h
> index bd3d0beec77f..bc53f1bfc80c 100644
> --- a/src/ipa/libipa/camera_sensor_helper.h
> +++ b/src/ipa/libipa/camera_sensor_helper.h
> @@ -54,7 +54,7 @@ private:
>  class CameraSensorHelperFactoryBase
>  {
>  public:
> -	CameraSensorHelperFactoryBase(const std::string name);
> +	CameraSensorHelperFactoryBase(std::initializer_list<const char *> names);
>  	virtual ~CameraSensorHelperFactoryBase() = default;
>  
>  	static std::unique_ptr<CameraSensorHelper> create(const std::string &name);
> @@ -68,15 +68,15 @@ private:
>  
>  	virtual std::unique_ptr<CameraSensorHelper> createInstance() const = 0;
>  
> -	std::string name_;
> +	std::vector<std::string> names_;
>  };
>  
>  template<typename _Helper>
>  class CameraSensorHelperFactory final : public CameraSensorHelperFactoryBase
>  {
>  public:
> -	CameraSensorHelperFactory(const char *name)
> -		: CameraSensorHelperFactoryBase(name)
> +	CameraSensorHelperFactory(std::initializer_list<const char *> names)
> +		: CameraSensorHelperFactoryBase(names)
>  	{
>  	}
>  
> @@ -87,8 +87,8 @@ private:
>  	}
>  };
>  
> -#define REGISTER_CAMERA_SENSOR_HELPER(name, helper) \
> -static CameraSensorHelperFactory<helper> global_##helper##Factory(name);
> +#define REGISTER_CAMERA_SENSOR_HELPER(helper, name, ...) \
> +static CameraSensorHelperFactory<helper> global_##helper##Factory({ name, __VA_ARGS__ });
>  
>  } /* namespace ipa */
>
Dave Stevenson Oct. 22, 2026, 4:49 p.m. UTC | #3
Hi Laurent

On Thu, 22 Oct 2026 at 17:29, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> Hi Jai,
>
> Thank you for the patch.
>
> On Thu, Oct 22, 2026 at 09:18:30PM +0530, Jai Luthra wrote:
> > Multiple sensors of the same family can often be supported by the same
> > helper. Currently we have to duplicate this by defining a new child
> > class and calling the REGISTER_CAMERA_SENSOR_HELPER macro again. Like
> > below:
> >
> > class CameraSensorHelperImx327 : public CameraSensorHelperImx290
> > {
> > };
> > REGISTER_CAMERA_SENSOR_HELPER("imx327", CameraSensorHelperImx327)
> >
> > Fix that by instead allowing registering the same camera sensor helper
> > class for multiple sensor names. Also update the macro to accept >= 1
> > names using variadic args.
> >
> > Now that this is in place, convert the three users of
> > CameraSensorHelperImx290 to use this.
>
> I'm not sure this is a good idea. I understand the motivation, but
> there's a parallel effort to merge the libipa camera sensor helpers with
> the camera sensor properties in libcamera. Different sensors supported
> by the same libipa helpers will have different properties (in particular
> the pixel size). We would then need to undo this change, at least
> partly.
>
> That being said, there are sensors with different names that are
> essentially the same device with a different process or pixel
> architecture. For instance, the IMX462 appears to differ from the IMX290
> by its sensitivity and maximum analog gain only. The analog gain limits
> are retrieved directly from the kernel driver, so that's fine. Unless we
> think we'll need to add sensitivity information to the sensor helpers (I
> think it probably belongs to the tuning file instead), the two can
> safely shared the same helper.
>
> IMX327 is also similar, but documented to be limited to 60 fps (which
> the kernel driver doesn't seem to take into account, to be
> investigated).

The imx290 kernel driver doesn't support the 120fps 10bit-only mode
that is available on IMX290 and IMX462.
The maximum supported is 1080p60 as either 10 or 12 bit, and that is
supported by all 3 sensors.

(I have had an enquiry about the 120fps mode, so hope to look into it
at some point).

  Dave

> This is also not something that is modelled in the
> helpers today, and limits are retrieved from the driver as for the
> analog gain, so that's probably fine too.
>
> In the camera sensor properties, the control delays are identical for
> the IMX290 and IMX462, but not specified for the IMX327. I assume they
> would be the same, but I haven't checked that.
>
> All this to say that I understand why you've proposed this patch, and I
> think it's probably fine for the IMX290, IMX327 and IMX462, but a single
> helper for all Starvis 2 sensors is likely not what we'll need.
>
> > Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
> > ---
> >  src/ipa/libipa/camera_sensor_helper.cpp | 98 +++++++++++++++------------------
> >  src/ipa/libipa/camera_sensor_helper.h   | 12 ++--
> >  2 files changed, 51 insertions(+), 59 deletions(-)
> >
> > diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp
> > index 359040ec7418..5fbeefaf5e90 100644
> > --- a/src/ipa/libipa/camera_sensor_helper.cpp
> > +++ b/src/ipa/libipa/camera_sensor_helper.cpp
> > @@ -241,15 +241,15 @@ double CameraSensorHelper::quantizeGain(double _gain, double *quantizationGain)
> >
> >  /**
> >   * \brief Construct a camera sensor helper factory base
> > - * \param[in] name Name of the camera sensor helper class
> > + * \param[in] names Names of the camera sensors to match with the helper
> >   *
> >   * Creating an instance of the factory base registers it with the global list of
> >   * factories, accessible through the factories() function.
> >   *
> > - * The factory \a name is used to look up factories and shall be unique.
> > + * The factory \a names are used to look up factories and shall be unique.
> >   */
> > -CameraSensorHelperFactoryBase::CameraSensorHelperFactoryBase(const std::string name)
> > -     : name_(name)
> > +CameraSensorHelperFactoryBase::CameraSensorHelperFactoryBase(std::initializer_list<const char *> names)
> > +    : names_(names.begin(), names.end())
> >  {
> >       registerType(this);
> >  }
> > @@ -269,7 +269,8 @@ std::unique_ptr<CameraSensorHelper> CameraSensorHelperFactoryBase::create(const
> >               CameraSensorHelperFactoryBase::factories();
> >
> >       for (const CameraSensorHelperFactoryBase *factory : factories) {
> > -             if (name != factory->name_)
> > +             const auto &names = factory->names_;
> > +             if (std::find(names.begin(), names.end(), name) == names.end())
> >                       continue;
> >
> >               return factory->createInstance();
> > @@ -345,8 +346,9 @@ std::vector<CameraSensorHelperFactoryBase *> &CameraSensorHelperFactoryBase::fac
> >  /**
> >   * \def REGISTER_CAMERA_SENSOR_HELPER
> >   * \brief Register a camera sensor helper with the camera sensor helper factory
> > - * \param[in] name Sensor model name used to register the class
> >   * \param[in] helper Class name of CameraSensorHelper derived class to register
> > + * \param[in] name Sensor model name used to register the class
> > + * \param[in] ... More sensor model names that can be matched to this helper
> >   *
> >   * Register a CameraSensorHelper subclass with the factory and make it available
> >   * to try and match sensors.
> > @@ -468,7 +470,7 @@ public:
> >               return m * (1 << coarse) / (1.0 - (fine / d1) / d2);
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("ar0144", CameraSensorHelperAr0144)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperAr0144, "ar0144")
> >
> >  class CameraSensorHelperAr0521 : public CameraSensorHelper
> >  {
> > @@ -493,7 +495,7 @@ public:
> >  private:
> >       static constexpr double kStep_ = 16;
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("ar0521", CameraSensorHelperAr0521)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperAr0521, "ar0521")
> >
> >  class CameraSensorHelperGc05a2 : public CameraSensorHelper
> >  {
> > @@ -505,7 +507,7 @@ public:
> >               gain_ = AnalogueGainLinear{ 100, 0, 0, 1024 };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("gc05a2", CameraSensorHelperGc05a2)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperGc05a2, "gc05a2")
> >
> >  class CameraSensorHelperGc08a3 : public CameraSensorHelper
> >  {
> > @@ -517,7 +519,7 @@ public:
> >               gain_ = AnalogueGainLinear{ 100, 0, 0, 1024 };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("gc08a3", CameraSensorHelperGc08a3)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperGc08a3, "gc08a3")
> >
> >  class CameraSensorHelperHm1246 : public CameraSensorHelper
> >  {
> > @@ -527,7 +529,7 @@ public:
> >               gain_ = AnalogueGainLinear{ 1, 16, 0, 16 };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("hm1246", CameraSensorHelperHm1246)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperHm1246, "hm1246")
> >
> >  class CameraSensorHelperImx214 : public CameraSensorHelper
> >  {
> > @@ -539,7 +541,7 @@ public:
> >               gain_ = AnalogueGainLinear{ 0, 512, -1, 512 };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("imx214", CameraSensorHelperImx214)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx214, "imx214")
> >
> >  class CameraSensorHelperImx219 : public CameraSensorHelper
> >  {
> > @@ -551,7 +553,7 @@ public:
> >               gain_ = AnalogueGainLinear{ 0, 256, -1, 256 };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("imx219", CameraSensorHelperImx219)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx219, "imx219")
> >
> >  class CameraSensorHelperImx258 : public CameraSensorHelper
> >  {
> > @@ -563,7 +565,7 @@ public:
> >               gain_ = AnalogueGainLinear{ 0, 512, -1, 512 };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("imx258", CameraSensorHelperImx258)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx258, "imx258")
> >
> >  class CameraSensorHelperImx283 : public CameraSensorHelper
> >  {
> > @@ -575,7 +577,7 @@ public:
> >               gain_ = AnalogueGainLinear{ 0, 2048, -1, 2048 };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("imx283", CameraSensorHelperImx283)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx283, "imx283")
> >
> >  class CameraSensorHelperImx290 : public CameraSensorHelper
> >  {
> > @@ -587,7 +589,7 @@ public:
> >               gain_ = AnalogueGainExp{ 1.0, expGainDb(0.3) };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("imx290", CameraSensorHelperImx290)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx290, "imx290", "imx327", "imx462")
> >
> >  class CameraSensorHelperImx296 : public CameraSensorHelper
> >  {
> > @@ -597,12 +599,7 @@ public:
> >               gain_ = AnalogueGainExp{ 1.0, expGainDb(0.1) };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("imx296", CameraSensorHelperImx296)
> > -
> > -class CameraSensorHelperImx327 : public CameraSensorHelperImx290
> > -{
> > -};
> > -REGISTER_CAMERA_SENSOR_HELPER("imx327", CameraSensorHelperImx327)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx296, "imx296")
> >
> >  class CameraSensorHelperImx335 : public CameraSensorHelper
> >  {
> > @@ -614,7 +611,7 @@ public:
> >               gain_ = AnalogueGainExp{ 1.0, expGainDb(0.3) };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("imx335", CameraSensorHelperImx335)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx335, "imx335")
> >
> >  class CameraSensorHelperImx355 : public CameraSensorHelper
> >  {
> > @@ -626,7 +623,7 @@ public:
> >               gain_ = AnalogueGainLinear{ 0, 1024, -1, 1024 };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("imx355", CameraSensorHelperImx355)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx355, "imx355")
> >
> >  class CameraSensorHelperImx415 : public CameraSensorHelper
> >  {
> > @@ -636,12 +633,7 @@ public:
> >               gain_ = AnalogueGainExp{ 1.0, expGainDb(0.3) };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("imx415", CameraSensorHelperImx415)
> > -
> > -class CameraSensorHelperImx462 : public CameraSensorHelperImx290
> > -{
> > -};
> > -REGISTER_CAMERA_SENSOR_HELPER("imx462", CameraSensorHelperImx462)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx415, "imx415")
> >
> >  class CameraSensorHelperImx471 : public CameraSensorHelper
> >  {
> > @@ -654,7 +646,7 @@ public:
> >               gain_ = AnalogueGainLinear{ 0, 1024, -1, 1024 };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("imx471", CameraSensorHelperImx471)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx471, "imx471")
> >
> >  class CameraSensorHelperImx477 : public CameraSensorHelper
> >  {
> > @@ -664,7 +656,7 @@ public:
> >               gain_ = AnalogueGainLinear{ 0, 1024, -1, 1024 };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("imx477", CameraSensorHelperImx477)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx477, "imx477")
> >
> >  class CameraSensorHelperImx662 : public CameraSensorHelper
> >  {
> > @@ -676,7 +668,7 @@ public:
> >               gain_ = AnalogueGainExp{ 1.0, expGainDb(0.3) };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("imx662", CameraSensorHelperImx662)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx662, "imx662")
> >
> >  class CameraSensorHelperImx678 : public CameraSensorHelper
> >  {
> > @@ -688,7 +680,7 @@ public:
> >               gain_ = AnalogueGainExp{ 1.0, expGainDb(0.3) };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("imx678", CameraSensorHelperImx678)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx678, "imx678")
> >
> >  class CameraSensorHelperImx708 : public CameraSensorHelper
> >  {
> > @@ -699,7 +691,7 @@ public:
> >               gain_ = AnalogueGainLinear{ 0, 1024, -1, 1024 };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("imx708", CameraSensorHelperImx708)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx708, "imx708")
> >
> >  class CameraSensorHelperOv01a10 : public CameraSensorHelper
> >  {
> > @@ -711,7 +703,7 @@ public:
> >               gain_ = AnalogueGainLinear{ 1, 0, 0, 256 };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("ov01a10", CameraSensorHelperOv01a10)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv01a10, "ov01a10")
> >
> >  class CameraSensorHelperOv08d10 : public CameraSensorHelper
> >  {
> > @@ -723,7 +715,7 @@ public:
> >               gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("ov08d10", CameraSensorHelperOv08d10)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv08d10, "ov08d10")
> >
> >  class CameraSensorHelperOv08x40 : public CameraSensorHelper
> >  {
> > @@ -734,7 +726,7 @@ public:
> >               gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("ov08x40", CameraSensorHelperOv08x40)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv08x40, "ov08x40")
> >
> >  class CameraSensorHelperMira220 : public CameraSensorHelper
> >  {
> > @@ -746,7 +738,7 @@ public:
> >               gain_ = AnalogueGainLinear{ 0, 2048, -1, 2048 };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("mira220", CameraSensorHelperMira220)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperMira220, "mira220")
> >
> >  class CameraSensorHelperOv2685 : public CameraSensorHelper
> >  {
> > @@ -760,7 +752,7 @@ public:
> >               gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("ov2685", CameraSensorHelperOv2685)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv2685, "ov2685")
> >
> >  class CameraSensorHelperOv2740 : public CameraSensorHelper
> >  {
> > @@ -772,7 +764,7 @@ public:
> >               gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("ov2740", CameraSensorHelperOv2740)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv2740, "ov2740")
> >
> >  class CameraSensorHelperOv4689 : public CameraSensorHelper
> >  {
> > @@ -784,7 +776,7 @@ public:
> >               gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("ov4689", CameraSensorHelperOv4689)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv4689, "ov4689")
> >
> >  class CameraSensorHelperOv5640 : public CameraSensorHelper
> >  {
> > @@ -796,7 +788,7 @@ public:
> >               gain_ = AnalogueGainLinear{ 1, 0, 0, 16 };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("ov5640", CameraSensorHelperOv5640)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv5640, "ov5640")
> >
> >  class CameraSensorHelperOv5647 : public CameraSensorHelper
> >  {
> > @@ -806,7 +798,7 @@ public:
> >               gain_ = AnalogueGainLinear{ 1, 0, 0, 16 };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("ov5647", CameraSensorHelperOv5647)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv5647, "ov5647")
> >
> >  class CameraSensorHelperOv5670 : public CameraSensorHelper
> >  {
> > @@ -816,7 +808,7 @@ public:
> >               gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("ov5670", CameraSensorHelperOv5670)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv5670, "ov5670")
> >
> >  class CameraSensorHelperOv5675 : public CameraSensorHelper
> >  {
> > @@ -828,7 +820,7 @@ public:
> >               gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("ov5675", CameraSensorHelperOv5675)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv5675, "ov5675")
> >
> >  class CameraSensorHelperOv5693 : public CameraSensorHelper
> >  {
> > @@ -839,7 +831,7 @@ public:
> >               gain_ = AnalogueGainLinear{ 1, 0, 0, 16 };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("ov5693", CameraSensorHelperOv5693)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv5693, "ov5693")
> >
> >  class CameraSensorHelperOv64a40 : public CameraSensorHelper
> >  {
> > @@ -849,7 +841,7 @@ public:
> >               gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("ov64a40", CameraSensorHelperOv64a40)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv64a40, "ov64a40")
> >
> >  class CameraSensorHelperOv8858 : public CameraSensorHelper
> >  {
> > @@ -865,7 +857,7 @@ public:
> >               gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("ov8858", CameraSensorHelperOv8858)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv8858, "ov8858")
> >
> >  class CameraSensorHelperOv8865 : public CameraSensorHelper
> >  {
> > @@ -875,7 +867,7 @@ public:
> >               gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("ov8865", CameraSensorHelperOv8865)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv8865, "ov8865")
> >
> >  class CameraSensorHelperOv13858 : public CameraSensorHelper
> >  {
> > @@ -885,7 +877,7 @@ public:
> >               gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("ov13858", CameraSensorHelperOv13858)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv13858, "ov13858")
> >
> >  class CameraSensorHelperVd55g1 : public CameraSensorHelper
> >  {
> > @@ -897,7 +889,7 @@ public:
> >               gain_ = AnalogueGainLinear{ 0, 32, -1, 32 };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("vd55g1", CameraSensorHelperVd55g1)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperVd55g1, "vd55g1")
> >
> >  class CameraSensorHelperVd56g3 : public CameraSensorHelper
> >  {
> > @@ -909,7 +901,7 @@ public:
> >               gain_ = AnalogueGainLinear{ 0, 32, -1, 32 };
> >       }
> >  };
> > -REGISTER_CAMERA_SENSOR_HELPER("vd56g3", CameraSensorHelperVd56g3)
> > +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperVd56g3, "vd56g3")
> >
> >  } /* namespace */
> >
> > diff --git a/src/ipa/libipa/camera_sensor_helper.h b/src/ipa/libipa/camera_sensor_helper.h
> > index bd3d0beec77f..bc53f1bfc80c 100644
> > --- a/src/ipa/libipa/camera_sensor_helper.h
> > +++ b/src/ipa/libipa/camera_sensor_helper.h
> > @@ -54,7 +54,7 @@ private:
> >  class CameraSensorHelperFactoryBase
> >  {
> >  public:
> > -     CameraSensorHelperFactoryBase(const std::string name);
> > +     CameraSensorHelperFactoryBase(std::initializer_list<const char *> names);
> >       virtual ~CameraSensorHelperFactoryBase() = default;
> >
> >       static std::unique_ptr<CameraSensorHelper> create(const std::string &name);
> > @@ -68,15 +68,15 @@ private:
> >
> >       virtual std::unique_ptr<CameraSensorHelper> createInstance() const = 0;
> >
> > -     std::string name_;
> > +     std::vector<std::string> names_;
> >  };
> >
> >  template<typename _Helper>
> >  class CameraSensorHelperFactory final : public CameraSensorHelperFactoryBase
> >  {
> >  public:
> > -     CameraSensorHelperFactory(const char *name)
> > -             : CameraSensorHelperFactoryBase(name)
> > +     CameraSensorHelperFactory(std::initializer_list<const char *> names)
> > +             : CameraSensorHelperFactoryBase(names)
> >       {
> >       }
> >
> > @@ -87,8 +87,8 @@ private:
> >       }
> >  };
> >
> > -#define REGISTER_CAMERA_SENSOR_HELPER(name, helper) \
> > -static CameraSensorHelperFactory<helper> global_##helper##Factory(name);
> > +#define REGISTER_CAMERA_SENSOR_HELPER(helper, name, ...) \
> > +static CameraSensorHelperFactory<helper> global_##helper##Factory({ name, __VA_ARGS__ });
> >
> >  } /* namespace ipa */
> >
>
> --
> Regards,
>
> Laurent Pinchart
Laurent Pinchart Oct. 22, 2026, 4:54 p.m. UTC | #4
Hi Dave,

On Thu, Oct 22, 2026 at 05:49:08PM +0100, Dave Stevenson wrote:
> On Thu, 22 Oct 2026 at 17:29, Laurent Pinchart wrote:
> > On Thu, Oct 22, 2026 at 09:18:30PM +0530, Jai Luthra wrote:
> > > Multiple sensors of the same family can often be supported by the same
> > > helper. Currently we have to duplicate this by defining a new child
> > > class and calling the REGISTER_CAMERA_SENSOR_HELPER macro again. Like
> > > below:
> > >
> > > class CameraSensorHelperImx327 : public CameraSensorHelperImx290
> > > {
> > > };
> > > REGISTER_CAMERA_SENSOR_HELPER("imx327", CameraSensorHelperImx327)
> > >
> > > Fix that by instead allowing registering the same camera sensor helper
> > > class for multiple sensor names. Also update the macro to accept >= 1
> > > names using variadic args.
> > >
> > > Now that this is in place, convert the three users of
> > > CameraSensorHelperImx290 to use this.
> >
> > I'm not sure this is a good idea. I understand the motivation, but
> > there's a parallel effort to merge the libipa camera sensor helpers with
> > the camera sensor properties in libcamera. Different sensors supported
> > by the same libipa helpers will have different properties (in particular
> > the pixel size). We would then need to undo this change, at least
> > partly.
> >
> > That being said, there are sensors with different names that are
> > essentially the same device with a different process or pixel
> > architecture. For instance, the IMX462 appears to differ from the IMX290
> > by its sensitivity and maximum analog gain only. The analog gain limits
> > are retrieved directly from the kernel driver, so that's fine. Unless we
> > think we'll need to add sensitivity information to the sensor helpers (I
> > think it probably belongs to the tuning file instead), the two can
> > safely shared the same helper.
> >
> > IMX327 is also similar, but documented to be limited to 60 fps (which
> > the kernel driver doesn't seem to take into account, to be
> > investigated).
> 
> The imx290 kernel driver doesn't support the 120fps 10bit-only mode
> that is available on IMX290 and IMX462.
> The maximum supported is 1080p60 as either 10 or 12 bit, and that is
> supported by all 3 sensors.

Thanks for the clarification, I didn't take much time to investigate
this in details.

> (I have had an enquiry about the 120fps mode, so hope to look into it
> at some point).

I expect that at that point the driver will expose differences through
control limits and libcamera will behave accordingly without any change
to helpers. If you think important differences will need to be provided
through the camera sensor helpers, please let me know.

> > This is also not something that is modelled in the
> > helpers today, and limits are retrieved from the driver as for the
> > analog gain, so that's probably fine too.
> >
> > In the camera sensor properties, the control delays are identical for
> > the IMX290 and IMX462, but not specified for the IMX327. I assume they
> > would be the same, but I haven't checked that.
> >
> > All this to say that I understand why you've proposed this patch, and I
> > think it's probably fine for the IMX290, IMX327 and IMX462, but a single
> > helper for all Starvis 2 sensors is likely not what we'll need.
> >
> > > Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
> > > ---
> > >  src/ipa/libipa/camera_sensor_helper.cpp | 98 +++++++++++++++------------------
> > >  src/ipa/libipa/camera_sensor_helper.h   | 12 ++--
> > >  2 files changed, 51 insertions(+), 59 deletions(-)
Dave Stevenson Oct. 22, 2026, 5:05 p.m. UTC | #5
On Thu, 22 Oct 2026 at 17:54, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> Hi Dave,
>
> On Thu, Oct 22, 2026 at 05:49:08PM +0100, Dave Stevenson wrote:
> > On Thu, 22 Oct 2026 at 17:29, Laurent Pinchart wrote:
> > > On Thu, Oct 22, 2026 at 09:18:30PM +0530, Jai Luthra wrote:
> > > > Multiple sensors of the same family can often be supported by the same
> > > > helper. Currently we have to duplicate this by defining a new child
> > > > class and calling the REGISTER_CAMERA_SENSOR_HELPER macro again. Like
> > > > below:
> > > >
> > > > class CameraSensorHelperImx327 : public CameraSensorHelperImx290
> > > > {
> > > > };
> > > > REGISTER_CAMERA_SENSOR_HELPER("imx327", CameraSensorHelperImx327)
> > > >
> > > > Fix that by instead allowing registering the same camera sensor helper
> > > > class for multiple sensor names. Also update the macro to accept >= 1
> > > > names using variadic args.
> > > >
> > > > Now that this is in place, convert the three users of
> > > > CameraSensorHelperImx290 to use this.
> > >
> > > I'm not sure this is a good idea. I understand the motivation, but
> > > there's a parallel effort to merge the libipa camera sensor helpers with
> > > the camera sensor properties in libcamera. Different sensors supported
> > > by the same libipa helpers will have different properties (in particular
> > > the pixel size). We would then need to undo this change, at least
> > > partly.
> > >
> > > That being said, there are sensors with different names that are
> > > essentially the same device with a different process or pixel
> > > architecture. For instance, the IMX462 appears to differ from the IMX290
> > > by its sensitivity and maximum analog gain only. The analog gain limits
> > > are retrieved directly from the kernel driver, so that's fine. Unless we
> > > think we'll need to add sensitivity information to the sensor helpers (I
> > > think it probably belongs to the tuning file instead), the two can
> > > safely shared the same helper.
> > >
> > > IMX327 is also similar, but documented to be limited to 60 fps (which
> > > the kernel driver doesn't seem to take into account, to be
> > > investigated).
> >
> > The imx290 kernel driver doesn't support the 120fps 10bit-only mode
> > that is available on IMX290 and IMX462.
> > The maximum supported is 1080p60 as either 10 or 12 bit, and that is
> > supported by all 3 sensors.
>
> Thanks for the clarification, I didn't take much time to investigate
> this in details.
>
> > (I have had an enquiry about the 120fps mode, so hope to look into it
> > at some point).
>
> I expect that at that point the driver will expose differences through
> control limits and libcamera will behave accordingly without any change
> to helpers. If you think important differences will need to be provided
> through the camera sensor helpers, please let me know.

Yes, it'll just be control differences.

IIRC V4L2_CID_PIXEL_RATE will have to double as the value of HMAX ends
up being 1100 which is less than the number of active pixels per line
(1920).
The main headache is juggling how link frequency and lane combinations
have been handled within the driver - the 120fps mode requires 4 lanes
at the higher link frequency.

  Dave

> > > This is also not something that is modelled in the
> > > helpers today, and limits are retrieved from the driver as for the
> > > analog gain, so that's probably fine too.
> > >
> > > In the camera sensor properties, the control delays are identical for
> > > the IMX290 and IMX462, but not specified for the IMX327. I assume they
> > > would be the same, but I haven't checked that.
> > >
> > > All this to say that I understand why you've proposed this patch, and I
> > > think it's probably fine for the IMX290, IMX327 and IMX462, but a single
> > > helper for all Starvis 2 sensors is likely not what we'll need.
> > >
> > > > Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
> > > > ---
> > > >  src/ipa/libipa/camera_sensor_helper.cpp | 98 +++++++++++++++------------------
> > > >  src/ipa/libipa/camera_sensor_helper.h   | 12 ++--
> > > >  2 files changed, 51 insertions(+), 59 deletions(-)
>
> --
> Regards,
>
> Laurent Pinchart

Patch
diff mbox series

diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp
index 359040ec7418..5fbeefaf5e90 100644
--- a/src/ipa/libipa/camera_sensor_helper.cpp
+++ b/src/ipa/libipa/camera_sensor_helper.cpp
@@ -241,15 +241,15 @@  double CameraSensorHelper::quantizeGain(double _gain, double *quantizationGain)
 
 /**
  * \brief Construct a camera sensor helper factory base
- * \param[in] name Name of the camera sensor helper class
+ * \param[in] names Names of the camera sensors to match with the helper
  *
  * Creating an instance of the factory base registers it with the global list of
  * factories, accessible through the factories() function.
  *
- * The factory \a name is used to look up factories and shall be unique.
+ * The factory \a names are used to look up factories and shall be unique.
  */
-CameraSensorHelperFactoryBase::CameraSensorHelperFactoryBase(const std::string name)
-	: name_(name)
+CameraSensorHelperFactoryBase::CameraSensorHelperFactoryBase(std::initializer_list<const char *> names)
+    : names_(names.begin(), names.end())
 {
 	registerType(this);
 }
@@ -269,7 +269,8 @@  std::unique_ptr<CameraSensorHelper> CameraSensorHelperFactoryBase::create(const
 		CameraSensorHelperFactoryBase::factories();
 
 	for (const CameraSensorHelperFactoryBase *factory : factories) {
-		if (name != factory->name_)
+		const auto &names = factory->names_;
+		if (std::find(names.begin(), names.end(), name) == names.end())
 			continue;
 
 		return factory->createInstance();
@@ -345,8 +346,9 @@  std::vector<CameraSensorHelperFactoryBase *> &CameraSensorHelperFactoryBase::fac
 /**
  * \def REGISTER_CAMERA_SENSOR_HELPER
  * \brief Register a camera sensor helper with the camera sensor helper factory
- * \param[in] name Sensor model name used to register the class
  * \param[in] helper Class name of CameraSensorHelper derived class to register
+ * \param[in] name Sensor model name used to register the class
+ * \param[in] ... More sensor model names that can be matched to this helper
  *
  * Register a CameraSensorHelper subclass with the factory and make it available
  * to try and match sensors.
@@ -468,7 +470,7 @@  public:
 		return m * (1 << coarse) / (1.0 - (fine / d1) / d2);
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("ar0144", CameraSensorHelperAr0144)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperAr0144, "ar0144")
 
 class CameraSensorHelperAr0521 : public CameraSensorHelper
 {
@@ -493,7 +495,7 @@  public:
 private:
 	static constexpr double kStep_ = 16;
 };
-REGISTER_CAMERA_SENSOR_HELPER("ar0521", CameraSensorHelperAr0521)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperAr0521, "ar0521")
 
 class CameraSensorHelperGc05a2 : public CameraSensorHelper
 {
@@ -505,7 +507,7 @@  public:
 		gain_ = AnalogueGainLinear{ 100, 0, 0, 1024 };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("gc05a2", CameraSensorHelperGc05a2)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperGc05a2, "gc05a2")
 
 class CameraSensorHelperGc08a3 : public CameraSensorHelper
 {
@@ -517,7 +519,7 @@  public:
 		gain_ = AnalogueGainLinear{ 100, 0, 0, 1024 };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("gc08a3", CameraSensorHelperGc08a3)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperGc08a3, "gc08a3")
 
 class CameraSensorHelperHm1246 : public CameraSensorHelper
 {
@@ -527,7 +529,7 @@  public:
 		gain_ = AnalogueGainLinear{ 1, 16, 0, 16 };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("hm1246", CameraSensorHelperHm1246)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperHm1246, "hm1246")
 
 class CameraSensorHelperImx214 : public CameraSensorHelper
 {
@@ -539,7 +541,7 @@  public:
 		gain_ = AnalogueGainLinear{ 0, 512, -1, 512 };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("imx214", CameraSensorHelperImx214)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx214, "imx214")
 
 class CameraSensorHelperImx219 : public CameraSensorHelper
 {
@@ -551,7 +553,7 @@  public:
 		gain_ = AnalogueGainLinear{ 0, 256, -1, 256 };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("imx219", CameraSensorHelperImx219)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx219, "imx219")
 
 class CameraSensorHelperImx258 : public CameraSensorHelper
 {
@@ -563,7 +565,7 @@  public:
 		gain_ = AnalogueGainLinear{ 0, 512, -1, 512 };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("imx258", CameraSensorHelperImx258)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx258, "imx258")
 
 class CameraSensorHelperImx283 : public CameraSensorHelper
 {
@@ -575,7 +577,7 @@  public:
 		gain_ = AnalogueGainLinear{ 0, 2048, -1, 2048 };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("imx283", CameraSensorHelperImx283)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx283, "imx283")
 
 class CameraSensorHelperImx290 : public CameraSensorHelper
 {
@@ -587,7 +589,7 @@  public:
 		gain_ = AnalogueGainExp{ 1.0, expGainDb(0.3) };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("imx290", CameraSensorHelperImx290)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx290, "imx290", "imx327", "imx462")
 
 class CameraSensorHelperImx296 : public CameraSensorHelper
 {
@@ -597,12 +599,7 @@  public:
 		gain_ = AnalogueGainExp{ 1.0, expGainDb(0.1) };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("imx296", CameraSensorHelperImx296)
-
-class CameraSensorHelperImx327 : public CameraSensorHelperImx290
-{
-};
-REGISTER_CAMERA_SENSOR_HELPER("imx327", CameraSensorHelperImx327)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx296, "imx296")
 
 class CameraSensorHelperImx335 : public CameraSensorHelper
 {
@@ -614,7 +611,7 @@  public:
 		gain_ = AnalogueGainExp{ 1.0, expGainDb(0.3) };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("imx335", CameraSensorHelperImx335)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx335, "imx335")
 
 class CameraSensorHelperImx355 : public CameraSensorHelper
 {
@@ -626,7 +623,7 @@  public:
 		gain_ = AnalogueGainLinear{ 0, 1024, -1, 1024 };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("imx355", CameraSensorHelperImx355)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx355, "imx355")
 
 class CameraSensorHelperImx415 : public CameraSensorHelper
 {
@@ -636,12 +633,7 @@  public:
 		gain_ = AnalogueGainExp{ 1.0, expGainDb(0.3) };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("imx415", CameraSensorHelperImx415)
-
-class CameraSensorHelperImx462 : public CameraSensorHelperImx290
-{
-};
-REGISTER_CAMERA_SENSOR_HELPER("imx462", CameraSensorHelperImx462)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx415, "imx415")
 
 class CameraSensorHelperImx471 : public CameraSensorHelper
 {
@@ -654,7 +646,7 @@  public:
 		gain_ = AnalogueGainLinear{ 0, 1024, -1, 1024 };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("imx471", CameraSensorHelperImx471)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx471, "imx471")
 
 class CameraSensorHelperImx477 : public CameraSensorHelper
 {
@@ -664,7 +656,7 @@  public:
 		gain_ = AnalogueGainLinear{ 0, 1024, -1, 1024 };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("imx477", CameraSensorHelperImx477)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx477, "imx477")
 
 class CameraSensorHelperImx662 : public CameraSensorHelper
 {
@@ -676,7 +668,7 @@  public:
 		gain_ = AnalogueGainExp{ 1.0, expGainDb(0.3) };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("imx662", CameraSensorHelperImx662)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx662, "imx662")
 
 class CameraSensorHelperImx678 : public CameraSensorHelper
 {
@@ -688,7 +680,7 @@  public:
 		gain_ = AnalogueGainExp{ 1.0, expGainDb(0.3) };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("imx678", CameraSensorHelperImx678)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx678, "imx678")
 
 class CameraSensorHelperImx708 : public CameraSensorHelper
 {
@@ -699,7 +691,7 @@  public:
 		gain_ = AnalogueGainLinear{ 0, 1024, -1, 1024 };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("imx708", CameraSensorHelperImx708)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx708, "imx708")
 
 class CameraSensorHelperOv01a10 : public CameraSensorHelper
 {
@@ -711,7 +703,7 @@  public:
 		gain_ = AnalogueGainLinear{ 1, 0, 0, 256 };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("ov01a10", CameraSensorHelperOv01a10)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv01a10, "ov01a10")
 
 class CameraSensorHelperOv08d10 : public CameraSensorHelper
 {
@@ -723,7 +715,7 @@  public:
 		gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("ov08d10", CameraSensorHelperOv08d10)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv08d10, "ov08d10")
 
 class CameraSensorHelperOv08x40 : public CameraSensorHelper
 {
@@ -734,7 +726,7 @@  public:
 		gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("ov08x40", CameraSensorHelperOv08x40)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv08x40, "ov08x40")
 
 class CameraSensorHelperMira220 : public CameraSensorHelper
 {
@@ -746,7 +738,7 @@  public:
 		gain_ = AnalogueGainLinear{ 0, 2048, -1, 2048 };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("mira220", CameraSensorHelperMira220)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperMira220, "mira220")
 
 class CameraSensorHelperOv2685 : public CameraSensorHelper
 {
@@ -760,7 +752,7 @@  public:
 		gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("ov2685", CameraSensorHelperOv2685)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv2685, "ov2685")
 
 class CameraSensorHelperOv2740 : public CameraSensorHelper
 {
@@ -772,7 +764,7 @@  public:
 		gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("ov2740", CameraSensorHelperOv2740)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv2740, "ov2740")
 
 class CameraSensorHelperOv4689 : public CameraSensorHelper
 {
@@ -784,7 +776,7 @@  public:
 		gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("ov4689", CameraSensorHelperOv4689)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv4689, "ov4689")
 
 class CameraSensorHelperOv5640 : public CameraSensorHelper
 {
@@ -796,7 +788,7 @@  public:
 		gain_ = AnalogueGainLinear{ 1, 0, 0, 16 };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("ov5640", CameraSensorHelperOv5640)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv5640, "ov5640")
 
 class CameraSensorHelperOv5647 : public CameraSensorHelper
 {
@@ -806,7 +798,7 @@  public:
 		gain_ = AnalogueGainLinear{ 1, 0, 0, 16 };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("ov5647", CameraSensorHelperOv5647)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv5647, "ov5647")
 
 class CameraSensorHelperOv5670 : public CameraSensorHelper
 {
@@ -816,7 +808,7 @@  public:
 		gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("ov5670", CameraSensorHelperOv5670)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv5670, "ov5670")
 
 class CameraSensorHelperOv5675 : public CameraSensorHelper
 {
@@ -828,7 +820,7 @@  public:
 		gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("ov5675", CameraSensorHelperOv5675)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv5675, "ov5675")
 
 class CameraSensorHelperOv5693 : public CameraSensorHelper
 {
@@ -839,7 +831,7 @@  public:
 		gain_ = AnalogueGainLinear{ 1, 0, 0, 16 };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("ov5693", CameraSensorHelperOv5693)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv5693, "ov5693")
 
 class CameraSensorHelperOv64a40 : public CameraSensorHelper
 {
@@ -849,7 +841,7 @@  public:
 		gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("ov64a40", CameraSensorHelperOv64a40)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv64a40, "ov64a40")
 
 class CameraSensorHelperOv8858 : public CameraSensorHelper
 {
@@ -865,7 +857,7 @@  public:
 		gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("ov8858", CameraSensorHelperOv8858)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv8858, "ov8858")
 
 class CameraSensorHelperOv8865 : public CameraSensorHelper
 {
@@ -875,7 +867,7 @@  public:
 		gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("ov8865", CameraSensorHelperOv8865)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv8865, "ov8865")
 
 class CameraSensorHelperOv13858 : public CameraSensorHelper
 {
@@ -885,7 +877,7 @@  public:
 		gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("ov13858", CameraSensorHelperOv13858)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv13858, "ov13858")
 
 class CameraSensorHelperVd55g1 : public CameraSensorHelper
 {
@@ -897,7 +889,7 @@  public:
 		gain_ = AnalogueGainLinear{ 0, 32, -1, 32 };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("vd55g1", CameraSensorHelperVd55g1)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperVd55g1, "vd55g1")
 
 class CameraSensorHelperVd56g3 : public CameraSensorHelper
 {
@@ -909,7 +901,7 @@  public:
 		gain_ = AnalogueGainLinear{ 0, 32, -1, 32 };
 	}
 };
-REGISTER_CAMERA_SENSOR_HELPER("vd56g3", CameraSensorHelperVd56g3)
+REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperVd56g3, "vd56g3")
 
 } /* namespace */
 
diff --git a/src/ipa/libipa/camera_sensor_helper.h b/src/ipa/libipa/camera_sensor_helper.h
index bd3d0beec77f..bc53f1bfc80c 100644
--- a/src/ipa/libipa/camera_sensor_helper.h
+++ b/src/ipa/libipa/camera_sensor_helper.h
@@ -54,7 +54,7 @@  private:
 class CameraSensorHelperFactoryBase
 {
 public:
-	CameraSensorHelperFactoryBase(const std::string name);
+	CameraSensorHelperFactoryBase(std::initializer_list<const char *> names);
 	virtual ~CameraSensorHelperFactoryBase() = default;
 
 	static std::unique_ptr<CameraSensorHelper> create(const std::string &name);
@@ -68,15 +68,15 @@  private:
 
 	virtual std::unique_ptr<CameraSensorHelper> createInstance() const = 0;
 
-	std::string name_;
+	std::vector<std::string> names_;
 };
 
 template<typename _Helper>
 class CameraSensorHelperFactory final : public CameraSensorHelperFactoryBase
 {
 public:
-	CameraSensorHelperFactory(const char *name)
-		: CameraSensorHelperFactoryBase(name)
+	CameraSensorHelperFactory(std::initializer_list<const char *> names)
+		: CameraSensorHelperFactoryBase(names)
 	{
 	}
 
@@ -87,8 +87,8 @@  private:
 	}
 };
 
-#define REGISTER_CAMERA_SENSOR_HELPER(name, helper) \
-static CameraSensorHelperFactory<helper> global_##helper##Factory(name);
+#define REGISTER_CAMERA_SENSOR_HELPER(helper, name, ...) \
+static CameraSensorHelperFactory<helper> global_##helper##Factory({ name, __VA_ARGS__ });
 
 } /* namespace ipa */