From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 56127C433F5 for ; Thu, 28 Apr 2022 07:57:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=XbmGiu6Nfyfg9SyHvfvKKvlucqHoI//eZ3kiy8s4VgA=; b=1GrKX5o2KaqnOn5stHJiLNTKxh 1E82PnBf6W2WP6UukivtMkw/Nz/nWcRKIkwt/21uULbCkk0UIwcTdnc9FuuAe0zviBs73icuXNVOm gf2HEnj+qZnknJLjPk4QOTNkhVA39EWQGt3yVVaPZOo1d1xJAy09lZhUsmy5fg729aQjDWw3dADa+ n8QWxcrfbrxTIg337jbKKyuHsW8qNM5gqJx3+Yupi4tcyUFxYHqd5vQf5QHo9ImqHYf7ISSdtuZ5P 5LwL+MIjxDfqH8k0fQn2cs5/N1gnLcYzZi9prXIsmHFMxsQMB/OqQVcwIQgCEfNKpBbVE8OkNxHjD RB/5pySA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1njz0X-005Mq9-NO; Thu, 28 Apr 2022 07:56:13 +0000 Received: from relay2-d.mail.gandi.net ([217.70.183.194]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1njz0T-005MnG-V3 for linux-arm-kernel@lists.infradead.org; Thu, 28 Apr 2022 07:56:12 +0000 Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 2362040007; Thu, 28 Apr 2022 07:56:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1651132564; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PwJWSFPyWMtOiNkzX7trHwiAp5qywL60TmDmXyh8PGE=; b=dvpykhS3lCXFqqBThqULeTtNcre6KG0VweOfWsTgp9gaa45NvaKxFs1rVpHur9eqVU3bmD CJ3wAoHMqu/3EZT8oXNhPed2JIt/fgielZnLo2c7dJuqNmmXQ4c6A73EGOBBfRMTGcH6Ea VNOhcXutVN3OWNCv6nZfZ1j6F9R4fAnd/4lucF8QHzdMkPjKidzTI2L+teZJZlvrRQSOCu MU8PTHX+fqSU7idnkfHN4ccBqbNaqJdLlP8GBnzfIpPNQ5/b3C9fG+0QUQr56bWZ289iWX d9W7nhhCk/K6rsARwdtrAsNhjHJBMjZhRDoTm9EvMPBRu8WPDtKi5TSusOE5ag== Date: Thu, 28 Apr 2022 09:55:56 +0200 From: Paul Kocialkowski To: Jernej =?utf-8?Q?=C5=A0krabec?= Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, Yong Deng , Mauro Carvalho Chehab , Chen-Yu Tsai , Samuel Holland , Laurent Pinchart , Maxime Ripard , Thomas Petazzoni Subject: Re: [PATCH v4 43/45] media: sun6i-csi: Detect the availability of the ISP Message-ID: References: <20220415152811.636419-1-paul.kocialkowski@bootlin.com> <20220415152811.636419-44-paul.kocialkowski@bootlin.com> <2029179.KlZ2vcFHjT@jernej-laptop> MIME-Version: 1.0 In-Reply-To: <2029179.KlZ2vcFHjT@jernej-laptop> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220428_005610_316286_77D9A4F5 X-CRM114-Status: GOOD ( 29.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============3200425117169042129==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============3200425117169042129== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Ed//Kfe9t1pc7ZsY" Content-Disposition: inline --Ed//Kfe9t1pc7ZsY Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Jernej, Thanks a lot for all your reviews! On Wed 27 Apr 22, 22:07, Jernej =C5=A0krabec 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. > >=20 > > Signed-off-by: Paul Kocialkowski > > --- > > .../platform/sunxi/sun6i-csi/sun6i_csi.c | 33 +++++++++++++++++++ > > .../platform/sunxi/sun6i-csi/sun6i_csi.h | 3 ++ > > 2 files changed, 36 insertions(+) > >=20 > > 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" > >=20 > > +/* ISP */ > > + > > +static bool sun6i_csi_isp_detect(struct sun6i_csi_device *csi_dev) > > +{ > > + struct device *dev =3D csi_dev->dev; > > + struct fwnode_handle *handle =3D NULL; > > + > > + /* ISP is not available if disabled in kernel config. */ > > + if (!IS_ENABLED(CONFIG_VIDEO_SUN6I_ISP)) >=20 > 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. > Best regards, > Jernej >=20 > > + return 0; > > + > > + /* > > + * ISP is not available if not connected via fwnode graph. > > + * This weill also check that the remote parent node is available. > > + */ > > + handle =3D fwnode_graph_get_endpoint_by_id(dev_fwnode(dev), > > + =20 > SUN6I_CSI_PORT_ISP, 0, > > + =20 > FWNODE_GRAPH_ENDPOINT_NEXT); > > + if (!handle) > > + return 0; > > + > > + fwnode_handle_put(handle); > > + > > + dev_info(dev, "ISP link is available\n"); > > + csi_dev->isp_available =3D true; > > + > > + return 0; > > +} > > + > > /* Media */ > >=20 > > static const struct media_device_ops sun6i_csi_media_ops =3D { > > @@ -306,6 +335,10 @@ static int sun6i_csi_probe(struct platform_device > > *platform_dev) if (ret) > > return ret; > >=20 > > + ret =3D sun6i_csi_isp_detect(csi_dev); > > + if (ret) > > + goto error_resources; > > + > > ret =3D sun6i_csi_v4l2_setup(csi_dev); > > if (ret) > > goto error_resources; > > diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h > > b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h index > > 6aa83dd11684..9b105c341047 100644 > > --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h > > +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h > > @@ -22,6 +22,7 @@ > > enum sun6i_csi_port { > > SUN6I_CSI_PORT_PARALLEL =3D 0, > > SUN6I_CSI_PORT_MIPI_CSI2 =3D 1, > > + SUN6I_CSI_PORT_ISP =3D 2, > > }; > >=20 > > struct sun6i_csi_buffer { > > @@ -46,6 +47,8 @@ struct sun6i_csi_device { > > struct clk *clock_mod; > > struct clk *clock_ram; > > struct reset_control *reset; > > + > > + bool isp_available; > > }; > >=20 > > struct sun6i_csi_variant { >=20 >=20 >=20 >=20 --=20 Paul Kocialkowski, Bootlin Embedded Linux and kernel engineering https://bootlin.com --Ed//Kfe9t1pc7ZsY Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEJZpWjZeIetVBefti3cLmz3+fv9EFAmJqSIsACgkQ3cLmz3+f v9FaXQgAofXC4aKthXOVBgx2avaUKkXQfv+k5TuIIIcHUt5UxHio7Jz/Jo63k4aS 40fL2G9UAHlkY/pvlmXOPWyoFOZkEOMgSPrDtOOYHnFDxfVdMMDr+WtEWewhiEic bWgj3LQRgrW51O/SFiAmCcFe3lrrkPy7MpSOKduQlfwXxnN9BKyF+SfC/Xd1fcD5 qHNk3WuDDyJ/jYC7d3hgdy4WdcE4Hy4OvZY8VzvGw0OGA9Ys0s0JMs74ohNqOnz/ 92wSVjm9u7Shz8UZMdA0rY9MKNN1d4WTFTp8ok4IOAIzv/2irOo3HA9+PBzatZw1 ZcQIEdZFCx0heApvDexHrVygwHTWWw== =JFVd -----END PGP SIGNATURE----- --Ed//Kfe9t1pc7ZsY-- --===============3200425117169042129== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============3200425117169042129==--