Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Galaxy Book4 Pro compatibility #230

Merged
merged 3 commits into from
Jun 5, 2024
Merged

Fix Galaxy Book4 Pro compatibility #230

merged 3 commits into from
Jun 5, 2024

Conversation

arter97
Copy link
Contributor

@arter97 arter97 commented May 28, 2024

Galaxy Book4 Pro uses OV02C10, and it needed some additional fixes to make it work.

@hao-yao
Copy link
Contributor

hao-yao commented May 28, 2024

I'm also doing similar changes, but I didn't know that there are also hardware configurations like "ov02c10 + discrete power control" without IVSC. This version looks good, but let me verify if it works on my side.

By the way, how do you think use dev_dbg instead of dev_info in commit "print module name"? dev_info maybe too noisy.

@arter97
Copy link
Contributor Author

arter97 commented May 28, 2024

I'm also doing similar changes, but I didn't know that there are also hardware configurations like "ov02c10 + discrete power control" without IVSC. This version looks good, but let me verify if it works on my side.

Sure thing :)

By the way, how do you think use dev_dbg instead of dev_info in commit "print module name"? dev_info maybe too noisy.

Yup, that makes sense. I've updated the PR.

@hao-yao
Copy link
Contributor

hao-yao commented May 29, 2024

Thanks @arter97 , I merged my changes to your patches and pushed here and a simple test on my side is good. Could you help review that and test if it works for you?

Currently ov02c10 has been used in many devices with IPU6 in different hardware configurations. I think we'd better review and test more before we merge this PR.

@arter97
Copy link
Contributor Author

arter97 commented May 29, 2024

Yup, it works correctly on my end too.

I noticed that this part is missing though:

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0) && \
    IS_ENABLED(CONFIG_INTEL_VSC)
	ov02c10->mipi_lanes = OV02C10_DATA_LANES;
	ov02c10->conf.lane_num = ov02c10->mipi_lanes;
	/* frequency unit 100k */
	ov02c10->conf.freq = OV02C10_LINK_FREQ_400MHZ / 100000;
	ret = vsc_acquire_camera_sensor(&ov02c10->conf,
					ov02c10_vsc_privacy_callback,
					ov02c10, &ov02c10->status);
	if (ret == -EAGAIN) {
		return -EPROBE_DEFER;
	} else if (ret) {
		dev_err(&client->dev, "Acquire VSC failed");
		return ret;
	}
#endif

I'm assuming you'd know better but just wanted to point that out if deleting that was a mistake.

Regardless, it's all working fine on my end :)

Let me know if you want me to update this PR to your latest tree directly.

@hao-yao
Copy link
Contributor

hao-yao commented May 29, 2024

Thanks,

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0) && \
    IS_ENABLED(CONFIG_INTEL_VSC)
	ov02c10->mipi_lanes = OV02C10_DATA_LANES;
	ov02c10->conf.lane_num = ov02c10->mipi_lanes;
	/* frequency unit 100k */
	ov02c10->conf.freq = OV02C10_LINK_FREQ_400MHZ / 100000;
	ret = vsc_acquire_camera_sensor(&ov02c10->conf,
					ov02c10_vsc_privacy_callback,
					ov02c10, &ov02c10->status);
	if (ret == -EAGAIN) {
		return -EPROBE_DEFER;
	} else if (ret) {
		dev_err(&client->dev, "Acquire VSC failed");
		return ret;
	}
#endif

I'm assuming you'd know better but just wanted to point that out if deleting that was a mistake.

This part is moved to ov02c10_power_on() so we can replace this by ov02c10_power_on().

Let me know if you want me to update this PR to your latest tree directly.

I need to do more test on my side, maybe my branch still need some changes. Will let you know if everything works well.

Signed-off-by: Juhyung Park <[email protected]>
Signed-off-by: Hao Yao <[email protected]>
The KBFC645 module used in Galaxy Book4 Pro also needs 180 rotation.

Signed-off-by: Juhyung Park <[email protected]>
Signed-off-by: Hao Yao <[email protected]>
This should come in handy when debugging module-specific issues.

Signed-off-by: Juhyung Park <[email protected]>
Signed-off-by: Hao Yao <[email protected]>
@hao-yao
Copy link
Contributor

hao-yao commented Jun 5, 2024

@arter97 a few fixes here: https://github.com/hao-yao/ipu6-drivers/tree/fix-ov02c
Could you help copy my branch to yours and update this PR? I think we can merge now.

@arter97
Copy link
Contributor Author

arter97 commented Jun 5, 2024

Yup, all done.

Tested it and it works well on my laptop as well. Thanks! :)

@hao-yao hao-yao merged commit 404740a into intel:master Jun 5, 2024
3 checks passed
@matinone
Copy link

Awesome work here @arter97 @hao-yao !
If I wanted to test this, is it enough to follow the build instructions from the README, or would I need to do anything else?
Thanks!

@arter97
Copy link
Contributor Author

arter97 commented Jun 11, 2024

Nothing special than any other IPU6 setup, it differs from distros to distros so you may have to google a bit.

IPU6 is generally just hard to get it right unlike traditional UVC webcams.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants