Repository navigation
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 <[email protected]>
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 <[email protected]>
|
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/[email protected]/) 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)
|
|
Confirmed on Surface Pro 6 (IPU3, ov5693 + ov8865 + ov7251), kernel 6.19.8-surface-3, Ubuntu 24.04. Worth stressing that before this patch no camera worked at all, not just the one with the VCM:
One thing that may save others some time: forcing the bind from userspace does not work as a stopgap. Manual sysfs bind still goes through the bus match, and the match is precisely what is missing here. With the patch applied the VCM binds, For anyone testing without rebuilding a whole kernel: Thanks for tracking this down. |
|
thanks @toor11
and
Can't find the line https://github.com/linux-surface/kernel/blob/v6.18-surface-devel/drivers/media/i2c/dw9719.c and what do you mean with at the end of the file it looks like Where exactly should the patch code be inserted? thanks for explaining |
|
ok sorry so it has to go into https://github.com/linux-surface/kernel/blob/v6.19-surface-devel/drivers/media/i2c/dw9719.c So i inserted the patch code and at the end of the file it looks like this now: Does this look right to you? |
|
Thanks for trying it — good instinct, but there are two problems in what you pasted, both in the driver-struct block. First, this line is not valid C: static struct i2c_driver .id_table = dw9719_id_table = {The declaration stays exactly as it already is in the file: static struct i2c_driver dw9719_i2c_driver = {and Here is the full corrected tail of the file (this matches static const struct of_device_id dw9719_of_table[] = {
{ .compatible = "dongwoon,dw9718s", .data = (const void *)DW9718S },
{ .compatible = "dongwoon,dw9719", .data = (const void *)DW9719 },
{ .compatible = "dongwoon,dw9761", .data = (const void *)DW9761 },
{ .compatible = "dongwoon,dw9800k", .data = (const void *)DW9800K },
{ }
};
MODULE_DEVICE_TABLE(of, dw9719_of_table);
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);
static DEFINE_RUNTIME_DEV_PM_OPS(dw9719_pm_ops, dw9719_suspend, dw9719_resume,
NULL);
static struct i2c_driver dw9719_i2c_driver = {
.driver = {
.name = "dw9719",
.pm = pm_sleep_ptr(&dw9719_pm_ops),
.of_match_table = dw9719_of_table,
},
.probe = dw9719_probe,
.remove = dw9719_remove,
.id_table = dw9719_id_table,
};
module_i2c_driver(dw9719_i2c_driver);
MODULE_AUTHOR("Daniel Scally <[email protected]>");
MODULE_DESCRIPTION("DW9719 VCM Driver");
MODULE_LICENSE("GPL");The two changes versus the current file are:
Your paste had everything else right — keep |
|
@toor11 Thanks for teaching me. Before i try now your patch - is there any thing i can do about the failing rear camera as well? |
|
@rocky-III The patch in #2169 is a kernel patch — you apply it to the kernel source tree, not this repo. Since you're on Arch-based (per earlier comment), easiest path:
If you just want the one file fix without a full kernel rebuild, the change is in |
|
@toor11 Thank for explaining actually I'm on a Debian based system... what does this change in your description ? |
@toor11 |
|
@rocky-III Sorry, I had that backwards — you're on Debian, not Arch. One important thing to know up front: PR #2169 (the rear-camera ov8865 fix) is still unmerged, so it is not yet in the prebuilt Option 1 — simplest, no risk (recommended): wait for the merge. Option 2 — build from source to get it now. # 1. Build dependencies
sudo apt install build-essential binutils-dev libssl-dev bison flex libelf-dev ccache debhelper
# 2. Stock 6.19 kernel source
git clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
cd linux
git checkout v6.19
git switch -c v6.19-surface
# 3. Surface patches repo
git clone https://github.com/linux-surface/linux-surface.git ~/linux-surface
# 4. Fold the unmerged ov8865 fix into the camera patch file (this is what #2169 changes)
curl -L https://github.com/linux-surface/linux-surface/pull/2169.patch -o /tmp/2169.patch
patch -p1 < /tmp/2169.patch # run from ~/linux-surface
# 5. Apply all surface patches to the kernel (now including the ov8865 fix)
cd linux
for i in ~/linux-surface/patches/6.19/*.patch; do patch -p1 < "$i"; done
# 6. Configure from your current running kernel's config
cp /boot/config-$(uname -r) .config
make olddefconfig
# 7. Build the Debian packages (this takes a while)
make -j "$(getconf _NPROCESSORS_ONLN)" deb-pkg LOCALVERSION=-ov8865
# 8. Install
sudo dpkg -i ../linux-headers-*.deb ../linux-image-*.deb ../linux-libc-dev-*.debThen Honestly, for someone who's not already comfortable compiling kernels, Option 1 is the better call — a from-source build with a patch-in-patch is easy to get subtly wrong, and one driver fix isn't worth the risk of a boot problem. If you do go the source route and any step fails, paste the exact error here and I'll walk you through it. |
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/[email protected]/
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+