Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp338887rwa; Sat, 20 Aug 2022 04:59:19 -0700 (PDT) X-Google-Smtp-Source: AA6agR4SnJMyc4v5pUXIvC8eMEa24rLtjMlZIRcMu+vEJnXwK990lA94+Edn/7USAL7/lFAEfuz+ X-Received: by 2002:a17:902:d4c9:b0:172:d64f:c861 with SMTP id o9-20020a170902d4c900b00172d64fc861mr1679283plg.169.1660996759402; Sat, 20 Aug 2022 04:59:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660996759; cv=none; d=google.com; s=arc-20160816; b=1BXOa2lQ1i4Zmpc6C36hbRF0qYJ60jam1vXvdJJ8s4ph8fakCOVet/S50hliAuJlok bMDpFBRg5fNvSJGw/2hckNsM1zDJWkOfoE7ZV6tQZhJpaGcxobcrNYMV7xbGOuwQy2rh cCWt9qTtxmZaBb1E4j8m9uzCJzPnXkpb+VLihYdYbqZt/PcnUglRQawzIzh02iYUZUfE tE+4K7cyHa0uKJnqDGmXaKv4YUMiO3ygwcsQvEYLEB4fQgiy1psrqaHG1dRlQk1Py5/y OjaFZdLZTTMIquNQSj67l8hxxjgwD3n3qPxs636/ro1dvjjswUo/dABBybobiC48wxdW teKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=zotOm0vBh1bAyStOxbTUWhJnvDJfpZ7ViTlQOLUMO7s=; b=PBDqXoxateweTqjxmCnxi+aatzIKhe96EwQ3DNwAOiWbCbSvlZelIjMN8aAfmCSWgX u99wcobpQrCCd/nY7ZAF7cJ5Fz4tSlja+PR+v3NEhUllSap1rPxOycRtREgpUNu+fxYS yegE/bh5I19FLKqvttW1CrZ6VllKqpYvMOwC+DYpsky4TBruyPaGkHqEN3ZyRUqcsIp9 jb6E+tiRVPb5iwRTHPk3hoYecThPH1s0UR6CP6KqmoYg65kB6X4TxWyH/g+LX7GMMbIR AlEKokbnIMdNey7jIdInsash+LSyvnE29O1QpgTZ7a04ACC8spBhFA45n2PCCOFylOl+ 9wiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QSAG70Ia; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u191-20020a6385c8000000b0042a435480e3si4286557pgd.457.2022.08.20.04.59.08; Sat, 20 Aug 2022 04:59:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QSAG70Ia; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345326AbiHTLir (ORCPT + 99 others); Sat, 20 Aug 2022 07:38:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242181AbiHTLin (ORCPT ); Sat, 20 Aug 2022 07:38:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BEEF02871C; Sat, 20 Aug 2022 04:38:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5BA86611B9; Sat, 20 Aug 2022 11:38:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C5BCC433D6; Sat, 20 Aug 2022 11:38:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660995519; bh=bbIuWX9FCmBU5zm1BMbNPSQGHmgBuPYgOyeviySP8Ng=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=QSAG70IaZuT42LuF6WAEbBfOmcMgfg/1cxbkPFlqS/tx5gwjsDYgnwoVYlI45qnBK wCDzrPPfhfZXQGlbizTIdIlx7IKDbPP26hBFpbXbARyz4yEwcKEzvfa4PnYwwxPz8j vzu0FqVbscYgvqPd5g1RJUuvEEEDOMdc0QFL8yc29hABiASGqtdBVINcqUZU4GY7cS qeMl9e8liIf57Hb8iPOEw9LVJpX3+46S1troomkP1IM5Y68ZqkuuV9s4jIY1S/3KL1 1qWMQ9ftlW6RGtf5VCykp3XTAqSXpJ46zbOITwZBiS3aUTy3PpzJLYsO7w8BpTkAWg 2urdTVmXcyUMw== Date: Sat, 20 Aug 2022 12:49:15 +0100 From: Jonathan Cameron To: Andy Shevchenko Cc: Eddie James , linux-iio , Lars-Peter Clausen , Linux Kernel Mailing List , Joel Stanley Subject: Re: [PATCH v4 1/2] iio: pressure: dps310: Refactor startup procedure Message-ID: <20220820124915.5dd5b745@jic23-huawei> In-Reply-To: References: <20220809211246.251006-1-eajames@linux.ibm.com> <20220809211246.251006-2-eajames@linux.ibm.com> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Fri, 19 Aug 2022 12:42:00 +0300 Andy Shevchenko wrote: > On Mon, Aug 15, 2022 at 4:42 PM Eddie James wrote: > > On 8/12/22 17:03, Andy Shevchenko wrote: > > > On Wed, Aug 10, 2022 at 12:12 AM Eddie James wrote: > > ... > > > >> + rc = regmap_write(data->regmap, 0x0e, 0xA5); > > >> + if (rc) > > >> + return rc; > > >> + > > >> + rc = regmap_write(data->regmap, 0x0f, 0x96); > > >> + if (rc) > > >> + return rc; > > > This code already exists, but still want to ask, is it really > > > byte-registers here and not be16/le16 one? In such a case perhaps bulk > > > write can be used to reflect it better? > > > > The temperature and pressure regs are 24 bits big endian, and all the > > rest are 8 bits. I think the existing approach is best. > > It doesn't look like you got what I was meaning... Or I misunderstood > what you said. > > The code above writes two byte values to two sequential registers > which make me think that they are 16-bit registers at offset 0x0e. Given they are undocumented, this is guessing territory. Probably best to just leave them as is. You could do a bulk write on an array though as that implies nothing about what's in the registers -just that they happen to be next to each other. > > ... > > > >> + rc = regmap_write(data->regmap, 0x0e, 0x00); > > >> + if (rc) > > >> + return rc; > > >> + > > >> + return regmap_write(data->regmap, 0x0f, 0x00); > > Ditto. >