Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp4024447rwn; Sun, 11 Sep 2022 03:36:58 -0700 (PDT) X-Google-Smtp-Source: AA6agR4vGracdeLUsAUysYnharUdTvhonb3vlkvR5A+lflt4CJ7CxexX/hQ4ZY0KLC32xeUWYRnJ X-Received: by 2002:aa7:dc13:0:b0:443:3f15:8440 with SMTP id b19-20020aa7dc13000000b004433f158440mr17915734edu.274.1662892618075; Sun, 11 Sep 2022 03:36:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662892618; cv=none; d=google.com; s=arc-20160816; b=dR0Czk1eV+yGTaxQOyOFsMgJwn2aWYg7dluj+3FojvEYxOH0BepFN2JDH0eIH/mumC K/nXEWSOj5uWcMOeaIzSrXdn6c7/YexYphLjOjUEI4sQA85p1M5lyxBQr2YWxms/stzU EQWhD/jM651aGjl9pCwAxUVrJfb1EtmBbei1dicqtlK33pkXXvfDRFSXNq4IivfbGk2b K1XwAPaO7r54scJB3WSYxXskLD5kICN9E24RHpM38a/dCzswk0TLfkSJ0oT4ZOb+Q2/t 9KqSwLEv66oJoBmu+CGpyVYha5a03fR7xGiFHov4//69jVEKovxdkjDCm1sCQKPsvN4r bGkg== 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=KsX0ZkiLqD3MMOQpYT5NW/GLJUuvtdT5B6FV0C4n0mY=; b=sIX1Yv40lZGY1YJs06xWgwiiKQJ0GJIl3ZaGvk7CCX9PPfYWEIHwBDBVwWnmK7KuOg Eb0qxu6/7BHOiOJXELsZPpZtK/b/VA9+DtS3b3WQ2jGY/UQ497thnjCvrTo93uBWVO70 zfUh0Ohn3yStwfPjDwYUo4WGxqnTaRFXZeG0AD0FuVhaa/fxmYSrlNNlkm5lbZP3dhON RwFsNRXaDJtXFan2NisKNHd5QRGLrvyLNotN3V3qfNokzUyDLwQHg3R/jsnIgNkBlbIz v10qBP9vcr+o4W2Gk071PZPpRSGbdVagXRyqRYXTIt9MACQUNQuApePbzw+aUPwEOXSQ 8gRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N7+so8nM; 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 q12-20020a056402248c00b00447c58358d7si4832271eda.616.2022.09.11.03.36.32; Sun, 11 Sep 2022 03:36:58 -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=N7+so8nM; 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 S229978AbiIKKah (ORCPT + 99 others); Sun, 11 Sep 2022 06:30:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230142AbiIKKad (ORCPT ); Sun, 11 Sep 2022 06:30:33 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F53037F9D; Sun, 11 Sep 2022 03:30:32 -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 ams.source.kernel.org (Postfix) with ESMTPS id A95F4B802BD; Sun, 11 Sep 2022 10:30:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 038BCC433C1; Sun, 11 Sep 2022 10:30:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662892229; bh=rNnbtRFKYREYyqEB7cI/f2rBcfDDV7x9aQ18P6n205U=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=N7+so8nMUS8AntI37LqQR6aolHFhmwsq60lvM/jMkeiTpXQFl68I22dUsOd8WwsGD 6EPkPkpxMqb8qSSzQxuD+ggBeil1U8iAPZJXFfK2VfkSRaK2R9CAoKIMEe6vDJORzY S7BahXqRiDLkAYhT3T62SHhCLs7X5d26ZGOIK3q8yI6vVWDZbMEP/8e2+p1KNnNAad y+ydJKlisNDGP9uByVGa92KVdo5O/3QNjdH2VzYdFZAH7q67QVh7nHMgRHVWKwge1p kde/pwUpH1pGbdKTQW8ZEXcx4J1HjQ8cxm2QQn1aWukNMU2wHQyLYyz2H2MIpnb8ZE JE8j9S0/RFfMA== Date: Sun, 11 Sep 2022 10:56:25 +0100 From: Jonathan Cameron To: Eddie James Cc: Andy Shevchenko , 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: <20220911105625.348e3861@jic23-huawei> In-Reply-To: <85280d48-4251-2811-b66d-092f4153fbb5@linux.ibm.com> References: <20220809211246.251006-1-eajames@linux.ibm.com> <20220809211246.251006-2-eajames@linux.ibm.com> <20220820124915.5dd5b745@jic23-huawei> <85280d48-4251-2811-b66d-092f4153fbb5@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 Tue, 6 Sep 2022 14:48:20 -0500 Eddie James wrote: > On 8/20/22 06:49, Jonathan Cameron wrote: > > 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. > > > Indeed. Is it worth it to switch to bulk write for two 2-byte writes? > I'm inclined to say no and will leave this as-is for v6, but if you > think it is, I can switch it. > As far as I'm concerned, fine either way. Jonathan > > Thanks, > > Eddie > > > > > >> ... > >> > >>>>> + rc = regmap_write(data->regmap, 0x0e, 0x00); > >>>>> + if (rc) > >>>>> + return rc; > >>>>> + > >>>>> + return regmap_write(data->regmap, 0x0f, 0x00); > >> Ditto. > >>