Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1712914rwb; Sun, 14 Aug 2022 10:11:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR5U9Jzs61uv0rraepyGaNMpKaSERIw49CbPSmnXzjSbxkFtDCZJZKgziA5Y5+Lc+/dfU+5b X-Received: by 2002:a17:906:4fc6:b0:731:137:8656 with SMTP id i6-20020a1709064fc600b0073101378656mr8213591ejw.582.1660497064101; Sun, 14 Aug 2022 10:11:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660497064; cv=none; d=google.com; s=arc-20160816; b=HpCHiNiHiQtKucTmM8kVMaeL4hTmiNxtfaG1kEm8WYyU1oC9CnjLn8c84c5IPG6gnn lWcD3jIaU8OLhDcmiqsIyXWaFgFqPG+vI9ZBoc230gCcpuMLMDkAYjBrUbcgKBCOVpGK Ue8LsUclBLf89DVGvJUAelN5jtgW1wpQOivQE/1IGwYhdR8zYy9RfRF9JVmyqSl13kjU R39za5RzSG+S8IBmik7mTWbBCV8WOFP2TYDDq8IRo8wGOuMJLmmlHm3rqIfra8PoaehV pOyDUsjQbx8GuZlHAbkp7Cgisyzcze0NHifQDK0TzC6n9MOYMhLp6I8mTqiVkBssfqex 33Gg== 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=RL+0M9cIiTLmxzd72a+9RACRNCgxXCIN+m/D/3ZjnU8=; b=n5iVedO4nytIqa0/+v7FpVGbKXvxM8cLAkz6Lbw/o0GhQmJloy7IUdSM5Sd6RV8sm4 y8E1azkyNfBxspcyg9NZagIjMjlB26CFXD8QeU9nafzzB987YrlmwEc5ZT4J6zDEjfV/ WDQbZpoNllv2/ZSthKk16BSr0CLSy5bfvl1CrEMkcXnEI4w2ERyls1xOPWwAhTFy793K IWdw2Dd6jFpAs87Qngxa33XzlGQgmyMiSWv2nQ56isn0aQ0Im+IplmwhDJh4ypFLY8eS KL9wHxx4Uhuj5PhP35OtZT91aiEGtJ3TihLSY3CbNbEnSJO06LghPCu6KZfcv3twGtdZ 0BAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=n7vVb891; 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 y13-20020a50ce0d000000b00435681044a9si5914887edi.372.2022.08.14.10.10.37; Sun, 14 Aug 2022 10:11:04 -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=n7vVb891; 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 S239784AbiHNQ5Z (ORCPT + 99 others); Sun, 14 Aug 2022 12:57:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241827AbiHNQ5B (ORCPT ); Sun, 14 Aug 2022 12:57:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 403D11EC46; Sun, 14 Aug 2022 09:46:29 -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 AF6E5603F6; Sun, 14 Aug 2022 16:46:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A0C2C433D6; Sun, 14 Aug 2022 16:46:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660495588; bh=yyw6coq5uenQ2Z/EFRGEVGSSgqlo1xB9T6OhB8ulWI0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=n7vVb891z3+DuQcx4hnlX4aNALJLAaeRVMbG+VkIvLIIKeg9McY+1f7o9Z5b0ELr8 99woumZLIk41hUfOg6BLo1VP5+dqCGEDmgWoOFZ5e2Yqr3paMCwg1JKB+p7+Fpsi6U QZgOTM2xoDeAXvr7bI4tv8I6z0NEKh3a24+MYnYdzSnrGVWwGkZg2d5fzaohEvSjpp XsOa4owsGZuYsgcV2vMhw7c1w5QaoeSzGAfyG/r6UvU5WpwJCwSZaeNJ4iLoCi2Rk/ 1NsI9NIBgklhFBaeQxLZWnViIscHRc+TQf+OnX7vEHf2EvcmAlOz0nX0P3Zec6AEas VW6ymFlWyV0iA== Date: Sun, 14 Aug 2022 17:56:56 +0100 From: Jonathan Cameron To: Angel Iglesias Cc: linux-iio , Lars-Peter Clausen , Andy Shevchenko , Nikita Yushchenko , Ulf Hansson , "Rafael J. Wysocki" , Paul Cercueil , linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 3/5] iio: pressure: bmp280: Add support for BMP380 sensor family Message-ID: <20220814175656.1d09f897@jic23-huawei> In-Reply-To: <53b0132936a98943fb4284c4f72e3f4e6faa402d.camel@gmail.com> References: <462251c4bca30b53f06307043ad52d859eb8d5c1.1659872590.git.ang.iglesiasg@gmail.com> <20220814151512.097c7779@jic23-huawei> <53b0132936a98943fb4284c4f72e3f4e6faa402d.camel@gmail.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=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.2 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 Sun, 14 Aug 2022 16:37:58 +0200 Angel Iglesias wrote: > On Sun, 2022-08-14 at 15:15 +0100, Jonathan Cameron wrote: > > On Sun,=C2=A0 7 Aug 2022 13:55:52 +0200 > > Angel Iglesias wrote: > > =20 > > > Adds compatibility with the new generation of this sensor, the BMP380 > > >=20 > > > Includes basic sensor initialization to do pressure and temp > > > measurements and allows tuning oversampling settings for each channel. > > >=20 > > > The compensation algorithms are adapted from the device datasheet and > > > the repository https://github.com/BoschSensortec/BMP3-Sensor-API > > >=20 > > > Signed-off-by: Angel Iglesias =20 > >=20 > > One additional comment from me inline. > >=20 > > Thanks, > >=20 > > Jonathan > >=20 > > =20 > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} > > > @@ -1124,6 +1471,13 @@ int bmp280_common_probe(struct device *dev, > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0return -EINVAL; > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} > > > =C2=A0 > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* BMP3xx requires soft-re= set as part of initialization */ > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (chip_id =3D=3D BMP380_= CHIP_ID) { =20 > >=20 > > I'd prefer this to be based on a flag in chip_info so that we can > > trivially add it to future devices by just setting that flag for the > > chip_info added for the new device. =20 >=20 > How a new init or preinit callback? For now only BMP380 chip would use it= , but I > would like to get my hands on a BMP390 and the new BMP580 and extend the = driver > to support for them. Hmm. Good point, I'd failed to noticed the register is bmp380 specific curr= ently. Maybe one to leave for a future refactor if you get those newer parts. Jonathan >=20 > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0ret =3D bmp380_cmd(data, BMP380_CMD_SOFT_RESET); > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0if (ret < 0) > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0ret= urn ret; > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} > > > + > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0ret =3D data->chip_in= fo->chip_config(data); > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (ret < 0) > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0return ret; =20 > > =20 >=20 > Kind regards, > Angel