From patchwork Wed Aug 23 15:58:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angel Iglesias X-Patchwork-Id: 13362803 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 3939DEE4993 for ; Wed, 23 Aug 2023 15:58:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237367AbjHWP64 (ORCPT ); Wed, 23 Aug 2023 11:58:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232171AbjHWP6z (ORCPT ); Wed, 23 Aug 2023 11:58:55 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12463E6E; Wed, 23 Aug 2023 08:58:54 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-31ae6bf91a9so4607963f8f.2; Wed, 23 Aug 2023 08:58:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692806332; x=1693411132; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DqdYH9doSRvp2JH1D1rlVrHQrKY8RQikW+rUObWbAko=; b=aXSyEPPqSAMJ6+JPKCnCD+RrsG2+xVlrOxSjGYKnbrorVip9Ci7LKJQ/Yrij0fGKzF iEppPgJg2SupU8R1Zg4MzM5Lf2ogLDvgnTtVAXv+T27I/ETxvsX+Ecn35Yn6BEFtUV5V vGADv7eMMk1PbOjdgfS/azPQ6I/wvBfn9CBxLWMDN9XsRbkgJwTxDQytnaNVD0rOyoAP dkZGpOUwSJWXfsceUQzm1Vmj+X1eJygNtTG6DD7SCWeNIG2/JoUe6t1bm2IVsYxevGZq K61ouGmsMvcHjrTfcOQKwyCaBm1GJ8P17/TEHjnBZ/A/Waaol8+FxtLx5CwSzXTgVGc1 eFug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692806332; x=1693411132; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DqdYH9doSRvp2JH1D1rlVrHQrKY8RQikW+rUObWbAko=; b=hagRIeqImcbHfsjiQDvJ+fFhfMFNVmemAAuGIodf4squvvtiSpF2IvhB7JvyXWqQrx AfH5RxDvP9CowAyx1LisTnXfIubFJu7SI8PJbe/Za+hRkEwYMxH2BiJ2nABPNveotkfT KdDMaZ+K5sqqmie75rzggpUU1gFbyu4wr8sZnhfUYybVT2ucN/fjwAF8fsutNKv0pgXr NawWrhyO0a+LDdtcyk3DSBj86CGET4pIIacf1O/35s9lDFP4fhUKT/vyvM+Hz7vT186Z AHCcWgVdWmCd5mte0zBUMPTTZe/JXF2RLAori5YfX9nFM2S7urDAxQAhGQscB1EuEQZu BwSQ== X-Gm-Message-State: AOJu0YyWr2h2LPhHgP91lg94xsUcWHybsm5Hz/mMMXu6KgoVhKQgccPG FQl7H6DLGUh7RtprM2O3VbwdZkKMioo= X-Google-Smtp-Source: AGHT+IHkTN7Z9GeeDmillfrS3M+Nu9K4B6bWlzat2COel2SfLV9iNqkSMvGDXkYiK3aK6li1hxitPw== X-Received: by 2002:adf:fcca:0:b0:319:85e2:6972 with SMTP id f10-20020adffcca000000b0031985e26972mr9150195wrs.42.1692806332129; Wed, 23 Aug 2023 08:58:52 -0700 (PDT) Received: from localhost.localdomain (35.red-83-35-63.dynamicip.rima-tde.net. [83.35.63.35]) by smtp.gmail.com with ESMTPSA id t24-20020a7bc3d8000000b003fe195cecb3sm17044613wmj.38.2023.08.23.08.58.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 08:58:51 -0700 (PDT) From: Angel Iglesias To: linux-iio@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Angel Iglesias , Jonathan Cameron , Lars-Peter Clausen , Andy Shevchenko Subject: [PATCH v2 1/3] iio: pressure: bmp280: Use uint8 to store chip ids Date: Wed, 23 Aug 2023 17:58:05 +0200 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Represent the device id reg values using uint8 to optimize memory use. Signed-off-by: Angel Iglesias diff --git a/drivers/iio/pressure/bmp280.h b/drivers/iio/pressure/bmp280.h index 5c0563ce7572..ff72e82f55ad 100644 --- a/drivers/iio/pressure/bmp280.h +++ b/drivers/iio/pressure/bmp280.h @@ -418,7 +418,7 @@ struct bmp280_data { struct bmp280_chip_info { unsigned int id_reg; - const unsigned int chip_id; + uint8_t chip_id; const struct regmap_config *regmap_config; From patchwork Wed Aug 23 15:58:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angel Iglesias X-Patchwork-Id: 13362804 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 90E27EE4993 for ; Wed, 23 Aug 2023 15:59:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237381AbjHWP7A (ORCPT ); Wed, 23 Aug 2023 11:59:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237379AbjHWP7A (ORCPT ); Wed, 23 Aug 2023 11:59:00 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77193E7B; Wed, 23 Aug 2023 08:58:57 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3ff1c397405so7182695e9.3; Wed, 23 Aug 2023 08:58:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692806335; x=1693411135; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aKUVthr6t5bmWGdyIQiDlm1KkqWyaS0Rldoy3Q9+o54=; b=l7C03TEoGxnD0VjymYuY7aMYiCLzSvNfIDcsiS8MpyB2/d3kedhiHsbNmp+eT3O1jz aZrFlUMUn+fw78BvF7Jfco7kTLmxShGys4HUG35uiWPRiUVy4CBjtPQXI7d/kHg6+Gb+ nLA9QxTnqjmdNs0+9YkLciQknTtOFJwEOB/PxNRcqLVNXI4uAM71od3T/TughtZ026wn wLPR4y3stynXoEjOom9l6wy6fJl/oLWlUDWSXEjCeFMsg6Q+Bww5ZBOCZbfvqktw736g Zya7FhVvwYupa3QsAQUL4daG89r7JKzH9lPYhMmGnNvrIgySwtf5gXTaE0IkoHN8jZT6 kJ7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692806335; x=1693411135; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aKUVthr6t5bmWGdyIQiDlm1KkqWyaS0Rldoy3Q9+o54=; b=PIsqgs9+Be91Rs8yoBQbjAihGw25F6dNXz0GRHvNBXYxm39JZiUrH8YRKdPeYaY3U4 N+/u6vTUa9X/gDVxh2+5ne+vTjF0YMJHtLQoQHdYjokRb3sZY6I3tmHi2tfh+ZEJluJE VQ2HMpsMeYztwUW2k0m5AmOSP9VJI9n9WNo8zxXe0MVb8MiwWDeYjEBd0RlyXExWSDis azYq2XTsdQD8vYhM2/RctibHvoK/sxQ4xwCfB8RyjN2FmmPxs4x3fOkHNZhdlZ7ITrbU ADlerBMvdNY1WX6HeiOisP23SyrhzSxiOOW6Y1/gvAvzcN6X58ZOZAe8Q9jYDInIOcfh t7TQ== X-Gm-Message-State: AOJu0YyFgK5cQjLnENL9nqJJqhYJy2Yuj02U3/jJ2GJEOp5xsl81tUi6 HdlKTuyd7+BMKsVrJF0A7J33cuN4aq0= X-Google-Smtp-Source: AGHT+IFXMTP4E2+qXRT8jTrU+745y0DWfAbqvC1SfwZn2qNCyfR/9vbAYlW9Bj6fKB6lbqy7Kcxu9A== X-Received: by 2002:a05:600c:255:b0:3fa:97ad:2ba5 with SMTP id 21-20020a05600c025500b003fa97ad2ba5mr9632016wmj.31.1692806335466; Wed, 23 Aug 2023 08:58:55 -0700 (PDT) Received: from localhost.localdomain (35.red-83-35-63.dynamicip.rima-tde.net. [83.35.63.35]) by smtp.gmail.com with ESMTPSA id t24-20020a7bc3d8000000b003fe195cecb3sm17044613wmj.38.2023.08.23.08.58.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 08:58:55 -0700 (PDT) From: Angel Iglesias To: linux-iio@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Angel Iglesias , Jonathan Cameron , Lars-Peter Clausen , Andy Shevchenko Subject: [PATCH v2 2/3] iio: pressure: bmp280: Allow multiple chips id per family of devices Date: Wed, 23 Aug 2023 17:58:06 +0200 Message-ID: <7bdfbfeb106acc5560e6cb090131f105b2d2e418.1692805377.git.ang.iglesiasg@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Improve device detection in certain chip families known to have various chip ids. Signed-off-by: Angel Iglesias diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c index 6089f3f9d8f4..4a544a20d6cb 100644 --- a/drivers/iio/pressure/bmp280-core.c +++ b/drivers/iio/pressure/bmp280-core.c @@ -40,6 +40,7 @@ #include #include #include +#include #include @@ -794,10 +795,12 @@ static int bmp280_chip_config(struct bmp280_data *data) } static const int bmp280_oversampling_avail[] = { 1, 2, 4, 8, 16 }; +static const uint8_t bmp280_chip_ids[] = { BMP280_CHIP_ID }; const struct bmp280_chip_info bmp280_chip_info = { .id_reg = BMP280_REG_ID, - .chip_id = BMP280_CHIP_ID, + .chip_id = bmp280_chip_ids, + .num_chip_id = ARRAY_SIZE(bmp280_chip_ids), .regmap_config = &bmp280_regmap_config, .start_up_time = 2000, .channels = bmp280_channels, @@ -846,9 +849,12 @@ static int bme280_chip_config(struct bmp280_data *data) return bmp280_chip_config(data); } +static const uint8_t bme280_chip_ids[] = { BME280_CHIP_ID }; + const struct bmp280_chip_info bme280_chip_info = { .id_reg = BMP280_REG_ID, - .chip_id = BME280_CHIP_ID, + .chip_id = bme280_chip_ids, + .num_chip_id = ARRAY_SIZE(bme280_chip_ids), .regmap_config = &bmp280_regmap_config, .start_up_time = 2000, .channels = bmp280_channels, @@ -1220,10 +1226,12 @@ static int bmp380_chip_config(struct bmp280_data *data) static const int bmp380_oversampling_avail[] = { 1, 2, 4, 8, 16, 32 }; static const int bmp380_iir_filter_coeffs_avail[] = { 1, 2, 4, 8, 16, 32, 64, 128}; +static const uint8_t bmp380_chip_ids[] = { BMP380_CHIP_ID }; const struct bmp280_chip_info bmp380_chip_info = { .id_reg = BMP380_REG_ID, - .chip_id = BMP380_CHIP_ID, + .chip_id = bmp380_chip_ids, + .num_chip_id = ARRAY_SIZE(bmp380_chip_ids), .regmap_config = &bmp380_regmap_config, .start_up_time = 2000, .channels = bmp380_channels, @@ -1720,10 +1728,12 @@ static int bmp580_chip_config(struct bmp280_data *data) } static const int bmp580_oversampling_avail[] = { 1, 2, 4, 8, 16, 32, 64, 128 }; +static const uint8_t bmp580_chip_ids[] = { BMP580_CHIP_ID, BMP580_CHIP_ID_ALT }; const struct bmp280_chip_info bmp580_chip_info = { .id_reg = BMP580_REG_CHIP_ID, - .chip_id = BMP580_CHIP_ID, + .chip_id = bmp580_chip_ids, + .num_chip_id = ARRAY_SIZE(bmp580_chip_ids), .regmap_config = &bmp580_regmap_config, .start_up_time = 2000, .channels = bmp380_channels, @@ -1983,10 +1993,12 @@ static int bmp180_chip_config(struct bmp280_data *data) static const int bmp180_oversampling_temp_avail[] = { 1 }; static const int bmp180_oversampling_press_avail[] = { 1, 2, 4, 8 }; +static const uint8_t bmp180_chip_ids[] = { BMP180_CHIP_ID }; const struct bmp280_chip_info bmp180_chip_info = { .id_reg = BMP280_REG_ID, - .chip_id = BMP180_CHIP_ID, + .chip_id = bmp180_chip_ids, + .num_chip_id = ARRAY_SIZE(bmp180_chip_ids), .regmap_config = &bmp180_regmap_config, .start_up_time = 2000, .channels = bmp280_channels, @@ -2077,7 +2089,7 @@ int bmp280_common_probe(struct device *dev, struct bmp280_data *data; struct gpio_desc *gpiod; unsigned int chip_id; - int ret; + int ret, i; indio_dev = devm_iio_device_alloc(dev, sizeof(*data)); if (!indio_dev) @@ -2142,10 +2154,31 @@ int bmp280_common_probe(struct device *dev, ret = regmap_read(regmap, data->chip_info->id_reg, &chip_id); if (ret < 0) return ret; - if (chip_id != data->chip_info->chip_id) { - dev_err(dev, "bad chip id: expected %x got %x\n", - data->chip_info->chip_id, chip_id); - return -EINVAL; + + for (i = 0; i < data->chip_info->num_chip_id; i++) { + if (chip_id == data->chip_info->chip_id[i]) + break; + } + + if (i == data->chip_info->num_chip_id) { + size_t nbuf; + char *buf; + + // 0x, so four chars per number plus one space + ENDL + if (check_mul_overflow(5, data->chip_info->num_chip_id, &nbuf)) + return ret; + + buf = kmalloc_array(nbuf, sizeof(char), GFP_KERNEL); + if (!buf) + return ret; + + for (i = 0; i < data->chip_info->num_chip_id; i++) + snprintf(&buf[i*5], nbuf, "0x%x ", data->chip_info->chip_id[i]); + buf[nbuf-1] = '\0'; + + dev_err(dev, "bad chip id: expected [ %s ] got 0x%x\n", buf, chip_id); + kfree(buf); + return ret; } if (data->chip_info->preinit) { diff --git a/drivers/iio/pressure/bmp280.h b/drivers/iio/pressure/bmp280.h index ff72e82f55ad..c2acc9315223 100644 --- a/drivers/iio/pressure/bmp280.h +++ b/drivers/iio/pressure/bmp280.h @@ -418,7 +418,8 @@ struct bmp280_data { struct bmp280_chip_info { unsigned int id_reg; - uint8_t chip_id; + const uint8_t *chip_id; + int num_chip_id; const struct regmap_config *regmap_config; From patchwork Wed Aug 23 15:58:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angel Iglesias X-Patchwork-Id: 13362805 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 32A29EE49A0 for ; Wed, 23 Aug 2023 15:59:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237375AbjHWP7F (ORCPT ); Wed, 23 Aug 2023 11:59:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232171AbjHWP7E (ORCPT ); Wed, 23 Aug 2023 11:59:04 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91D5710C1; Wed, 23 Aug 2023 08:59:00 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-400a087b0bfso3684505e9.2; Wed, 23 Aug 2023 08:59:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692806339; x=1693411139; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TDcQFVm5HdglSU0dZiKU1iAD22HC6I1kyuCmnz9csnQ=; b=h0SUl/VCmypPZaNRwY1nv4rcSwMvtdlO5R+R+9IfLNkiID/ItjgFZri7FcEbeSMmig D3oAYgbTQ7Yq47jhR7hm1EuRONTmRVow9u44b5iUnsLsu/+LkPKFBTh7D0b6u9zYtYv9 EnMWKHaQQ/HVa+wkUEVzXYqvY1XVrLnyssfG3ZhHrxmiBm3PJUbBHfCl8OGVfAc2Z6M3 hYM7qXu9DfQlgu0NUgB3Qh6Axf7a8ZoPm4OE3H9Xeha+FLT5BNpM4HwOtDZvi+lAX9MW FItpPCCahbZNFcQFFAa8F26HRT8Meq53cIcjtNgo1sZWvuzmdJ7pmV0SIUjsN8HUTUT/ cdoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692806339; x=1693411139; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TDcQFVm5HdglSU0dZiKU1iAD22HC6I1kyuCmnz9csnQ=; b=mFxi8jl+IXLUsfxwA0i/+i+xot704BSJgWjdKCKb3/HZf/rAqw54CSui8mfhK+RhOC S1U5CDWEOD2tTvHWDOqlMfZ+tF/rI8SeW50C7pqQhhDfyuKRY8hGnPUFyee+3kz3MuMw +YatLZhN1ExJGqrIDzNYB+IxdJRBhPYlxR3XlhioJXoVIkIDrXdULrwR9vasXBt56VzL XPY14rGRfBMm9dflImUjud/xuAJbQetU6dapkqYCe6ZbNiMFlvq0KQyVNdJND0Rnji1q Wo8faoLQSJJouMKctX29ZyfsIWViIpKkXGhOJhKi9M3agf4fdDHQ7DB+cEefpqPNunV1 vQLA== X-Gm-Message-State: AOJu0YzshcpsjYUQgeETOY/Rhcy0lCWuuLhVc+ralrMdcJ3uO18q8Q/m jyxLdIQh8KU9/V324D5Aj0X2h5ZlNco= X-Google-Smtp-Source: AGHT+IH08pv5jEnSd9N0g0myKkPsS+O7VIKhyG1EAZOsEbSxNy2qjpsRjLezPQ8ipXwBTiKDprDkQA== X-Received: by 2002:a05:600c:28b:b0:3fe:2108:eb8e with SMTP id 11-20020a05600c028b00b003fe2108eb8emr10108210wmk.34.1692806338837; Wed, 23 Aug 2023 08:58:58 -0700 (PDT) Received: from localhost.localdomain (35.red-83-35-63.dynamicip.rima-tde.net. [83.35.63.35]) by smtp.gmail.com with ESMTPSA id t24-20020a7bc3d8000000b003fe195cecb3sm17044613wmj.38.2023.08.23.08.58.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 08:58:58 -0700 (PDT) From: Angel Iglesias To: linux-iio@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Angel Iglesias , Jonathan Cameron , Lars-Peter Clausen , Andy Shevchenko Subject: [PATCH v2 3/3] iio: pressure: bmp280: Add support for BMP390 Date: Wed, 23 Aug 2023 17:58:07 +0200 Message-ID: <52adecef119e65e145669925e4a355a84e7f84d9.1692805377.git.ang.iglesiasg@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Adds BMP390 device id to the supported ids on bmp380 sensor family Signed-off-by: Angel Iglesias diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c index 4a544a20d6cb..d679a5644d16 100644 --- a/drivers/iio/pressure/bmp280-core.c +++ b/drivers/iio/pressure/bmp280-core.c @@ -13,6 +13,7 @@ * https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmp280-ds001.pdf * https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bme280-ds002.pdf * https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmp388-ds001.pdf + * https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmp390-ds002.pdf * https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmp581-ds004.pdf * * Notice: @@ -1226,7 +1227,7 @@ static int bmp380_chip_config(struct bmp280_data *data) static const int bmp380_oversampling_avail[] = { 1, 2, 4, 8, 16, 32 }; static const int bmp380_iir_filter_coeffs_avail[] = { 1, 2, 4, 8, 16, 32, 64, 128}; -static const uint8_t bmp380_chip_ids[] = { BMP380_CHIP_ID }; +static const uint8_t bmp380_chip_ids[] = { BMP380_CHIP_ID, BMP390_CHIP_ID }; const struct bmp280_chip_info bmp380_chip_info = { .id_reg = BMP380_REG_ID, diff --git a/drivers/iio/pressure/bmp280.h b/drivers/iio/pressure/bmp280.h index c2acc9315223..d536e123ef14 100644 --- a/drivers/iio/pressure/bmp280.h +++ b/drivers/iio/pressure/bmp280.h @@ -292,6 +292,7 @@ #define BMP580_CHIP_ID_ALT 0x51 #define BMP180_CHIP_ID 0x55 #define BMP280_CHIP_ID 0x58 +#define BMP390_CHIP_ID 0x60 #define BME280_CHIP_ID 0x60 #define BMP280_SOFT_RESET_VAL 0xB6