mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
media: imx290: Add module parameter to allow selection of HCG mode
The sensor has Low Conversion Gain (HCG) and High Conversion Gain (HCG) modes, with the supposedly the HCG mode having better noise performance at high gains. As this parameter changes the gain range of the sensor, it isn't possible to make this an automatic property, and there is no suitable V4L2 control to set it, so just add it as a module parameter. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
This commit is contained in:
committed by
Dom Cobley
parent
40996d9f2e
commit
c582bdeff2
@@ -13,6 +13,7 @@
|
||||
#include <linux/gpio/consumer.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/moduleparam.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/regmap.h>
|
||||
@@ -40,6 +41,9 @@
|
||||
#define IMX290_WINMODE_720P (1 << 4)
|
||||
#define IMX290_WINMODE_CROP (4 << 4)
|
||||
#define IMX290_FR_FDG_SEL CCI_REG8(0x3009)
|
||||
#define IMX290_FDG_HCG BIT(4)
|
||||
#define IMX290_FRSEL_60FPS BIT(0)
|
||||
#define IMX290_FDG_LCG 0
|
||||
#define IMX290_BLKLEVEL CCI_REG16_LE(0x300a)
|
||||
#define IMX290_GAIN CCI_REG8(0x3014)
|
||||
#define IMX290_VMAX CCI_REG24_LE(0x3018)
|
||||
@@ -160,6 +164,10 @@
|
||||
|
||||
#define IMX290_NUM_SUPPLIES 3
|
||||
|
||||
static bool hcg_mode;
|
||||
module_param(hcg_mode, bool, 0664);
|
||||
MODULE_PARM_DESC(hcg_mode, "Enable HCG mode");
|
||||
|
||||
enum imx290_colour_variant {
|
||||
IMX290_VARIANT_COLOUR,
|
||||
IMX290_VARIANT_MONO,
|
||||
@@ -695,7 +703,8 @@ static int imx290_set_data_lanes(struct imx290 *imx290)
|
||||
&ret);
|
||||
cci_write(imx290->regmap, IMX290_CSI_LANE_MODE, imx290->nlanes - 1,
|
||||
&ret);
|
||||
cci_write(imx290->regmap, IMX290_FR_FDG_SEL, 0x01, &ret);
|
||||
cci_write(imx290->regmap, IMX290_FR_FDG_SEL, IMX290_FRSEL_60FPS |
|
||||
(hcg_mode ? IMX290_FDG_HCG : IMX290_FDG_LCG), &ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user