Re: [PATCH net-next v4 5/8] mfd: zl3073x: Add functions to work with register mailboxes
From: Ivan Vecera
Date: Thu Apr 24 2025 - 16:00:40 EST
On 24. 04. 25 9:29 odp., Andrew Lunn wrote:
Yes, PHC (PTP) sub-driver is using mailboxes as well. Gpio as well for some
initial configuration.
O.K, so the mailbox code needs sharing. The question is, where do you
put it.
This is crucial question... If I put the MB API into DPLL sub-driver
then PTP sub-driver will depend on it. Potential GPIO sub-driver as
well.
There could be some special library module to provide this for
sub-drivers but is this what we want? And if so where to put it?
The mutex needs to be shared, but that could be in the common data
structure.
Do you mean that sub-device would access mutexes placed in zl3073x_dev which
is parent (mfd) driver structure?
Yes.
So, some helper functions for taking and releasing lock... The v4
approach uses (will use) one mutex per mailbox type but one mutex for
MB access is also sufficient.
Ivan