Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1715083rda; Tue, 24 Oct 2023 00:30:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH/1LROnbgci9AHcL2t2TQXTP8A1F/iQejTCxls9c8tPd5n6hYtCZiQaJH8rNjoSJnvrKpL X-Received: by 2002:a05:6a00:158d:b0:693:3783:4a29 with SMTP id u13-20020a056a00158d00b0069337834a29mr9444744pfk.20.1698132641624; Tue, 24 Oct 2023 00:30:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698132641; cv=none; d=google.com; s=arc-20160816; b=OfJYtL0L2iC1RhRa7eADvMWFoXK8FEVYr2lIPmoKEIktlqzRgfxH81KXRoXYcW/26v +EXiugvg4fqf4BiCWh0PHfppvv8LMKcWY7Dnsstu9miKHRMxsOPEciQxqBiY1zERKNP4 Xk9N4+YKBNnLn4SnrxyslMO0dTzMoGIdUMFIhnS4Ij9JFAWlmVebYj2WtTH+vJc9yo0f i/lVEVzj1wqEtptgSwi2MEM8beYY5pkoA+xv+RBsOL28o0e7kVOlTY8E71x8L0aRYoH8 dwxPnEYrs+SjJfUchNarenwT/J54PEk2JUua60XsF3i1x8Fj6Neq/br7VrgQImiFdV3R eyQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:autocrypt:references:in-reply-to:date:cc :to:from:subject:message-id; bh=I9KaG0qxbajvP99/wm3ple6LLcIG2wCoRE1QydpXH5I=; fh=PQ2t6BMTtEYcpEafYusGTFKg6bnyDw5zyI0w6/ae5vI=; b=aF0JeczI0Yq8rMVO0cDxTRMcbfSiEacplog4g6BrMoT4ZB8n3WHQRZ52/sCYE6gd/5 ZOuXc3yYV22hX2YzYpH3Y+qVy3WBJ66oYPFXL7Sya5rtjuoeSDE6wgzeEmsVR4xjVKLf kX/MU4U3Z/QG5nhTMNMIseb0TBstbIiC1JMgGJaqdiEY5Dq48sFRr99EP2DVa3Fcekht 1NiOd+cekktWRfdvfcD0vMw7tXfiAM+qECllJZBMYLr03RZaV8aEgq6/saTH69lcr8Ku QZCHF6gse081dgQmpy9rOJ9+glStRmU3K9fLioS9i29Fh1PCWM4y2QzOEHl4/bv9KnnT /E3A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id s10-20020a056a00194a00b0069342cee042si8224370pfk.51.2023.10.24.00.30.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 00:30:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 096538079B6F; Tue, 24 Oct 2023 00:30:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233298AbjJXHaQ convert rfc822-to-8bit (ORCPT + 99 others); Tue, 24 Oct 2023 03:30:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232706AbjJXHaO (ORCPT ); Tue, 24 Oct 2023 03:30:14 -0400 Received: from smtprelay04.ispgateway.de (smtprelay04.ispgateway.de [80.67.18.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96F78DB; Tue, 24 Oct 2023 00:30:10 -0700 (PDT) Received: from [92.206.139.21] (helo=note-book.lan) by smtprelay04.ispgateway.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.1) (envelope-from ) id 1qvBra-0006IC-2U; Tue, 24 Oct 2023 09:30:06 +0200 Message-ID: <9117e551a4a4dd0e94a1395817d89cb18ac11b24.camel@apitzsch.eu> Subject: Re: [PATCH 1/4] media: i2c: imx214: Explain some magic numbers From: =?ISO-8859-1?Q?Andr=E9?= Apitzsch To: Kieran Bingham , Mauro Carvalho Chehab , Ricardo Ribalda , Sakari Ailus Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht Date: Tue, 24 Oct 2023 09:30:01 +0200 In-Reply-To: <169810104910.2245571.16606813523946813634@ping.linuxembedded.co.uk> References: <20231023-imx214-v1-0-b33f1bbd1fcf@apitzsch.eu> <20231023-imx214-v1-1-b33f1bbd1fcf@apitzsch.eu> <169810104910.2245571.16606813523946813634@ping.linuxembedded.co.uk> Autocrypt: addr=git@apitzsch.eu; prefer-encrypt=mutual; keydata=mQINBFZtkcEBEADF2OvkhLgFvPPShI0KqafRlTDlrZw5H7pGDHUCxh0Tnxsj7r1V6N7M8L2ck9GBhoQ9uSNeer9sYJV3QCMs6uIJD8XV60fsLrGZxSnZejYxAmT5IMp7hHZ6EXtgbRBwPUUymfKpMJ55pmyNFBkxWxQA6E33X/rH0ddtGmAsw+g6tOHBY+byBDZrsAZ7MLKqGVaW7IZCQAk4yzO7cLnLVHS2Pk4EOaG+XR/NYQ+jTfMtszD/zSW6hwskGZ6RbADHzCbV01105lnh61jvzpKPXMNTJ31L13orLJyaok1PUfyH0KZp8xki8+cXUxy+4m0QXVJemnnBNW5DG3YEpQ59jXn3I7Eu2pzn2N+NcjqK8sjOffXSccIyz8jwYdhASL5psEvQqZ6t60fvkwQw7++IZvs2BPmaCiQRo415/jZrEkBBE3xi1qdb3HEmpeASV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jq32Be4C3QUYRBloU2l2VyGghZxdShJvNIZvup0ID0BFhcs0+4dWS4Loz8HW7FBWcmsUsti3mUBuBb6PN+jRoIYBbsUGDffbxz2/tHF3mckCS4qVtwiD7noU0l69FqZm/aOOUbwZ7UiTuuYgZ0HvQBMEb9PiiC0qjrTIST/U6zqLs4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.50.1 MIME-Version: 1.0 X-Df-Sender: YW5kcmVAYXBpdHpzY2guZXU= X-Spam-Status: No, score=-0.8 required=5.0 tests=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 morse.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 (morse.vger.email [0.0.0.0]); Tue, 24 Oct 2023 00:30:30 -0700 (PDT) Am Montag, dem 23.10.2023 um 23:44 +0100 schrieb Kieran Bingham: > Quoting André Apitzsch (2023-10-23 22:47:50) > > Code refinement, no functional changes. > > > > Signed-off-by: André Apitzsch > > --- > >  drivers/media/i2c/imx214.c | 24 +++++++++++++++++++----- > >  1 file changed, 19 insertions(+), 5 deletions(-) > > > > diff --git a/drivers/media/i2c/imx214.c > > b/drivers/media/i2c/imx214.c > > index 4f77ea02cc27..9218c149d4c8 100644 > > --- a/drivers/media/i2c/imx214.c > > +++ b/drivers/media/i2c/imx214.c > > @@ -19,12 +19,23 @@ > >  #include > >  #include > >   > > +#define IMX214_REG_MODE_SELECT         0x0100 > > +#define IMX214_MODE_STANDBY            0x00 > > +#define IMX214_MODE_STREAMING          0x01 > > + > >  #define IMX214_DEFAULT_CLK_FREQ        24000000 > >  #define IMX214_DEFAULT_LINK_FREQ 480000000 > >  #define IMX214_DEFAULT_PIXEL_RATE ((IMX214_DEFAULT_LINK_FREQ * > > 8LL) / 10) > >  #define IMX214_FPS 30 > >  #define IMX214_MBUS_CODE MEDIA_BUS_FMT_SRGGB10_1X10 > >   > > +/* Exposure control */ > > +#define IMX214_REG_EXPOSURE            0x0202 > > +#define IMX214_EXPOSURE_MIN            0 > > +#define IMX214_EXPOSURE_MAX            3184 > > +#define IMX214_EXPOSURE_STEP           1 > > +#define IMX214_EXPOSURE_DEFAULT                0x0c70 > > I like this change, and I see that 0x0c70 was directly moved here > from > the code below. But could we replace 0xc70 here with 3184 please so > that > it's /far/ clearer that the Exposure Default == Exposure Max which is > otherwise hidden? > Hi Kieran, I can do that. But I propose to replace 3184 with 0x0c70 instead. Because that matches the entries used in the reg_8 lists mode_4096x2304[] and mode_1920x1080[]. {0x0202, 0x0C}, {0x0203, 0x70}, What do you think? Regards, André > -- > Regards > > Kieran >