patches/6.19: cameras: add dw9719 i2c_device_id table fix - #2123
Conversation
The i2c_device_id table was removed from the dw9719 VCM driver in kernel 6.19 as 'unused', but it is required for Surface devices where the VCM is instantiated via the I2C bus by the IPU bridge. Without this table, the dw9719 driver fails to bind to the VCM device (MODALIAS i2c:dw9719), preventing cio2_notifier_complete() from running, leaving cameras without media links and V4L2 subdevice nodes. libcamera then reports no cameras. Fixes: linux-surface#2087 Fixes: linux-surface#2101 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adjust line numbers in the dw9719 i2c_device_id patch to account for the 3 lines added by the preceding dw9719 probe delay patch at line 121. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
I didn't create an issue for it, but I see the same behaviour on my Surface Book 1, and have confirmed the front camera is re-enabled with this patch and correctly shows an image. (The rear camera is detected after applying this patch, but shows only a green screen if selected in the fedora f44 gnome camera app). |
|
Thanks for testing on Surface Book 1! Great to see the fix working for the front camera. The green screen on the rear camera is likely a separate issue. |
|
Tested this patch on a Surface Book 2 (13") — kernel Method: applied just the Before (stock dw9719, OF-match only):
After (patched dw9719 with the The |
|
Hey I'm newish ( brand new ) to patching. Do I just download the repo and build? or do I have to clone the repo and apply the patches? |
|
Hi @fbd-ss — welcome, happy to help! 👋 Quick clarification first: this repo doesn't contain the kernel source itself, only the patches that linux-surface applies on top of the mainline kernel (the actual source lives in linux-surface/kernel). The files under Because this PR isn't merged yet, the prebuilt linux-surface kernel packages don't include it, so updating packages won't get you the fix just yet. A few options, easiest first: 1. Wait for it to merge. Once a maintainer merges this and it ships in the package repo, a normal linux-surface kernel update will include it — no building required. Lowest effort. 2. Build just the one driver (no full kernel rebuild). The fix only touches a single file ( 3. Full kernel build. Follow the wiki guide: Compiling the Kernel from Source. Clone If you just want working cameras with the least hassle, go with option 1 (or the official packages once it lands). If you want it now and are comfortable with a few terminal commands, tell me which distro you're on and I'll write up the DKMS steps for option 2. |
|
@toor11 Thanks for the reply, appreciate it. I wouldn't mind trying option 2 if its not too much hassle. I'm comfortable with the terminal, but have never patched anything yet. |
|
Glad to help with option 2 — it's not bad at all. The fix lives in one file ( First, one quick check — this only works if you're already running the linux-surface kernel: You should see 1. Install DKMS + your kernel's headers + build tools
2. Create the DKMS source dir
obj-m := dw9719.o
KDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
all:
$(MAKE) -C $(KDIR) M=$(PWD) modules
clean:
$(MAKE) -C $(KDIR) M=$(PWD) clean
static const struct i2c_device_id dw9719_id_table[] = {
{ .name = "dw9718s", .driver_data = (kernel_ulong_t)DW9718S },
{ .name = "dw9719", .driver_data = (kernel_ulong_t)DW9719 },
{ .name = "dw9761", .driver_data = (kernel_ulong_t)DW9761 },
{ .name = "dw9800k", .driver_data = (kernel_ulong_t)DW9800K },
{ }
};
MODULE_DEVICE_TABLE(i2c, dw9719_id_table);and (b) add 3. Build & install 4. Reboot. On boot the patched module loads, the VCM binds, and both cameras enumerate. Verify with: Because it's a DKMS module it'll auto-rebuild on future kernel updates, and it becomes redundant (harmless) once this PR merges. Shout if any step errors out — paste the output and I'll sort it. |
Same here on my Surface Pro 5 too. |
|
Status update for maintainers. Since this was opened, the one-hunk fix has now been independently confirmed working on four devices:
In each case the front camera re-enumerates once the The rear-camera "green screen" a couple of testers mention is a separate, pre-existing IPU3 issue unrelated to this VCM-binding fix — this PR does not touch that path. The branch still rebases cleanly on current |
|
Quick follow-up on the rear-camera green screen several people mentioned in this thread (separate from this PR, which is correct as-is): root cause found and fixed. The ov8865 driver only programs its registers on runtime-PM resume, and the VCM's PM device link (plus wireplumber holding the VCM subdev open) keeps the sensor permanently awake — so the format userspace negotiates never reaches the hardware, CIO2 hits a payload mismatch, and the stream stalls on one bogus frame. Fix submitted to linux-media (https://lore.kernel.org/linux-media/20260609232255.13559-1-eng.juri@gmail.com/) and to the surface kernel as #2169. No change needed to this PR — the VCM fix here is a prerequisite for autofocus and stands on its own. |
Applied DKMS fix, got similar results to @kiddconk; front camera working, rear camera green (haven't attempted to fix this separate issue yet) |
|
Ok, I think this is not super-useful, but sharing anyhow. I'm on Surface Pro 6, Ubuntu 24.04. I worked through this issue manually before finding this, and ended up migrating back to the old 6.17.13-surface-2 kernel using this process: https://gist.github.com/patcon/a80adb97920dc5378b1bd265ba683450 Since finding this issue, rather than applying a patch, I was curious what was the last linux-surface kernel built for debian was, without the regression. Linux kernel removed tables in 6.19 kernel here (Oct 29, 2025): debian surface-linux migrated 6.18 => 6.19 here (Mar 13, 2026): Last surface-linux debian kernel before Mar 13 was debian-6.18.7-1 (Jan 25, 2026): So basically, in the meantime to this fix landing, if you're looking for a working linux-surface kernel pre-regression, look for a release before Mar, for your flavour. |
|
Thank you so much |
We can also add Surface Go 2 into that list as that was the device the original fix was tested with. The PR continues to be cleanly mergeable. |
|
Confirmed working on Microsoft Surface Go (1st gen), kernel Had the exact same symptom — all three sensors detected by ipu3-cio2 ( Applied the fix by building just the
Adding Surface Go 1st gen to the confirmed devices list. Hope this helps get it merged. |
|
The i2c_device_table that was removed from dw9719 in kernel version 6.19 has been readded upstream starting from kernel 7.1.6. I have tested on Surface Go 1 and 2. Libcamera now recognises both front and back cameras on both devices. There is still an issue with the back cameras producing a green image but this is being addressed as a separate issue. Hopefully this will simplify the updating and release of an updated Linux surface kernel. |
I'm on OpenSUSE Tumbleweed with Surface Go 2 and I can confirm that with 7.1.6 kernel I got something for the first time from nick@SGO2:~> cam --list
[0:01:35.473411444] [5834] INFO Camera camera_manager.cpp:340 libcamera v0.7.2
[0:01:35.557060470] [5835] WARN IPAProxy ipa_proxy.cpp:196 Configuration file 'ov8865.yaml' not found for IPA module 'ipu3', falling back to '/usr/share/libcamera/ipa/ipu3/uncalibrated.yaml'
[0:01:35.578872232] [5836] INFO IPAProxyIPU3Worker ipu3_ipa_proxy_worker.cpp:505 Starting worker for IPA module /usr/lib64/libcamera/ipa/ipa_ipu3.so with IPC fd = 29
[0:01:35.582289202] [5835] WARN CameraSensor camera_sensor_legacy.cpp:502 'ov8865 2-0010': No sensor delays found in static properties. Assuming unverified defaults.
[0:01:35.582446260] [5835] INFO Camera camera_manager.cpp:223 Adding camera '\_SB_.PCI0.LNK0' for pipeline handler ipu3
[0:01:35.582478941] [5835] INFO IPU3 ipu3.cpp:1140 Registered Camera[0] "\_SB_.PCI0.LNK0" connected to CSI-2 receiver 0
[0:01:35.587692525] [5835] WARN IPAProxy ipa_proxy.cpp:196 Configuration file 'ov5693.yaml' not found for IPA module 'ipu3', falling back to '/usr/share/libcamera/ipa/ipu3/uncalibrated.yaml'
[0:01:35.612348418] [5837] INFO IPAProxyIPU3Worker ipu3_ipa_proxy_worker.cpp:505 Starting worker for IPA module /usr/lib64/libcamera/ipa/ipa_ipu3.so with IPC fd = 34
[0:01:35.616210089] [5835] WARN CameraSensor camera_sensor_legacy.cpp:502 'ov5693 4-0036': No sensor delays found in static properties. Assuming unverified defaults.
[0:01:35.616441695] [5835] INFO Camera camera_manager.cpp:223 Adding camera '\_SB_.PCI0.LNK1' for pipeline handler ipu3
[0:01:35.616503473] [5835] INFO IPU3 ipu3.cpp:1140 Registered Camera[1] "\_SB_.PCI0.LNK1" connected to CSI-2 receiver 1
Available cameras:
1: Internal back camera (\_SB_.PCI0.LNK0)
2: Internal front camera (\_SB_.PCI0.LNK1)
|
Summary
Adds back the
i2c_device_idtable to the dw9719 VCM driver for kernel 6.19, fixing a regression that prevents cameras from working on Surface devices that use the dw9719 voice coil motor (ov8865 autofocus).Root cause: Upstream commit "media: i2c: dw9719: Remove unused i2c device id table" in kernel 6.19 removed the
i2c_device_idtable. However, on Surface devices, the VCM is instantiated by the IPU bridge via I2C, so it requires I2C device matching. Without the table,dw9719_i2c_driverhas noi2c:dw9719alias and the driver never binds.Cascade failure: Without the VCM bound,
cio2_notifier_complete()does not fire, sov4l2_device_register_subdev_nodes()is never called. The ipu3-csi2 entities get no V4L2 subdevice nodes, and libcamera reports "Skip ipu3-csi2 0: no device node" → empty camera list.This patch is taken from Sakari Ailus's upstream fix:
https://lore.kernel.org/all/20260326174909.2746696-1-sakari.ailus@linux.intel.com/
Affected issues
Test plan
modinfo dw9719showsalias: i2c:dw9719(and dw9718s, dw9761, dw9800k)media-ctl -pshows links between sensor entities and ipu3-csi2cam --listreports cameras on Surface Book 2 / Surface Go 2 / Surface Pro 8+