Re: [PATCH v4 43/45] media: sun6i-csi: Detect the availability of the ISP

From: Maxime Ripard
Date: Fri Apr 29 2022 - 10:24:59 EST


On Thu, Apr 28, 2022 at 01:43:44PM +0200, Paul Kocialkowski wrote:
> Hi Maxime,
>
> On Thu 28 Apr 22, 10:11, Maxime Ripard wrote:
> > On Thu, Apr 28, 2022 at 09:55:56AM +0200, Paul Kocialkowski wrote:
> > > Hi Jernej,
> > >
> > > Thanks a lot for all your reviews!
> > >
> > > On Wed 27 Apr 22, 22:07, Jernej Škrabec wrote:
> > > > Dne petek, 15. april 2022 ob 17:28:09 CEST je Paul Kocialkowski napisal(a):
> > > > > Add a helper to detect whether the ISP is available and connected
> > > > > and store the indication in a driver-wide variable.
> > > > >
> > > > > Signed-off-by: Paul Kocialkowski <paul.kocialkowski@xxxxxxxxxxx>
> > > > > ---
> > > > > .../platform/sunxi/sun6i-csi/sun6i_csi.c | 33 +++++++++++++++++++
> > > > > .../platform/sunxi/sun6i-csi/sun6i_csi.h | 3 ++
> > > > > 2 files changed, 36 insertions(+)
> > > > >
> > > > > diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
> > > > > b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c index
> > > > > a88deb8ba1e7..f185cbd113c7 100644
> > > > > --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
> > > > > +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
> > > > > @@ -25,6 +25,35 @@
> > > > > #include "sun6i_csi_capture.h"
> > > > > #include "sun6i_csi_reg.h"
> > > > >
> > > > > +/* ISP */
> > > > > +
> > > > > +static bool sun6i_csi_isp_detect(struct sun6i_csi_device *csi_dev)
> > > > > +{
> > > > > + struct device *dev = csi_dev->dev;
> > > > > + struct fwnode_handle *handle = NULL;
> > > > > +
> > > > > + /* ISP is not available if disabled in kernel config. */
> > > > > + if (!IS_ENABLED(CONFIG_VIDEO_SUN6I_ISP))
> > > >
> > > > Where is this symbol defined?
> > >
> > > That is defined through Kconfig's auto-generated header, from the associated
> > > option for the ISP driver. It is defined in the ISP support series so this
> > > will effectively always be false for now.
> >
> > Can the ISP be compiled as a module, but the CSI driver built-in?
>
> I think so yes, I don't see any reason why not.
>
> > If so,
> > that would create a dependency from the kernel image to a module, which
> > won't compile.
>
> I think this would introduce a run-time dependency (sun6i-csi needing sun6i-isp
> in order to register) but I don't understand why it wouldn't compile though.
> Could you ellaborate a bit?

Never mind, that was a brainfart, I was somehow thinking you wer calling
a function there.

Maxime