Skip to content

drivers: media: i2c: imx219: Fix for imx219_get_binning()#7392

Closed
njhollinghurst wants to merge 1 commit into
raspberrypi:rpi-6.18.yfrom
njhollinghurst:imx219_20260522
Closed

drivers: media: i2c: imx219: Fix for imx219_get_binning()#7392
njhollinghurst wants to merge 1 commit into
raspberrypi:rpi-6.18.yfrom
njhollinghurst:imx219_20260522

Conversation

@njhollinghurst
Copy link
Copy Markdown
Contributor

Fixes 5eb74d4 ("Remove enum binning_mode")
which mixed two different interpretations of "bin_h", "bin_v" (as binning factors and as binning modes), and broke binning.

In this version they are factors; the return value is the selected binning mode (which also depends on the sensor mode).

@njhollinghurst
Copy link
Copy Markdown
Contributor Author

Candidate fix for #7391

@njhollinghurst
Copy link
Copy Markdown
Contributor Author

There remains some redundancy in imx219_set_pad_format() which

  • computes binning factors itself
  • calls imx219_get_binning()
  • calls imx219_get_rate_factor() which again calls imx219_get_binning()

but perhaps that's not urgent to fix.

Fixes: 5eb74d4 ("Remove enum binning_mode")
which mixed two different interpretations of "bin_h", "bin_v"
(as binning factors and as binning modes), and broke binning.

In this version they are factors; the return value is the
selected binning mode (which also depends on the sensor mode).

Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>
@6by9
Copy link
Copy Markdown
Contributor

6by9 commented May 22, 2026

Do just check the patches off mainline for duplication.
https://github.com/torvalds/linux/commits/master/drivers/media/i2c/imx219.c

Sakari's patchset at https://lore.kernel.org/linux-media/20260408153939.969381-1-sakari.ailus@linux.intel.com/ is also messing with imx219, and I'm reviewing those patches at the moment.

@njhollinghurst
Copy link
Copy Markdown
Contributor Author

njhollinghurst commented May 22, 2026

Hmm. The above is the minimal fix to unbreak what we have now.
In mainline the imx219_get_binning() function continues to return void. Maybe we should stay closer to that.

The thing we need to bring in that's absent from mainline, is the sensor-mode-dependent binning method, from 82ffe96

I'll have another go...

@njhollinghurst njhollinghurst marked this pull request as draft May 22, 2026 12:52
@6by9
Copy link
Copy Markdown
Contributor

6by9 commented May 22, 2026

Upstream, Jai has increased the LLP slightly, and that has fixed the need for different binning modes. Those should have been in 6.15 and above, so I'm not sure there is a need any longer.

@njhollinghurst
Copy link
Copy Markdown
Contributor Author

Will start again by reverting downstream changes...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants