0
votes

I have a laptop running Ubuntu, kernel v5.8. It has two cameras which lack of functional drivers, and I want to try to get them to work.

I'm hitting an immediate hurdle in that the devices don't seem to be present in the way I (or indeed the ACPI tables) expect. For example for the front camera, the ACPI tables have this to say:

            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                Name (SBUF, ResourceTemplate ()
                {
                    I2cSerialBusV2 (0x0010, ControllerInitiated, 0x00061A80,
                        AddressingMode7Bit, "\\_SB.PCI0.I2C2",
                        0x00, ResourceConsumer, , Exclusive,
                        )
                })
                Return (SBUF) /* \_SB_.PCI0.CAM1._CRS.SBUF */
            }

and the datasheet somewhat contradictory addresses:

The 8-bit address of the OV2680 is 0x20 when SID pin is set to 1 or 0x6C when SID pin is set to 0.

But none of that's helpful, because there's no chip at 0x10, 0x6C or 0x20. There is a chip at 0x0c, but only one chip on the I2C bus for two cameras. This makes me suspect that perhaps the cameras are behind a multiplexer or something, but I can't find any documentation on that. How can I identify what device is running on a particular I2C port, so that I can figure out what the thing at 0x0c is?

Further Info:

Laptop Specs: Lenovo Miix 510. Original installed OS by OEM was Windows 10. The camera sensors are an OVTI2680 and an OVTI5648.

Full DSDT tables in this gist

1
@0andriy your comment got deleted I suspect. But thanks for your response. It was Win10 originally yes, and I did indeed suspect that the Win10 drivers would be hardcoded because the ACPI tables don't mention address 0x0c at all - so clearly some hard coding going on or they wouldn't work! Happy to share complete DSDT but it's too large for pastebin...is there a segment you think would be enough? Maybe the Scope of the I2C bus it's on, plus the two things listed as dependencies of the 2680?Dan Scally
@0andriy ok, full DSDT table added as a gistDan Scally
@0andriy yeah a thread on the linux-surface github lead me down that route. You might well be right, although now I read the DSDT tables more closely 0x0c is the second of two I2CSerialBus2 entries for the OVTI5648 camera, so that's still a chance. The PMICs seem to be IN3472's, I don't know of any drivers but I'm just trying to copy some code from the linux-surface guys that they say turn on the camera chips using the GpioIo entries from the INT3472's that the cameras are dependent on.Dan Scally
@0andriy ah! Bit shifting the addresses always confuses me, I'm never sure whether the values given are in 8 or 7bit. Thanks, that might explain some things. Those drivers aren't enabled in my config at the moment. I'll enable them and see what happens, thanks for the pointer!Dan Scally
@0andriy no dice unfortunately. With those config options set and the new kernel built and running, 0x0c is still the only device on that bus. I'm struggling to use the GPIO pins too; I made another question around that, but it seems like the gpiod_get_index() func doesn't find them in the way I expect.Dan Scally

1 Answers

1
votes

Do you have camera PMIC drivers loaded? Your camera sensors likely powered off. The camera PMIC is TPS68470 chip which is represented by three drivers:

  1. PMIC as Multi-Functional Device (MFD) driver with ACPI ID INT3472
  2. GPIO driver for it, and
  3. OpRegion driver to support access from ACPI code

All three must be enabled and loaded in order to get power gating work.

Side note regarding to I²C addresses. In data sheet the addresses most probably are in 8-bit format, means the real ones (7-bit) are 0x10 or 0x36.