From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16AFAC25B06 for ; Sun, 14 Aug 2022 14:38:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231902AbiHNOiE (ORCPT ); Sun, 14 Aug 2022 10:38:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231892AbiHNOiD (ORCPT ); Sun, 14 Aug 2022 10:38:03 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91B441581B; Sun, 14 Aug 2022 07:38:01 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id bs25so6414387wrb.2; Sun, 14 Aug 2022 07:38:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc; bh=espo5Jw5sWu9O5noOsv3BtZvfu0CnVnvAhoBUKVmfr0=; b=PJoPqZAYOVZ0/HM/DD7vPkhRRMoCL663palCKJjlwBO+bepesRU6eX6PEEsFslPnQE 7anhly6UjGx2p8Mt3BOAjipJ4BpJ4vnRxNp5OuV6tnDSMeP4lTo/wfznkRWd+5skeZYX MglyrpMD6tbjzPSD2fxBiokrrneT3re5lJj4V11TrdFelL/GKcRF39z1zsEByxUvZjXD IANWUEzy8l17KyMZlyyIgbeti1tSL+d6yz8UaBEHEkkWEHaSR8z+b5VCfBoD5YFbjtB2 fa0ytVBJaaC526pL4jzIc7oXTZnJ9yzHO8o1VXPbUWoWWc+rMRzSzw7W6Z/T5FSwLlZP Q65w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc; bh=espo5Jw5sWu9O5noOsv3BtZvfu0CnVnvAhoBUKVmfr0=; b=QwqsGksw5d+AcS1pnLqG7dvmOXmBcjJH0gC3pfmRVpLrINYe2OLkDFCtpG6zv0DzBJ YB4Sikb9rYIm9Gv3J+kdMxHb9+qxAvXXEVVKWUGGWV72f7/C57GR2a0TtGYSRnA+H6RA g+EXuwbzGUC10UGPTD+RYqmdXhc7nBNrhTgU4ih79ybc2VZxJsiSGX56Vd4cfBpWyAN4 g302h7/tc20Gz0vD9xCoXZ5Own17JOv77du86EXKwdpxPWOCIbC4UXUuqSbWKf+lhN/T y0joLqsrI/2bDrpsUVEQfnz7TFWYv8HnrxXqZKm6RLmWqQKH1vccQXHKiZ9ZgYXPPqC2 1WmQ== X-Gm-Message-State: ACgBeo1juV/IbVc+i3YTzN4kwoJTlyfFOpxJ3bKA+uAFjelVd0yQeTSc T6M5XNZVaEiB+1n31uXKze8= X-Google-Smtp-Source: AA6agR7dxhtvBR7RZSWcvPn39LFFZm1dHGpaIpdtlSL3Uf1PD6Pa3ToS4qQCoim5h3SoH9xmqteo6A== X-Received: by 2002:a5d:64e9:0:b0:220:7dd7:63eb with SMTP id g9-20020a5d64e9000000b002207dd763ebmr6460123wri.590.1660487880069; Sun, 14 Aug 2022 07:38:00 -0700 (PDT) Received: from [192.168.90.207] (188.red-83-35-57.dynamicip.rima-tde.net. [83.35.57.188]) by smtp.gmail.com with ESMTPSA id h13-20020a5d430d000000b00224f605f39dsm3748037wrq.76.2022.08.14.07.37.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Aug 2022 07:37:59 -0700 (PDT) Message-ID: <53b0132936a98943fb4284c4f72e3f4e6faa402d.camel@gmail.com> Subject: Re: [PATCH v5 3/5] iio: pressure: bmp280: Add support for BMP380 sensor family From: Angel Iglesias To: Jonathan Cameron Cc: linux-iio , Lars-Peter Clausen , Andy Shevchenko , Nikita Yushchenko , Ulf Hansson , "Rafael J. Wysocki" , Paul Cercueil , linux-kernel@vger.kernel.org Date: Sun, 14 Aug 2022 16:37:58 +0200 In-Reply-To: <20220814151512.097c7779@jic23-huawei> References: <462251c4bca30b53f06307043ad52d859eb8d5c1.1659872590.git.ang.iglesiasg@gmail.com> <20220814151512.097c7779@jic23-huawei> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.module_f35+14217+587aad52) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On Sun, 2022-08-14 at 15:15 +0100, Jonathan Cameron wrote: > On Sun,  7 Aug 2022 13:55:52 +0200 > Angel Iglesias wrote: > > > Adds compatibility with the new generation of this sensor, the BMP380 > > > > Includes basic sensor initialization to do pressure and temp > > measurements and allows tuning oversampling settings for each channel. > > > > The compensation algorithms are adapted from the device datasheet and > > the repository https://github.com/BoschSensortec/BMP3-Sensor-API > > > > Signed-off-by: Angel Iglesias > > One additional comment from me inline. > > Thanks, > > Jonathan > > > >         } > > @@ -1124,6 +1471,13 @@ int bmp280_common_probe(struct device *dev, > >                 return -EINVAL; > >         } > >   > > +       /* BMP3xx requires soft-reset as part of initialization */ > > +       if (chip_id == BMP380_CHIP_ID) { > > 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. 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. > > +               ret = bmp380_cmd(data, BMP380_CMD_SOFT_RESET); > > +               if (ret < 0) > > +                       return ret; > > +       } > > + > >         ret = data->chip_info->chip_config(data); > >         if (ret < 0) > >                 return ret; > Kind regards, Angel