Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2435160rda; Wed, 25 Oct 2023 02:38:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHc86tHWygbTWzjcrtyRh/b7WwU5cEcDgNwoBmM/M++y/i9ePpgkHeGP8R6l3YN1DRsxNRO X-Received: by 2002:a25:b18a:0:b0:d9b:8804:3153 with SMTP id h10-20020a25b18a000000b00d9b88043153mr13608393ybj.8.1698226721494; Wed, 25 Oct 2023 02:38:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698226721; cv=pass; d=google.com; s=arc-20160816; b=iyrDStRHcqBfl7/5rKcNg/wCflXdWOiR7SaYMyv+fpRZV7QVRJgrSvrB6dDTRnYzu3 KDB03oPvs+Fz0nRl9zR4IruA9x5X5F3L7IR+PZvfpODvIrt0RXvu6humtXsCqZVM09CG 06nIl6QUXQKbPia2+zQ6jZ3PjKKA9AdelR/aOwfnn1+Su7wD8KaBML5a6Hmd/FJNwv+r gvO7SVwiQinb99QmwvrK7bZJ+gXJRlHuomsGUc856CU28qhGu7WL5VGXS18zUV+d9jsb ZNugY0jrdKusDEZQJhiDi5IF7Vna4Z+2YoReqd+5r6yHef2r3jAbWqQsT0A29Wpsi+4h lR8Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:organization:from:references:cc:to:content-language :subject:user-agent:date:message-id:dkim-signature; bh=VmMtWpsXZGVhkZ1Icss0nqZjYD9VYYx1WEav7k7iTpE=; fh=smEw9sX7pq/bz2ZIugh8HD84L69CuU1fO6WpYQY2zu8=; b=VL/ZGHmLeFslFhTrlVBu2jRaCrdAurgH/fgodxV/R/mqGW7IsG4pqHF1yO294pG9pe S2cP+KPsyYMkVevjLBZD8hQ6NpWLwmLSteg23TOIlsuknpqAiETOVSYx9U2dDaRd812x qMQ7lwuUNtE5ceCA5m/44x8xDtztHC8tmfo4osXdo+oR6HNyhQHkfmMb08FslW5IPItk CiIsrNTR9gjbLPewAU7lO4s7KCS9RP3U4g9MibnfWU45KJpCCRt/uptzsol7FlBBMZ5j /EvKlLKfhehwCKLg0Z9PWtu5EflvlOk63+TKsouZSQom9cSuVBTiEwFX2HbsA0czeb7b OrSQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wolfvision.net header.s=selector2 header.b=iGe2nmXJ; arc=pass (i=1 spf=pass spfdomain=wolfvision.net dkim=pass dkdomain=wolfvision.net dmarc=pass fromdomain=wolfvision.net); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wolfvision.net Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id e138-20020a25e790000000b00d9a5e205080si9582860ybh.599.2023.10.25.02.38.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 02:38:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@wolfvision.net header.s=selector2 header.b=iGe2nmXJ; arc=pass (i=1 spf=pass spfdomain=wolfvision.net dkim=pass dkdomain=wolfvision.net dmarc=pass fromdomain=wolfvision.net); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wolfvision.net Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 23BAD801B492; Wed, 25 Oct 2023 02:38:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234517AbjJYJih (ORCPT + 99 others); Wed, 25 Oct 2023 05:38:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230217AbjJYJid (ORCPT ); Wed, 25 Oct 2023 05:38:33 -0400 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2055.outbound.protection.outlook.com [40.107.15.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90CC8A6; Wed, 25 Oct 2023 02:38:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nKu6pKlXLwzLHirUTniUFZ6b3/80+RibH3yXVZHt7h+Ccc0cP/rnKoWePtyUnEaTxlXBzQbILFBo4n3NK5XY2g4nNBsZ+XmhzWLfUsFy2Jnq9EeSwjqhMdgZW/tUoGXDb/4VBOT5gUg309Gb/JNds91CxiEpTmWiE9N9RM4Vh/qyFOesq2f2KxMS7RSJm3UI1a9VyFEvcoXhzm+TCnr1N6VVx8q6ktevv8rMIKLx5YtgRyhnKr23rIvY+OcuHdJhjM6gZ8fwvtplXgDn9y6UdnqeirASC/fH/+9vy/9dA1XhW2zlcHSOaLckHFgSaP6+nyAbqixgHmFX5zkPJ8I7Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VmMtWpsXZGVhkZ1Icss0nqZjYD9VYYx1WEav7k7iTpE=; b=Zc5brme+7nfH/K5d1IASp2VQIePFnL+sEn6IMh9oTAM1hEWfnGTtBuwCgUdISEv1tsQJE8MNu6CddM3gwf/Lr2n1OpMhuq9NIyuAl6kSPM3Hph6YWdqO4YSsJnW1yBjysthzxqGgBXbN9JPMkYV6NWiDh2dtyjojI/7BSl+1hH7VgKGhl0qgrH3bIqFJlnM7dSRqvmEcgYk6cZsbtRO2f6iESyChA5GFym3c8wKLSDzUS8HwrC2cOj+xEn1ezur0x5/BjXdcC/N9UbvMLmpFFNemwmdOUi+lt9Uidg1HmRz3shx9p1Q2QM3ktiTCik0b5eirLVBdU64foYRvXcz3Dw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wolfvision.net; dmarc=pass action=none header.from=wolfvision.net; dkim=pass header.d=wolfvision.net; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wolfvision.net; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VmMtWpsXZGVhkZ1Icss0nqZjYD9VYYx1WEav7k7iTpE=; b=iGe2nmXJTxte5sdEnu2fj7vtLx39uDLBIlxAHCzkR/mnr5aW5mrUw1yOuv0tJQGCNZFXbDgPb1liQZ0P3zkyLMe1ab5zlFa+3yWDqU8EMC415zIz99WHDVuQ1Xuzpki7Kn1LZGWFF70DZ+9vyi0UOtpFMlVG++L37fpgflEwbHI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wolfvision.net; Received: from DU0PR08MB9155.eurprd08.prod.outlook.com (2603:10a6:10:416::5) by PAWPR08MB8790.eurprd08.prod.outlook.com (2603:10a6:102:333::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.29; Wed, 25 Oct 2023 09:38:27 +0000 Received: from DU0PR08MB9155.eurprd08.prod.outlook.com ([fe80::87b4:3635:b89d:c07c]) by DU0PR08MB9155.eurprd08.prod.outlook.com ([fe80::87b4:3635:b89d:c07c%6]) with mapi id 15.20.6933.019; Wed, 25 Oct 2023 09:38:27 +0000 Message-ID: Date: Wed, 25 Oct 2023 11:38:25 +0200 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v8 2/3] media: rockchip: Add a driver for Rockhip's camera interface Content-Language: en-US To: Paul Kocialkowski 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 References: <3790470ff7606fc075ec742d43254e52dde5d120.1697446303.git.mehdi.djait@bootlin.com> From: Michael Riesch Organization: WolfVision GmbH In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: VI1PR07CA0151.eurprd07.prod.outlook.com (2603:10a6:802:16::38) To DU0PR08MB9155.eurprd08.prod.outlook.com (2603:10a6:10:416::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB9155:EE_|PAWPR08MB8790:EE_ X-MS-Office365-Filtering-Correlation-Id: de555c5c-05b0-4e59-e6e5-08dbd53e23fb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HLvTbQoxvlowS6dYWCi2WSrGnBosNQnelFc7n0RlTZ6GTfyi1q78yQs955dcLktJ0GslTnG0aYtlu0ATx6lNQCrmcTYxYc0t87Fl11PUAJe9K4Z76HD3XEHt/+T1Nd41hw1ixdUCqSXxYD/MlymOlDNLZlZKA2zjcu+RjzlE+Zpz+2FUu/IUVJ2KkZ2kZp5Zeyb99DeSOIR9JcASAKZrQ1pJSgrBOcW3d85oCJFJvEN2sizLtFsdGgEL5IDLDtqPZTqOgUKCw7kgQZE3DpDOzOcdfO8Ojn1LvgA0u/MaG54s+J/rtp+R4DnnidIpeE+07mbOKyqCgMYv7oCCxTbDK+k/ZAgXzjN1Yn3NNfj1u/Hc4vB9dZirk1Cp182O5mLGO0xmOCSYmlk/DQeZ+YukBJzfGLjsD+LI+lTx/zx/Ev4qFmXGX9e9mQsBaMXOjhU4PAnfVyeazqklugtqWIg/oNSiWa6X5NZXEDKYPrSFo5NO88Jxd446qkjM41y4YTjjR2liZSWKg9L7pwnNB5e0ifllX4exdiQrM5lR9S6Kj0AGWTEs9gdXWuFbrZaF7FGjlKCunz2iq+F6wtCMD42DFZspQByn1crNCMmmhZtwb259GB4jF+jVlzwV3AGIQatI/rNJ+GZSW5gT8+8SRJgIHg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR08MB9155.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(366004)(376002)(136003)(346002)(39850400004)(230922051799003)(1800799009)(186009)(64100799003)(451199024)(2906002)(38100700002)(36756003)(2616005)(66476007)(66556008)(6916009)(66946007)(36916002)(6506007)(478600001)(6486002)(53546011)(6512007)(83380400001)(4326008)(86362001)(44832011)(41300700001)(5660300002)(7416002)(31696002)(8676002)(316002)(8936002)(26005)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dnNSTkxJWU5VaWYzWXJrb3hUZ0VNdzhidmNjVmRWZGZobW4wRFduK1FVRVZs?= =?utf-8?B?L1JWaThXUnJOTjRNVzkvcE9tYkVxS3lrOTNNZjBIOG8rcWt5bUVGNTBtZnlu?= =?utf-8?B?MUhzaDRLQ2tZcENaN2RLdE41Z3hvQ21YMGQ3QmlXYzlXdytuTGVhb0RBNGZC?= =?utf-8?B?bVoxUSsrSnBrV1I4Z25XSHdwNGhxSkwzcURRL2FtYzU5Q25jOGdGVWZDc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3c21aMEtlTlQxTmY3b3NaZTRaaXNt?= =?utf-8?B?VkwzT0JDWkM5Z1dJeEprMjE3OUoza3dGRkJWd3FlMzYxZnRWZlZpT0NJMEpy?= =?utf-8?B?WUl0bTBHK05YQmFTVXpKQWsxRHlrWXlGN29ibmhTZ0g1ejNIdUxZMG1aKzhm?= =?utf-8?B?ckE9PQ==?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: de555c5c-05b0-4e59-e6e5-08dbd53e23fb X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB9155.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2023 09:38:27.2846 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e94ec9da-9183-471e-83b3-51baa8eb804f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: eQpZHE4vLyLJoYJ8omJffucdExGARvFV5euet2YaQs6uBPqK33u1Y8ZwTeROU6p/FhNhMJ0FTNrKHeIWvOghKXDv8hSRIRnjqgv+JHhDl38= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB8790 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 25 Oct 2023 02:38:40 -0700 (PDT) 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); 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? > [...] >>> + 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". "remote" sounds reasonable. Prefix to be bikeshedded, see comment above. In the future, we may add an array with mipi_remotes that represents the subdevices attached wia MIPI CSI-2. Best regards, Michael > Cheers, > > Paul >