Bug 195877 - OV5648 and HM2056 cameras not yet supported by the kernel.
Summary: OV5648 and HM2056 cameras not yet supported by the kernel.
Status: NEW
Alias: None
Product: v4l-dvb
Classification: Unclassified
Component: v4l-other (show other bugs)
Hardware: Intel Linux
: P1 normal
Assignee: v4l-other
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-25 12:50 UTC by alan
Modified: 2021-09-19 11:22 UTC (History)
5 users (show)

See Also:
Kernel Version: All
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Untested port of ov5648 driver from 01org to 4.12-rc4 (74.95 KB, patch)
2017-06-11 14:23 UTC, Devid Filoni
Details | Diff
Untested and "unpolished" port of hm2056 driver from zenfone5 to 4.13-rc6 (60.43 KB, patch)
2017-09-04 00:05 UTC, Devid Filoni
Details | Diff
Untested port of ov5648 driver from 01org (74.43 KB, patch)
2017-09-22 13:46 UTC, alan
Details | Diff
Untested and "unpolished" port of hm2056 driver from zenfone5 (60.43 KB, patch)
2017-09-22 13:47 UTC, alan
Details | Diff
My Dsdt.dsl file (559.09 KB, text/x-csrc)
2017-09-22 14:04 UTC, alan
Details
My acpidata.fat file (389.73 KB, text/plain)
2017-09-22 14:05 UTC, alan
Details

Description alan 2017-05-25 12:50:35 UTC
Hello,

OV5648 and HM2056 drivers seems to be available on the net, but for now these cameras are not yet supported by the kernel. 
Can someone here have a look on it and see if it is possible to porting and upstream the ov5648 and hm2056 camera support in the kernel ?

Thanks.

OV5648 driver: 

https://github.com/01org/ProductionKernelQuilts/tree/master/uefi/cht-m1stable/patches (0004-ov2680-ov5648-Fork-lift-source-from-CTS.patch ; 0005-ov2680-ov5648-gminification.patch ; 0006-ov5648-Focus-support.patch ; 0008-ov2680-ov5648-Enabled-the-set_exposure-functions.patch).

HM2056 driver:

https://github.com/ZenfoneArea/android_kernel_asus_zenfone5/blob/master/linux/modules/camera/drivers/media/i2c/hm2056.h
https://github.com/ZenfoneArea/android_kernel_asus_zenfone5/blob/master/linux/modules/camera/drivers/media/i2c/hm2056.c
Comment 1 alan 2017-06-07 12:24:01 UTC
Hi,

Nobody to check it ?

Thanks.
Comment 2 Devid Filoni 2017-06-11 14:23:17 UTC
Created attachment 256937 [details]
Untested port of ov5648 driver from 01org to 4.12-rc4

Hi,
I ported ov5648 driver from github.com/01org/ProductionKernelQuilts and it builds fine but I'm not able to fully test it at the moment due to other issues in atomisp_gmin_platform, indeed, the ov2680 driver which is already included in 4.12 doesn't work too on my computer.
Can someone test this patch please?
Thanks
Comment 3 alan 2017-08-16 09:25:29 UTC
For information, here are the results from my dmesg log file when the patch from Devid Filoni has been applied to the kernel sources and that I compiled it :

[8.603361] ov5648: module is from the staging directory, the quality is unknown, you have been warned.
[8.737873] acpi INT5648:00: Failed to find gmin variable INT5648:00_CameraModule
[8.737879] ov5648 i2c-INT5648:00: Camera module id is missing
[8.737883] ov5648 i2c-INT5648:00: gmin: initializing atomisp module subdev data.PMIC ID 1
[8.738072] acpi INT5648:00: Failed to find gmin variable INT5648:00_CamClk
[8.738227] acpi INT5648:00: Failed to find gmin variable INT5648:00_ClkSrc
[8.738384] acpi INT5648:00: Failed to find gmin variable INT5648:00_CsiPort
[8.738556] acpi INT5648:00: Failed to find gmin variable INT5648:00_CsiLanes
[8.738745] ov5648 i2c-INT5648:00: i2c-INT5648:00 supply V1P8SX not found, using dummy regulator
[8.738782] ov5648 i2c-INT5648:00: i2c-INT5648:00 supply V2P8SX not found, using dummy regulator
[8.738820] ov5648 i2c-INT5648:00: i2c-INT5648:00 supply V1P2A not found, using dummy regulator
[8.738844] ov5648 i2c-INT5648:00: i2c-INT5648:00 supply VPROG4B not found, using dummy regulator
[8.816136] ov5648 i2c-INT5648:00: camera pdata: port: 0 lanes: 1 order: 00000002
[8.835512] ov5648: module is from the staging directory, the quality is unknown, you have been warned.
[8.901789] @update_otp: no valid wb otp data
[8.901810] ov5648 i2c-INT5648:00: register atomisp i2c module type 1
Comment 4 Devid Filoni 2017-09-04 00:05:58 UTC
Created attachment 258179 [details]
Untested and "unpolished" port of hm2056 driver from zenfone5 to 4.13-rc6
Comment 5 Devid Filoni 2017-09-04 00:12:32 UTC
Hi,
@alan: I have the same output for ov5648 and ov2680 :(
I uploaded here an untested and "unpolished" patch for hm2056. It builds fine but I don't have a device to test it. Could someone test this patch too?
Thank you!
Comment 6 alan 2017-09-05 10:45:08 UTC
Hi Devid,

I will test your hm2056 patch with the 4.13 stable version of the kernel. For now the atomisp support is not good so we can't use our cameras. I think it will take a long time before the cameras support is operational.
Comment 7 alan 2017-09-13 11:35:04 UTC
@Devid:

You talked to me that your gmin variables for ov5648 looks like that from your DSDT :

"CamId", "ov5648",
"CamType", "1",
"CsiPort", "1",
"CsiLanes", "2",
"CsiFmt", "15",
"CsiBayer", "2",
"CamClk", "0",
"Regulator1p8v", "0",
"Regulator2p8v", "0"

I would like to test your gmin variables to see if these values can work for my hardware (as I've got also an ov5648 camera like you), but I must modify the atomisp_gmin_platform.c file to put the workaround. Do you think it is a good idea to put the workaround like this ? :

For example for your hardware:

static const struct gmin_cfg_var lenovo_miix_310_vars[] = {
	{"INT5648:00_CamType", "1"},
	{"INT5648:00_CsiPort", "1"},
	{"INT5648:00_CsiLanes", "2"},
	{"INT5648:00_CsiFmt", "15"},
	{"INT5648:00_CsiBayer", "2"},
	{"INT5648:00_CamClk", "0"},
	{},
};

} hard_vars[] = {
	{ "BYT-T FFD8", ffrd8_vars },
	{ "T100TA", t100_vars },
	{ "MRD7", mrd7_vars },
	{ "ST70408", ecs7_vars },
	{ "VTA0803", i8880_vars },
	{ "T701", insyde_t701_vars },
        { "MIIX310", lenovo_miix_310_vars },
};

Of course, I need to change the lenovo_miix_310_vars and MIIX310 values for my personal hardware.
Comment 8 Devid Filoni 2017-09-13 11:51:14 UTC
@alan: I don't think Lenovo Miix 310 variables will work on your hardware, also that change won't fix missing AXP regulators support, your PC uses XPOWER PMIC Controller (INT33F4) as the Lenovo Miix 310 does and AFAIK it isn't supported in mainline atomisp_gmin_platform.
Comment 9 alan 2017-09-14 10:47:58 UTC
@Devid: Ok, if you think it is not a good idea. So, for now, your OV5648 patch is not useable. But I will test your HM2056 patch to see what happens. I waited some patches. We don't know if the support of the cameras for Baytrail and Cherry Trail hardware will be available one day. :-(
Comment 10 Sergei Trusov 2017-09-17 15:09:23 UTC
Hallo,

Just in case. Before testing sensors, make sure the ISP device is enabled and configured properly:

# lspci -k
00:03.0 Multimedia controller: Intel Corporation Atom Processor Z36xxx/Z37xxx Series Camera ISP (rev ff)
        Kernel driver in use: atomisp-isp2
        Kernel modules: atomisp

If not, check the BIOS for something like 'ISP PCI Device as B0D3F0' option.
(Unfortunately, some devices has none)


(In reply to Devid Filoni from comment #2)

> the ov2680 driver which is already
> included in 4.12 doesn't work too on my computer.

This one seems to be a bit buggy. With the following hack 

--- a/drivers/staging/media/atomisp/i2c/ov2680.c
+++ b/drivers/staging/media/atomisp/i2c/ov2680.c
@@ -1111,6 +1116,8 @@ static int ov2680_set_fmt(struct v4l2_subdev *sd,
        dev_dbg(&client->dev, "__s_mbus_fmt i=%d, w=%d, h=%d\n",
                     dev->fmt_idx, fmt->width, fmt->height);
 
+       power_up(sd);
+
        ret = ov2680_write_reg_array(client, ov2680_res[dev->fmt_idx].regs);
        if (ret)
                dev_err(&client->dev, "ov2680 write resolution register err\n");

ov2680_write_reg_array() starts to return no error.

BTW this behaviour observed on a device with the Xpower PMIC.

However I had to add one more:

--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c
@@ -897,6 +897,9 @@ static int atomisp_register_entities(struct atomisp_device *isp)
                goto v4l2_device_failed;
        }
 
+       /* HACK: allow sensors to init pdata */
+       msleep(2000);
+
        ret = atomisp_subdev_probe(isp);
        if (ret < 0)
                goto csi_and_subdev_probe_failed;
Comment 11 alan 2017-09-18 11:06:47 UTC
Hi,

(In reply to Sergei Trusov from comment #10)
> Hallo,
> 
> Just in case. Before testing sensors, make sure the ISP device is enabled
> and configured properly:
> 
> # lspci -k
> 00:03.0 Multimedia controller: Intel Corporation Atom Processor
> Z36xxx/Z37xxx Series Camera ISP (rev ff)
>         Kernel driver in use: atomisp-isp2
>         Kernel modules: atomisp
> 
> If not, check the BIOS for something like 'ISP PCI Device as B0D3F0' option.
> (Unfortunately, some devices has none)
> 

Thanks for your reply. I will check your command. I have to check if the patch given by Devid for the HM2056 camera works. The OV5648 and HM2056 support are missing in the kernel. Devid made patches to support these cameras. I don't know if they can be upstreamed into the kernel to have a better support ?
Comment 12 alan 2017-09-22 13:46:16 UTC
Created attachment 258561 [details]
Untested port of ov5648 driver from 01org
Comment 13 alan 2017-09-22 13:47:16 UTC
Created attachment 258563 [details]
Untested and "unpolished" port of hm2056 driver from zenfone5
Comment 14 alan 2017-09-22 14:02:58 UTC
Hi,

I uploaded the two patches from Devid with modifications I made (for OV5648 patch and HM2056 patch). I couldn't use the HM2056 patch from Devid because there was an error in line 27. The line should look like this: @@ -8,6 +8,7 @@ obj - $ (CONFIG_VIDEO_GC2235) + = gc2235 .o

So I made the change.

I compiled the 4.13.3 stable kernel with the patches given by Devid that I modified and here are the results:

[    8.480206] hm2056: module is from the staging directory, the quality is unknown, you have been warned.
[    8.484067] ov5648: module is from the staging directory, the quality is unknown, you have been warned.
[    8.616322] hm2056 i2c-HIMX2056:00: gmin: initializing atomisp module subdev data.PMIC ID 1
[    8.616674] acpi HIMX2056:00: Failed to find gmin variable HIMX2056:00_CamClk
[    8.616826] acpi HIMX2056:00: Failed to find gmin variable HIMX2056:00_ClkSrc
[    8.617202] acpi HIMX2056:00: Failed to find gmin variable HIMX2056:00_CsiPort
[    8.617525] acpi HIMX2056:00: Failed to find gmin variable HIMX2056:00_CsiLanes
[    8.617687] hm2056 i2c-HIMX2056:00: i2c-HIMX2056:00 supply V1P8SX not found, using dummy regulator
[    8.617720] hm2056 i2c-HIMX2056:00: i2c-HIMX2056:00 supply V2P8SX not found, using dummy regulator
[    8.617738] hm2056 i2c-HIMX2056:00: i2c-HIMX2056:00 supply V1P2A not found, using dummy regulator
[    8.617756] hm2056 i2c-HIMX2056:00: i2c-HIMX2056:00 supply VPROG4B not found, using dummy regulator
[    8.617773] hm2056 i2c-HIMX2056:00: power_up
[    8.694053] hm2056 i2c-HIMX2056:00: camera pdata: port: 0 lanes: 1 order: 00000000
[    8.700386] hm2056 i2c-HIMX2056:00: hm2056_raw_detect sensor ID is 0x2056
[    8.700391] hm2056 i2c-HIMX2056:00: power_down
[    8.722054] hm2056 i2c-HIMX2056:00: register atomisp i2c module type 1
[    8.723100] acpi INT5648:00: Failed to find gmin variable INT5648:00_CameraModule
[    8.723105] ov5648 i2c-INT5648:00: Camera module id is missing
[    8.723109] ov5648 i2c-INT5648:00: gmin: initializing atomisp module subdev data.PMIC ID 1
[    8.723272] acpi INT5648:00: Failed to find gmin variable INT5648:00_CamClk
[    8.723434] acpi INT5648:00: Failed to find gmin variable INT5648:00_ClkSrc
[    8.723595] acpi INT5648:00: Failed to find gmin variable INT5648:00_CsiPort
[    8.723756] acpi INT5648:00: Failed to find gmin variable INT5648:00_CsiLanes
[    8.723875] ov5648 i2c-INT5648:00: i2c-INT5648:00 supply V1P8SX not found, using dummy regulator
[    8.723911] ov5648 i2c-INT5648:00: i2c-INT5648:00 supply V2P8SX not found, using dummy regulator
[    8.723933] ov5648 i2c-INT5648:00: i2c-INT5648:00 supply V1P2A not found, using dummy regulator
[    8.723952] ov5648 i2c-INT5648:00: i2c-INT5648:00 supply VPROG4B not found, using dummy regulator
[    8.723981] ov5648 i2c-INT5648:00: gpio failed 2
[    8.724649] mei_txe 0000:00:1a.0: can't derive routing for PCI INT A
[    8.724655] mei_txe 0000:00:1a.0: PCI INT A: not connected
[    8.743051] ov5648: module is from the staging directory, the quality is unknown, you have been warned.
[    8.804033] ov5648 i2c-INT5648:00: sensor power-up failed
[    8.804042] ov5648 i2c-INT5648:00: ov5648 power-up err.
[    8.804057] ov5648 i2c-INT5648:00: gpio failed 2
[    8.804062] ov5648 i2c-INT5648:00: sensor power-gating failed
[    8.804143] ov5648: probe of i2c-INT5648:00 failed with error -22

If it can help you my dsdt.dsl and acpidata.dat files are available above as attachments.

Thanks.

Regards.
Comment 15 alan 2017-09-22 14:04:40 UTC
Created attachment 258565 [details]
My Dsdt.dsl file
Comment 16 alan 2017-09-22 14:05:14 UTC
Created attachment 258567 [details]
My acpidata.fat file
Comment 17 alan 2017-09-24 10:47:38 UTC
Hi,

I forgot to tell you that I had these errors in the dmesg log file. Perhaps that's why the system can't find the gmin variables and there is a gpio error ?

[    0.274383] ACPI Error: No handler for Region [GPOP] (ffff8ae77693e360) [GeneralPurposeIo] (20170531/evregion-166)
[    0.274406] ACPI Error: Region GeneralPurposeIo (ID=8) has no handler (20170531/exfldio-299)
[    0.274423] ACPI Error: Method parse/execution failed \_SB.I2C2.CAM1._STA, AE_NOT_EXIST (20170531/psparse-550)
[    0.274499] ACPI Error: No handler for Region [GPOP] (ffff8ae77693e360) [GeneralPurposeIo] (20170531/evregion-166)
[    0.274516] ACPI Error: Region GeneralPurposeIo (ID=8) has no handler (20170531/exfldio-299)
[    0.274532] ACPI Error: Method parse/execution failed \_SB.I2C2.CAM1._STA, AE_NOT_EXIST (20170531/psparse-550)
[    0.274556] ACPI Error: Method execution failed \_SB.I2C2.CAM1._STA, AE_NOT_EXIST (20170531/uteval-103)
[    0.274745] ACPI: Power Resource [P28P] (off)
[    0.274863] ACPI: Power Resource [P18P] (off)
[    0.275323] ACPI Error: No handler for Region [GPOP] (ffff8ae77693e360) [GeneralPurposeIo] (20170531/evregion-166)
[    0.275342] ACPI Error: Region GeneralPurposeIo (ID=8) has no handler (20170531/exfldio-299)
[    0.275358] ACPI Error: Method parse/execution failed \_SB.I2C2.CAM2._STA, AE_NOT_EXIST (20170531/psparse-550)
[    0.275433] ACPI Error: No handler for Region [GPOP] (ffff8ae77693e360) [GeneralPurposeIo] (20170531/evregion-166)
[    0.275450] ACPI Error: Region GeneralPurposeIo (ID=8) has no handler (20170531/exfldio-299)
[    0.275466] ACPI Error: Method parse/execution failed \_SB.I2C2.CAM2._STA, AE_NOT_EXIST (20170531/psparse-550)
[    0.275499] ACPI Error: Method execution failed \_SB.I2C2.CAM2._STA, AE_NOT_EXIST (20170531/uteval-103)
[    0.275966] ACPI Error: No handler for Region [GPOP] (ffff8ae77693e360) [GeneralPurposeIo] (20170531/evregion-166)
[    0.275992] ACPI Error: Region GeneralPurposeIo (ID=8) has no handler (20170531/exfldio-299)
[    0.276011] ACPI Error: Method parse/execution failed \_SB.I2C2.CAM3._STA, AE_NOT_EXIST (20170531/psparse-550)
[    0.276097] ACPI Error: No handler for Region [GPOP] (ffff8ae77693e360) [GeneralPurposeIo] (20170531/evregion-166)
[    0.276122] ACPI Error: Region GeneralPurposeIo (ID=8) has no handler (20170531/exfldio-299)
[    0.276146] ACPI Error: Method parse/execution failed \_SB.I2C2.CAM3._STA, AE_NOT_EXIST (20170531/psparse-550)
[    0.276178] ACPI Error: Method execution failed \_SB.I2C2.CAM3._STA, AE_NOT_EXIST (20170531/uteval-103)
[    0.276715] ACPI Error: No handler for Region [GPOP] (ffff8ae77693e360) [GeneralPurposeIo] (20170531/evregion-166)
[    0.276742] ACPI Error: Region GeneralPurposeIo (ID=8) has no handler (20170531/exfldio-299)
[    0.276766] ACPI Error: Method parse/execution failed \_SB.I2C2.CAM4._STA, AE_NOT_EXIST (20170531/psparse-550)
[    0.276849] ACPI Error: No handler for Region [GPOP] (ffff8ae77693e360) [GeneralPurposeIo] (20170531/evregion-166)
[    0.276874] ACPI Error: Region GeneralPurposeIo (ID=8) has no handler (20170531/exfldio-299)
[    0.276898] ACPI Error: Method parse/execution failed \_SB.I2C2.CAM4._STA, AE_NOT_EXIST (20170531/psparse-550)
[    0.276931] ACPI Error: Method execution failed \_SB.I2C2.CAM4._STA, AE_NOT_EXIST (20170531/uteval-103)
Comment 18 alan 2017-09-27 10:23:54 UTC
Hi,

(In reply to Sergei Trusov from comment #10)
> Hallo,
> 
> Just in case. Before testing sensors, make sure the ISP device is enabled
> and configured properly:
> 
> # lspci -k
> 00:03.0 Multimedia controller: Intel Corporation Atom Processor
> Z36xxx/Z37xxx Series Camera ISP (rev ff)
>         Kernel driver in use: atomisp-isp2
>         Kernel modules: atomisp
> 
> If not, check the BIOS for something like 'ISP PCI Device as B0D3F0' option.
> (Unfortunately, some devices has none)
> 

I tried your command but it only displays the following kernel modules: iosf_mbi_pci, i915, xhci_hcd, mei_txe, lpc_ich. I can't access to advanced options in my BIOS. I think it is bridled. Or Perhaps I will be able to access to advanced options but I don't know how.
Comment 19 alan 2017-12-06 13:27:58 UTC
Hi,

no news about the support for these cameras and for the atomisp support in the kernel ?

Thanks.
Comment 20 RussianNeuroMancer 2018-03-18 04:53:09 UTC
> the ov2680 driver which is already included in 4.12 doesn't work too on my
> computer

Same issue with DEXP Ursus 10XW and DEXP Ursus Apollo Z110/Z110i.
Comment 21 alan 2020-04-14 10:25:31 UTC
Hello,

after two years, I would like to know if OV5648 and HM2056 cameras are now supported in new kernels. Do you know if the OV5648 is compatible with the OV5640 drivers.

Thanks.
Comment 22 mirh 2021-09-19 11:22:56 UTC
VIDEO_OV5648 was added in 5.12
https://patchwork.kernel.org/project/linux-media/patch/20201231142357.2929424-3-paul.kocialkowski@bootlin.com/

The other camera is still missing on the other hand.. 
https://github.com/rockchip-linux/kernel/blob/develop-4.4/drivers/media/i2c/hm2056.c
Maybe this somewhat newer-but-older-but-at-least-tested driver could help.

Note You need to log in before you can comment on or make changes to this bug.