Repository navigation
sensors: detect Sony IMX662 (Starvis 2) - #274
Merged
Merged
Conversation
detect_sony_sensor() had no IMX662 entry, so a camera carrying one came
back "no sensor detected" -- e.g. a Hi3516CV610, where the probe path
already reaches the sensor (0x34>>1 = 0x1a on /dev/i2c-0) and only the
decision tree was missing a leaf.
Key on 0x3B00: 0x41 at power-on reset -- the state at boot-time
auto-detection -- and 0x39 after the standard init ("Set to 39h", IMX662
Standard Register Setting v2.0); both distinct from IMX415's 0x2E/0x28
ruled out just above. 0x341C=0x01 (IMX334 reads 0x47 there) confirms and
holds in either state. Verified on a live IMX662 on a Hi3516CV610 in both
reset and configured states; the unit test covers both 0x3B00 values.
PR Summary by QodoDetect Sony IMX662 at reset and after initialization
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can see how risky a PR is at a glance with blast radius labels |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
detect_sony_sensor()has no IMX662 entry, so a camera carrying one reports "No sensor detected". On a Hi3516CV610 the probe path already reaches the sensor correctly (sony_addrs = {0x34}→0x34>>1 = 0x1aon/dev/i2c-0, 16-bit register reads) — the decision tree was simply missing the leaf, so auto-detection (and the firmware'sSENSORauto-set) fell through to unknown.Fix
Add an IMX662 branch keyed on
0x3B00:0x41at power-on reset — the state boot-time auto-detection reads0x39after the standard init ("Set to 39h", IMX662 Standard Register Setting v2.0)Both are distinct from IMX415's
0x2E/0x28ruled out just above.0x341C == 0x01(IMX334 reads0x47there) confirms and holds in either state; the branch sits after the IMX415 check so nothing else is perturbed.Verification
Tested on a live IMX662 on a Hi3516CV610 over both states:
0x3B00ipctool -s0x41imx662_i2c0x39imx662_i2cRegister values cross-checked against the IMX662 Standard Register Setting v2.0 datasheet. Unit test (
sensors_test.c) added for both0x3B00values;sensors_testpasses. Cross-builds clean with the 32-bit ARM musl toolchain.