Re: [PATCH v11] media: Add t4ka3 camera sensor driver

From: Sakari Ailus

Date: Tue Mar 17 2026 - 18:35:23 EST


Hi Hans,

On Tue, Mar 17, 2026 at 08:56:47PM +0100, Hans de Goede wrote:
> Hi,
>
> On 17-Mar-26 18:58, Sakari Ailus wrote:
>
> ...
>
> >>>> +
> >>>> + /* Only apply changes to the controls if the device is powered up */
> >>>> + if (!pm_runtime_get_if_in_use(sensor->sd.dev)) {
> >>>> + t4ka3_set_bayer_order(sensor, fmt);
> >>>
> >>> Does this call belong here?
> >>
> >> Yes, if the hflip/vflip controls change then fmt->code needs to be
> >> updated to the now changed bayer-order. t4ka3_set_bayer_order()
> >> uses the cached ctrl->val values so it is cheap enough to
> >> always do this instead of checking if the changed ctrl is
> >> vflip or hflip.
> >>
> >> In case the sensor is actually streaming and we don't hit this path,
> >> the t4ka3_t_vflip()helper will return -EBUSY since changing
> >> the active fmt while streaming is not a good idea.
> >
> > This should also apply to non-active state (albeit implementation requires
> > implementing get_fmt locally). This will get "fixed" with the metadata
> > series eventually with generic raw formats.
>
> Ok, so what you are saying is that given the special need to
> set fmt->code based on the flip ctrl values, this driver should
> not use v4l2_subdev_get_fmt directly, but instead it should
> provide its own subdev_get_fmt() which wraps v4l2_subdev_get_fmt()
> overriding fmt->code based on the flip settings before returning it ?
>
> Do I have that right ?

I'd like to say "no", but yes, that's right. :-)

--
Sakari Ailus