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. |
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+