Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2438996rda; Wed, 25 Oct 2023 02:48:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH1ll9EVtYELCuuRi2HIEqVNxgzARId5oWI/tUjANhda/oJGkU73gtQVj5/PsVFoL8eNdMI X-Received: by 2002:a05:622a:144b:b0:41c:b909:e033 with SMTP id v11-20020a05622a144b00b0041cb909e033mr17566284qtx.23.1698227307811; Wed, 25 Oct 2023 02:48:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698227307; cv=none; d=google.com; s=arc-20160816; b=ERIn7F5+2r0bSGaQTr5UeIOIdiJLKa8FQmJR4jQO2VkbY9U04q8i7cvNpkFdzmlZ4S f+l30CWUO+N2pepYjHG9vvfjSBoJfdpmGz90sKHTFKSCweGnGbsjiXwpqVTkUYW/OcEn WBJV91RaMhVHn8w0gWmsIaZlTG/SG/3BgDZ/jVAZidPxJVNQC0EH0O8sMPOSr8OHDhhZ b6ggl04yomPnXi/95uIZtGoW+Yw1sOaKHBKlHaSARHmxoSPf7bjTyAU70O5Gct6LxJ4t I27vof1mPpjQ8LFY/fMw1JC/ouX9BpS/8J9omVFIgdf8bjqd4bWQ8sp5eUWZAeVuTc7w AVSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1k2YPUzWcOkEagcDThcHO9wlMohvRnn0bjyNb8MXgl0=; fh=WDSmL4zc2st/HHoTFge1Sqx1/RRthNUb6FHsK24Hkf8=; b=UQhdZhXgrOl5lN8J5fDhc/EkHvbVURXFWGNYYfOz/CfKWY/lnCG/tezyMfqWflabSS 4YDHqaYYbN0TlEBcgvpkiM3lEWOc02laz1B8rrFpzghA+Y0pxiW4evqvfqGWU1/BlabA DRnmXMe05ZnjBmMuA2H/7zTHajWsYNzYU23V6bH1jHojqCpIANBliwsqQDcGn1faxvJW L2b4y8oJWHFjKbBn0aHRHvtfHdQOyTbhQcFblolUhuUPvIX/Mtyx0PnQJzNCH9kQjkad jnLnRFSEwUdaGy0YZadb3wR+IfHYtMG2tgVOT5Fq7Hhjqge7AEwqA7fVd1iMSpJ90urJ OqWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=LTvFjk7r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id s10-20020a81770a000000b005a7b0942ecesi10635612ywc.387.2023.10.25.02.48.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 02:48:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=LTvFjk7r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id B838E808D495; Wed, 25 Oct 2023 02:48:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234034AbjJYJsS (ORCPT + 99 others); Wed, 25 Oct 2023 05:48:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229606AbjJYJsQ (ORCPT ); Wed, 25 Oct 2023 05:48:16 -0400 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0FCD9D; Wed, 25 Oct 2023 02:48:12 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 399E2C0012; Wed, 25 Oct 2023 09:48:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1698227290; 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=1k2YPUzWcOkEagcDThcHO9wlMohvRnn0bjyNb8MXgl0=; b=LTvFjk7ru7UkIs9uW/KET6ghc50QAERqTyVRBn2khbb2K7m4F49+ChD2Azxt9feWIyQb2T vJwtrXSaA7BMxp0cpTuB1L+6khhVbMYWIhlMGwH+c9yGOzqhfAHLKFk5LyrafZMIiuS6/8 XQlcV2xRb4lzS0UhDzyOBQc7cBmkhHiG28Ytdqm2FF2KPM7w0yRVD8mNyBt2FMzfHWZTQL Uvsw7y3E3wGqUfMGCx3S6LjTOUZ7NlIF4YJwaQ0bpM1aFPxoQ1Gx/Q2BSwYLVrBPr6M+w5 K4Dj6pFCie03LwOpfeIA60So2qTBctC8eqdZ9F4ypOdHw8UAubUPyRE6RLOGtg== Date: Wed, 25 Oct 2023 11:48:08 +0200 From: Paul Kocialkowski To: Michael Riesch Cc: Mehdi Djait , mchehab@kernel.org, heiko@sntech.de, hverkuil-cisco@xs4all.nl, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, conor+dt@kernel.org, ezequiel@vanguardiasur.com.ar, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, alexandre.belloni@bootlin.com, maxime.chevallier@bootlin.com Subject: Re: [PATCH v8 2/3] media: rockchip: Add a driver for Rockhip's camera interface Message-ID: References: <3790470ff7606fc075ec742d43254e52dde5d120.1697446303.git.mehdi.djait@bootlin.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fBirLtQySHnjwSRc" Content-Disposition: inline In-Reply-To: X-GND-Sasl: paul.kocialkowski@bootlin.com X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 25 Oct 2023 02:48:24 -0700 (PDT) --fBirLtQySHnjwSRc Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Michael, On Wed 25 Oct 23, 11:38, Michael Riesch wrote: > Hi Paul, >=20 > On 10/25/23 10:49, Paul Kocialkowski wrote: > > Hi, > >=20 > > On Mon 23 Oct 23, 15:28, Michael Riesch wrote: > >> Typo in the subject: "Rockhip's" -> "Rockchip's" > >> I think this typo has been in there for a while now ;-) > >=20 > > Great hips make for great dancing! >=20 > ...to rock music, obviously. :) > > [...] > >>> +#define write_vip_reg(base, addr, val) writel(val, (addr) + (base)) > >>> +#define read_vip_reg(base, addr) readl((addr) + (base)) > >> > >> Please provide those helpers as proper inline functions. As to the > >> naming, the "_reg" suffix seems unnecessary. > >> > >> Alternatively, you could consider converting the driver to use regmap. > >=20 > > Come to think of it, I feel like it would make more sense to have an in= line > > function which is given a struct rk_vip_device instead of having to der= eference > > it every time in the caller to access the base address. >=20 > Indeed. Either using regmap, e.g., >=20 > int regmap_write(struct regmap *map, unsigned int reg, unsigned int val); >=20 > or something equivalant >=20 > static inline int cif_write(struct cif_device *device, unsigned int reg, > unsigned int val); Looks good to me! > Not sure what you agreed on in terms of a method prefix. The Rockchip > RGA driver uses "rga_something", the Rockchip ISP driver uses > "rkisp1_something". This would mean either "cif_something" or > "rkcif_something", right? Yeah I don't really have strong opinions on this so I'll let Mehdi decide (as long as it's consistent everywhere in the code). I guess there is a slight readability advantage in using "cif_" instead of "rkcif_". > > [...] > >>> + struct rk_vip_sensor_info sensor; > >> > >> Using "sensor" as name does not seem correct. As pointed out above it > >> could be a video decoder just as well. Something with "subdevice" mayb= e? > >=20 > > Agreed. I suggest renaming the struct "rk_vip_sensor_info" -> "rk_cif_r= emote" > > and just calling the member "remote". >=20 > "remote" sounds reasonable. Prefix to be bikeshedded, see comment above. >=20 > In the future, we may add an array with mipi_remotes that represents the > subdevices attached wia MIPI CSI-2. Sounds good! Thanks, Paul --=20 Paul Kocialkowski, Bootlin Embedded Linux and kernel engineering https://bootlin.com --fBirLtQySHnjwSRc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEJZpWjZeIetVBefti3cLmz3+fv9EFAmU45FgACgkQ3cLmz3+f v9FojAf+IytRfPPzjE8k2tDfOt43W+J5DlDw5ygYN5c877ywwBi+bZDgapHTZWo6 arsbbgPIJqQpb7mz3bHRTzzm8COFbFO6PWrO0WKVGB6Rzm/N0kSY9rN4GGpgbT+2 ZA7eIWJ8eJza0pfp2JG/MYBznMFCuiJhta/j+4Hgz3iQH9h64UKycPfl+eiWZdZD SaEc07LkpYZZIOrPZtGVQKDiAqQX5lrCyA5YhadGs+P1BVukq2yTSM/O5nk4N8ds 1AR6hRVMy65rGrSLagXj0enP1GFYPDoYLFRO4lfbh/CU0yriNtSkecyz2k9q4NgW NPRaBti9VhIeNutHheCCKZyoeWPBEA== =zaqo -----END PGP SIGNATURE----- --fBirLtQySHnjwSRc--