Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp58799lqp; Sun, 9 Jun 2024 16:38:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWNLA+yXWbvR7LhUJv4rZshFA8fLlB+1/21ru+ox9VoFcldANOKqi46x0nEyNbaiIs/atKGuPynMvfCiM3eZJepybxEh/f04dxeBXRHLA== X-Google-Smtp-Source: AGHT+IFSBFNzMBehgxxPj3HVxomvwLPxJ2fiOPIVbLNai8d4kmpEd1Yu8kjJL2cb+2UXhiGoT14y X-Received: by 2002:ac8:7f43:0:b0:440:5e76:7253 with SMTP id d75a77b69052e-4405e76740bmr49716541cf.6.1717976321921; Sun, 09 Jun 2024 16:38:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717976321; cv=pass; d=google.com; s=arc-20160816; b=s58Ijxoa8+uCK+fTx3K4/vcEOh9wi9tuZL9bU77W46SLYpnIL15OtH7JAMkpbYY/f/ Uwe7ijPmpJlfNiYSyUX4Z/3XPm6Fq7ZYr9cjdhik4P+ztczSHHkJehJSsJ2OO+p3CGoI XCbs8n/tJ+3yx5h1I54pIVh2EYsVn9AFTDXjj/rXPu04wVZFfVMGU22TvMEG79seNqGD khklunEvyfIsDkr7ILMev2GPImzQCHJrld0h6uy0ydE8ASr+7ajyanv1D6zSr/Rvia8S KAhOQxstbfWg3159cwE4TlxIFyrK6eqvxahFqKmyFaIk0gA6k+D0BgVWIoO+d9nezoN4 C8sQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=02MNU9GYhtO+IwacgDb9GmG63HRnt1F+VZqY4FJZbpg=; fh=LoaLNDvk6tD3G3Xz5mxcVxS9D/0jWghi96vCkPrpi2s=; b=xSBxvhzr1OMzQlhR6FHb4vsJgAFjRvCUY9C4K/u3JyMibA0XMkCFc0MvShZs0Yv0yd 2UeLo3OKLiQR61gaUAjuxy0xyB7BIpz1MxTNbuhB9cJd47Nk7xXeKXqqfgqw6+jrIPne sQN05LZRL1ArLpEwcRcmaAINCo/taaUqZ0RHb206TXwphnlWSfw6lxLK2w3ab034Eteu Lm773oD5PmQJ56wm4yVOdsC7WWBwIsYIPU3PdASBYh5n5AkgGCo/XX0tvIEXSnadm2/E 1I6+EUUsQOCaUlcG6K5HhnDGBe72cvUHOGWkzSSDofJm81loeZbMNIUyNwK+5PQQ7j/7 J+ug==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=KytWlnDM; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-207539-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207539-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-44038b7dcf3si95391051cf.742.2024.06.09.16.38.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 16:38:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207539-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=KytWlnDM; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-207539-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207539-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 90D6E1C209C0 for ; Sun, 9 Jun 2024 23:38:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 680EE5466C; Sun, 9 Jun 2024 23:38:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KytWlnDM" Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DBAF4179AE; Sun, 9 Jun 2024 23:38:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717976313; cv=none; b=PUYft6UjVgzx6MHvI3lSSe5spr3TF7sr2+u6xyZB3EK5XTL8UcPRnSwZTxOGMl+ViPCmoFHYvTphR7sE8oBZeYx/LOeCHGtzeE2BRiGnmghACGzUpWSNZBFfF5YKy1Ii5sEjwtUGyDo7JM/gRa0ziRU/PS5xsW/RXRiCfGaN9MA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717976313; c=relaxed/simple; bh=WQu9K2ue5eeyp0u/2COx1PCNb014zEKrmMT+Lhhs9BU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=tRkWMrrK3vo50wqshxSBBoC2j/kWcmX0nxfRoRCXqlEG913UwDMW3ZcCLaW9zca3TYtjXpWkkgP+kNLib5F5nzMAw9MQQzwLHdlPi1kgo0E8diLI0Iy366DTKwy09RrZ0zk4gbNDP4UHgNW3/BIv0tr0p5PVt8NLHNzk/YaaBwA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KytWlnDM; arc=none smtp.client-ip=209.85.208.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-57c76497cefso965228a12.1; Sun, 09 Jun 2024 16:38:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717976310; x=1718581110; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=02MNU9GYhtO+IwacgDb9GmG63HRnt1F+VZqY4FJZbpg=; b=KytWlnDMTi0KiK0ZdcvXrHcaU/ZPCTmwi8LKnQjAWjOWa2XTsT4W4D7MNx7tncTgZA wVVS0/TfanRm8iZG1zL0QeGyFjHFaxUMuLqB2gK3nHht9Q3Cp44rwf16JCgFTEs1FdRS c0zeLBzpSZKMD6s0D6DCOlV5a/mW5i9GAf73gY0BbUplty42hiT+fdS75nOwGwtYfyyd +2yRvuVhq/GJQwblrot8zEqxPXRc0Pjk7TpIhbqwH/YZmOoAchU+vUtW7cQhGPKT19Jz NcQa15+HM93J9l6k4oRXZbApYB3vtpwsrqjKIFApGrHnH2cxdN6daJZIaW6lUIjhn0qD ur9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717976310; x=1718581110; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=02MNU9GYhtO+IwacgDb9GmG63HRnt1F+VZqY4FJZbpg=; b=ZPBQ+9KOw+16Bc6JWlBZlY4ynUSDPN0cGG0WlR1N5dYKbau+Gdr/79aZmOx57SKg9J iDxsQT8PtesZnzaO61H2f0be7PsLQca56Og69inoGSCgu646Fo8Z1o7OhitwRWH+wZtt uQe9A85EgqciJGlfQjlzuTMgEvUn8pHMtk5ze255/LdoLt5oF3+oWC1u6zdryi8IKSjH xzKS0xXQzyTsqmBVZ1e2uQEh5hyLKP4uy395hygdL/PuomHEq4db4Mc0CWX2eKFURRlM 83Y9pmpOVfq4CHuzIey0MYLWgm/2gXpI4UEutRKs2xIeI7OkUKhmha5dZyWs/fhZ9WxQ t55w== X-Forwarded-Encrypted: i=1; AJvYcCUljDMBdPTNmFk6grM526GTwDczdzbtxdE0tLVeXjoqPLY0aiWGoZayOdlbTtEPopzlkd1H6AjQrsDy8G9qOXzwtnJGFoLS9O5ck88X4lg+FhX5t3AziY3pz4yZb2pLU7x1ejtKyA2g X-Gm-Message-State: AOJu0YzFiDigufK5nGWdGEoPUKraYCjKoIPsoRxK2ARYrKQZHtSlWbZD H1UyrfZdxQYWibdZoDFdFm1qkmtjiw+Hg8cUoh6TYsHQvVSgZtpB X-Received: by 2002:a17:906:478c:b0:a68:e58b:2c35 with SMTP id a640c23a62f3a-a6cd6660cbemr696404666b.31.1717976309923; Sun, 09 Jun 2024 16:38:29 -0700 (PDT) Received: from localhost.localdomain ([2a04:ee41:82:7577:635a:738f:880f:9ea5]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f20bb1abesm46063366b.172.2024.06.09.16.38.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 16:38:29 -0700 (PDT) From: Vasileios Amoiridis To: jic23@kernel.org Cc: dpfrey@gmail.com, himanshujha199640@gmail.com, lars@metafoo.de, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, mike.looijmans@topic.nl, vassilisamir@gmail.com Subject: [PATCH v3 00/15] iio: chemical: bme680: Driver cleanup Date: Mon, 10 Jun 2024 01:38:11 +0200 Message-Id: <20240609233826.330516-1-vassilisamir@gmail.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Based on fixes-togreg as the 4 first commits are already applied Patch 1/15: Added comment for explanation of what mutex is used for Patch 2/15: Removed fixes tag Patch 3-15/15: Reworded the commit messages to come close to convention of 75 chars per line. v2: https://lore.kernel.org/linux-iio/20240606212313.207550-1-vassilisamir@gmail.com/ Patch 4/19: - Combined the bme680_conversion_time_us() and bme680_wait_for_eoc() into one function. - Added better comment for the calculation. - Added checks in the bme680_wait_for_eoc() function. Patch 5/19: - Fixed typo in commit message. Patch 6/19: - Added a fixes tag since without the mutexes, read operations can be broken. Patch 10/19: - Converted shifting operation to FIELD_GET() Patch 11/19: - Changed convention from &data->bufer[0] to data->buffer. - Removed IIO_DMA_MINALIGN as it is not needed anymore. Patch 13/19: - Removed IIO_DMA_MINALIGN Patch 14/19: - Splitted from Patch v1 14/19 Patch 15/19: - Splitted from Patch v1 14/19 Patch 16/19: **NEW** - Use dev_err_probe() where applicable. v1: https://lore.kernel.org/linux-iio/20240527183805.311501-1-vassilisamir@gmail.com/ This started as a series to add support for buffers and the new BME688 but it ended up being just a cleaning series. These might be quite some patches for such a thing but I feel that they are are well split, in order to allow for better review. The patches are mostly small changes but essential for the correct use of the driver. The first patches looked like fixes that should be marked for the stable. Patches [11,17/17] might be a bit bigger but 11/17 is quite straightforward and 17/17 is basically a duplication of a very similar commit coming from the BMP280 driver [1]. In general, the datasheet [2] of the driver is not very descriptive, and it redirects the user to the BME68x Sensor API [3]. All the things that were identified from the BME68x Sensor API have been marked with links to the original locations of the GitHub code. If this is too much and we don't want this type of information on the commit message, please let me know and I will fix it. [1]: https://lore.kernel.org/linux-iio/20240512230524.53990-1-vassilisamir@gmail.com/T/#mc6f814e9a4f8c2b39015909d174c7013b3648b9b [2]: https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bme680-ds001.pdf [3]: https://github.com/boschsensortec/BME68x_SensorAPI/tree/master Vasileios Amoiridis (15): iio: chemical: bme680: Fix read/write ops to device by adding mutexes iio: chemical: bme680: Fix typo in define iio: chemical: bme680: Drop unnecessary casts and correct adc data types iio: chemical: bme680: Remove remaining ACPI-only stuff iio: chemical: bme680: Sort headers alphabetically iio: chemical: bme680: Remove duplicate register read iio: chemical: bme680: Use bulk reads for calibration data iio: chemical: bme680: Allocate IIO device before chip initialization iio: chemical: bme680: Add read buffers in read/write buffer union iio: chemical: bme680: Make error checks consistent iio: chemical: bme680: Modify startup procedure iio: chemical: bme680: Move probe errors to dev_err_probe() iio: chemical: bme680: Remove redundant gas configuration iio: chemical: bme680: Move forced mode setup in ->read_raw() iio: chemical: bme680: Refactorize reading functions drivers/iio/chemical/bme680.h | 41 +- drivers/iio/chemical/bme680_core.c | 631 +++++++++++++---------------- 2 files changed, 291 insertions(+), 381 deletions(-) base-commit: 4241665e6ea063a9c1d734de790121a71db763fc -- 2.25.1