Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2458984rda; Wed, 25 Oct 2023 03:29:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFGze24hAJYePvt0gfGKyEDW5zCufTaZDWkfQndnPkasclK7fHOxPYBEgHXp7cVnYNI2C9d X-Received: by 2002:a0d:f582:0:b0:591:15a6:c11f with SMTP id e124-20020a0df582000000b0059115a6c11fmr13797034ywf.50.1698229747677; Wed, 25 Oct 2023 03:29:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698229747; cv=none; d=google.com; s=arc-20160816; b=UyEnVBalqHM7A6tfK85xHyP8abvYjx9X7QrvNKGP0i381X/ggOEscF9z0cOjrS179A HzHcx1YSmXnEwpmHDNh6xcHdnd6bTHr/SIs9jRm4JaiZ8ojoh9JfoB3cWzSVpEVU9oyM byiq5JSgPv2GzVkEdy19wIYBwsUkDyaWQwP6NWYuxCxUtUnyQzaPjGSy1lVSwwCHshjQ FtO3mrzqGFL+4cOwT1WR/JrpudnyWrDIxzFMtxz6be6Exf/pqx1v2A3fgJRQb89+u3Sc eMYMR10S/Jazmdh0WNGtS49hDpysWuepuJiuqBcc6C+q52ZkrkLAfU9NkXgEAb8Rmtne jegw== 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=z0VFej7lIc8Tw0pWBz/Y9lLcMVb2c7+L+vzZC6J9dkI=; fh=AB7aNFfqnu0t3UxOo7UI4CJsuiM49/J4gYXGR1dfI28=; b=d1JhE6baNHsdh9WX6xUbYlyqMaS39pP4o+VPQVuMjBXYlyl/6iukNvHHAmKoVGVexS SUT6XEPPV6exkuOGowiWXcChuVuqzwtprck6nYFygLWQLA+6/rd3n7PivfHDVUPc92Th kQwxdCvWpubog7ZOk0qlSgPfbT0B3HZEIzGjRQa5eqm4auHquO8OcCewKu6Rf1nlj8Vk 3htjNDfgHaay7QiWj7KTy6DQXe2XQNxpxA5znIcKvZwcWknZIHxZ1d9cp5P9Ej0bkxZQ tIEwpT/XiiFL4bEPEbAN/1xZjv2EjtNBpAH63xsrtdvqSxOg+vn58EL6RkLffm/2ke2h 9pAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="NJg/COsA"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id j7-20020a0de007000000b0059bbce95a6asi10345874ywe.543.2023.10.25.03.29.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 03:29:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="NJg/COsA"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id F16C880BA7D0; Wed, 25 Oct 2023 03:29:04 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343536AbjJYK2w (ORCPT + 99 others); Wed, 25 Oct 2023 06:28:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234790AbjJYK2r (ORCPT ); Wed, 25 Oct 2023 06:28:47 -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 07651D56; Wed, 25 Oct 2023 03:28:37 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 5B933C000C; Wed, 25 Oct 2023 10:28:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1698229715; 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=z0VFej7lIc8Tw0pWBz/Y9lLcMVb2c7+L+vzZC6J9dkI=; b=NJg/COsAqjIcBAKiAewVyxisum8g8jw2yKZDrcOgvL50JsuerikogK/QEV5UDj4/t7fG+X XHhErbRpsQIlBkQo/GS9wgm+W2p2Bce/ktmDbX1kDJox9om/2UOTS8L52JkWlAbfHFD+IF stWud9REKlD8zyrq29m3zNpdfyrOOQjXLSxJqTXTYfDO2FjyFsCKLfTXoDN8GLoYomGKd3 SjcFKGoLGWoy//xy3oSz5108shFAQfeGutzg+/C/etrAMeNh4ll0d60pnekQZ/mhXdT0og ch+xgsrwmvvZiWsDu2wWq8jICQDqqyuEMcxO5VOAjMaNrvjmTd+bJyUTpcovLQ== Date: Wed, 25 Oct 2023 12:28:33 +0200 From: Mehdi Djait To: Paul Kocialkowski Cc: Michael Riesch , 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: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-GND-Sasl: mehdi.djait@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 groat.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 (groat.vger.email [0.0.0.0]); Wed, 25 Oct 2023 03:29:05 -0700 (PDT) Hi Paul, Hi Michael Thank you for the review! On Wed, Oct 25, 2023 at 11:48:08AM +0200, Paul Kocialkowski wrote: > Michael, > > On Wed 25 Oct 23, 11:38, Michael Riesch wrote: > > Hi Paul, > > > > On 10/25/23 10:49, Paul Kocialkowski wrote: > > > Hi, > > > > > > 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 ;-) > > > > > > Great hips make for great dancing! > > > > ...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. > > > > > > Come to think of it, I feel like it would make more sense to have an inline > > > function which is given a struct rk_vip_device instead of having to dereference > > > it every time in the caller to access the base address. > > > > Indeed. Either using regmap, e.g., > > > > int regmap_write(struct regmap *map, unsigned int reg, unsigned int val); > > > > or something equivalant > > > > static inline int cif_write(struct cif_device *device, unsigned int reg, > > unsigned int val); > > Looks good to me! > Yes, I will change it ro cif_write() > > 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? I am going with cif_*() > > 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" maybe? > > > > > > Agreed. I suggest renaming the struct "rk_vip_sensor_info" -> "rk_cif_remote" > > > and just calling the member "remote". Yes "remote" sounds right in this situation -- Kind Regards Mehdi Djait