[libcamera-devel,v2] libipa: Add CameraSensorHelper for IMX258
diff mbox series

Message ID 20210722112250.805973-1-umang.jain@ideasonboard.com
State Accepted
Headers show
Series
  • [libcamera-devel,v2] libipa: Add CameraSensorHelper for IMX258
Related show

Commit Message

Umang Jain July 22, 2021, 11:22 a.m. UTC
Extend the CameraSensorHelper factory with support for the IMX258
sensor found in the Nautilus Chromebook.

The values are read by manually tweaking the IMX258 kernel driver.
The IMX258 kernel driver hints that the sensor may be compatible
with the MIPI CCS specification, as the register set matches.
The values for analog gain constants are obtained by reading the
register indexes, corresponding to the analog gain constants, as
mentioned in MIPI CCS v1.1 specification.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
---
v1 -> v2:
- Revamp commit message. 
- Dave from RPi can confirm these values from the datasheet.
---
 src/ipa/libipa/camera_sensor_helper.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Laurent Pinchart July 22, 2021, 1:56 p.m. UTC | #1
Hi Umang,

Thank you for the patch.

On Thu, Jul 22, 2021 at 04:52:50PM +0530, Umang Jain wrote:
> Extend the CameraSensorHelper factory with support for the IMX258
> sensor found in the Nautilus Chromebook.
> 
> The values are read by manually tweaking the IMX258 kernel driver.
> The IMX258 kernel driver hints that the sensor may be compatible
> with the MIPI CCS specification, as the register set matches.
> The values for analog gain constants are obtained by reading the
> register indexes, corresponding to the analog gain constants, as
> mentioned in MIPI CCS v1.1 specification.

I would add here

"The values have further been confirmed by Dave Stevenson as correct."

> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> v1 -> v2:
> - Revamp commit message. 
> - Dave from RPi can confirm these values from the datasheet.
> ---
>  src/ipa/libipa/camera_sensor_helper.cpp | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp
> index 709835a8..c43368df 100644
> --- a/src/ipa/libipa/camera_sensor_helper.cpp
> +++ b/src/ipa/libipa/camera_sensor_helper.cpp
> @@ -295,6 +295,16 @@ public:
>  };
>  REGISTER_CAMERA_SENSOR_HELPER("imx219", CameraSensorHelperImx219)
>  
> +class CameraSensorHelperImx258 : public CameraSensorHelper
> +{
> +public:
> +        CameraSensorHelperImx258()
> +        {
> +                analogueGainConstants_ = { AnalogueGainLinear, 0, 512, -1, 512 };
> +        }
> +};
> +REGISTER_CAMERA_SENSOR_HELPER("imx258", CameraSensorHelperImx258)
> +
>  class CameraSensorHelperOv5670 : public CameraSensorHelper
>  {
>  public:
Dave Stevenson July 22, 2021, 2:07 p.m. UTC | #2
On Thu, 22 Jul 2021 at 14:56, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> Hi Umang,
>
> Thank you for the patch.
>
> On Thu, Jul 22, 2021 at 04:52:50PM +0530, Umang Jain wrote:
> > Extend the CameraSensorHelper factory with support for the IMX258
> > sensor found in the Nautilus Chromebook.
> >
> > The values are read by manually tweaking the IMX258 kernel driver.
> > The IMX258 kernel driver hints that the sensor may be compatible
> > with the MIPI CCS specification, as the register set matches.
> > The values for analog gain constants are obtained by reading the
> > register indexes, corresponding to the analog gain constants, as
> > mentioned in MIPI CCS v1.1 specification.
>
> I would add here
>
> "The values have further been confirmed by Dave Stevenson as correct."

Name and shame the guilty party! :-)

"The values have further been confirmed by Dave Stevenson as being
those specified in the datasheet"

I have no intrinsic knowledge of the sensor itself, and we all know
that datasheets can be wrong at times.

  Dave

> > Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
> > ---
> > v1 -> v2:
> > - Revamp commit message.
> > - Dave from RPi can confirm these values from the datasheet.
> > ---
> >  src/ipa/libipa/camera_sensor_helper.cpp | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> >
> > diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp
> > index 709835a8..c43368df 100644
> > --- a/src/ipa/libipa/camera_sensor_helper.cpp
> > +++ b/src/ipa/libipa/camera_sensor_helper.cpp
> > @@ -295,6 +295,16 @@ public:
> >  };
> >  REGISTER_CAMERA_SENSOR_HELPER("imx219", CameraSensorHelperImx219)
> >
> > +class CameraSensorHelperImx258 : public CameraSensorHelper
> > +{
> > +public:
> > +        CameraSensorHelperImx258()
> > +        {
> > +                analogueGainConstants_ = { AnalogueGainLinear, 0, 512, -1, 512 };
> > +        }
> > +};
> > +REGISTER_CAMERA_SENSOR_HELPER("imx258", CameraSensorHelperImx258)
> > +
> >  class CameraSensorHelperOv5670 : public CameraSensorHelper
> >  {
> >  public:
>
> --
> Regards,
>
> Laurent Pinchart
Laurent Pinchart July 22, 2021, 2:34 p.m. UTC | #3
On Thu, Jul 22, 2021 at 03:07:54PM +0100, Dave Stevenson wrote:
> On Thu, 22 Jul 2021 at 14:56, Laurent Pinchart wrote:
> > On Thu, Jul 22, 2021 at 04:52:50PM +0530, Umang Jain wrote:
> > > Extend the CameraSensorHelper factory with support for the IMX258
> > > sensor found in the Nautilus Chromebook.
> > >
> > > The values are read by manually tweaking the IMX258 kernel driver.
> > > The IMX258 kernel driver hints that the sensor may be compatible
> > > with the MIPI CCS specification, as the register set matches.
> > > The values for analog gain constants are obtained by reading the
> > > register indexes, corresponding to the analog gain constants, as
> > > mentioned in MIPI CCS v1.1 specification.
> >
> > I would add here
> >
> > "The values have further been confirmed by Dave Stevenson as correct."
> 
> Name and shame the guilty party! :-)
> 
> "The values have further been confirmed by Dave Stevenson as being
> those specified in the datasheet"

Even better :-) Thanks Dave.

> I have no intrinsic knowledge of the sensor itself, and we all know
> that datasheets can be wrong at times.
> 
> > > Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
> >
> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> >
> > > ---
> > > v1 -> v2:
> > > - Revamp commit message.
> > > - Dave from RPi can confirm these values from the datasheet.
> > > ---
> > >  src/ipa/libipa/camera_sensor_helper.cpp | 10 ++++++++++
> > >  1 file changed, 10 insertions(+)
> > >
> > > diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp
> > > index 709835a8..c43368df 100644
> > > --- a/src/ipa/libipa/camera_sensor_helper.cpp
> > > +++ b/src/ipa/libipa/camera_sensor_helper.cpp
> > > @@ -295,6 +295,16 @@ public:
> > >  };
> > >  REGISTER_CAMERA_SENSOR_HELPER("imx219", CameraSensorHelperImx219)
> > >
> > > +class CameraSensorHelperImx258 : public CameraSensorHelper
> > > +{
> > > +public:
> > > +        CameraSensorHelperImx258()
> > > +        {
> > > +                analogueGainConstants_ = { AnalogueGainLinear, 0, 512, -1, 512 };
> > > +        }
> > > +};
> > > +REGISTER_CAMERA_SENSOR_HELPER("imx258", CameraSensorHelperImx258)
> > > +
> > >  class CameraSensorHelperOv5670 : public CameraSensorHelper
> > >  {
> > >  public:

Patch
diff mbox series

diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp
index 709835a8..c43368df 100644
--- a/src/ipa/libipa/camera_sensor_helper.cpp
+++ b/src/ipa/libipa/camera_sensor_helper.cpp
@@ -295,6 +295,16 @@  public:
 };
 REGISTER_CAMERA_SENSOR_HELPER("imx219", CameraSensorHelperImx219)
 
+class CameraSensorHelperImx258 : public CameraSensorHelper
+{
+public:
+        CameraSensorHelperImx258()
+        {
+                analogueGainConstants_ = { AnalogueGainLinear, 0, 512, -1, 512 };
+        }
+};
+REGISTER_CAMERA_SENSOR_HELPER("imx258", CameraSensorHelperImx258)
+
 class CameraSensorHelperOv5670 : public CameraSensorHelper
 {
 public: