Repository navigation
Anan Jaser's Galaxy S9+ cameras (rear, front, telephoto) as the S9+'s own driver; unification with the S9's deferred - #296
Merged
Conversation
…s hakios.exynos_camera_star2.c This is drivers/camera/exynos/hakios.exynos_camera.c of 13c4fce, byte for byte, under a second name: the file Anan Jaser's three Galaxy S9+ camera commits were written on. Main's own file has since gone another way (the S9's rear camera in hakios.exynos_camera_rear.c, the lens in hakios.ak737x.c). His commits follow, applied to this copy, so that his work lands as he ran it; the commit after them wires it into the build for star2lte only. Not built yet.
… streams, AK737x focus, CSIS DMA input mux - Rear S5K2L3 on CSIS0 and telephoto S5K3M3 on CSIS2 from Apollo's star2 tree (rails, resets, D-PHY isolation, setfiles A/B extracted from Apollo's fimc-is-cis headers by tools/extract-*-setfile.py) - Lens motors: rear OIS logic rails, front USI09 selector 0x34 (was USI08's 0x30), telephoto on I2C_CAM3 - SYSREG_ISPPRE SC_CON2/4/6: each CSIS DMA takes its own CSIS (fimc-is-v6_0_0 hw-chain); the telephoto's DMA2 had no input and wrote nothing. SC_CON8 is the secure camera's and is never touched (reading it aborts) - The S2MPB02 bus shared with the flashlight is locked; the flashlight starts after the camera; boot flash test off (cherry picked from commit 74ad077; applied to hakios.exynos_camera_star2.c, the copy of the file this was written on, without its drivers/map and hakios.exynos_hsi2c.c hunks and without the two generated files hakios.s5k2l3_setfiles.h and hakios.s5k3m3_setfiles.h, which hold the sensors' RAM patches: firmware is not committed to this tree; the build makes them with the two extract tools of this commit. The commit after his three says how)
…023, the macro end) (cherry picked from commit 03c2ed2; applied to hakios.exynos_camera_star2.c, the copy of the file this was written on, without its drivers/map and hakios.exynos_hsi2c.c hunks: the next commit says why)
…ndor_first_delay, star2lte/starlte DT) (cherry picked from commit 6014ef8; applied to hakios.exynos_camera_star2.c, the copy of the file this was written on, without its drivers/map and hakios.exynos_hsi2c.c hunks: the next commit says why)
…rything else; its two table headers are made at build time Anan Jaser's three camera commits (before this one) are his Galaxy S9+ driver, applied to a copy of the file they were written on (hakios.exynos_camera_star2.c). Main's own driver went another way on the same day and was run on a Galaxy S9. Making one of the two means running the result on both phones, and neither can be run now, so for the time being each phone keeps the code seen working on it (docs/exynos9810-cameras.md: what the two share, where they differ, what was not compared). - One of them in a kernel, never both: tools/hakios-config.py writes HAKIOS_DEVICE_IS_<DEVICE> into dev/hakios.drivers.h; the S9's three files compile to nothing for star2lte, the S9+'s file to nothing for everything else. Same configuration symbol (EXYNOS_CAMERA), same three entry points, so no device configuration changes. The ios-27 tree has no such header and takes the S9's files only: its kernel is unchanged. - Not taken from 74ad077: its drivers/map lines (written here) and its hakios.exynos_hsi2c.c hunk (main already has the same change, made independently: a dedicated camera HSI2C has no USI selector). - Not committed: hakios.s5k2l3_setfiles.h and hakios.s5k3m3_setfiles.h. They hold the sensors' RAM patches, which is firmware, and firmware is not kept in this tree. tools/mk-star2-setfiles.sh makes them when a star2lte kernel is built: three headers of Samsung's GPL-2.0 kernel fetched from github.com/ananjaser1211/Apollo at a pinned commit, checked by SHA-256, run through his two extract tools (the result is byte for byte the files of his commit); xnu-build.sh lays them beside the driver in the kernel tree. NOTICE and THIRD_PARTY_LICENSES.md say so, and the latter now names the S9+ panel table. - tools/hakios-config.py and tools/extract-2l3-setfile.py are executable in git again (the patch had recorded 644). Built for every configuration; not run on a phone.
…rear, cam_s9_tele and their probes, torch_flash_ms; drivers.md)
Collaborator
Author
|
ios-27 check (no phone): |
# Conflicts: # NOTICE
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.
@ananjaser1211, these are your three camera commits (
74ad0778,03c2ed23,6014ef87), the ones left out of #292. Thank you for them: front, rear and telephoto on an S9+ is more than this tree had.What this does
The same day you wrote them, main got its own Galaxy S9 rear camera, lens driver, aperture and stabiliser, in the same file, built differently (one camera chosen at boot, three files) from yours (a table of three camera paths the reader switches between, one file). Making one driver of the two means choosing one structure, carrying the other's features across about five thousand lines, and then running the result on both phones. Neither phone can be run today. So the unification is deliberately deferred, and each phone keeps the code that was seen working on it:
hakios.exynos_camera_star2.cis your driver: the file your commits were written on (main's at 13c4fce, added byte for byte in the first commit here), then your three commits applied to it with your authorship and dates, their messages kept with a note of what was left out.star2lteonly; main's driver (hakios.exynos_camera.c,hakios.exynos_camera_rear.c,hakios.ak737x.c) is built for every other configuration and for the ios-27 tree, unchanged. Same configuration symbol, same three kernel entry points, same/dev/hakios-camera. A kernel has exactly one:tools/hakios-config.pywritesHAKIOS_DEVICE_IS_<DEVICE>into the generated header and each driver's files compile to nothing in the other's kernel. Checked in the built kernels: star2lte has your driver's symbols and none of the other's; starlte and crownlte the reverse.What was left out of 74ad077, and why
hakios.s5k2l3_setfiles.handhakios.s5k3m3_setfiles.h. Besides mode tables they hold each sensor's RAM patch (the burst writes to 0x6F12). That is firmware, and this tree never commits firmware, whatever form it comes in (main's own S9 rear work left the same patch out for that reason). Insteadtools/mk-star2-setfiles.shmakes them when a star2lte kernel is built: the three Samsung headers (GPL-2.0) are fetched from your Apollo repository at a pinned commit (30656faf), checked by SHA-256, and run through your two extract tools, which are here unchanged. The result is byte for byte the two files of your commit (checked). They live in the build directory only. Without a network the script says which three files to put where.hakios.exynos_hsi2c.chunk: main already has the same change, made independently (a dedicated camera HSI2C has no USI selector).drivers/maplines (written anew for the new file name).Also here
docs/exynos9810-cameras.md: the two drivers side by side, where they agree (the lens: 0x0C, first position 120, 10 ms before active; the rear link: CSIS0, four lanes, 1352 Mb/s, settle 66,SC_CON2= 1), where they differ (the front's DMA mux write, a hand-written rear sequence against Samsung's tables, the RAM patch used or not, the S2MPB02 bus lock, argument names), and what was not compared (the S5K2L3's registers one by one). The later job starts from that page.Your userland camera commit (already on main, 9461d3f)
It was written against this driver, and this driver is as you wrote it. Every request it uses (
HAKIOS_CAMERA_SENSOR,_FOCUS,_NO_FOCUS,_EXPOSURE,_KEEP, the frame's magic) is also answered by the S9's driver, by reading; how the S9's driver behaves with your user space's rear and telephoto requests has not been run.Checked (build machine; no phone)
checkworkflow pass locally.hakios.s2mpb02_torch.c) now has your bus lock andtorch_flash_ms, which the S9 has not run.npm run preflightdoes not apply (no Node project).🤖 Generated with Claude Code