Commit 1bead33
authored
sensor: fix IMX415 latching into an IMX335 misdetection via 0x316A (#179)
0x316A is INCKSEL4, not an identifier. A pristine IMX415 reads 0x00 there,
but libsns_imx335.so writes 0x316A=0x7E in both its linear and WDR init
tables -- the same value a real IMX335 reads. Streamers ask ipctool which
sensor is present and then load that vendor lib, so a single misdetection
stamps 0x7E into an IMX415 and every later probe agrees with itself. The
loop survives streamer restarts and soft reboots; only removing power
clears it. The existing IMX415 test (0x3B00) sat below the 0x316A test and
was unreachable once latched.
Rule IMX415 out before concluding IMX335, using 3B00h ("set to 2Eh",
default after reset 28h, IMX415 datasheet p.46) together with 300Bh, which
neither vendor init table writes and which therefore survives the latch
(IMX415: 0xA0, IMX335: 0x00). Only reject IMX335 when IMX415 is positively
identified, mirroring the IMX347 disambiguation added in #167, so no sensor
loses detection if a register drifts. A failed read (-1) is not taken as
"not IMX415", which would otherwise let a latched part re-arm the loop.
Measured 0x316A: IMX415 pristine 0x00, IMX415 after the IMX335 driver ran
0x7E, real IMX335 0x7E. Measured 0x300B: IMX415 0xA0 both latched and
pristine, IMX335 0x00. The dropped HINT claiming 0x30C0 == 0x20 on IMX415
is wrong -- it measures 0x2A.
Verified on Hi3516AV300 + IMX415 (imx335_i2c -> imx415_i2c while still
latched, then 3840x2160 @ 20fps on libsns_imx415.so after a cold boot) and
on Hi3516EV300 + IMX335 (unchanged; its 0x3057 reads 0x06, so it exercises
the #167 fall-through).1 parent 9f57d6e commit 1bead33
1 file changed
Lines changed: 22 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
162 | | - | |
| 161 | + | |
163 | 162 | | |
164 | | - | |
| 163 | + | |
165 | 164 | | |
166 | 165 | | |
167 | 166 | | |
| |||
189 | 188 | | |
190 | 189 | | |
191 | 190 | | |
192 | | - | |
193 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
194 | 209 | | |
195 | 210 | | |
196 | 211 | | |
| |||
208 | 223 | | |
209 | 224 | | |
210 | 225 | | |
211 | | - | |
212 | | - | |
| 226 | + | |
| 227 | + | |
213 | 228 | | |
214 | 229 | | |
215 | 230 | | |
| |||
0 commit comments