[libcamera-devel] Fwd: Surface Go VCM type (was: Need to pass acpi_enforce_resources=lax on the Surface Go (version1))

Daniel Scally djrscally at gmail.com
Wed Nov 10 01:01:19 CET 2021


Hi Hans

On 09/11/2021 16:35, Daniel Scally wrote:
>>>> That's not working correctly for me at the moment, but I think this is a
>>>> surmountable problem rather than the wrong approach, so I'm just working
>>>> through the differences to try and get the matching working.
>>> OK, I eventually got this working - the dw9719 registers as
>>> /dev/v4l-subdev7 for me now ... long story short is the attached patch
>>> was needed to make the references work, as the internals of v4l2 aren't
>>> checking for fwnode->secondary. Prior to your latest series as well, an
>>> additional problem was that once the VCMs fwnode was linked to the
>>> sensor's the .complete() callback for ipu3-cio2 would never call
>>> (because it needs ALL the devices for the linked fwnodes to be bound to
>>> do that)...which meant the VCMs never got instantiated, because that was
>>> where that function was called. With your new set separating those
>>> processes it works well, so yes I like that new approach very much :D
>>>
>>>
>>> In the end we don't have to add a call creating the subdev's - it turns
>>> out that v4l2 knows it's part of ipu3-cio2's v4l2-device so it registers
>>> the nodes for the vcm when .complete() is called for that driver. I
>>> still think we should add a bit creating the link to expose to userspace
>>> in match_notify() though.
>>>
>>>
>>> Trying to list controls for the dw9719 with v4l2-ctl -d /dev/v4l-subdev7
>>> -L fails with an IOCTL error, so I have some remedial work on the driver
>>> which I'll do tonight; I'd expect to be able to control focus with
>>> v4l2-ctl -d /dev/v4l-subdev7 -c absolute_focus=n once this is sorted.
>> That is great, thank you so much. I wanted to look into this myself
>> today but I got distracted by other stuff.
>
> No problem; I'll link you the patches for the updated versions of
> everything once I've sorted the IOCTL error tonight.


OK, this is running now. With the attached patches on top of your v5
series and the 4-patch series from earlier today, the dw9719 registers
as a v4l2 subdev and I can control it with v4l2-ctl -d /dev/v4l-subdev7
-c focus_absolute=1200 (or whatever value). One problem I'm experiencing
is that the focus position I set isn't maintained; it holds for a couple
of seconds and then resets to the "normal" focus...this happens when the
.close() callback for the driver is called, which happens right after
the control value is applied. All the other VCM drivers in the kernel
power down on .close() so I did the same, but the behaviour is not
particularly useful - since removing the power seems to reset it, it
needs to be on whilst the linked sensor is streaming I suppose. Given
that ascertaining the state of the sensor probably will require some
link established between them anyway I guess I will look at that next,
unless you'd rather do it?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-media-i2c-Add-driver-for-DW9719-VCM.patch
Type: text/x-patch
Size: 11908 bytes
Desc: not available
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20211110/b1b2cea6/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-device-property-Check-fwnode-secondary-when-finding-.patch
Type: text/x-patch
Size: 1473 bytes
Desc: not available
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20211110/b1b2cea6/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-platform-x86-int3472-Add-vsio-regulator-supply-to-bo.patch
Type: text/x-patch
Size: 1291 bytes
Desc: not available
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20211110/b1b2cea6/attachment-0002.bin>


More information about the libcamera-devel mailing list