Commit 5a192905 authored by Dorota Czaplejewicz's avatar Dorota Czaplejewicz
Browse files

s5k3l6xx: Fix noise

parent 365e9de8
Pipeline #68547 passed with stage
in 66 minutes and 4 seconds
......@@ -115,6 +115,14 @@ static const struct s5k3l6xx_reg frame_1052x780px_8bit_xfps_2lane[] = {
{ 0x0901, 0x44, 1 },
// y_odd_inc
{ 0x0387, 0x07, 1 },
// Noise reduction
// The last 3 bits (0x0007) control some global brightness/noise pattern.
// They work slightly differently depending on the value of 307b:80
// It's not strictly necessary here,
// as the sensor seems to do the same correction without asking at 1:4 binning,
// but added to formalize the default value.
{ 0x3074, 0x0974, 2},
};
// Downscaled 1:2 in both directions.
......@@ -143,6 +151,7 @@ static const struct s5k3l6xx_reg frame_2104x1560px_8bit_xfps_2lane[] = {
// end to match sensor
{ 0x0348, 0x1068, 2 },
// binning in 1:2 mode seems to average out focus pixels.
// binning enable
{ 0x0900, 0x01, 1 },
// type: 1/?x, 1/?y, full binning when matching skips
......@@ -150,6 +159,12 @@ static const struct s5k3l6xx_reg frame_2104x1560px_8bit_xfps_2lane[] = {
// x binning skips 8-pixel bocks, making it useless
// y_odd_inc
{ 0x0387, 0x03, 1 },
// Noise reduction
// The last 3 bits (0x0007) control some global brightness/noise pattern.
// They work slightly differently depending on the value of 307b:80
// 0x0972 makes focus pixels appear.
{ 0x3074, 0x0974, 2}, // 74, 75, 76, 77 all good for binning 1:2.
};
// Not scaled.
......@@ -180,6 +195,11 @@ static const struct s5k3l6xx_reg frame_4208x3120px_8bit_xfps_2lane[] = {
{ 0x0348, 0x1068, 2 },
// line length in pixel clocks. This is a slow mode.
{ 0x0342, 0x3600, 2 },
// Noise reduction
// The last 3 bits (0x0007) control some global brightness/noise pattern.
// They work slightly differently depending on the value of 307b:80
{ 0x3074, 0x0977, 2}, // 74, 75, 76, 77 all good for binning 1:!, might introduce banding.
};
struct s5k3l6xx_gpio {
......@@ -482,6 +502,10 @@ static int s5k3l6xx_clear_error(struct s5k3l6xx *state)
static const struct s5k3l6xx_reg setstream[] = {
{ S5K3L6XX_REG_DATA_FORMAT, S5K3L6XX_DATA_FORMAT_RAW8, 2 },
// Noise reduction
// Bit 0x0080 will create noise when off (by default)
// Raises data pedestal to 15-16.
{ 0x307a, 0x0d00, 2 },
};
static void s5k3l6xx_hw_set_config(struct s5k3l6xx *state) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment