On 15/10/2021 19:47, Jacopo Mondi wrote:
Hi Tomi,
On Fri, Oct 15, 2021 at 07:10:02PM +0300, Tomi Valkeinen wrote:
Hi,
On 15/10/2021 18:28, Jacopo Mondi wrote:
Hi Tomi,
On Fri, Oct 15, 2021 at 06:17:45PM +0300, Tomi Valkeinen wrote:
Hi,
On 15/10/2021 17:05, Jacopo Mondi wrote:
Ok, I understand this allow you to
int _set_routing(sd, state, krouting)
{
v4l2_subdev_set_routing(krouting);
}
int set_routing(sd, state, which, krouting)
{
_set_routing(sd, state, krouting);
if (which == ACTIVE)
apply_to_hw();
}
pad_ops ops = {
.set_routing = set_routing,
};
int init_cfg(sd, state)
{
routes = {
...
};
krouting routing {
.routes = routes,
.num_routes = 1,
};
_set_routing(sd, state, &routing);
}
Yes, although I would guess that the likely use of which in set_routing is
if (which == ACTIVE && priv->streaming)
return -EBUSY;
Not really. In my use case in example, I need to know if a route is
active as according to the routing table I have to update the value of
a control (the total pixel rate of the demultiplexer) and I need to
update the mask of active (routed) GMSL link upon which several other
operations and HW configurations to be applied at s_stream() time
depend on.
Are you allowing changing routing while streaming is enabled? You have to be
No :) What I meant is that I need to know if a route is active or not
for other reasons, not just for disallow route changes while
streaming.
I'm interested to hear why =). I think set_routing should mostly just
check if the routing is valid, and that check is the same for active and
try cases.
In your example above you call apply_to_hw(). I think that should not be
done. The commit to HW should be done in s_stream().
Tomi