[libcamera-devel,1/2] libipa: Add CameraSensorHelper for ov8865
diff mbox series

Message ID 20210722203658.3588263-1-djrscally@gmail.com
State Accepted
Headers show
Series
  • [libcamera-devel,1/2] libipa: Add CameraSensorHelper for ov8865
Related show

Commit Message

Daniel Scally July 22, 2021, 8:36 p.m. UTC
Add a CameraSensorHelperOv8865 class. The gain coefficients are gleaned
from the datasheet; the lowest 7 bits are reported there as fractional
bits, so real gain is val/128.

Signed-off-by: Daniel Scally <djrscally@gmail.com>
---
 src/ipa/libipa/camera_sensor_helper.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Umang Jain July 24, 2021, 5:06 a.m. UTC | #1
Hi Daniel,

Thanks for the patch.

On 7/23/21 2:06 AM, Daniel Scally wrote:
> Add a CameraSensorHelperOv8865 class. The gain coefficients are gleaned
> from the datasheet; the lowest 7 bits are reported there as fractional
> bits, so real gain is val/128.
>
> Signed-off-by: Daniel Scally <djrscally@gmail.com>
Reviewed-by: Umang Jain <umang.jain@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 709835a8..e72167ec 100644
> --- a/src/ipa/libipa/camera_sensor_helper.cpp
> +++ b/src/ipa/libipa/camera_sensor_helper.cpp
> @@ -325,6 +325,16 @@ public:
>   };
>   REGISTER_CAMERA_SENSOR_HELPER("ov13858", CameraSensorHelperOv13858)
>   
> +class CameraSensorHelperOv8865 : public CameraSensorHelper
> +{
> +public:
> +	CameraSensorHelperOv8865()
> +	{
> +		analogueGainConstants_ = { AnalogueGainLinear, 1, 0, 0, 128 };
> +	}
> +};
> +REGISTER_CAMERA_SENSOR_HELPER("ov8865", CameraSensorHelperOv8865)
> +
>   #endif /* __DOXYGEN__ */
>   
>   } /* namespace ipa */
Laurent Pinchart July 24, 2021, 10:52 p.m. UTC | #2
Hi Daniel,

Thank you for the patch.

On Thu, Jul 22, 2021 at 09:36:57PM +0100, Daniel Scally wrote:
> Add a CameraSensorHelperOv8865 class. The gain coefficients are gleaned
> from the datasheet; the lowest 7 bits are reported there as fractional
> bits, so real gain is val/128.
> 
> Signed-off-by: Daniel Scally <djrscally@gmail.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 709835a8..e72167ec 100644
> --- a/src/ipa/libipa/camera_sensor_helper.cpp
> +++ b/src/ipa/libipa/camera_sensor_helper.cpp
> @@ -325,6 +325,16 @@ public:
>  };
>  REGISTER_CAMERA_SENSOR_HELPER("ov13858", CameraSensorHelperOv13858)
>  
> +class CameraSensorHelperOv8865 : public CameraSensorHelper
> +{
> +public:
> +	CameraSensorHelperOv8865()
> +	{
> +		analogueGainConstants_ = { AnalogueGainLinear, 1, 0, 0, 128 };
> +	}
> +};
> +REGISTER_CAMERA_SENSOR_HELPER("ov8865", CameraSensorHelperOv8865)
> +

Let's move this above OV13858 to keep entries sorted. I'll fix this when
applying.

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

>  #endif /* __DOXYGEN__ */
>  
>  } /* namespace ipa */
Daniel Scally July 24, 2021, 10:54 p.m. UTC | #3
Hi Laurent

On 24/07/2021 23:52, Laurent Pinchart wrote:
> Hi Daniel,
>
> Thank you for the patch.
>
> On Thu, Jul 22, 2021 at 09:36:57PM +0100, Daniel Scally wrote:
>> Add a CameraSensorHelperOv8865 class. The gain coefficients are gleaned
>> from the datasheet; the lowest 7 bits are reported there as fractional
>> bits, so real gain is val/128.
>>
>> Signed-off-by: Daniel Scally <djrscally@gmail.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 709835a8..e72167ec 100644
>> --- a/src/ipa/libipa/camera_sensor_helper.cpp
>> +++ b/src/ipa/libipa/camera_sensor_helper.cpp
>> @@ -325,6 +325,16 @@ public:
>>  };
>>  REGISTER_CAMERA_SENSOR_HELPER("ov13858", CameraSensorHelperOv13858)
>>  
>> +class CameraSensorHelperOv8865 : public CameraSensorHelper
>> +{
>> +public:
>> +	CameraSensorHelperOv8865()
>> +	{
>> +		analogueGainConstants_ = { AnalogueGainLinear, 1, 0, 0, 128 };
>> +	}
>> +};
>> +REGISTER_CAMERA_SENSOR_HELPER("ov8865", CameraSensorHelperOv8865)
>> +
> Let's move this above OV13858 to keep entries sorted. I'll fix this when
> applying.


One day I will learn to sort things! Thanks very much

> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
>>  #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 709835a8..e72167ec 100644
--- a/src/ipa/libipa/camera_sensor_helper.cpp
+++ b/src/ipa/libipa/camera_sensor_helper.cpp
@@ -325,6 +325,16 @@  public:
 };
 REGISTER_CAMERA_SENSOR_HELPER("ov13858", CameraSensorHelperOv13858)
 
+class CameraSensorHelperOv8865 : public CameraSensorHelper
+{
+public:
+	CameraSensorHelperOv8865()
+	{
+		analogueGainConstants_ = { AnalogueGainLinear, 1, 0, 0, 128 };
+	}
+};
+REGISTER_CAMERA_SENSOR_HELPER("ov8865", CameraSensorHelperOv8865)
+
 #endif /* __DOXYGEN__ */
 
 } /* namespace ipa */