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

Message ID 20210715101315.199703-1-jeanmichel.hautbois@ideasonboard.com
State Accepted
Headers show
Series
  • [libcamera-devel,v2] libipa: Add CameraSensorHelper for OV13858
Related show

Commit Message

Jean-Michel Hautbois July 15, 2021, 10:13 a.m. UTC
Extend the CameraSensorHelper factory with support for an
OV13858 sensor as found in the Soraka Chromebook.

The datasheet states that low 7 bits are fraction bits, so the gain is
calculated as gainCode=128*gain.
According to the formula, it means m0=1 and c1=128.
m1 then has to be 0, and c0=0.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
---
 src/ipa/libipa/camera_sensor_helper.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Laurent Pinchart July 15, 2021, 2:15 p.m. UTC | #1
Hi Jean-Michel,

Thank you for the patch.

On Thu, Jul 15, 2021 at 12:13:15PM +0200, Jean-Michel Hautbois wrote:
> Extend the CameraSensorHelper factory with support for an
> OV13858 sensor as found in the Soraka Chromebook.
> 
> The datasheet states that low 7 bits are fraction bits, so the gain is
> calculated as gainCode=128*gain.
> According to the formula, it means m0=1 and c1=128.
> m1 then has to be 0, and c0=0.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>

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

> ---
>  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 84d8ccf7..17e4f0b2 100644
> --- a/src/ipa/libipa/camera_sensor_helper.cpp
> +++ b/src/ipa/libipa/camera_sensor_helper.cpp
> @@ -315,6 +315,16 @@ public:
>  };
>  REGISTER_CAMERA_SENSOR_HELPER("ov5693", CameraSensorHelperOv5693)
>  
> +class CameraSensorHelperOv13858 : public CameraSensorHelper
> +{
> +public:
> +	CameraSensorHelperOv13858()
> +	{
> +		analogueGainConstants_ = { AnalogueGainLinear, 1, 0, 0, 128 };
> +	}
> +};
> +REGISTER_CAMERA_SENSOR_HELPER("ov13858", CameraSensorHelperOv13858)
> +
>  #endif /* __DOXYGEN__ */
>  
>  } /* namespace ipa */
Kieran Bingham July 15, 2021, 2:30 p.m. UTC | #2
On 15/07/2021 11:13, Jean-Michel Hautbois wrote:
> Extend the CameraSensorHelper factory with support for an
> OV13858 sensor as found in the Soraka Chromebook.
> 
> The datasheet states that low 7 bits are fraction bits, so the gain is
> calculated as gainCode=128*gain.
> According to the formula, it means m0=1 and c1=128.
> m1 then has to be 0, and c0=0.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>

While I already have an SoB here - This can also apply ;-)

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



> ---
>  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 84d8ccf7..17e4f0b2 100644
> --- a/src/ipa/libipa/camera_sensor_helper.cpp
> +++ b/src/ipa/libipa/camera_sensor_helper.cpp
> @@ -315,6 +315,16 @@ public:
>  };
>  REGISTER_CAMERA_SENSOR_HELPER("ov5693", CameraSensorHelperOv5693)
>  
> +class CameraSensorHelperOv13858 : public CameraSensorHelper
> +{
> +public:
> +	CameraSensorHelperOv13858()
> +	{
> +		analogueGainConstants_ = { AnalogueGainLinear, 1, 0, 0, 128 };
> +	}
> +};
> +REGISTER_CAMERA_SENSOR_HELPER("ov13858", CameraSensorHelperOv13858)
> +
>  #endif /* __DOXYGEN__ */
>  
>  } /* namespace ipa */
>

Patch
diff mbox series

diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp
index 84d8ccf7..17e4f0b2 100644
--- a/src/ipa/libipa/camera_sensor_helper.cpp
+++ b/src/ipa/libipa/camera_sensor_helper.cpp
@@ -315,6 +315,16 @@  public:
 };
 REGISTER_CAMERA_SENSOR_HELPER("ov5693", CameraSensorHelperOv5693)
 
+class CameraSensorHelperOv13858 : public CameraSensorHelper
+{
+public:
+	CameraSensorHelperOv13858()
+	{
+		analogueGainConstants_ = { AnalogueGainLinear, 1, 0, 0, 128 };
+	}
+};
+REGISTER_CAMERA_SENSOR_HELPER("ov13858", CameraSensorHelperOv13858)
+
 #endif /* __DOXYGEN__ */
 
 } /* namespace ipa */