From patchwork Mon Jun 17 13:49:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700729 Received: from mail-oa1-f45.google.com (mail-oa1-f45.google.com [209.85.160.45]) (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 B90D81B5838 for ; Mon, 17 Jun 2024 13:49:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632190; cv=none; b=B5HEL6fm0ALW9RNCOTGwqgtgCbD7vaTZdJFAd2PrhSIMPUOd0ig0vQvTY1Wbu0AThgi6YwUdEoriGrUJqrmJYMumEIKQeo2XtV4vzhYcBK1qKbo7DETRD/DACC93JArr6zNQMTuN/tSdoXwGZi/usINB6+ZQyGcLk0SakiA8Ye0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632190; c=relaxed/simple; bh=V5OVdhy+qCvjDRbv3yGURnLSWDE3JAmTDMZiE2ZFhuA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Vj+kjy7PEIWvQ+ryieK/xG8zW8OiUPUyFdLMDtvipAmNrJDhxKUGQvH1NAMRDgQjWQqO+XRCSkv5t+i23/jYuu06mRAX954uWcYAQj0S3GnthWFGkdCqpddSsyq7arsMdqVGO9xF5CUNdNNQIgGTiw49qNW+H86fZ5/NqwrnfLU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=21WOSPy5; arc=none smtp.client-ip=209.85.160.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="21WOSPy5" Received: by mail-oa1-f45.google.com with SMTP id 586e51a60fabf-250c0555a63so2163741fac.1 for ; Mon, 17 Jun 2024 06:49:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632187; x=1719236987; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=uOw9ZuYF7yVVJfGh3LeTM6VDPH42QqBSzznALZp99zM=; b=21WOSPy5jOdGHEa8ADN9MG4UcBEILK1wwG2VcOe3knogcZMhJTh6jDgoL78jlGCrJW Uh/tchRQTysTgKA74FYtIxxD9+f5m+n9YbewPILIbzlLLd+3YYX+uuvFmeIZsuHg7vWM MZqZmZW++1zCFcOntD1aiT6Rrs7Nqy4UBPD6SSBA7BbVmCt86XsPHZhq1SRWHk3uJcqw xoDDJXJwFQgSflxoM+6vENFY7hvkKQz+ZNoLQG9pAxF4jsvxv05RAGdLddb0sFOj++yg s8mufBlhmZ4CJ66BkWzrVa82n7eVr6wtrFFEpcLUqOeZ0msfnbaVxDwSQ2CWuOR95i47 lE2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632187; x=1719236987; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uOw9ZuYF7yVVJfGh3LeTM6VDPH42QqBSzznALZp99zM=; b=Qk5SNvIKgav4vtezH/frtF/tl36Fk6PJNRRLpHCFWRr/erFu2ova7S/Bn6lECNvqiC P7pmoRp97XD3CJ8dKsWvfoqzqeXzGnEJafdUGLuj/mLaIEv71S3MG6LKokRKuRMTxChk iNbAK8CTksgYTl7XEvc9u2limjXlgeiue9ifATlx9ab84vF0RDLpgBlVfSQxH8rzemWQ W6pVt7YLdWxOlbN2b7FVtdT1GGrOTzi4yGQA+o2nMcSHXaYPzHZjecdqRdKGf2o1hkkq 004igh4a0Uav+YHYpGt6vM7fNcxdOkeLOJHu+VSJS7Y1kHOzZC0YGr/TMyhTHJeeJ+PY ygMw== X-Forwarded-Encrypted: i=1; AJvYcCVQY8vkjp4JPpaulBOE5jhLAy//rFBIjGS/laSz7JL8F2gB/BcVmPl5AXSB+c/J343YJ2scMG9cfdsFqfXXxqM13v5+ X-Gm-Message-State: AOJu0YyWZ03EYMQJStLftlcfyMkcrz3RUYoDSHIplGHzAbVml+ChSn3r HGEnAfqjmUi0WDQuueE/cSmuYNlGq0xqxy5TpbOE/myjAlP7x3Zb6V2f21w76vE= X-Google-Smtp-Source: AGHT+IFJGSJ8d0p4WXCzz2NyljOfF1k3KjSXOWFFs3OCSrxLmfdmtEDsU18y1hD0hfEhjyu+NXEwMw== X-Received: by 2002:a05:6870:8188:b0:255:1bb8:85ec with SMTP id 586e51a60fabf-2584288e46bmr10661973fac.12.1718632186790; Mon, 17 Jun 2024 06:49:46 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.49.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:49:46 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:41 -0400 Subject: [PATCH v3 01/41] iio: accel: fxls8962af-core: Make use of regmap_set_bits(), regmap_clear_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-1-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/accel/fxls8962af-core.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/iio/accel/fxls8962af-core.c b/drivers/iio/accel/fxls8962af-core.c index 4fbc01bda62e..d25e31613413 100644 --- a/drivers/iio/accel/fxls8962af-core.c +++ b/drivers/iio/accel/fxls8962af-core.c @@ -228,8 +228,8 @@ static int fxls8962af_power_off(struct fxls8962af_data *data) static int fxls8962af_standby(struct fxls8962af_data *data) { - return regmap_update_bits(data->regmap, FXLS8962AF_SENS_CONFIG1, - FXLS8962AF_SENS_CONFIG1_ACTIVE, 0); + return regmap_clear_bits(data->regmap, FXLS8962AF_SENS_CONFIG1, + FXLS8962AF_SENS_CONFIG1_ACTIVE); } static int fxls8962af_active(struct fxls8962af_data *data) @@ -785,9 +785,8 @@ static int fxls8962af_reset(struct fxls8962af_data *data) unsigned int reg; int ret; - ret = regmap_update_bits(data->regmap, FXLS8962AF_SENS_CONFIG1, - FXLS8962AF_SENS_CONFIG1_RST, - FXLS8962AF_SENS_CONFIG1_RST); + ret = regmap_set_bits(data->regmap, FXLS8962AF_SENS_CONFIG1, + FXLS8962AF_SENS_CONFIG1_RST); if (ret) return ret; @@ -830,9 +829,8 @@ static int fxls8962af_buffer_postenable(struct iio_dev *indio_dev) fxls8962af_standby(data); /* Enable buffer interrupt */ - ret = regmap_update_bits(data->regmap, FXLS8962AF_INT_EN, - FXLS8962AF_INT_EN_BUF_EN, - FXLS8962AF_INT_EN_BUF_EN); + ret = regmap_set_bits(data->regmap, FXLS8962AF_INT_EN, + FXLS8962AF_INT_EN_BUF_EN); if (ret) return ret; @@ -851,8 +849,8 @@ static int fxls8962af_buffer_predisable(struct iio_dev *indio_dev) fxls8962af_standby(data); /* Disable buffer interrupt */ - ret = regmap_update_bits(data->regmap, FXLS8962AF_INT_EN, - FXLS8962AF_INT_EN_BUF_EN, 0); + ret = regmap_clear_bits(data->regmap, FXLS8962AF_INT_EN, + FXLS8962AF_INT_EN_BUF_EN); if (ret) return ret; From patchwork Mon Jun 17 13:49:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700730 Received: from mail-ua1-f43.google.com (mail-ua1-f43.google.com [209.85.222.43]) (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 18F1B1BA876 for ; Mon, 17 Jun 2024 13:49:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632191; cv=none; b=mCgfP8cAfSPQVJhEt6tZGyalJZDnID5scddNdFKy51I3ilP0Y00HRx1vOREdCmZVaKij7tskw2Gckv/G3ggj4ZcyCu1Oasc4CCWlaxb0q0pKzevoJ71By5JEaxel54TJ8hmeOC7tHgJ2K4gmr8AtVm6IVGIfBM8ubwZWNUA35Ao= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632191; c=relaxed/simple; bh=yZg3W0CF/EzgkZiaio4uCiv0EYa6DTKX0nMHxwiSYDA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kKO4e8zs1aznmBJqAtHkxICrVMZJ0XkMRr583pPqV5KjF58zxAEFRS22+h2OOmUI7gK0OgUSxEZAAAHKHRLfo6nxVGFXO3uq8RDLrP14GQUFP+lAy4ijE7chQQ0qPhZJQ5Wereapz0nY/PH5kRAZLSiQNiAGkXBoNllrbx7m7mA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=cCViwIaf; arc=none smtp.client-ip=209.85.222.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="cCViwIaf" Received: by mail-ua1-f43.google.com with SMTP id a1e0cc1a2514c-80d6534e302so1379895241.0 for ; Mon, 17 Jun 2024 06:49:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632189; x=1719236989; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=8Zs4CGtswXRcL4r5zLR2D5+LAoG+l8N82wbiM+7ownU=; b=cCViwIaf0vZUVkgu9NUvKNc5fvslLmWrc+7EbfGBubwKLSiP+OdgeBN3XiCNP16ZDR vZEuFjbVbKIDS6UAWzDL3o61r+s4teFHUe/8JBkAI2ZbgDGzF4h3Fc+RFOQfLh244FC/ cashX6kydxt5EBz+e1BmJ+zUTuS1WuRh+duvsQ/OGYFJzK+h31NuU/973DE86IrEgbOO r9y7dy6KdqjvudiTj51MbdGB5xcDDVjFds/2/IcGIczar9gfmkWbqq3WZfApyP/FNEsJ 5soxXqt8FPogAIOWTE8L69gLYbHNzlnj5IXonHCgzQGsthk0AEuBFlGVIeEDUdyuvR55 EXTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632189; x=1719236989; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8Zs4CGtswXRcL4r5zLR2D5+LAoG+l8N82wbiM+7ownU=; b=XxZm5z8CDPY49ABw7grzZvr/J9HnUYl9/ayZerV3ZS7g+U1yYWZG/CHFKsDQuxRfar ZNa9eGOohq90EhW1R+UHo8cuCbv2xzPCF36Mekr9fBlmToVm929/Hj1So6xztqFppHob RGbNswyG/EWY3GlOqadQLaApWgwQXrhQNbwlMrBZf+3HcErseiN3ZtDkVOc0bY4hMaYM QfQVCFT5oXWecFyzF0SiVTHUOQ9F2MBLn2LD3fwPzP1+w3EqyntEMISdhdQ4/HQ8W35C CnQd+E8XEIb/E5dB7FWgGgRfB8pwn2G4gRlwusNeY6AQWZXEtnMJbpd43ryD3zFCpURM ayPA== X-Forwarded-Encrypted: i=1; AJvYcCWATV55tbrY/bvbluzUXyOiGaEYCfv7yOeN2R1KhDVcTwAyc743AqcFyrfp4NVqFdvD5auMyfB5ZMPEDdaTZm60NwJz X-Gm-Message-State: AOJu0YxLBEDS9rt+dXGds4Gq59553xRSxDVxdN0FESevWG81U9ksxnwJ AcILkRMz8XXpTgm3GmGA5l1DLoXNhHq5waa8HkK1mJYX8yZ4fnqy141CZLqxPbg= X-Google-Smtp-Source: AGHT+IEFmgHtaGyOVxmPD/zpG+S8mAUnggR0FqGzztaCLAyq4bVNR5GtCNAnJm1CQv7c1xou1ffjIg== X-Received: by 2002:a67:b902:0:b0:48d:7702:99e2 with SMTP id ada2fe7eead31-48dae3e00c7mr8793212137.31.1718632188950; Mon, 17 Jun 2024 06:49:48 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.49.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:49:48 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:42 -0400 Subject: [PATCH v3 02/41] iio: accel: kxsd9: Make use of regmap_clear_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-2-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin Reviewed-by: Linus Walleij --- drivers/iio/accel/kxsd9.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iio/accel/kxsd9.c b/drivers/iio/accel/kxsd9.c index ba99649fe195..03ce032e06ff 100644 --- a/drivers/iio/accel/kxsd9.c +++ b/drivers/iio/accel/kxsd9.c @@ -370,10 +370,8 @@ static int kxsd9_power_down(struct kxsd9_state *st) * make sure we conserve power even if there are others users on the * regulators. */ - ret = regmap_update_bits(st->map, - KXSD9_REG_CTRL_B, - KXSD9_CTRL_B_ENABLE, - 0); + ret = regmap_clear_bits(st->map, KXSD9_REG_CTRL_B, + KXSD9_CTRL_B_ENABLE); if (ret) return ret; From patchwork Mon Jun 17 13:49:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700731 Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (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 4F9611BA871 for ; Mon, 17 Jun 2024 13:49:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632193; cv=none; b=U2k1Cvp2cp8i5Q8Td5vx2oHYFqRlGbn4qqxlP8yN1165rIdX9iU4TgLmSaM+rFw+2rmZhO1zMV7KPWwhXs2qXpfPwcrd3amCY9iJWbrpAwGPWBYPR4VamyEWo+xZFP9sspKwvwgHoSaM1X8zwKC24Nyd2lFatZBzFPdg0+8M8/E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632193; c=relaxed/simple; bh=xkccHr6wwnlQsKCmzwFyuv2WRICeUsdifxKHZufCCP4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=enWMN4JRrXP8edObKOmrhkM56w36L2jYba2MnF1MvXeQVNY+yVgvsdr9NqfCSYiP2UYUQ9KYkKsfl+6aeU5vGnsBDE3GMm3+wSGImuDRNEA3aU65pAjIjGH3w9B+HF9os8C5VGlEm4fZGAIbepHb1KFoSPENLDNJ/bWI6p7HFgI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=OfL3c4NL; arc=none smtp.client-ip=209.85.222.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="OfL3c4NL" Received: by mail-qk1-f180.google.com with SMTP id af79cd13be357-7965d034cedso284170985a.3 for ; Mon, 17 Jun 2024 06:49:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632191; x=1719236991; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=+qpLBIScyQiW6pZURHAKIC6sw71J1lEFsgxMlm6mPzw=; b=OfL3c4NLTCB9dOrmv7JSDshmi9msHLzrocqMqrr+iFKRY287A0gECdkdzM/ajlKCzC UnaEJ2UjCKEtf6rKITbyF+7nBzK3rqQF5sNI6TTo2Scz8Too4RkUgHGu015ouddq6Vh3 892EDtxqMMINdAiYrNyG2hNq/vsygtV4wWnXMtbv3v8p3qWyOOi3sX4O7dllKMWO13hB KPH524jMCnVLU3m94A/utOoTOrC1vsuRAhnHXDWN2Hzxkz7yFRxYKn41CJdI0UWg40OD kHm80/ZwgXOYRgGYA+pozAPOwDUngJXPbKMg1X6+Wd9vuMMATO1LWx56NctrlcF/IO7r 7W6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632191; x=1719236991; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+qpLBIScyQiW6pZURHAKIC6sw71J1lEFsgxMlm6mPzw=; b=izUNzn1miG4DCl7N5fz01IL31z8CJ24FXBqV0wW2gxE+usapgerhFb3TuSpCR+g3E0 o0xBudEfsKYNDBRdnKmr9l5nCfjeMtMFC8WBsDm5dOKAhkodNjniv54McXIhgK/ln5A9 wum4wbcUlV/8MG7Z1idh1ZNtiIumG06S2VbrpQq1vMv46EFYBttvAkGr+NyuELvcPkRn yaw6eefkPnz0OxlXagsQHpOQGToxNnnxqvMTro6lRTETEO6XvIFTCWc67GL3bk74sL4a DlR7LFSKlo4UJIQRBq5VODpX9dHCstSVQrAjb5zCrfKISnN3qXglUMceDe52HGtPBnXS RVPg== X-Forwarded-Encrypted: i=1; AJvYcCUZ1J3y4rw45+neKy2Y/MVj5zeniCKbEB7J9NM2eb88oEe7o34/nMVzPzDHHJuWagA8xirrIE5BpsywtKJNnnXzFqnK X-Gm-Message-State: AOJu0Yz76eRFEnYhVXvlSPExjvNDncJ5XUe78JBWdzJ/6JWPrb9gP6Gt SYfvPMaBtYKk5UJ6VvhzYxirK60cEB8/cNdOQ3M6R7QLSznUw0GH2p575vPYceU= X-Google-Smtp-Source: AGHT+IECnYQvKUI7WwTgcSFed1zXdKR1H19TPysNu9rY9UY+uM67szMwUskr66DbaCdyM94wmFAuyQ== X-Received: by 2002:a05:620a:372a:b0:797:b2a9:90a7 with SMTP id af79cd13be357-798d26b9321mr1211989385a.69.1718632191103; Mon, 17 Jun 2024 06:49:51 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.49.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:49:50 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:43 -0400 Subject: [PATCH v3 03/41] iio: accel: msa311: make use of regmap_clear_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-3-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/accel/msa311.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iio/accel/msa311.c b/drivers/iio/accel/msa311.c index b8ddbfd98f11..4cdbf5424a53 100644 --- a/drivers/iio/accel/msa311.c +++ b/drivers/iio/accel/msa311.c @@ -1034,10 +1034,10 @@ static int msa311_chip_init(struct msa311_priv *msa311) "failed to unmap map0/map1 interrupts\n"); /* Disable all axes by default */ - err = regmap_update_bits(msa311->regs, MSA311_ODR_REG, - MSA311_GENMASK(F_X_AXIS_DIS) | - MSA311_GENMASK(F_Y_AXIS_DIS) | - MSA311_GENMASK(F_Z_AXIS_DIS), 0); + err = regmap_clear_bits(msa311->regs, MSA311_ODR_REG, + MSA311_GENMASK(F_X_AXIS_DIS) | + MSA311_GENMASK(F_Y_AXIS_DIS) | + MSA311_GENMASK(F_Z_AXIS_DIS)); if (err) return dev_err_probe(dev, err, "can't enable all axes\n"); From patchwork Mon Jun 17 13:49:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700732 Received: from mail-oa1-f54.google.com (mail-oa1-f54.google.com [209.85.160.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 480D01BA899 for ; Mon, 17 Jun 2024 13:49:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632195; cv=none; b=Sc8GZbwHdv9zhKxnzsQ7PgCmOb2QTaesFxPgX2zEFmmjrQqIQHFH9CnW4FVnFsMTipx0J/G7ARFVbde3wbPNkMSfvDsY625yyfE7qIhFxVKb++CU8UmO74Ynx4SPJQBm0iICjckWmBevRLGtkcu0f1Ic4Xbl9YaDBh1o3wKTRLw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632195; c=relaxed/simple; bh=F6edunFIUcDZTIb1mqBjURHwGYYpBYudXYPFSJXncC8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uuT6ScRok6iBP4aGKGgWDedJhKutUUs/KPztvFZ5p5yA07vqyKTlKW6G0ywS59HAHEcBgtqvORIw15ULp1xetUHyjTRIzAs7eehzH8W6oUAr1TrjfJLEmz1v4ZTJMFuny9S2+KeuRK8P6k5cMMn3HjEimsQASDbS7YUq51RWEBs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=1vvY9CNG; arc=none smtp.client-ip=209.85.160.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="1vvY9CNG" Received: by mail-oa1-f54.google.com with SMTP id 586e51a60fabf-24542b8607fso2288428fac.1 for ; Mon, 17 Jun 2024 06:49:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632193; x=1719236993; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=EcLjABCmPDgHOzLEYjNK5DROGA4JTxd15k6kwWpFoxg=; b=1vvY9CNGvgS2pGKQxnsbkSmxABvf0k2buYXWoNXDDI8cNWhOIp2UBzI/HL92vXskP3 DN3QBzs4KnMiBVbwnLbCkGIgtxI68cokzKGVXZazcdOg1qa8UKOCq90mp/ouKC0l/jW1 noa6UgYak5+w+e1LYkUDcZg5zp606MCyVppZPo+5vCK8YSf8iIyah5CJ2Xgzhaf8uk7W d9eqYMb2sQa5xj3lBfWr5Fzq2jiPqBdcwdVNT71z6qXHuBvXsaulLjGXz+bSoEEyHJqR lA0j5HZP4T5ER2ffDe5a+eWKZUtGqUUT0LhfZK/J9pauuZaRYTqsZ2PtZ9fDTyhlC3Zu G1Mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632193; x=1719236993; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EcLjABCmPDgHOzLEYjNK5DROGA4JTxd15k6kwWpFoxg=; b=MJx9g7vqfI+Ma5hHxvsHLF+Na8pgSSL/j5kpkqmull34GO4EMz+2Ln754nJZ6BF4J3 nZ6b6GCO+G7qceDhES/MCYOydy8wmbig0fE5Y9MAeFELYvfMQXGdemd1CO1Sbe6a5hYr 3nimHmtipITpE8uuHPiQy+EToFT2pCweAedzobc4z7PPcM2o7BZ9Y8sJufypIaYkl9Fw YwItSZpxKpT6MAlZ3b3o7lCfG2Ac2cfv5F+lnSQiMiorzUpV91LY89kT3khle9zrku1D n369Mjs/g2fVn+v2KFifwmix5PVbsrmtYASQ0kZv4pD4D6G/ZKHz96LfjViElprWOEug 5s4w== X-Forwarded-Encrypted: i=1; AJvYcCU16tkNeFe5TYRbz1uoHRkVwZ9z58v2wUB6WhkafNZk7eaiCxcg/wYRyTBGugi0zhRimLvO52wri3cEQ8xQ98L7VVjY X-Gm-Message-State: AOJu0YxpCN/XKbMYaAxl/7aIqSdQdfT5DFezBkIBa2hROXvROTZ27TGB wo8+44cuzSz/Q7aCBWP5fgoBMvEZAuTkl253HSNfe5RtX1i1NhplZWT8jGy4xU8= X-Google-Smtp-Source: AGHT+IGzXK8LLO+jQf8g3iL5MCifYqjIipjPlFcW7eDQk67H8aKJxfmuoG4FYBXo33Z8PvtltK6jug== X-Received: by 2002:a05:6870:4728:b0:24f:d9de:3bed with SMTP id 586e51a60fabf-25842b793famr10756815fac.41.1718632193273; Mon, 17 Jun 2024 06:49:53 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.49.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:49:53 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:44 -0400 Subject: [PATCH v3 04/41] iio: adc: ad4130: make use of regmap_clear_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-4-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin Reviewed-by: Nuno Sa --- drivers/iio/adc/ad4130.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/ad4130.c b/drivers/iio/adc/ad4130.c index aaf1fb0ac447..e134d6497827 100644 --- a/drivers/iio/adc/ad4130.c +++ b/drivers/iio/adc/ad4130.c @@ -1883,8 +1883,8 @@ static int ad4130_setup(struct iio_dev *indio_dev) if (ret) return ret; - ret = regmap_update_bits(st->regmap, AD4130_FIFO_CONTROL_REG, - AD4130_FIFO_CONTROL_HEADER_MASK, 0); + ret = regmap_clear_bits(st->regmap, AD4130_FIFO_CONTROL_REG, + AD4130_FIFO_CONTROL_HEADER_MASK); if (ret) return ret; From patchwork Mon Jun 17 13:49:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700733 Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (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 C90591BBBCC for ; Mon, 17 Jun 2024 13:49:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632198; cv=none; b=kUN2NasGs+Oh/K+2N1NlzAyJwVG3Rp7ObRN9rn1lUOFcVE9L4ny1Gj6h3QNRTA2fNNaGhLiEWqq3YMgjbXpls5JQgsSqUFzbzFYa8FP02z32sqwJMJHtWnMoaF0PkWRDT4o/p8JtwaDes0LhCuOC3YywWOXPkycl38QziyP9FZ0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632198; c=relaxed/simple; bh=tZD2LK0TsNQLeO1PQXlfQAFGl//p991fLtVre5bjIaA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=B6WT0DhKYwOsasoU3wwz6kIqF8iV4djIJA+kl38iVD8xBaGm4wb3eiKPtXFFCtCcALlKL8zdGT5xdEQwtzQsMiKJEjgew3WboMKMo/Anj9SUujam1Q2WzQ9168I2GrHao/hWe7kuYZQfKJF3ehEKggaa4GEZKFLYZjFO0HGsOnE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=ppwVP6GD; arc=none smtp.client-ip=209.85.222.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="ppwVP6GD" Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-7955841fddaso361866585a.1 for ; Mon, 17 Jun 2024 06:49:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632196; x=1719236996; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=6sTXUSoBs+YlsgH71N9X/wOixyDVYk1BR8pUCCabPaI=; b=ppwVP6GD64EIaRKp7pf0XC1CrgRYKlT8DaBfAR3k/pUrH3j7NafWjk+RRhehdH7/+/ x1aIGEqWxvh+I2txOuwe3oZ19bjkYuTFGD4pkN7pvtQaJAuvXSA8DQtBl0/yItoFbflw fPi0J5BhdP170Ct5xvjTn9ITW0zYIs9Fu1Duvr12wvU5C7WCBBSua/5ySu2wRjyuK0JO OHE7IhGWlnqWAHj7lwwO2OR2FJPcGIpfxyvQSEwcxIAcYXIg2agu+VuvqtjNZj5yjwVX 17Cho3I8K3sbBSbw8Cpb12eWEL0vwMiEgcOhYyooflphsAPxzHZMBySwtf4f1EtdNbwH +8Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632196; x=1719236996; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6sTXUSoBs+YlsgH71N9X/wOixyDVYk1BR8pUCCabPaI=; b=CkLH7nko7lmvhIItFHGlWAEHwqCwxVWQcufGITWZqRKOgxMcsjjdvdiVn3fVQgCW1G pI5bHEKUeqnrgKyLytHVI5WT+ugRW3PlN01r1cZsVqpM+KjLH8sBQsWpzYyboJ80xMHz JMjiQvoTB4JDpwIcDMtM0ND4Nq+oh6hcVCZWPxbnIV7fe76sVNMVvjHGXJqJIcsJEbJB ewsUOKPe9CCAIZUX3Cvh7Qv3wn9cvmP1ZuWFYakT6Yh/HzRN24G1Dm6aV3ibyU96NLK9 af5m46mUYzaj98TEQ9RsUMuWNozYYmhTvHIKsDyhM21UwKIlBphu71qIZ7wMRUIYMxhx CAVg== X-Forwarded-Encrypted: i=1; AJvYcCXcy+Gn7o8C/DiXdhnIzhFvWpWV8CvkfIeu0PGowvQ8YbkVLwDW2HMpN/UceYPUYj3L3S6AlFOGtNe3tuaX9JLGzo05 X-Gm-Message-State: AOJu0Yyl7+KLCmnGy7SZh7vwRpJdHVK/55hycLIj2GWT0C2hNuzRQ32z 1j/7rav8wFRKs8V1fU82Rm0v+TWvBabjh1jLR5iVv7eW88bHa2vUlWJRt/saJRU= X-Google-Smtp-Source: AGHT+IGjHbBOrTl20NthbniN5xVzM8rCge08JoanAoI0amw+zX4G0dqtT7iYT1wcjjqa5iiFtvInEw== X-Received: by 2002:a05:620a:44c4:b0:795:5b00:edcb with SMTP id af79cd13be357-798d0243396mr1793084785a.21.1718632195400; Mon, 17 Jun 2024 06:49:55 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.49.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:49:55 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:45 -0400 Subject: [PATCH v3 05/41] iio: adc: axp20x_adc: make use of regmap_set_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-5-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/adc/axp20x_adc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/axp20x_adc.c b/drivers/iio/adc/axp20x_adc.c index d6c51b0f48e3..00c1a01cac63 100644 --- a/drivers/iio/adc/axp20x_adc.c +++ b/drivers/iio/adc/axp20x_adc.c @@ -712,9 +712,8 @@ static int axp20x_probe(struct platform_device *pdev) regmap_write(info->regmap, AXP20X_ADC_EN1, info->data->adc_en1_mask); if (info->data->adc_en2_mask) - regmap_update_bits(info->regmap, AXP20X_ADC_EN2, - info->data->adc_en2_mask, - info->data->adc_en2_mask); + regmap_set_bits(info->regmap, AXP20X_ADC_EN2, + info->data->adc_en2_mask); /* Configure ADCs rate */ info->data->adc_rate(info, 100); From patchwork Mon Jun 17 13:49:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700734 Received: from mail-vs1-f44.google.com (mail-vs1-f44.google.com [209.85.217.44]) (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 92FB71BBBE8 for ; Mon, 17 Jun 2024 13:49:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632201; cv=none; b=QbU3IuAWvRoL7hKX2hpZUA8LXhLnex/hauDunn5cy1SR7BaWJvEg371pmt6ugnGofa/Ol5PnXuuHQoxT3+G+uKIokAgP/L7uENKxc5GvBcEWkN7dNAoeze017TVjbDnhOpnRT818zZwUZct5AFknyh3MwZOz1UNbGdk38EQPUCA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632201; c=relaxed/simple; bh=UCswPzc07ScF6/5JfvW+wgRVfrWxtjhgBr2M86YwQWQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=biJBVEC/my8fBhkeTsmlEb4cKB44uTh7cYRW5W2Cu1DprRxqTT4fx2EHLrmIJeBHJ1OOyHbh5tU89nM4Ttprj+3ECfiniRUoJ8Bd93dAmmj2cyhyl2DlMxq+EKJgojHu/Iw7Sd0Bktx281yFVtUNTrrCZcrrYygQnbSR2CoeUBk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=feQfbKEg; arc=none smtp.client-ip=209.85.217.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="feQfbKEg" Received: by mail-vs1-f44.google.com with SMTP id ada2fe7eead31-48c37941349so1596107137.3 for ; Mon, 17 Jun 2024 06:49:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632197; x=1719236997; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=g6UQvfPsoXnGJXINmWjQmEBO62NliLdepCpDJh/A7YM=; b=feQfbKEgcTslk0JZfYZT96lHl1XI0zx2QRfXq9lNnLZqNKvNm3qbUkw1zy0SfuOABC 5o70XD34o/sxMAxJjsvuPaSnaoqxSkL3bs9pVE0aNDPo5k9uWDXE+J9s8p917pQsxD/T am32I0gqFzifGA1FhOA88Av9NlegI0Ogb6sLIx1LlZblp/CXtgMmNOoiNkpPMfalv2TQ k0CNRqRd6EiRTL6ecUrCGznLgVw3/xXdkfiDV56lNANeiOpa4f5R2H+Gy2xUQ3se1oyG qXgBhAjfPleMVT2XE74GoVUGoL/dnHBjk7L71OSjthhHOCeDUhBK+GQvN3glYt0XZVWB IjJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632197; x=1719236997; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=g6UQvfPsoXnGJXINmWjQmEBO62NliLdepCpDJh/A7YM=; b=ealuOm2RKR4Mrrbxb1LOzpqOm+MEyjv3A0pQYIuUB67MhUY7o0ZPr4lc1ecT0obpsl uV5Or0suj0nn7VCWwmLikN1luHIyVzaAL3I0frPM0cmUIXwFOJxc/vAoMpcBxylE0V1H DUiJtJQtNrqK0gtrcRGtrdTrzl5FDPH9vFTjQ0BeW4bc6GYy7kh+9ZGbLJrPop9Yzt7E emsvV53p/b65n5Yha9kDt/2y41WwH0rzRITOIStib7U01T454FpwqGwPAQVgWU9jcbFB c8fDDBDn2qvPnnvYPfqiMaa/AQXhgp4STC5mNfGy05ihVcYwD7vDsqaf1M4F8pIEjDXk el0g== X-Forwarded-Encrypted: i=1; AJvYcCWiEsGloQ8izsFqLlCKbueM+Gj50GpzFA/PTi9tnKNp5X63JqatiUKMJWewQv6gDo7lytvI8eN/7tn1Cw6yH5Y7CxQ6 X-Gm-Message-State: AOJu0YyHpniAfuT8WrHPDEA3ZxnqtDT2Nl17u1lMX8rgSYs2VmTuHc/q X5jcDdqQ6cwsbGaIwcm7qqCA6MXQTxRMpiKbX3eFBe7FFnwNA/WAQ5n70dDJAoM= X-Google-Smtp-Source: AGHT+IHh1rKlzT8+664YalrD1JcHiwA7k7yzEL0kYz4H+P2//V4FMw+RVSrpyNsoJMn06TFOuuRyhA== X-Received: by 2002:a67:f452:0:b0:48d:a159:dd80 with SMTP id ada2fe7eead31-48dae329fbdmr9819998137.12.1718632197524; Mon, 17 Jun 2024 06:49:57 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.49.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:49:57 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:46 -0400 Subject: [PATCH v3 06/41] iio: adc: axp288_adc: make use of regmap_set_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-6-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/adc/axp288_adc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/axp288_adc.c b/drivers/iio/adc/axp288_adc.c index 49fff1cabd0d..f135cf2362df 100644 --- a/drivers/iio/adc/axp288_adc.c +++ b/drivers/iio/adc/axp288_adc.c @@ -247,8 +247,8 @@ static int axp288_adc_initialize(struct axp288_adc_info *info) return ret; /* Turn on the ADC for all channels except TS, leave TS as is */ - return regmap_update_bits(info->regmap, AXP20X_ADC_EN1, - AXP288_ADC_EN_MASK, AXP288_ADC_EN_MASK); + return regmap_set_bits(info->regmap, AXP20X_ADC_EN1, + AXP288_ADC_EN_MASK); } static const struct iio_info axp288_adc_iio_info = { From patchwork Mon Jun 17 13:49:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700735 Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) (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 C67461BC073 for ; Mon, 17 Jun 2024 13:50:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632202; cv=none; b=NU+PvQkxy5eD5hr6MuBW1+Zq3vpUKWap5x910vb0c8VUIuh0g01ayeoxq4OA2wzGW/cUQzmVq1BiEf9IlJdY4yqL768kzmumZtbMQ39Yi9QqkDaoflosqlFFXNtI8DicG3wyKNAXZ/ejJZlAVsfQ7SaMy8R1o0GlHx+/3o8WKiY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632202; c=relaxed/simple; bh=StudXC8HM5AaA51joNKIseNwtqaK04Fr9WYaAPBMqi8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kh2Ly8wxD9KDaWS7ANtWKZKrx+Cl7FvnlT/ZNt1zgzkMoBU6aOfQki49f44pa1qBkAsP/Lg6XbS84F92V2OUo0ha7R21awInhNgb+T2zLSHcKYsCQYTlPD1cL7Upw3o2KtQFcZqiwJRdbquyZXEWKHvwi611RPt+4RTddXQm9vw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=bq+PCebn; arc=none smtp.client-ip=209.85.222.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="bq+PCebn" Received: by mail-qk1-f178.google.com with SMTP id af79cd13be357-796df041d73so313346185a.3 for ; Mon, 17 Jun 2024 06:50:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632200; x=1719237000; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=YrcJbk8xCEXw8t4EaXrcTeVF+NCC1LSKzcpZFP4BG5g=; b=bq+PCebnKCUwB3J8JBr8W5X/wRwSqpLM/yglyuubAevLxTnUUpGZ5QgP97lg+WFBiJ CnbFFweF/CEh6jnPI/lREImO5ZE6Qps933tBayEc++qzA/+k2mQdsA2hUdA3kshSNcMq OL1g2sial86oloKDtBeZepdqT9JAw3lNFyELADiu8MIOpwjLh21RiFct8MNQdHUb4TU4 bhV18Mk6my8vTigaKdpz/AP8mGBkFNxpIYkmsEHDMvnpISAXlCVW6lDMWNt/EkgyPLYQ V7ZoP5GEzFUUnS7TMZTdZINjqAyl205AM9ucG3TWbKN2ta4QcUg5AzxAZZbhjQYBSCmH 5ATg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632200; x=1719237000; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YrcJbk8xCEXw8t4EaXrcTeVF+NCC1LSKzcpZFP4BG5g=; b=HeRR3J+iMj6GBLrHaxvrXYKnv6GeIZYZWv0dTe+1iP4Fk4cWe2J/dWVcOY0UDOFuwu 5H2EsfFGRcBE61VwrSmVci3v2a9ZSlpXynxqeboiknYWPODp5C8McQLnWwj9GxBomjxx An+8rgRUGwGakt+cQFHrwgP5VmEmH7h1qUIZOBfvAYyOTE0v0HiBPuneEDk4oZzhEl6k TvVL+/4HaZffRVXESUl+/jOcJ2EBVcjXWGzYvPsHxKhBASWdaZNpRhbG1P8VaXNbTW3D tpWirfmrHVvqAu24L0/3wlXVUylw7TFS6xLe0GDmQXJPGEeQPWW3AZh0a+73JgJiQbg5 YA9Q== X-Forwarded-Encrypted: i=1; AJvYcCVojJpjDp0bHgkkWeDplw+EB1r+Arplnbzpz6x+HJt/JVJWd8UMtF9zE8JDu513cxqssZJToAnbQ81MKVMlhPYIK7DR X-Gm-Message-State: AOJu0YynZaSZxHAw05F+BgCZMULRIHeoqjCX6UpL1RcIATgSKTyIEUpN yQ3rFRRjU1bED4urgORplKdDWoHktvrN3om9m6ZvKna9o9YSpX2oOol0PZoveuA= X-Google-Smtp-Source: AGHT+IE5uBXfLurzd0jxJqKEavsP5xlBerQNz/5zZPhVz/sS8JYp4QTVcbxX+BgweFysUZBWMYLagg== X-Received: by 2002:a05:620a:1a81:b0:795:4e35:ea9d with SMTP id af79cd13be357-798d2692fc4mr1312471985a.60.1718632199656; Mon, 17 Jun 2024 06:49:59 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.49.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:49:59 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:47 -0400 Subject: [PATCH v3 07/41] iio: adc: bcm_iproc_adc: make use of regmap_clear_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-7-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/adc/bcm_iproc_adc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iio/adc/bcm_iproc_adc.c b/drivers/iio/adc/bcm_iproc_adc.c index 5bc514bd5ebc..6bc149c51414 100644 --- a/drivers/iio/adc/bcm_iproc_adc.c +++ b/drivers/iio/adc/bcm_iproc_adc.c @@ -357,8 +357,8 @@ static int iproc_adc_enable(struct iio_dev *indio_dev) int ret; /* Set i_amux = 3b'000, select channel 0 */ - ret = regmap_update_bits(adc_priv->regmap, IPROC_ANALOG_CONTROL, - IPROC_ADC_CHANNEL_SEL_MASK, 0); + ret = regmap_clear_bits(adc_priv->regmap, IPROC_ANALOG_CONTROL, + IPROC_ADC_CHANNEL_SEL_MASK); if (ret) { dev_err(&indio_dev->dev, "failed to write IPROC_ANALOG_CONTROL %d\n", ret); @@ -543,8 +543,8 @@ static int iproc_adc_probe(struct platform_device *pdev) if (adc_priv->irqno < 0) return adc_priv->irqno; - ret = regmap_update_bits(adc_priv->regmap, IPROC_REGCTL2, - IPROC_ADC_AUXIN_SCAN_ENA, 0); + ret = regmap_clear_bits(adc_priv->regmap, IPROC_REGCTL2, + IPROC_ADC_AUXIN_SCAN_ENA); if (ret) { dev_err(&pdev->dev, "failed to write IPROC_REGCTL2 %d\n", ret); return ret; From patchwork Mon Jun 17 13:49:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700736 Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (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 D756C1BC091 for ; Mon, 17 Jun 2024 13:50:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632204; cv=none; b=eL8BX+8Gmb2P+CVnhhriL3JheBAN33Lx2xJS4sZk0oetSViTsbntvz+TzE9C6emYa2q8t5OBrWM5Wvn1Ph8634lhebm33cOl/oWEOjVw9q6raHDqYH1heq4J1RH8zuRJGxdmBKhFUXOA8BItAAXUf2pePW0Kdr53EGMI1SQcHnQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632204; c=relaxed/simple; bh=ut+W8QUP8tQabPWzbyke7d8OEC6HNxiYzZgFQhQRoBI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=d/EDuSVc8n79kR2lmBwaKEn+Ns5S7TwB+TtSyMNNM16UvOuyn3yZRb0atM80DEoHq2hi/L1XrxvdYx+DVyfZGLHPlpqLl7zr8lb0zguzI/qzWRLFPAKKYH9BUiZYeNClNF9o5SLRwroaB4AtL4P8LXrcV3vnVTPfFg8TYgXC12E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=A0e1Dt7M; arc=none smtp.client-ip=209.85.222.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="A0e1Dt7M" Received: by mail-qk1-f182.google.com with SMTP id af79cd13be357-797dcb558ebso286407085a.2 for ; Mon, 17 Jun 2024 06:50:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632202; x=1719237002; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=/J+uii6o7EZaRWTf6fwT0Zq6b6sr2oRr59Sqisc7RFA=; b=A0e1Dt7MLvlc/bGOcBqTNQqY3UGuqa9z2cD+f/cWkEAK2uBpuVsifs3biV3rPiCyGQ zQEz4SY2nBN4cinTynaI18huo1bkzvJAe21ZuSIyCCEsKBCp3P6jULMLG1g6po/+L6RE S8GUlir5TexIxnG0Neu6ZzwcTvmN0yUdylayF9/myliDJ1K6Rl6v2DCvDgbwdBU9Ik6O tjYUXLnjupKMg9aqhayQeKFrneu6gEoGRj7bn7cDYcgSBdOqYqGnJy+9PYFc5k7r4LyN H0ZrHpQJrYEng0vy5nghc2lHo0zS+8a5McN8skzhDDhbpHqSFROG5fUPbbtg9y3C1FOr pS6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632202; x=1719237002; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/J+uii6o7EZaRWTf6fwT0Zq6b6sr2oRr59Sqisc7RFA=; b=bFH5zQip+Jc5r/zaYDxQAkbkcR2b6qMVoo0En62h70LCsUXm63w9VW2D3EYgrJpQvT sri1kaWzAg9MlKtt5d6ZNDeO+D+hlVv3hsR+Y5ugzDbRzE+exgHT9K5G0lYNK8+tNwDe /VES9KOm22FV30tCcGl4iJaRvCkGlFmZ4bREga2MJeS/feHybDoYK+RGPNGLQWQfiNq1 +RIf0Vffd1dmiqTq4tiNzV2zVuJlUSWXeZ3l63MLIqW3Aa0fYFGU4Wz+AmLgt7VBvcxH EGSqw2mqI30BNOO58ACOtMpqVu34+tSMXpgvIkCwEh5vfr+pbdaTXGvej/K+OiKZEWll +Bng== X-Forwarded-Encrypted: i=1; AJvYcCUZbUU+bYaaQUXGk1FFpk9crKGp4+GKsAcDSFlh4mwOGowKxZexk8irD+XKZmFwR/jGpaEEj6ntmxyivECP0wENuEuw X-Gm-Message-State: AOJu0YxhOkKnHhOFZiNZg/bwzR06MEMvjC5wtun82AXz4UFkTjYBmpB2 IUdXvBkc1Rr2utR+t7r/7AtgwPGmnD4fHkW+9OvP4++xi9C9knYfDvgulG3Jb6w= X-Google-Smtp-Source: AGHT+IHQO7lDiG1TVDzbCtPAbJI8uHKSdU2/yIiDIlagRddBfJsOkXoStyLOw9TY/mBvF1osZeRq9Q== X-Received: by 2002:a05:620a:2955:b0:792:c34d:482 with SMTP id af79cd13be357-798d2413b26mr1228938285a.25.1718632201881; Mon, 17 Jun 2024 06:50:01 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.49.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:01 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:48 -0400 Subject: [PATCH v3 08/41] iio: adc: berlin2-adc: make use of regmap_clear_bits(), regmap_set_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-8-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/adc/berlin2-adc.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/iio/adc/berlin2-adc.c b/drivers/iio/adc/berlin2-adc.c index a4e7c7eff5ac..4cdddc6e36e9 100644 --- a/drivers/iio/adc/berlin2-adc.c +++ b/drivers/iio/adc/berlin2-adc.c @@ -129,8 +129,8 @@ static int berlin2_adc_read(struct iio_dev *indio_dev, int channel) msecs_to_jiffies(1000)); /* Disable the interrupts */ - regmap_update_bits(priv->regmap, BERLIN2_SM_ADC_STATUS, - BERLIN2_SM_ADC_STATUS_INT_EN(channel), 0); + regmap_clear_bits(priv->regmap, BERLIN2_SM_ADC_STATUS, + BERLIN2_SM_ADC_STATUS_INT_EN(channel)); if (ret == 0) ret = -ETIMEDOUT; @@ -139,8 +139,8 @@ static int berlin2_adc_read(struct iio_dev *indio_dev, int channel) return ret; } - regmap_update_bits(priv->regmap, BERLIN2_SM_CTRL, - BERLIN2_SM_CTRL_ADC_START, 0); + regmap_clear_bits(priv->regmap, BERLIN2_SM_CTRL, + BERLIN2_SM_CTRL_ADC_START); data = priv->data; priv->data_available = false; @@ -180,8 +180,8 @@ static int berlin2_adc_tsen_read(struct iio_dev *indio_dev) msecs_to_jiffies(1000)); /* Disable interrupts */ - regmap_update_bits(priv->regmap, BERLIN2_SM_TSEN_STATUS, - BERLIN2_SM_TSEN_STATUS_INT_EN, 0); + regmap_clear_bits(priv->regmap, BERLIN2_SM_TSEN_STATUS, + BERLIN2_SM_TSEN_STATUS_INT_EN); if (ret == 0) ret = -ETIMEDOUT; @@ -190,8 +190,8 @@ static int berlin2_adc_tsen_read(struct iio_dev *indio_dev) return ret; } - regmap_update_bits(priv->regmap, BERLIN2_SM_TSEN_CTRL, - BERLIN2_SM_TSEN_CTRL_START, 0); + regmap_clear_bits(priv->regmap, BERLIN2_SM_TSEN_CTRL, + BERLIN2_SM_TSEN_CTRL_START); data = priv->data; priv->data_available = false; @@ -284,8 +284,7 @@ static const struct iio_info berlin2_adc_info = { static void berlin2_adc_powerdown(void *regmap) { - regmap_update_bits(regmap, BERLIN2_SM_CTRL, - BERLIN2_SM_CTRL_ADC_POWER, 0); + regmap_clear_bits(regmap, BERLIN2_SM_CTRL, BERLIN2_SM_CTRL_ADC_POWER); } @@ -339,9 +338,8 @@ static int berlin2_adc_probe(struct platform_device *pdev) indio_dev->num_channels = ARRAY_SIZE(berlin2_adc_channels); /* Power up the ADC */ - regmap_update_bits(priv->regmap, BERLIN2_SM_CTRL, - BERLIN2_SM_CTRL_ADC_POWER, - BERLIN2_SM_CTRL_ADC_POWER); + regmap_set_bits(priv->regmap, BERLIN2_SM_CTRL, + BERLIN2_SM_CTRL_ADC_POWER); ret = devm_add_action_or_reset(&pdev->dev, berlin2_adc_powerdown, priv->regmap); From patchwork Mon Jun 17 13:49:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700737 Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) (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 F19781BD01C for ; Mon, 17 Jun 2024 13:50:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632206; cv=none; b=l3PCtdPmmp0YurvjFuKln8IwwhUesw/kUaQzALARVI5QsDNy8Hu16VG9Dt+oXObvidABH5T/59mp8Pn6OV1oQklaFEqB8uSl6xutxGjkJbY0xISQAoon32dLioTpV7fcMYZCDw3oEnnmtCrNy2FysDiEYr+IVkqRcTdvukXPDnI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632206; c=relaxed/simple; bh=C6gfMUeKRh6vNiJAqdCzmX2JzDDgIvBqfFNnNfFuGtI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gvHEaDZ0dEfPPzYQg4KXsPpUqQsZdfWtZ8sJu5U/WfVTSQLo0hTTaQ9S4DJItu9VrrOh5d8or/OVbTQY6RGQXPbnW99/mjChSB0XspOpS76ofZvz9rBB8aXE1SKtHRzQYnqiB9fWO7zq93Df+q/Vp8tUGrrngI9IdTOKemQN4As= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=tBxBhg93; arc=none smtp.client-ip=209.85.222.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="tBxBhg93" Received: by mail-qk1-f179.google.com with SMTP id af79cd13be357-795ca45c54cso246567185a.0 for ; Mon, 17 Jun 2024 06:50:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632204; x=1719237004; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ClhrI/fyo1cx6bZjSpXIGRy7tTTxclMqWX7+F4JU4yY=; b=tBxBhg93PegvN3+CjqfY9NxlsMW+8T00L8u8y63pw/mGMb8yFHv4Vxla7wLgxTyEdA 5wO+rowcF+0YQm8u5lavZkBmITz2Ox2EwiVixlUQBbPxvOY4P1zRe7Vzm5G11P1sMODH tBz3oo88pUvo9Ec7IghR37dLnLkL2beS8g6b8LthsITh53u7poLrcwrU+xzG9lnSnd3T zoxWtB6h4s9vPEdNfM0VYhbh8Q0PmS5eg9tCUY3rVTVcxhy0wcwAB2sJEqpgCQPx733D YVp+Br2KnZYKj5BOO8Frc7eOkXvIyx1+XWSu7HpFMje0hpz4790gnviwqKHG3QrP68P6 ZAGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632204; x=1719237004; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ClhrI/fyo1cx6bZjSpXIGRy7tTTxclMqWX7+F4JU4yY=; b=AMxmnbm6cItCxezJ678f9Y1N/OLyyDYaCD9xlMEF73dB0PWX5l0ATuX3y/S0QJkxLX H77TRlcMxrz+pqtbCx+1eDaHhidinzPh6vNXtPtUUqIybosW1V/zczvLskYem/cu/hw8 TVixDavbVF/F9Whk4Z2Ll0U5kKxaEJ7gD8gUJtkzkODFrVSBb1mkRtkY7MZw9GVV19Ho hqDmh3ZDpkytbytBXKs8VWDMrV2tNsOcAem6ChaojKmM1ctKMnYmv7ZU2WSDdV5cd935 R1m8seXhpboekiQM0rLdDL0fyyau0sKHLEMUes4qs+bYdKGfMI327GA4eLymcrjphgTn R8ew== X-Forwarded-Encrypted: i=1; AJvYcCUWtkGZ5ewGP4XdVnCJYRHA5DGEYMu1Zw6EiKDtV+/86AibrNKyPoXB2ud1TE/BE32WWLj+rxN/nKs+jeZuZZib/CGi X-Gm-Message-State: AOJu0YwsIqM1dyTJzbTpy7qIwcmAV0SNxJsXtO8JLoCDdglLOb1cd7KB ElfZA3MHDaXX/Uzo2QOS/sOY2Y/Wca87u/vXrrEMo4L5rE0stX3EkyWxHqabAiE= X-Google-Smtp-Source: AGHT+IGEJP+y4ORB/qQsSLGS1aQN67uw6XFJYR5D2HpTVdZajfNzX+EcKLbp10S7XC6/Qne2Ev/fMQ== X-Received: by 2002:a05:620a:4721:b0:795:55a1:9dd3 with SMTP id af79cd13be357-798d23c4382mr1195766785a.16.1718632204033; Mon, 17 Jun 2024 06:50:04 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:03 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:49 -0400 Subject: [PATCH v3 09/41] iio: adc: cpcap-adc: make use of regmap_clear_bits(), regmap_set_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-9-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/adc/cpcap-adc.c | 46 +++++++++++++++++++-------------------------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/drivers/iio/adc/cpcap-adc.c b/drivers/iio/adc/cpcap-adc.c index b6c4ef70484e..c218acf6c9c6 100644 --- a/drivers/iio/adc/cpcap-adc.c +++ b/drivers/iio/adc/cpcap-adc.c @@ -385,9 +385,8 @@ static irqreturn_t cpcap_adc_irq_thread(int irq, void *data) struct cpcap_adc *ddata = iio_priv(indio_dev); int error; - error = regmap_update_bits(ddata->reg, CPCAP_REG_ADCC2, - CPCAP_BIT_ADTRIG_DIS, - CPCAP_BIT_ADTRIG_DIS); + error = regmap_set_bits(ddata->reg, CPCAP_REG_ADCC2, + CPCAP_BIT_ADTRIG_DIS); if (error) return IRQ_NONE; @@ -424,23 +423,19 @@ static void cpcap_adc_setup_calibrate(struct cpcap_adc *ddata, if (error) return; - error = regmap_update_bits(ddata->reg, CPCAP_REG_ADCC2, - CPCAP_BIT_ATOX_PS_FACTOR | - CPCAP_BIT_ADC_PS_FACTOR1 | - CPCAP_BIT_ADC_PS_FACTOR0, - 0); + error = regmap_clear_bits(ddata->reg, CPCAP_REG_ADCC2, + CPCAP_BIT_ATOX_PS_FACTOR | + CPCAP_BIT_ADC_PS_FACTOR1 | + CPCAP_BIT_ADC_PS_FACTOR0); if (error) return; - error = regmap_update_bits(ddata->reg, CPCAP_REG_ADCC2, - CPCAP_BIT_ADTRIG_DIS, - CPCAP_BIT_ADTRIG_DIS); + error = regmap_set_bits(ddata->reg, CPCAP_REG_ADCC2, + CPCAP_BIT_ADTRIG_DIS); if (error) return; - error = regmap_update_bits(ddata->reg, CPCAP_REG_ADCC2, - CPCAP_BIT_ASC, - CPCAP_BIT_ASC); + error = regmap_set_bits(ddata->reg, CPCAP_REG_ADCC2, CPCAP_BIT_ASC); if (error) return; @@ -455,8 +450,8 @@ static void cpcap_adc_setup_calibrate(struct cpcap_adc *ddata, dev_err(ddata->dev, "Timeout waiting for calibration to complete\n"); - error = regmap_update_bits(ddata->reg, CPCAP_REG_ADCC1, - CPCAP_BIT_CAL_MODE, 0); + error = regmap_clear_bits(ddata->reg, CPCAP_REG_ADCC1, + CPCAP_BIT_CAL_MODE); if (error) return; } @@ -602,26 +597,23 @@ static void cpcap_adc_setup_bank(struct cpcap_adc *ddata, return; if (req->timing == CPCAP_ADC_TIMING_IMM) { - error = regmap_update_bits(ddata->reg, CPCAP_REG_ADCC2, - CPCAP_BIT_ADTRIG_DIS, - CPCAP_BIT_ADTRIG_DIS); + error = regmap_set_bits(ddata->reg, CPCAP_REG_ADCC2, + CPCAP_BIT_ADTRIG_DIS); if (error) return; - error = regmap_update_bits(ddata->reg, CPCAP_REG_ADCC2, - CPCAP_BIT_ASC, - CPCAP_BIT_ASC); + error = regmap_set_bits(ddata->reg, CPCAP_REG_ADCC2, + CPCAP_BIT_ASC); if (error) return; } else { - error = regmap_update_bits(ddata->reg, CPCAP_REG_ADCC2, - CPCAP_BIT_ADTRIG_ONESHOT, - CPCAP_BIT_ADTRIG_ONESHOT); + error = regmap_set_bits(ddata->reg, CPCAP_REG_ADCC2, + CPCAP_BIT_ADTRIG_ONESHOT); if (error) return; - error = regmap_update_bits(ddata->reg, CPCAP_REG_ADCC2, - CPCAP_BIT_ADTRIG_DIS, 0); + error = regmap_clear_bits(ddata->reg, CPCAP_REG_ADCC2, + CPCAP_BIT_ADTRIG_DIS); if (error) return; } From patchwork Mon Jun 17 13:49:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700738 Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (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 3B6321BD4FE for ; Mon, 17 Jun 2024 13:50:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632208; cv=none; b=SNbsysrHoF835VmoZ1AdtFXqKzoU580Grb8we4Tn/TtaBi59LZkJulRNa71cgEBjVZkpQidHfpflsAgRCxiIFMF0R3mbgoy5rTdRFCTKvSBdxN2Y9SivAIjn+UgtD1/17cBErQPhz1CeQEylRGD82dPyZGkWQHvpUvTCurExY6I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632208; c=relaxed/simple; bh=zWMvkgbpb12CypNp6YHAF3/7MiDNI6jYeCI/ir0hmEs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XShzD1FmRY7WrHeuZQJ80N8QBiwBHYku3A2khS/Un10jLQsq94ozt8RkHY/i+YGYG0qsPLdv+NhstbO6S3reOzi5Vbc0aCxUOp7vQ0pVJBetE03T4FRLPSzFEDYVCN6rFEHeVGCoYGLGra/y27Jr4CjtadVepZfiVMxNJYotvRo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=eRiJDO1f; arc=none smtp.client-ip=209.85.222.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="eRiJDO1f" Received: by mail-qk1-f171.google.com with SMTP id af79cd13be357-796df041d73so313355685a.3 for ; Mon, 17 Jun 2024 06:50:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632206; x=1719237006; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=QUJvHuZZxgwBDIkIwz1c6/5nEPPRUcnNJo5C6L4NEfc=; b=eRiJDO1fRpRfsD00XPOg8xMJgEswbHDh3lP2E3Uq07UHCNQ4rFlB5awGLKN+POakCQ VccFfVXNqZIMvSrOW1Vq6Ma0zhOo7vrQTEXCgVNrnZo2+4JtFcBW8MIBCJASf5qDTdFu MZckcef/RbhStB/rTM9ERewn2lB+pmMF1UKEdXYX23s4V+MzowC/+ilkrXIk2A60CMnq ZLoI6qpLk+mVLxYosErExV3dRRqIQbylfqgIbbFBh1qdMaQ29YMJuL8QOYAOIIPQkZ/5 GDnJHwZKqB/PYGQ8wyoE2TljmwEO1C0DKM9sP10HdQnLaq9g9AxPFbw53fFv97G60MUf qKJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632206; x=1719237006; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QUJvHuZZxgwBDIkIwz1c6/5nEPPRUcnNJo5C6L4NEfc=; b=eDKc77CQZJ8uNbEZMhYhZ1ZV1czuuMf9xE5aLA7gnZjWQ4UAH9SxAaMe+xIwy0l4uV m2B+ZNNyDC57Nnq+Png6mf/TdHSPH8CrXccyEkY93oJ1diXI2ro4tUrfLUosDMx8iAcA ML5gHZmQBycjYrDU38QM7JvfE7esI+KanHRO/d4R4AgkE4F7vvgVj+L+JmM6zm4lRFxz Y5SwVYWAOB1Qv4H/Pe7A/8h7XW3EZkBkXGG8kuOeoYxg2QV5cm/K45nX9cp2Nb2RcxFY nhJDaZqTR5VLROVeLRf2YWE0ZaZ67JOSfjLCaShP3gk6e4UyqYPj8d6BwuwYkUbVNPJx 5njw== X-Forwarded-Encrypted: i=1; AJvYcCVynZbw+edL+0Oprk9EouHOUWWCNuf5ZGhRIEmesp8qtnA2sgpzD+n+c7GQeCKFZg4weM8Jzl5BYf1p3ZjN3tCIKiSk X-Gm-Message-State: AOJu0YyKOEGP2TIUAP+GNkj4tsbuE4Bj6cKUctRge0MfH/JKs3nrH54+ yLxWtkesLYLKHjoKQCDD+OdyDdjSzrqt4aa4XrJ2f99RSLq3HOioaRB53J1MelA= X-Google-Smtp-Source: AGHT+IEuE3X+Ttrgd1pciF1gOmiGqm6CNudwXH5GABygzdDAc5BXX3iLlJx1my8INZ4E7qgPOczVYA== X-Received: by 2002:a05:620a:444f:b0:795:5815:2f9f with SMTP id af79cd13be357-798d241d00fmr1205475685a.25.1718632206164; Mon, 17 Jun 2024 06:50:06 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:05 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:50 -0400 Subject: [PATCH v3 10/41] iio: adc: fsl-imx25-gcq: make use of regmap_clear_bits(), regmap_set_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-10-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/adc/fsl-imx25-gcq.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/iio/adc/fsl-imx25-gcq.c b/drivers/iio/adc/fsl-imx25-gcq.c index b680690631db..b3f037510e35 100644 --- a/drivers/iio/adc/fsl-imx25-gcq.c +++ b/drivers/iio/adc/fsl-imx25-gcq.c @@ -87,13 +87,13 @@ static irqreturn_t mx25_gcq_irq(int irq, void *data) regmap_read(priv->regs, MX25_ADCQ_SR, &stats); if (stats & MX25_ADCQ_SR_EOQ) { - regmap_update_bits(priv->regs, MX25_ADCQ_MR, - MX25_ADCQ_MR_EOQ_IRQ, MX25_ADCQ_MR_EOQ_IRQ); + regmap_set_bits(priv->regs, MX25_ADCQ_MR, + MX25_ADCQ_MR_EOQ_IRQ); complete(&priv->completed); } /* Disable conversion queue run */ - regmap_update_bits(priv->regs, MX25_ADCQ_CR, MX25_ADCQ_CR_FQS, 0); + regmap_clear_bits(priv->regs, MX25_ADCQ_CR, MX25_ADCQ_CR_FQS); /* Acknowledge all possible irqs */ regmap_write(priv->regs, MX25_ADCQ_SR, MX25_ADCQ_SR_FRR | @@ -115,11 +115,10 @@ static int mx25_gcq_get_raw_value(struct device *dev, regmap_write(priv->regs, MX25_ADCQ_ITEM_7_0, MX25_ADCQ_ITEM(0, chan->channel)); - regmap_update_bits(priv->regs, MX25_ADCQ_MR, MX25_ADCQ_MR_EOQ_IRQ, 0); + regmap_clear_bits(priv->regs, MX25_ADCQ_MR, MX25_ADCQ_MR_EOQ_IRQ); /* Trigger queue for one run */ - regmap_update_bits(priv->regs, MX25_ADCQ_CR, MX25_ADCQ_CR_FQS, - MX25_ADCQ_CR_FQS); + regmap_set_bits(priv->regs, MX25_ADCQ_CR, MX25_ADCQ_CR_FQS); time_left = wait_for_completion_interruptible_timeout( &priv->completed, MX25_GCQ_TIMEOUT); @@ -272,9 +271,8 @@ static int mx25_gcq_setup_cfgs(struct platform_device *pdev, MX25_ADCQ_CFG_REFN_MASK, refp | refn); } - regmap_update_bits(priv->regs, MX25_ADCQ_CR, - MX25_ADCQ_CR_FRST | MX25_ADCQ_CR_QRST, - MX25_ADCQ_CR_FRST | MX25_ADCQ_CR_QRST); + regmap_set_bits(priv->regs, MX25_ADCQ_CR, + MX25_ADCQ_CR_FRST | MX25_ADCQ_CR_QRST); regmap_write(priv->regs, MX25_ADCQ_CR, MX25_ADCQ_CR_PDMSK | MX25_ADCQ_CR_QSM_FQS); From patchwork Mon Jun 17 13:49:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700739 Received: from mail-vs1-f46.google.com (mail-vs1-f46.google.com [209.85.217.46]) (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 AFE3A1BD51B for ; Mon, 17 Jun 2024 13:50:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632211; cv=none; b=guxtDQXRm8AaehjZ7yGp6Y+kjOEZSLT+y/nlpfFuJvYtHiYif/CdmGZAI1MXrgfjX5c08DXmuifG3xy7Jtv4eF193pmCKi5QA8wc5NAxEaKWNZeh/T602i0rcU+sgNgmLSvTxkh4ISYgbWz5QW06nCKZJwQEtt8sZcCcYsDFZO0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632211; c=relaxed/simple; bh=5OuEWFVCpArtZhx4z8JpNnfTVTHf4ULROK8X14+lutQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eo06vRFVyY/Wv5wpfsF/6vsoWX1rbWRisEe13MjFbUBx/SKEQMzmUf/HO3rwBeFcqTQHlmcpdR0tm3PQ5kFHpd5XQIJdfqibpN7ZD/f2vDF3xo5w8iszzefpMLWNxp5tdrws7ZvIxjRmC/Bzi6S05Pkv342DW0Ch3Kt64dTtuUw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=cjKuFXcE; arc=none smtp.client-ip=209.85.217.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="cjKuFXcE" Received: by mail-vs1-f46.google.com with SMTP id ada2fe7eead31-48e56ae9ac7so334470137.3 for ; Mon, 17 Jun 2024 06:50:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632208; x=1719237008; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=SS/VahdjQ8SKQC25MQPNc7rg+KDijJeHwUtRITveNmM=; b=cjKuFXcEmtNbxK8GgdFutnGoFfalqPn67urmHzXtE3ybJ7NwNhZ9SK2FqvOpzdY12/ 9ogZYiKrasqPHEFMRkWE+IZZPZTnpVLaA+X3wLEvtLKDowHFm/I6EipbsV56wgdvEVj0 +Fk5DJ8MHKBot7Htlibx0aAnt6MRVab+rZKry6QXWVY1APjX32+XygZFofMGj8H95BuX mLoISZK+ekL3rvrmVzZpflRD5LfpnJKMFbHeeciagSoWJ9QnMGc5uEwlV/S46hxifIeh 2kW3j6We7qEdgpHxpiPW8EP7O13+XdXe1BHuZte3h9xirUdVqV/VDfDiSKkTHTPo+qd0 0DKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632208; x=1719237008; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SS/VahdjQ8SKQC25MQPNc7rg+KDijJeHwUtRITveNmM=; b=j5LqB+n9uurTj6gOn5XVyw/RX4Hp0KE5bkUFXJ056TTIggMZWDxJYkN1VgkX0YAZhJ nm0dRhDhnvG6l8NUAH/0xpwSs8YemWYIRO7XfNebgyv258dhtwXfzJ3U7ZJEEqujpWY7 y6yUBmn2ukitE6W+nokRzBWItIdyrYsaL3Ldey7j021+CkJwIDQpxLMwhoHFfSJN5C+j bSv12VxQdRJvo/BxxQiYaMfkF8+JSZKbqjn0Fp/HAmBhvKNA7eLZY1XHDPSsd3r0EhGK 0SzkhuPyEHJWA7QLZUWtDSqfCZ8fFzsNGRaWnbLA+KxmPyaNFRWBnmZgzpigt29FJ6AC I6jA== X-Forwarded-Encrypted: i=1; AJvYcCXEVDIccj135CGkfEA7lNOvFt1YHxeDKsGp007UcrI7KInBHqWOOmxLNGNjTmB8A6xjqlzn7QihqB5AgfKhJU1VrGhg X-Gm-Message-State: AOJu0YywFzR2CUgYOf1FQzn1Z06oHGKXElgR4lZtT4/esDmNHcZ9B2qY Nb1eF3EO+WYTFRmNwa6JPwO2jN/qbDNvlbFQLw8vOkWaZvJlDJxyCBxBATzAyP8= X-Google-Smtp-Source: AGHT+IExs5o6BBy2GiVBbRbl5RTcmAHYS/6pj70WZUFQ8c7/pJkIjoippgtnc/biSc9YFfMmt2B/ig== X-Received: by 2002:a67:f783:0:b0:48d:9b03:3ff4 with SMTP id ada2fe7eead31-48dae3e1559mr9042383137.28.1718632208483; Mon, 17 Jun 2024 06:50:08 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:08 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:51 -0400 Subject: [PATCH v3 11/41] iio: adc: ina2xx-adc: make use of regmap_clear_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-11-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/adc/ina2xx-adc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/adc/ina2xx-adc.c b/drivers/iio/adc/ina2xx-adc.c index 9e52207352fb..727e390bd979 100644 --- a/drivers/iio/adc/ina2xx-adc.c +++ b/drivers/iio/adc/ina2xx-adc.c @@ -1046,8 +1046,7 @@ static void ina2xx_remove(struct i2c_client *client) iio_device_unregister(indio_dev); /* Powerdown */ - ret = regmap_update_bits(chip->regmap, INA2XX_CONFIG, - INA2XX_MODE_MASK, 0); + ret = regmap_clear_bits(chip->regmap, INA2XX_CONFIG, INA2XX_MODE_MASK); if (ret) dev_warn(&client->dev, "Failed to power down device (%pe)\n", ERR_PTR(ret)); From patchwork Mon Jun 17 13:49:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700740 Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (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 A4D031BE251 for ; Mon, 17 Jun 2024 13:50:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632214; cv=none; b=ZM+pON5XwPIXXrUOazC8dJr2iNMkk4Po+OanQ8IdCbGoBDspLrpj1xyix9cefxra+rLB1dTdd4um7IRVOKP+z88/mlEGJniIjHnX2xw8TnZ4LhQHYEFTEK3JLYAcP86lX+4sznWvVrkY+KWQ1OJTP+mDhLtq2D+My/wcn7lg43k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632214; c=relaxed/simple; bh=38T/q5mgwk2j8HZtXOQWhbPXZHF8GM5UZOsgQFkjGgQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ADQ6ydBUyBtGFGPpjKqstFnpCxtxUpSu/bZkgwuBLQEQ+gUpLtQNhLFMNpO4+0YSmsX1QvT2XLOR9sOI3THCMsAUIrUT2rm/CHV+teWE/e4+OasjZ4rdScBVGjRpcztzGrqE4JMlaeI7tW9tNAt1JUMogquvlZ6eNbKvvukdgAA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=nW2tcAEN; arc=none smtp.client-ip=209.85.222.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="nW2tcAEN" Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-795fb13b256so419698985a.0 for ; Mon, 17 Jun 2024 06:50:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632210; x=1719237010; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=DyBlb3Ba1k/jlth0MsPpVigCEg60zHZmfggBIvSR+YQ=; b=nW2tcAENVEBHC/1gauVGo39DPWdQ/pwdQipa+VqZUW6UaguTikYn4BGDmIiqxw4i3Y joXyzOmT4QNHpZuD3gIqvbzBq8UsWPKKew2xIFze2Ox94NVBg6nBdzWHG2KQ0/2HWNoX MgdjxoXxmZ0+GQ2eInZfZ/rmsiG+Np4OEn37UxwnG7W1/KHQXnLVytU5PNIjwWdFi5xr lmjs2a/TxB2Gm2sU6EuojaTEcInCUBeCtdpQxhHBxaXKIzARXl+KVaOFHeTuEQ0VYz/5 6jGhzgcfJBEl1YhTO5t1PbtNRnUY+madsaxO9PYiZk2sGjci9T63W4SrWUUh76sG0Twj b14A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632210; x=1719237010; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DyBlb3Ba1k/jlth0MsPpVigCEg60zHZmfggBIvSR+YQ=; b=nahdY86f1DESMRZmsdzsvmN0s6IPuSSa4ajXlydz95219vdMn48WutTO4LDQVOsWF+ xnhBOK+4HXT0xgnCTIB8cVVYSPuM5NTyMVCWM+/WdGx2WsDvS0PzAnY375RYlshbxQBg S7ikGuIZKWGcbe4UIYdMnOj30kAUUFKjPB/1QTJiUNBi2sXnJ+AK/aYR6Y6iN0rzgsSL vlpJDXpMjQBLXFKH8UioaDT2gb+TY6mZlpfWELNXfkGNb2a6IQsZH2DDnqclVdHh85r2 LK6KbptF1lUpuWPpZixcILZ7hvdFXjwHwIPAGXzspg30P+x5Uegnhq3dRqaWhavodkkE NX1w== X-Forwarded-Encrypted: i=1; AJvYcCVgyug8YiuGuVhNGvG0mIT/LntqrXBgygcwHULFAH45OyGo2nlIUHOXLKk0H8Xn5zRaiNNM/k+4kmkuQjm1wqKN6srb X-Gm-Message-State: AOJu0Yx/mvk4UjzKvMamc/qlhgxEal4QBxABWBraVaQYB2odRPwpmYtA W1pVGn/3wPSCUeP/vLSnYi46DFN/c8qLAJFCv7EZGoyEtxviAquHZNqGcGUvbZ8= X-Google-Smtp-Source: AGHT+IHWmg+UOH3erM5jeRd6l80OV3UNPvKSawdtaAa099apOKn54lBrRboJnTNNmboBsmxvynve5Q== X-Received: by 2002:a05:620a:408a:b0:799:b171:b1fe with SMTP id af79cd13be357-799b171b5f4mr1409403885a.14.1718632210646; Mon, 17 Jun 2024 06:50:10 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:10 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:52 -0400 Subject: [PATCH v3 12/41] iio: adc: intel_mrfld_adc: make use of regmap_clear_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-12-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/adc/intel_mrfld_adc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/intel_mrfld_adc.c b/drivers/iio/adc/intel_mrfld_adc.c index c7f40ae6e608..0590a126f321 100644 --- a/drivers/iio/adc/intel_mrfld_adc.c +++ b/drivers/iio/adc/intel_mrfld_adc.c @@ -81,8 +81,8 @@ static int mrfld_adc_single_conv(struct iio_dev *indio_dev, reinit_completion(&adc->completion); - regmap_update_bits(regmap, BCOVE_MADCIRQ, BCOVE_ADCIRQ_ALL, 0); - regmap_update_bits(regmap, BCOVE_MIRQLVL1, BCOVE_LVL1_ADC, 0); + regmap_clear_bits(regmap, BCOVE_MADCIRQ, BCOVE_ADCIRQ_ALL); + regmap_clear_bits(regmap, BCOVE_MIRQLVL1, BCOVE_LVL1_ADC); ret = regmap_read_poll_timeout(regmap, BCOVE_GPADCREQ, req, !(req & BCOVE_GPADCREQ_BUSY), From patchwork Mon Jun 17 13:49:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700741 Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) (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 CC32C1BE867 for ; Mon, 17 Jun 2024 13:50:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632216; cv=none; b=mGVBhs8EIePGehVgUiKFEy7o8YFbDRx68A4mHk5OYihEbnpCcZQtfOow+DoulbKaUN+XEm2fCvL4VFjCXWOs+aKFonVywgCK+ooXXvySLqWpRDOKYz5aI9Q6bup9VkpMPV2phbu9EJ934vt4tD2gnB7RZDN8S+DIc7qHsZATdHg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632216; c=relaxed/simple; bh=4gIRZ/vu50pKU4o1TP9QUC/IjjrHpbnZ1GOSjHAMZ4M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KZvOHeAimwLmmq+TCa2i99lxwiHzSCvBtI5eqDRC6PBXUKNXQAEnl2Fx4vgMKqpW+s9uoamA2u2De8riCCEoc9mQXhyV8ePbm/Uqd8XocE+rDiMzBYmMNvJR5demjQiZ0VBWPeYH8PMUCBT4RWDTRoi1KdG5E8cOCMy19Oe4prg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=BOGbkqc/; arc=none smtp.client-ip=209.85.222.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="BOGbkqc/" Received: by mail-qk1-f178.google.com with SMTP id af79cd13be357-7955aaf8006so368493685a.1 for ; Mon, 17 Jun 2024 06:50:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632213; x=1719237013; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=KXJIaHqTfmpNhZnTE583n/Ec2b/3cyzD9UXAylu36IA=; b=BOGbkqc/0PySLk4At20sO7V9yYPrXcx9KbY3R4PZGb77lyST1Uf/eJBQCZmsgBiQje nOAhXTaLSXNdtZuwre+lH/A51qF6GFeacIzOJM0zRb2TJQtd/VyDqKk6DgHLWEH53jr8 AT6np24jHmeQyeWP6b+cRFbOb9FSSyZduxiKbuthC6rvDvJlQNxQnZSWgB1OELvkpZPa 8o+x5D7MWtbbKFIxXGwmgwfYIY3nMbYBypghFerUvMzBkFI+OyWTGqFFTZWjRT9fJTkS 7QAPGRBPyDNi9z7JwnJiTXVrp/9WS5egBXUKzP+RXLS24ve+dLMH2fMfy5bKwaLdJ2Pv c7JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632213; x=1719237013; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KXJIaHqTfmpNhZnTE583n/Ec2b/3cyzD9UXAylu36IA=; b=CzmqFonrG/MvBya/LHnSd2fgplvnaNqXtbTYVocLTM18EYwdP83QhdknBBkqC/FDJ6 9wYMBw4H6IpZS/Vum0LhwtKWylGTmiy8StJvL37CH3u3PYpaK01HB0bX7wN6MKMHV8QN zbHvnKcypJ6579IZEBmzNWfQ4tCyWswmzTOheQBpCXfOzPEmCXUV7FQCV5sskQ7h5rgx CreKEDEi6LxGRH8E7SYFP7fV88qk/HogiX9RkEbHvFfp6zl9bIyBzFwHE/+Xt+y4plES AMDbX/WOqC2r7F9qW5S2RGN/LRAQHs20XHC4cwaKTSDw7pcZ9uVSPRh9ud/hQ9tsDVQe NeIA== X-Forwarded-Encrypted: i=1; AJvYcCXAIfnKi/1Jm1Vl9y057zCccdYJRGCOqT9D5VZ1J3F6vFQvAVzUpEmDRv9aPsBRpacNuR3HAxnorrPqTPpjdleX7EHs X-Gm-Message-State: AOJu0YzWeYrSpP4gAxPgaxTG7XXl0aWNf6ASl3pg/ftPhs4xUOfk/ccw oJ2xgiSr2TgT97UzA//Q+VZVfegtISQ38MQ8nR+odWtwJ6XahPs1FHKQUWSeHd8= X-Google-Smtp-Source: AGHT+IFE4+GjUcRvfBj86U5p9RlM1W0UrqMbwwjDZojT1mdFRj7PyY3udpb+reAC5jxDfHM60DBB3g== X-Received: by 2002:a05:620a:28c7:b0:797:8564:920a with SMTP id af79cd13be357-798d2413c45mr1111201285a.29.1718632212779; Mon, 17 Jun 2024 06:50:12 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:12 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:53 -0400 Subject: [PATCH v3 13/41] iio: adc: meson_saradc: make use of regmap_clear_bits(), regmap_set_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-13-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin Reviewed-by: George Stark --- drivers/iio/adc/meson_saradc.c | 101 ++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 57 deletions(-) diff --git a/drivers/iio/adc/meson_saradc.c b/drivers/iio/adc/meson_saradc.c index 13b473d8c6c7..e16b0e28974e 100644 --- a/drivers/iio/adc/meson_saradc.c +++ b/drivers/iio/adc/meson_saradc.c @@ -546,35 +546,31 @@ static void meson_sar_adc_start_sample_engine(struct iio_dev *indio_dev) reinit_completion(&priv->done); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG0, - MESON_SAR_ADC_REG0_FIFO_IRQ_EN, - MESON_SAR_ADC_REG0_FIFO_IRQ_EN); + regmap_set_bits(priv->regmap, MESON_SAR_ADC_REG0, + MESON_SAR_ADC_REG0_FIFO_IRQ_EN); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG0, - MESON_SAR_ADC_REG0_SAMPLE_ENGINE_ENABLE, - MESON_SAR_ADC_REG0_SAMPLE_ENGINE_ENABLE); + regmap_set_bits(priv->regmap, MESON_SAR_ADC_REG0, + MESON_SAR_ADC_REG0_SAMPLE_ENGINE_ENABLE); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG0, - MESON_SAR_ADC_REG0_SAMPLING_START, - MESON_SAR_ADC_REG0_SAMPLING_START); + regmap_set_bits(priv->regmap, MESON_SAR_ADC_REG0, + MESON_SAR_ADC_REG0_SAMPLING_START); } static void meson_sar_adc_stop_sample_engine(struct iio_dev *indio_dev) { struct meson_sar_adc_priv *priv = iio_priv(indio_dev); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG0, - MESON_SAR_ADC_REG0_FIFO_IRQ_EN, 0); + regmap_clear_bits(priv->regmap, MESON_SAR_ADC_REG0, + MESON_SAR_ADC_REG0_FIFO_IRQ_EN); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG0, - MESON_SAR_ADC_REG0_SAMPLING_STOP, - MESON_SAR_ADC_REG0_SAMPLING_STOP); + regmap_set_bits(priv->regmap, MESON_SAR_ADC_REG0, + MESON_SAR_ADC_REG0_SAMPLING_STOP); /* wait until all modules are stopped */ meson_sar_adc_wait_busy_clear(indio_dev); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG0, - MESON_SAR_ADC_REG0_SAMPLE_ENGINE_ENABLE, 0); + regmap_clear_bits(priv->regmap, MESON_SAR_ADC_REG0, + MESON_SAR_ADC_REG0_SAMPLE_ENGINE_ENABLE); } static int meson_sar_adc_lock(struct iio_dev *indio_dev) @@ -586,9 +582,8 @@ static int meson_sar_adc_lock(struct iio_dev *indio_dev) if (priv->param->has_bl30_integration) { /* prevent BL30 from using the SAR ADC while we are using it */ - regmap_update_bits(priv->regmap, MESON_SAR_ADC_DELAY, - MESON_SAR_ADC_DELAY_KERNEL_BUSY, - MESON_SAR_ADC_DELAY_KERNEL_BUSY); + regmap_set_bits(priv->regmap, MESON_SAR_ADC_DELAY, + MESON_SAR_ADC_DELAY_KERNEL_BUSY); udelay(1); @@ -614,8 +609,8 @@ static void meson_sar_adc_unlock(struct iio_dev *indio_dev) if (priv->param->has_bl30_integration) /* allow BL30 to use the SAR ADC again */ - regmap_update_bits(priv->regmap, MESON_SAR_ADC_DELAY, - MESON_SAR_ADC_DELAY_KERNEL_BUSY, 0); + regmap_clear_bits(priv->regmap, MESON_SAR_ADC_DELAY, + MESON_SAR_ADC_DELAY_KERNEL_BUSY); mutex_unlock(&priv->lock); } @@ -869,17 +864,16 @@ static int meson_sar_adc_init(struct iio_dev *indio_dev) * disable this bit as seems to be only relevant for Meson6 (based * on the vendor driver), which we don't support at the moment. */ - regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG0, - MESON_SAR_ADC_REG0_ADC_TEMP_SEN_SEL, 0); + regmap_clear_bits(priv->regmap, MESON_SAR_ADC_REG0, + MESON_SAR_ADC_REG0_ADC_TEMP_SEN_SEL); /* disable all channels by default */ regmap_write(priv->regmap, MESON_SAR_ADC_CHAN_LIST, 0x0); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG3, - MESON_SAR_ADC_REG3_CTRL_SAMPLING_CLOCK_PHASE, 0); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG3, - MESON_SAR_ADC_REG3_CNTL_USE_SC_DLY, - MESON_SAR_ADC_REG3_CNTL_USE_SC_DLY); + regmap_clear_bits(priv->regmap, MESON_SAR_ADC_REG3, + MESON_SAR_ADC_REG3_CTRL_SAMPLING_CLOCK_PHASE); + regmap_set_bits(priv->regmap, MESON_SAR_ADC_REG3, + MESON_SAR_ADC_REG3_CNTL_USE_SC_DLY); /* delay between two samples = (10+1) * 1uS */ regmap_update_bits(priv->regmap, MESON_SAR_ADC_DELAY, @@ -914,21 +908,17 @@ static int meson_sar_adc_init(struct iio_dev *indio_dev) MESON_SAR_ADC_CHAN_10_SW_CHAN1_MUX_SEL_MASK, regval); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_CHAN_10_SW, - MESON_SAR_ADC_CHAN_10_SW_CHAN0_XP_DRIVE_SW, - MESON_SAR_ADC_CHAN_10_SW_CHAN0_XP_DRIVE_SW); + regmap_set_bits(priv->regmap, MESON_SAR_ADC_CHAN_10_SW, + MESON_SAR_ADC_CHAN_10_SW_CHAN0_XP_DRIVE_SW); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_CHAN_10_SW, - MESON_SAR_ADC_CHAN_10_SW_CHAN0_YP_DRIVE_SW, - MESON_SAR_ADC_CHAN_10_SW_CHAN0_YP_DRIVE_SW); + regmap_set_bits(priv->regmap, MESON_SAR_ADC_CHAN_10_SW, + MESON_SAR_ADC_CHAN_10_SW_CHAN0_YP_DRIVE_SW); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_CHAN_10_SW, - MESON_SAR_ADC_CHAN_10_SW_CHAN1_XP_DRIVE_SW, - MESON_SAR_ADC_CHAN_10_SW_CHAN1_XP_DRIVE_SW); + regmap_set_bits(priv->regmap, MESON_SAR_ADC_CHAN_10_SW, + MESON_SAR_ADC_CHAN_10_SW_CHAN1_XP_DRIVE_SW); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_CHAN_10_SW, - MESON_SAR_ADC_CHAN_10_SW_CHAN1_YP_DRIVE_SW, - MESON_SAR_ADC_CHAN_10_SW_CHAN1_YP_DRIVE_SW); + regmap_set_bits(priv->regmap, MESON_SAR_ADC_CHAN_10_SW, + MESON_SAR_ADC_CHAN_10_SW_CHAN1_YP_DRIVE_SW); /* * set up the input channel muxes in MESON_SAR_ADC_AUX_SW @@ -944,12 +934,10 @@ static int meson_sar_adc_init(struct iio_dev *indio_dev) regmap_write(priv->regmap, MESON_SAR_ADC_AUX_SW, regval); if (priv->temperature_sensor_calibrated) { - regmap_update_bits(priv->regmap, MESON_SAR_ADC_DELTA_10, - MESON_SAR_ADC_DELTA_10_TS_REVE1, - MESON_SAR_ADC_DELTA_10_TS_REVE1); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_DELTA_10, - MESON_SAR_ADC_DELTA_10_TS_REVE0, - MESON_SAR_ADC_DELTA_10_TS_REVE0); + regmap_set_bits(priv->regmap, MESON_SAR_ADC_DELTA_10, + MESON_SAR_ADC_DELTA_10_TS_REVE1); + regmap_set_bits(priv->regmap, MESON_SAR_ADC_DELTA_10, + MESON_SAR_ADC_DELTA_10_TS_REVE0); /* * set bits [3:0] of the TSC (temperature sensor coefficient) @@ -976,10 +964,10 @@ static int meson_sar_adc_init(struct iio_dev *indio_dev) regval); } } else { - regmap_update_bits(priv->regmap, MESON_SAR_ADC_DELTA_10, - MESON_SAR_ADC_DELTA_10_TS_REVE1, 0); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_DELTA_10, - MESON_SAR_ADC_DELTA_10_TS_REVE0, 0); + regmap_clear_bits(priv->regmap, MESON_SAR_ADC_DELTA_10, + MESON_SAR_ADC_DELTA_10_TS_REVE1); + regmap_clear_bits(priv->regmap, MESON_SAR_ADC_DELTA_10, + MESON_SAR_ADC_DELTA_10_TS_REVE0); } regval = FIELD_PREP(MESON_SAR_ADC_REG3_CTRL_CONT_RING_COUNTER_EN, @@ -1062,9 +1050,8 @@ static int meson_sar_adc_hw_enable(struct iio_dev *indio_dev) meson_sar_adc_set_bandgap(indio_dev, true); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG3, - MESON_SAR_ADC_REG3_ADC_EN, - MESON_SAR_ADC_REG3_ADC_EN); + regmap_set_bits(priv->regmap, MESON_SAR_ADC_REG3, + MESON_SAR_ADC_REG3_ADC_EN); udelay(5); @@ -1079,8 +1066,8 @@ static int meson_sar_adc_hw_enable(struct iio_dev *indio_dev) return 0; err_adc_clk: - regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG3, - MESON_SAR_ADC_REG3_ADC_EN, 0); + regmap_clear_bits(priv->regmap, MESON_SAR_ADC_REG3, + MESON_SAR_ADC_REG3_ADC_EN); meson_sar_adc_set_bandgap(indio_dev, false); regulator_disable(priv->vref); err_vref: @@ -1104,8 +1091,8 @@ static void meson_sar_adc_hw_disable(struct iio_dev *indio_dev) clk_disable_unprepare(priv->adc_clk); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG3, - MESON_SAR_ADC_REG3_ADC_EN, 0); + regmap_clear_bits(priv->regmap, MESON_SAR_ADC_REG3, + MESON_SAR_ADC_REG3_ADC_EN); meson_sar_adc_set_bandgap(indio_dev, false); From patchwork Mon Jun 17 13:49:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700742 Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) (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 D55DE1C0DD2 for ; Mon, 17 Jun 2024 13:50:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632217; cv=none; b=bAt09glAj1URij4q0/2/W0Q3m5hzE/qT2OKLJFUTP4Sz2nQbuXfGA3KCY/CeWj2yJmp1bqzOvMuSqxHcaXHnWqVaHrBuHO0fUXrdUUInnxvB+PD+XcrOjaDfpwAS7V1NJm6iH42Sl0kDSW5mwQI/ZOksWhIOOkvgRm/CXIJ2zbI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632217; c=relaxed/simple; bh=fzPzUYcNz9V2ID3qrrApafMZGiDVZpy6ghrI0nU92Lw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Gr5cjXQb0zjDHvzXd6uoZmJlibASta4KP2mPT4e4mflBtjBEjr5YtcbInF54Gn9flAYLA6czG7jc7e8vhQ00r7ZgHlH7cgQZPgdn8ZWWN5A49iy57nCGN3txIEMxwUKb88qGAQb+odrxnO1Je83oZ0qDmDWvUGG+aS/TXRBfEOc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=FR5emlIV; arc=none smtp.client-ip=209.85.222.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="FR5emlIV" Received: by mail-qk1-f172.google.com with SMTP id af79cd13be357-795569eedcaso228709585a.3 for ; Mon, 17 Jun 2024 06:50:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632215; x=1719237015; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=GyaMuqBhP7o7wmqZwNnsnkbTtRp5AugJ4lcsefsATFM=; b=FR5emlIVR5/gTeE96016BCtEuqObXY1YISSBXYIiEsCGdXJl9CPm0oEXZbHmNCjHxI YMWkyHCNR15SeHuZwus/vd88ws8Vu727rdHaAUilEADfKe/yGTXUCRI9+RwaACo1+zgJ XLMwxG1Ep4gDY3JA4FwM5elVcOJ8ifntqIk+hYAWuAGWzOj5g9xSkPae8IID00E96I0n S30waO2zjyJeg/b+Ctu4cPdF2fQU0XIUaBWLzDDJNyew0vdqjBBkAXHIAc5b2z3+5eed 847YscUjzC2FS8YkS5C0JIE6LO0XgaxDwY322oNzaLWzkQ4P++1edbG8DoBYiBkiLtqb 7cBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632215; x=1719237015; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GyaMuqBhP7o7wmqZwNnsnkbTtRp5AugJ4lcsefsATFM=; b=pG377fVxTesfmmTxJyJM77FuuerXaFmH4xsPcvrCl/g60XlQd/ye8eeQKYVhnXx1su 9F0Uq9vY4SczNzaafqqs9BoB/3xaOuMiYdSH7ecGqu958iN18GIqz6c+B3/GfgyPYL4d aNmnMUac0Qq2OJwgjBlJo7GiLGFBxWDI0A4t97E/Vebl5XbnIBonRI5a/G3Wghe9J0Kx wXHqr/sfoZphyesLYQ+cJeqzYe7UZeodEcJZ7JFcT+XXIRe+Sm25E4+bchkCg8cXR1nK C+5/wVqiONT88yt20jLwCJZIGnsnVg/1N8VNppHSGwW4Qs+y6NV7agZAkE7IwDE2Zm7q NIXg== X-Forwarded-Encrypted: i=1; AJvYcCWHCd04Mz+bna2t6rZfm1y4Y2sNfCftPzsiScJVf7sbPlAfQ9glh2OKCp4Y6KjbEm1ZRMws384M8ismQSyLSC/tVRxi X-Gm-Message-State: AOJu0YxSfhxipmTGhpM2pfL4vfB+2yZH4ZlBQi4qOWsaMWNUl01B5+J5 XW6UXmwnLd22o/mRrnuDZedoqeYJBvzz8CmeJNV7ZzJBqLJ8KmCdcm08NBolsZk= X-Google-Smtp-Source: AGHT+IG9rvLxXHys5yM3fiDf+G14AWJNmGoLIu5wSpeGGOXNzHBF3wjPuE24N3ncETdlUUNQNA6oSA== X-Received: by 2002:a05:620a:45aa:b0:795:4e64:dbbe with SMTP id af79cd13be357-798d1f824a7mr1191474185a.0.1718632214915; Mon, 17 Jun 2024 06:50:14 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:14 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:54 -0400 Subject: [PATCH v3 14/41] iio: adc: mp2629_adc: make use of regmap_clear_bits(), regmap_set_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-14-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/adc/mp2629_adc.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/iio/adc/mp2629_adc.c b/drivers/iio/adc/mp2629_adc.c index 7c66c2cd5be2..5f672765d4a2 100644 --- a/drivers/iio/adc/mp2629_adc.c +++ b/drivers/iio/adc/mp2629_adc.c @@ -131,9 +131,8 @@ static int mp2629_adc_probe(struct platform_device *pdev) info->dev = dev; platform_set_drvdata(pdev, indio_dev); - ret = regmap_update_bits(info->regmap, MP2629_REG_ADC_CTRL, - MP2629_ADC_START | MP2629_ADC_CONTINUOUS, - MP2629_ADC_START | MP2629_ADC_CONTINUOUS); + ret = regmap_set_bits(info->regmap, MP2629_REG_ADC_CTRL, + MP2629_ADC_START | MP2629_ADC_CONTINUOUS); if (ret) { dev_err(dev, "adc enable fail: %d\n", ret); return ret; @@ -163,10 +162,9 @@ static int mp2629_adc_probe(struct platform_device *pdev) iio_map_array_unregister(indio_dev); fail_disable: - regmap_update_bits(info->regmap, MP2629_REG_ADC_CTRL, - MP2629_ADC_CONTINUOUS, 0); - regmap_update_bits(info->regmap, MP2629_REG_ADC_CTRL, - MP2629_ADC_START, 0); + regmap_clear_bits(info->regmap, MP2629_REG_ADC_CTRL, + MP2629_ADC_CONTINUOUS); + regmap_clear_bits(info->regmap, MP2629_REG_ADC_CTRL, MP2629_ADC_START); return ret; } @@ -180,10 +178,9 @@ static void mp2629_adc_remove(struct platform_device *pdev) iio_map_array_unregister(indio_dev); - regmap_update_bits(info->regmap, MP2629_REG_ADC_CTRL, - MP2629_ADC_CONTINUOUS, 0); - regmap_update_bits(info->regmap, MP2629_REG_ADC_CTRL, - MP2629_ADC_START, 0); + regmap_clear_bits(info->regmap, MP2629_REG_ADC_CTRL, + MP2629_ADC_CONTINUOUS); + regmap_clear_bits(info->regmap, MP2629_REG_ADC_CTRL, MP2629_ADC_START); } static const struct of_device_id mp2629_adc_of_match[] = { From patchwork Mon Jun 17 13:49:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700743 Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (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 1E3BB1C0DFE for ; Mon, 17 Jun 2024 13:50:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632219; cv=none; b=fCXK9wtjmpyMAVgpTKOnxyZuUparC9H84VUlEydo0qt6QEJsaWLq/A8WcAwzJlveSBrINwRyfUdFejIR5oipgu/8cOj6RFMxSu9f2rLwUeBMk7iv2D2HxNjDjzBi35Pr/OWw+EW/JL7i5Qrsz2kCTuQzfhC3tgB4QjZSDKvMIy8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632219; c=relaxed/simple; bh=MPFBeRiBqEWL2ZmKqHZsE/yYze6ZRHtpV3TD+LCyks4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PszmBhoF5Mww5Mz+ZIeMR5ndfStepuLTUm0bbqXiaFrUOJgPmLct06ud9FhJsTJawyrEAro0fpl6/DqmfR9zt3nQayAaHlOECgU4NZhBS8cGsztuv1ATCRSYMjWx8dklFvIUPNBUxkTK7i377QYo0aucXBaoF9y/ZUl8FWoPUCI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=M38+BemS; arc=none smtp.client-ip=209.85.222.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="M38+BemS" Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-79550284502so267240185a.2 for ; Mon, 17 Jun 2024 06:50:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632217; x=1719237017; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=FJ898fDCKj42D5/vtQAto1s5SAQxhzxV4OLmCarOpnQ=; b=M38+BemSMwZwB9Lm5BwljlZFczIsKs5wh/Emi10TBh3tnHim7gfZFrgL5jiU63EEHP m8aSvH62ZIe81wMIvc9ayy0NjDGjt+1XtEG/ytBeeMKuh4QO3BmOEK2hkTwZl3MlEZsK XWty7j9VUANWfSUWD/1L1cyBj8YzqlMX1Kz53P+ykCffiOLCQSqgX28EzuNdUtmm0kKv Q+19Kp+0ZyNnWFjfLrRmPhy3Tc4IUsvLqdEgyd/R8RVaTeL7K/E5LHRonoA/u5/iFmE7 vSL3mCss+o7CXTSlpX+BtIe85P/latpFrE7RJJm8qexXy1feJn7qLN/1H6bOUrg0jv2d VYSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632217; x=1719237017; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FJ898fDCKj42D5/vtQAto1s5SAQxhzxV4OLmCarOpnQ=; b=QATswDnbD7kltyDLP03V7KgUNCTlbMhx/QjFJXB713xEMsoy1C7euNa07QVzkEKOIa 42z982me9OxLsZ/kr7vVRkdmtNXKsPPtz7DcMHxwobx5yDLtCUnArkRZqKxqbwODOC1i VLdgPRoUmroSokBimU7O4fL0UHU4WKcRI9XYitmBZg+cawwUuXzhOEMUvRqsfRYVnhm/ YPHe8ToJsxuu3mMTzQ1G6r53Z8oDeScDC00ir9VVGiTNGEUfL1EXQd7DE9GtsNStjJwJ RviiLx3KGxN0C34r/Z/dVhuWtEpQMlEmRZLW27dDd05RX7sICjmwGLGPQIIUzv33gMhz FvFw== X-Forwarded-Encrypted: i=1; AJvYcCUEPFvKY7Lr5RHtj/X8bCnDQR1tezvJYdGgqF/pbEuHcjz7cCy1WWJBEs1F3LI3uLubtFmzgFmn43/uS9sNsIwP76tK X-Gm-Message-State: AOJu0Yxu9jlJ43WyY0O6aukF3ryZ78Sl1lSvLNJKooVi+rgMrFrYo86p WmVmmzm507PKSV+KwBriNlTE4fAkGeSmftd0816tWvPlwOYm67joRfIqyajMA6E= X-Google-Smtp-Source: AGHT+IG7O2bJi0GCfnphwmiN8zuYwAKTZAA7K/LgtdsfOhK/hCe8sAhzrzmLoDYS8PhLsNItnynlLA== X-Received: by 2002:a05:620a:404a:b0:795:2307:97ec with SMTP id af79cd13be357-798d2588f12mr1074628285a.56.1718632217032; Mon, 17 Jun 2024 06:50:17 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:16 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:55 -0400 Subject: [PATCH v3 15/41] iio: adc: qcom-spmi-rradc: make use of regmap_clear_bits(), regmap_set_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-15-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/adc/qcom-spmi-rradc.c | 50 +++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/drivers/iio/adc/qcom-spmi-rradc.c b/drivers/iio/adc/qcom-spmi-rradc.c index 56a713766954..1402df68dd52 100644 --- a/drivers/iio/adc/qcom-spmi-rradc.c +++ b/drivers/iio/adc/qcom-spmi-rradc.c @@ -358,15 +358,15 @@ static int rradc_enable_continuous_mode(struct rradc_chip *chip) int ret; /* Clear channel log */ - ret = regmap_update_bits(chip->regmap, chip->base + RR_ADC_LOG, - RR_ADC_LOG_CLR_CTRL, RR_ADC_LOG_CLR_CTRL); + ret = regmap_set_bits(chip->regmap, chip->base + RR_ADC_LOG, + RR_ADC_LOG_CLR_CTRL); if (ret < 0) { dev_err(chip->dev, "log ctrl update to clear failed:%d\n", ret); return ret; } - ret = regmap_update_bits(chip->regmap, chip->base + RR_ADC_LOG, - RR_ADC_LOG_CLR_CTRL, 0); + ret = regmap_clear_bits(chip->regmap, chip->base + RR_ADC_LOG, + RR_ADC_LOG_CLR_CTRL); if (ret < 0) { dev_err(chip->dev, "log ctrl update to not clear failed:%d\n", ret); @@ -374,9 +374,8 @@ static int rradc_enable_continuous_mode(struct rradc_chip *chip) } /* Switch to continuous mode */ - ret = regmap_update_bits(chip->regmap, chip->base + RR_ADC_CTL, - RR_ADC_CTL_CONTINUOUS_SEL, - RR_ADC_CTL_CONTINUOUS_SEL); + ret = regmap_set_bits(chip->regmap, chip->base + RR_ADC_CTL, + RR_ADC_CTL_CONTINUOUS_SEL); if (ret < 0) dev_err(chip->dev, "Update to continuous mode failed:%d\n", ret); @@ -389,8 +388,8 @@ static int rradc_disable_continuous_mode(struct rradc_chip *chip) int ret; /* Switch to non continuous mode */ - ret = regmap_update_bits(chip->regmap, chip->base + RR_ADC_CTL, - RR_ADC_CTL_CONTINUOUS_SEL, 0); + ret = regmap_clear_bits(chip->regmap, chip->base + RR_ADC_CTL, + RR_ADC_CTL_CONTINUOUS_SEL); if (ret < 0) dev_err(chip->dev, "Update to non-continuous mode failed:%d\n", ret); @@ -434,8 +433,8 @@ static int rradc_read_status_in_cont_mode(struct rradc_chip *chip, return -EINVAL; } - ret = regmap_update_bits(chip->regmap, chip->base + chan->trigger_addr, - chan->trigger_mask, chan->trigger_mask); + ret = regmap_set_bits(chip->regmap, chip->base + chan->trigger_addr, + chan->trigger_mask); if (ret < 0) { dev_err(chip->dev, "Failed to apply trigger for channel '%s' ret=%d\n", @@ -469,8 +468,8 @@ static int rradc_read_status_in_cont_mode(struct rradc_chip *chip, rradc_disable_continuous_mode(chip); disable_trigger: - regmap_update_bits(chip->regmap, chip->base + chan->trigger_addr, - chan->trigger_mask, 0); + regmap_clear_bits(chip->regmap, chip->base + chan->trigger_addr, + chan->trigger_mask); return ret; } @@ -481,17 +480,16 @@ static int rradc_prepare_batt_id_conversion(struct rradc_chip *chip, { int ret; - ret = regmap_update_bits(chip->regmap, chip->base + RR_ADC_BATT_ID_CTRL, - RR_ADC_BATT_ID_CTRL_CHANNEL_CONV, - RR_ADC_BATT_ID_CTRL_CHANNEL_CONV); + ret = regmap_set_bits(chip->regmap, chip->base + RR_ADC_BATT_ID_CTRL, + RR_ADC_BATT_ID_CTRL_CHANNEL_CONV); if (ret < 0) { dev_err(chip->dev, "Enabling BATT ID channel failed:%d\n", ret); return ret; } - ret = regmap_update_bits(chip->regmap, - chip->base + RR_ADC_BATT_ID_TRIGGER, - RR_ADC_TRIGGER_CTL, RR_ADC_TRIGGER_CTL); + ret = regmap_set_bits(chip->regmap, + chip->base + RR_ADC_BATT_ID_TRIGGER, + RR_ADC_TRIGGER_CTL); if (ret < 0) { dev_err(chip->dev, "BATT_ID trigger set failed:%d\n", ret); goto out_disable_batt_id; @@ -500,12 +498,12 @@ static int rradc_prepare_batt_id_conversion(struct rradc_chip *chip, ret = rradc_read_status_in_cont_mode(chip, chan_address); /* Reset registers back to default values */ - regmap_update_bits(chip->regmap, chip->base + RR_ADC_BATT_ID_TRIGGER, - RR_ADC_TRIGGER_CTL, 0); + regmap_clear_bits(chip->regmap, chip->base + RR_ADC_BATT_ID_TRIGGER, + RR_ADC_TRIGGER_CTL); out_disable_batt_id: - regmap_update_bits(chip->regmap, chip->base + RR_ADC_BATT_ID_CTRL, - RR_ADC_BATT_ID_CTRL_CHANNEL_CONV, 0); + regmap_clear_bits(chip->regmap, chip->base + RR_ADC_BATT_ID_CTRL, + RR_ADC_BATT_ID_CTRL_CHANNEL_CONV); return ret; } @@ -965,9 +963,9 @@ static int rradc_probe(struct platform_device *pdev) if (batt_id_delay >= 0) { batt_id_delay = FIELD_PREP(BATT_ID_SETTLE_MASK, batt_id_delay); - ret = regmap_update_bits(chip->regmap, - chip->base + RR_ADC_BATT_ID_CFG, - batt_id_delay, batt_id_delay); + ret = regmap_set_bits(chip->regmap, + chip->base + RR_ADC_BATT_ID_CFG, + batt_id_delay); if (ret < 0) { dev_err(chip->dev, "BATT_ID settling time config failed:%d\n", From patchwork Mon Jun 17 13:49:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700744 Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) (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 2CCCF1C2310 for ; Mon, 17 Jun 2024 13:50:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632222; cv=none; b=j7PgqYm8tMMSX72pJ8aSyxc+AWONrKUjcELmlvHUaRsbzpMvRxgm+Ab0NyadEfbNgYZrLCU1K2BaD+WCgJ30SImqFSTILA4TAMY12fO7mjyCx3SY6j/tA17wlxohfLCGGAwVHaQ0hGsF08f/xkd0yUI3H288exI1MmNfNLrCEuw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632222; c=relaxed/simple; bh=guuqVXSs2s7BD/iWi4IU8Nf6aEgnRuSwwDipuP5iGhw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LaY3lexXn0uTZK2NxcNpJuVxerynlge0POpmgeBa4AidrxRyxhCqzFbcXTj5yt1Zs27hjAoscfuNl5r88/X8lkbMyI997WEPbu3y+cotImPeOHmbxZwDKQBbJxxroL5fZgw3bQhuQjvLBeOuK+PemZ+dGrD5nRACAg2S44mDyUg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=kd0s5uVs; arc=none smtp.client-ip=209.85.222.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="kd0s5uVs" Received: by mail-qk1-f178.google.com with SMTP id af79cd13be357-797f1287aa3so342732685a.2 for ; Mon, 17 Jun 2024 06:50:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632219; x=1719237019; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=KVb/0PilAc52B9kaVfDX+4rlv8WRgZtRLdvIf/r6J1Y=; b=kd0s5uVsCb+VXwGz9f2i4i0pAZuXaOjiFnCAHA29LFzGnOJpoxYG1xXEtDmC/JXrOw yWrPkm/o/zUtaqnJabyYMKEEDyouks06ikZwEMlr9HxY9Y5Jhljbm0sFjYVkK6/MXt+2 GwPjTSU8NbircOOVFJR3h+ekOOE5AvxCdkJoJUV/DnZy0wgWAvdnP+h9fNYAZugruCGi F2ygCVrtjLmuhyfy7S7kN87CwO4VcxPOYJpEesmvEtXoFQbAwUVW7AIDuURRnq9hH9Vf Li8OGpoBJuN3S5AbRS2bT7Y8ONLG26G1r/h2bw+UV8pstTei8xoNgG/PBud0KzAjZXq2 AKaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632219; x=1719237019; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KVb/0PilAc52B9kaVfDX+4rlv8WRgZtRLdvIf/r6J1Y=; b=NQm1wll9+NCebdcZVBUe0l1UVrrnC9kPisrREOvlGUzSmtLYJo+PZ6wa/j0dJH7SvH RzyumqBFr4WcuDoJvO80ebjhQzuAa7zxUwAzifVhgDOFfVdh3D7Vsr/gePlB5+zPAR2E dO34/7fHnOnfuLAKireFcsOKISYEiEDhMR5CsQbr0o285Nlwoyqog9DtdFNUPo8sQ7S6 KcPs7wfalzKDiG83rqFe+HJSd8ZvRtkcwyFPmksMDGl7ZbdFn99BdbFiiVpU4vhD4VTK PPnSJ6hMh/L8aYxZndXYrifTRQ3FaVgsMqAd2g5ivvCPU3tQD30d1Xqx7vEI9hDiLvOZ AyvA== X-Forwarded-Encrypted: i=1; AJvYcCX/g5z/uzMnIqgoUCFhm3ic5EUiAQxvd0e61Q9u9H3u7pmJuzIIYMZ8HS5ibIjwDeMnZ8k56rQzW5MkF72D7242b4ld X-Gm-Message-State: AOJu0YzLeP+R1qovv5POS84LvdJTHGm5UXQ2O8zxvIbpfJswYGbHkAul aytSAs/vThpk+kywmM5nztk0GXfLXIO7Go9b3kqkcHWLsCzJxTleTyeSVPrBFF4= X-Google-Smtp-Source: AGHT+IEhAnjjomgk19gOfh4FY6+tmL+ftVg/dpR5n10Qt2NpVGAkWAorRIXV5RllBFaajmvErpGqLg== X-Received: by 2002:a05:620a:370d:b0:796:842c:77f1 with SMTP id af79cd13be357-798d243aaa6mr1278103785a.36.1718632219186; Mon, 17 Jun 2024 06:50:19 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:18 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:56 -0400 Subject: [PATCH v3 16/41] iio: adc: rn5t618-adc: make use of regmap_set_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-16-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/adc/rn5t618-adc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/rn5t618-adc.c b/drivers/iio/adc/rn5t618-adc.c index 6bf32907f01d..ce5f3011fe00 100644 --- a/drivers/iio/adc/rn5t618-adc.c +++ b/drivers/iio/adc/rn5t618-adc.c @@ -137,9 +137,8 @@ static int rn5t618_adc_read(struct iio_dev *iio_dev, init_completion(&adc->conv_completion); /* single conversion */ - ret = regmap_update_bits(adc->rn5t618->regmap, RN5T618_ADCCNT3, - RN5T618_ADCCNT3_GODONE, - RN5T618_ADCCNT3_GODONE); + ret = regmap_set_bits(adc->rn5t618->regmap, RN5T618_ADCCNT3, + RN5T618_ADCCNT3_GODONE); if (ret < 0) return ret; From patchwork Mon Jun 17 13:49:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700745 Received: from mail-oa1-f47.google.com (mail-oa1-f47.google.com [209.85.160.47]) (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 5D3E71C6884 for ; Mon, 17 Jun 2024 13:50:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632224; cv=none; b=mC1eHyFdnU/kfsp20nzavJuAS/qENfdjw/YyUqlI0QecAlCz16ZxQHqcCBS2tgZSjIoeeZvCjzu4fdrXZ6v/VTG/4Ed5K+dq0EGu2M45YluVPQp4P4sAys28fs3JLD1ZKsuNRvNQtiikE8Zzfw5tf2eAddTkOdV2QB1R/XKF6vU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632224; c=relaxed/simple; bh=iX/O4thw4u8jxmjQXCGvy7+RStVKhiFFxFMRaqR3WK0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bXYSMcwNBQv6iUqGP22r7M4kopHYYs7Ah18IuDIVAuuhBj3hXqlNCJ7VunR1hX8VSXMOlTOccgLIwHXx+2yLsnBzYpsEiEM0NbSBKCFngVuqpco6lqOqknh6WFJIZe6iFBas9nYhJq0nqcjTILBOZ+YKzIa4REp+AF3SBsv9DEQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=tMQZTnJ2; arc=none smtp.client-ip=209.85.160.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="tMQZTnJ2" Received: by mail-oa1-f47.google.com with SMTP id 586e51a60fabf-2508320e62dso2268660fac.3 for ; Mon, 17 Jun 2024 06:50:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632221; x=1719237021; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=pghOqqoUrgqxulm8czqYmTg2ejQ+jCMFTS9OcdLe8gI=; b=tMQZTnJ2rl0ZQ2oKFYLFb1zwB8GHuLxIbJ7/ZChOOiOusN3XVlF1Vu0DvqwrdCjbFN LovrB4Lw8ie+t3eyzLUYncv0zEVTRG+sb9pB+m99BJKumhmB1EyRl9zPB9eAE1l+9jnL 4Jqj6CwcDwM36nXDo9NYRvyo0V6QTkN4v0GbkEniD95Dv5hDUSuaUzUrZ0rL61Y7VTC5 iucM1oazSGP1DOAiATtOnd7BaoCaDnTD+o6jiIpvj7PYRs6AxSHB9jDPrYZwgN8O1ERY WAK2jLPEovadnafXSbwdLN6uuIz724pDtWnp7HxhaXbJy+Cop1GmpFvLFaTRincemaqB i93g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632221; x=1719237021; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pghOqqoUrgqxulm8czqYmTg2ejQ+jCMFTS9OcdLe8gI=; b=oMRTTYtk1DPSBOfLmkvUJxoVwEb4n/dNUTgKlVemgZCD34WZyyTNRU0omDyGjG4ZKa GSCLmAjN5NPycNW6PKv2U2FvFH9dns/AdjMgswqg3yK7TgO5uf3cbhHIsq3odTCNHxL9 dPp//1Mth9JNIfG4WmeNQ44XzXr/EkGG5HMe8DQFUNFPxDVrv+sMPSsPe4JixixuSQ4Y PkzRi9iyVksDQfxJuMF63aOwdWa/J+tNCYwIG3Dm74Sojfih2B+KmjQ96cU3KFGUm7Wq 6vT/lTIai9JNWkX/FbKv+oNbSMxU4wTF1Wn8SGkwDO/Co1wavvwq/BPv5M8U/1ZVhdKp v2Cw== X-Forwarded-Encrypted: i=1; AJvYcCX/TnFyeS2ITMWPQKItfq7Sdm8WrcRabjceHTSE+4UJ/vSjeB3jYuWUluWXVUJv113CgJc2xtYGJINmK2eZm57HWrV7 X-Gm-Message-State: AOJu0Yw87bp3OTIHMLf3JSf9fnU1RbCtvc0rEwSJRSFe/Y7wbD/aVEx0 Wuy3prNNUVuDluU77Ig69sKgnkgJ85NaHbBq3stBt21ggkdDHAxnsMo7tOFGO6I= X-Google-Smtp-Source: AGHT+IHPRFjhQJMl5A95ZWgXFtrQQKsMmXYW6RVDp9V1gMjS9xuHYY98wxPGrZXsyYueeiP6Xe3wcg== X-Received: by 2002:a05:6871:5c9:b0:254:94a4:35d2 with SMTP id 586e51a60fabf-25842b7af81mr10339918fac.45.1718632221358; Mon, 17 Jun 2024 06:50:21 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:21 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:57 -0400 Subject: [PATCH v3 17/41] iio: adc: sc27xx_adc: make use of regmap_clear_bits(), regmap_set_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-17-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Reviewed-by: Baolin Wang Signed-off-by: Trevor Gamblin --- drivers/iio/adc/sc27xx_adc.c | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/drivers/iio/adc/sc27xx_adc.c b/drivers/iio/adc/sc27xx_adc.c index b4a2e057d80f..2535c2c3e60b 100644 --- a/drivers/iio/adc/sc27xx_adc.c +++ b/drivers/iio/adc/sc27xx_adc.c @@ -508,13 +508,13 @@ static int sc27xx_adc_read(struct sc27xx_adc_data *data, int channel, } } - ret = regmap_update_bits(data->regmap, data->base + SC27XX_ADC_CTL, - SC27XX_ADC_EN, SC27XX_ADC_EN); + ret = regmap_set_bits(data->regmap, data->base + SC27XX_ADC_CTL, + SC27XX_ADC_EN); if (ret) goto regulator_restore; - ret = regmap_update_bits(data->regmap, data->base + SC27XX_ADC_INT_CLR, - SC27XX_ADC_IRQ_CLR, SC27XX_ADC_IRQ_CLR); + ret = regmap_set_bits(data->regmap, data->base + SC27XX_ADC_INT_CLR, + SC27XX_ADC_IRQ_CLR); if (ret) goto disable_adc; @@ -537,8 +537,8 @@ static int sc27xx_adc_read(struct sc27xx_adc_data *data, int channel, if (ret) goto disable_adc; - ret = regmap_update_bits(data->regmap, data->base + SC27XX_ADC_CTL, - SC27XX_ADC_CHN_RUN, SC27XX_ADC_CHN_RUN); + ret = regmap_set_bits(data->regmap, data->base + SC27XX_ADC_CTL, + SC27XX_ADC_CHN_RUN); if (ret) goto disable_adc; @@ -559,8 +559,8 @@ static int sc27xx_adc_read(struct sc27xx_adc_data *data, int channel, value &= SC27XX_ADC_DATA_MASK; disable_adc: - regmap_update_bits(data->regmap, data->base + SC27XX_ADC_CTL, - SC27XX_ADC_EN, 0); + regmap_clear_bits(data->regmap, data->base + SC27XX_ADC_CTL, + SC27XX_ADC_EN); regulator_restore: if ((data->var_data->set_volref) && (channel == 30 || channel == 31)) { ret_volref = regulator_set_voltage(data->volref, @@ -765,15 +765,14 @@ static int sc27xx_adc_enable(struct sc27xx_adc_data *data) { int ret; - ret = regmap_update_bits(data->regmap, data->var_data->module_en, - SC27XX_MODULE_ADC_EN, SC27XX_MODULE_ADC_EN); + ret = regmap_set_bits(data->regmap, data->var_data->module_en, + SC27XX_MODULE_ADC_EN); if (ret) return ret; /* Enable ADC work clock and controller clock */ - ret = regmap_update_bits(data->regmap, data->var_data->clk_en, - SC27XX_CLK_ADC_EN | SC27XX_CLK_ADC_CLK_EN, - SC27XX_CLK_ADC_EN | SC27XX_CLK_ADC_CLK_EN); + ret = regmap_set_bits(data->regmap, data->var_data->clk_en, + SC27XX_CLK_ADC_EN | SC27XX_CLK_ADC_CLK_EN); if (ret) goto disable_adc; @@ -789,11 +788,11 @@ static int sc27xx_adc_enable(struct sc27xx_adc_data *data) return 0; disable_clk: - regmap_update_bits(data->regmap, data->var_data->clk_en, - SC27XX_CLK_ADC_EN | SC27XX_CLK_ADC_CLK_EN, 0); + regmap_clear_bits(data->regmap, data->var_data->clk_en, + SC27XX_CLK_ADC_EN | SC27XX_CLK_ADC_CLK_EN); disable_adc: - regmap_update_bits(data->regmap, data->var_data->module_en, - SC27XX_MODULE_ADC_EN, 0); + regmap_clear_bits(data->regmap, data->var_data->module_en, + SC27XX_MODULE_ADC_EN); return ret; } @@ -803,11 +802,11 @@ static void sc27xx_adc_disable(void *_data) struct sc27xx_adc_data *data = _data; /* Disable ADC work clock and controller clock */ - regmap_update_bits(data->regmap, data->var_data->clk_en, - SC27XX_CLK_ADC_EN | SC27XX_CLK_ADC_CLK_EN, 0); + regmap_clear_bits(data->regmap, data->var_data->clk_en, + SC27XX_CLK_ADC_EN | SC27XX_CLK_ADC_CLK_EN); - regmap_update_bits(data->regmap, data->var_data->module_en, - SC27XX_MODULE_ADC_EN, 0); + regmap_clear_bits(data->regmap, data->var_data->module_en, + SC27XX_MODULE_ADC_EN); } static const struct sc27xx_adc_variant_data sc2731_data = { From patchwork Mon Jun 17 13:49:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700746 Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (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 850BB1C68AB for ; Mon, 17 Jun 2024 13:50:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632226; cv=none; b=kMYxvGmZVBpjYQY/3vB74ka3Z6AIG2EgmrvlKjQZVDEQKBOJBNNUQsrBLuW3HUFN9o9r/uMUXr4leSjN1PMN4woOxVpU2ao1EC/WmH5ovZopXfOPbWgzowAdN+P4AxcaIK+sKRYxMHPErG5Mq2+JWcojcsxGPjWYrkyPQtSQLqg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632226; c=relaxed/simple; bh=6WpzNw/7O6Bgfvz8lndloRTTgJyhcPEVJA0wYoY3R1g=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=r4KPmOh/v+0gTfdLogdgN6mHq7+c4kDrWk4JYnM1Lfd73lNfP8wf0ncGuISkkrtGbJi3DixICkVlHC6mWvDafVAav8yWqedPJvDW1P8zd1aPCAGuwH5nC0LCtC0UTP6p8EF03dAt+z6Oyl2oXo1einHB9gwhold2/LTWNMOd4O8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=CogdSTqX; arc=none smtp.client-ip=209.85.222.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="CogdSTqX" Received: by mail-qk1-f177.google.com with SMTP id af79cd13be357-7979198531fso327514485a.0 for ; Mon, 17 Jun 2024 06:50:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632223; x=1719237023; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=l19FGmHt7cx9Y1e6lJcD6lg62Kq+f+HHsekNkW7FIwQ=; b=CogdSTqXkwYOlOyjXNX/q+UZn7xZC3HSIgso9vz75vwJYkyewwDbC3l3MoZ+TiUAxQ jpr4BHfPwdWpaJTW2gfUSqSmMgh1pwSGci75DCXzMRPYTpJx9F5gUhZklU8tRaJFVCuS Wrntua1vHKGOhauK58v2JXbo7CqTOk1nHbZBR2BgC76RoywmHgOtPghoT0XYnm/mpxsm C5oZWxcCwbxEEuFiXPo+ec3NypLAg87yF6QQTXFxN13KHeldya3Y0VqBhg6V5h9W8hLU Gb/vvwEVSlILfe3dDW72hGceqF8lUmcotKpfnq7invMz23/7G/ffY/aTihINhTaTfePS PmBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632223; x=1719237023; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=l19FGmHt7cx9Y1e6lJcD6lg62Kq+f+HHsekNkW7FIwQ=; b=AD99/SdvEppaaEx2NMTLQ06RGQG9AwGiMEDXyT3C11ic3fLnVX6tqcX56ePBuQfEwe SPM9/3n+Pfe00eNNLsb/Z9gyTpxkvHZWRO0ZGUGoRDzv4m1Npxud+KlfKi9hD/HDAQqa MnY2snWIZO7wky3OrbQq3Yw4wnUlFAwDK6JHd5iVi0qxNVLaRrXfU2Ax04apGsu2rUll YFv/KwRGWx8oeMB0FJnwT6NKaGC32a5mcLl1mLaHiKkK25z72ZaQMmQ5WLipbE+EohdN jSLkYZ3lMt38VqbCkiyhy9us5nC3t6MvEXO764XrPjD8wrwC9UNqnomc9wlP9f0bkpOs WpNA== X-Forwarded-Encrypted: i=1; AJvYcCX1Ojf1ycSyqojOegPfIeqY9/pxpFWK2l/KqYT1QWnwBGSKjQNpH5ThjrbY0zimAvm9E2pN4HfW7DFGaYDBvg+nznHE X-Gm-Message-State: AOJu0YynkroFKmfY9vdFnuBOluuWp+/evD58Z7Dsp/0a9lu/NCIZ2ssA /+ztLKwcLKbg8Lq0UXH3viVTsCYhCvC6aJI5Dd9JgcYJJ+h85dukkpqgGQzfn0U= X-Google-Smtp-Source: AGHT+IEh7KDprGK33BeeaVNTDiPQqvpWOrx7hEFjzf44w52REiEzqTJNM1IGPx8qlAanIRK9VBBUsQ== X-Received: by 2002:a05:620a:4101:b0:795:dca5:e9b7 with SMTP id af79cd13be357-798d26b4948mr1182835585a.69.1718632223483; Mon, 17 Jun 2024 06:50:23 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:23 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:58 -0400 Subject: [PATCH v3 18/41] iio: adc: stm32-dfsdm-adc: make use of regmap_clear_bits(), regmap_set_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-18-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/adc/stm32-dfsdm-adc.c | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/drivers/iio/adc/stm32-dfsdm-adc.c b/drivers/iio/adc/stm32-dfsdm-adc.c index 9a47d2c87f05..fabd654245f5 100644 --- a/drivers/iio/adc/stm32-dfsdm-adc.c +++ b/drivers/iio/adc/stm32-dfsdm-adc.c @@ -759,8 +759,7 @@ static int stm32_dfsdm_start_conv(struct iio_dev *indio_dev, return 0; filter_unconfigure: - regmap_update_bits(regmap, DFSDM_CR1(adc->fl_id), - DFSDM_CR1_CFG_MASK, 0); + regmap_clear_bits(regmap, DFSDM_CR1(adc->fl_id), DFSDM_CR1_CFG_MASK); stop_channels: stm32_dfsdm_stop_channel(indio_dev); @@ -774,8 +773,7 @@ static void stm32_dfsdm_stop_conv(struct iio_dev *indio_dev) stm32_dfsdm_stop_filter(adc->dfsdm, adc->fl_id); - regmap_update_bits(regmap, DFSDM_CR1(adc->fl_id), - DFSDM_CR1_CFG_MASK, 0); + regmap_clear_bits(regmap, DFSDM_CR1(adc->fl_id), DFSDM_CR1_CFG_MASK); stm32_dfsdm_stop_channel(indio_dev); } @@ -951,16 +949,14 @@ static int stm32_dfsdm_adc_dma_start(struct iio_dev *indio_dev) if (adc->nconv == 1 && !indio_dev->trig) { /* Enable regular DMA transfer*/ - ret = regmap_update_bits(adc->dfsdm->regmap, - DFSDM_CR1(adc->fl_id), - DFSDM_CR1_RDMAEN_MASK, - DFSDM_CR1_RDMAEN_MASK); + ret = regmap_set_bits(adc->dfsdm->regmap, + DFSDM_CR1(adc->fl_id), + DFSDM_CR1_RDMAEN_MASK); } else { /* Enable injected DMA transfer*/ - ret = regmap_update_bits(adc->dfsdm->regmap, - DFSDM_CR1(adc->fl_id), - DFSDM_CR1_JDMAEN_MASK, - DFSDM_CR1_JDMAEN_MASK); + ret = regmap_set_bits(adc->dfsdm->regmap, + DFSDM_CR1(adc->fl_id), + DFSDM_CR1_JDMAEN_MASK); } if (ret < 0) @@ -981,8 +977,8 @@ static void stm32_dfsdm_adc_dma_stop(struct iio_dev *indio_dev) if (!adc->dma_chan) return; - regmap_update_bits(adc->dfsdm->regmap, DFSDM_CR1(adc->fl_id), - DFSDM_CR1_RDMAEN_MASK | DFSDM_CR1_JDMAEN_MASK, 0); + regmap_clear_bits(adc->dfsdm->regmap, DFSDM_CR1(adc->fl_id), + DFSDM_CR1_RDMAEN_MASK | DFSDM_CR1_JDMAEN_MASK); dmaengine_terminate_all(adc->dma_chan); } @@ -1305,9 +1301,8 @@ static irqreturn_t stm32_dfsdm_irq(int irq, void *arg) if (status & DFSDM_ISR_ROVRF_MASK) { if (int_en & DFSDM_CR2_ROVRIE_MASK) dev_warn(&indio_dev->dev, "Overrun detected\n"); - regmap_update_bits(regmap, DFSDM_ICR(adc->fl_id), - DFSDM_ICR_CLRROVRF_MASK, - DFSDM_ICR_CLRROVRF_MASK); + regmap_set_bits(regmap, DFSDM_ICR(adc->fl_id), + DFSDM_ICR_CLRROVRF_MASK); } return IRQ_HANDLED; From patchwork Mon Jun 17 13:49:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700747 Received: from mail-oo1-f45.google.com (mail-oo1-f45.google.com [209.85.161.45]) (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 908621C8FAC for ; Mon, 17 Jun 2024 13:50:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632229; cv=none; b=rM1gl/olCmka8A4nZzZvon2UGxvgDtJGuTPavVzrB896Shz9sEBn3RkTguTFHlL4zefUJvxxAPbQi6ZWGp9jxfCFgjys/jS5nlwVVld/Wt1j8Al4NMGu2HPvE0kjry7ACPNE0ITq9vqEMsFDscDIq6rU3v/+T3y8jv92C5A7rFI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632229; c=relaxed/simple; bh=vF9eCSFK9zsl5BTxl6iZi/Jw5sWK8MiJQHD/bb1xgts=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FCDZ6Ft71g2pL1ZQPdwb25wJMt8QlztT1bKlMGzaHYTGayqE76MBvSEgizwJY2QakoTraDgRdrGTEPi6uSlrYeIrgrGcDFa8Lx6a4Pg2dPwefgOHQBikiKTQPtDcI9qAvYVt38gv92SRpTMffPIC8vHiEHlJTc8Tz0smxkCfZBI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=vVcGtlBa; arc=none smtp.client-ip=209.85.161.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="vVcGtlBa" Received: by mail-oo1-f45.google.com with SMTP id 006d021491bc7-5ba1f60eb96so2547296eaf.3 for ; Mon, 17 Jun 2024 06:50:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632225; x=1719237025; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=TsjL1PDi95mMX5sXzypBRu5MAqP+mGu/27hW1rxKMDQ=; b=vVcGtlBaQG5lUOTjA7cvDVrboXLZZFwFxm8QfD1GKVYqMfhX4V9Nyrm3jmkq0AeJFQ ieW0a6E+AK7aHNv+cz5Fv7YewK7Zl6kQToWzE/Wmmbrv+OXRX8CoXp30a1bEPlQntjHi qm5jqNEB7WPJibalbs6eOQfCbJbc5weSD9OFru6KEbB5T4QGtWMJy2ZUKfr5PHm6Z+N/ O7Y1o2XJuxLMh66sdoFUQEAOEc01RA6Nc1Y7fw2OI1UedN16n2BFFP+9erF1V4zlSmyc bHpy5Z0tVs5xcKOKq4tbod6lnqI10Fpy+7JoQQsiHtk7jcgFe5PEmrBSmG6HSgolbvIJ n1Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632225; x=1719237025; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TsjL1PDi95mMX5sXzypBRu5MAqP+mGu/27hW1rxKMDQ=; b=FkDSN7UpOcPiw1FFXoJQpugZIIlfp5LgYUMpOdVfJ6jM5sVzsvGApeePHNUpEkTJLo /alRCImyziDcH9gs9NW6LHaCKoqHUJymfPUfSeUMqTD2YWed5f8CcDkjLQZjgNxAKkyt yJQB00xvyHncdIPV7iWzMcEjGuMu5n+X1dB0t3Cm7nYdaAoQwDyRlefwxOC9wuYNaR16 AXMOhysivEt5jemGA3nYe+dw3QPPghKkwoqYcLtZ8NzsiWUziN93CMI2AUy+qZnglBzU glLf7FK5K6qY9YN8lWrAfnT2obrmVJmCfzBkw8Y/0ajPdFVvVu3o5IkXM7ZJE6H0B2Ky snfA== X-Forwarded-Encrypted: i=1; AJvYcCXMKlwmirZ+jaQnEHOxbtCj/DrtzytHcFe3/IGIwLc9kvkhKQmIZYgQnKbah83h4n3eUZ+26AAdLNW/lV2OuhfOlTYl X-Gm-Message-State: AOJu0Yxh3lm170vthzfvapP4J3Rw6CU5tvYNskpKI2VJDCEPKca603+3 kkQHj0ompCVo9gxCd/Kpw5800sOeYbKw6vvmGBQmRAGTVBcN81IU2D5pIKksBtA= X-Google-Smtp-Source: AGHT+IFvblxIubOLu7csKqd2DaYsYhFE9mHOS6tHSYRNjsfIzum/J8kKl7oiGVOQ0fHTuqtXTzPk8w== X-Received: by 2002:a05:6870:d383:b0:254:ac99:1152 with SMTP id 586e51a60fabf-25842baade0mr8855321fac.58.1718632225631; Mon, 17 Jun 2024 06:50:25 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:25 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:59 -0400 Subject: [PATCH v3 19/41] iio: dac: ltc2688: make use of regmap_set_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-19-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin Reviewed-by: Nuno Sa --- drivers/iio/dac/ltc2688.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/dac/ltc2688.c b/drivers/iio/dac/ltc2688.c index c4b1ba30f935..af50d2a95898 100644 --- a/drivers/iio/dac/ltc2688.c +++ b/drivers/iio/dac/ltc2688.c @@ -860,9 +860,8 @@ static int ltc2688_setup(struct ltc2688_state *st, struct regulator *vref) /* bring device out of reset */ gpiod_set_value_cansleep(gpio, 0); } else { - ret = regmap_update_bits(st->regmap, LTC2688_CMD_CONFIG, - LTC2688_CONFIG_RST, - LTC2688_CONFIG_RST); + ret = regmap_set_bits(st->regmap, LTC2688_CMD_CONFIG, + LTC2688_CONFIG_RST); if (ret) return ret; } From patchwork Mon Jun 17 13:50:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700748 Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (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 A71DA1C8FD2 for ; Mon, 17 Jun 2024 13:50:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632230; cv=none; b=khxbPA5ag6j1gx9jwz6LZ74g6rNfnp1I9oJITdi1jWcqnSbjo09YZC9pgTxMbWcm2zo9jIw7UotKScuUfTIV6c+ePwEwT0RMIAOAWRSmoJUQ/XOkYbFYDHgvVzVojrBH4AZgVUpdD0EI4P2t2sbpp8fl1FgaFlutk74Cxn3k6pQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632230; c=relaxed/simple; bh=Q7aNKMVQoMCDJLMDKdU1X+EFFJ/s/U4Tzm3jjRZeQ7Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BuQF4SJfgPJGatBHUPxhj3mCqPuMrvyNmspSHlbVTFk7udrBMDlFAtVyPW2ybNSCD7nmmTOX2YePUqhDvnq8cuwPPR1MBBNsB7bDouaTR/trldxmdewcENwczi3sNPDV5CRNLkJflqaMDN86TDX2pL5KnryX5yW64pEfP1upVdA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=gznxWJ/d; arc=none smtp.client-ip=209.85.222.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="gznxWJ/d" Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-795569eede0so223565985a.2 for ; Mon, 17 Jun 2024 06:50:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632228; x=1719237028; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=/XakTIALlxEv0HYj2MxlbOtZFxZOxjUYZWhXJH4zlh0=; b=gznxWJ/dPrhHJ4Gh08fjY+NkzN1Z3kLvTQAvKLXHdQoZX1eV4+H5ekmUojVOZXAElZ 9g17foXIPrP9gwTUfZyTgvFrZXfkxqCfa+5hRV+gvERSbgl00Zj55LNKNS9F8MrbXXub EzvrCSnaLHuoG3zAip0h9KFkNH5SYAoZ40r3PE/CAuw1nmvLbzev1OoX8mx7R1zuuXT0 AG0JSeeDKQ/NYuAUKuDVMpcI+jsDTeWgzzA2gsDZmDUcnLcroP6gF8idKy92v8BKE54t 9xSySt2Lsh2mdUWfOeZHIUTGQDnZSQp8MNWGsXQqAw4BZaXLHu0Ef+lg5+g8tx746EIk ipTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632228; x=1719237028; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/XakTIALlxEv0HYj2MxlbOtZFxZOxjUYZWhXJH4zlh0=; b=f4jFO0spDO9J6Aij9MVXl6x+vPV2fAxKf6fx7UOz2qIWerdRH+0UjFyIwHlBeJ7aCt 9NAhDcS57IbMSkc4S3YwqtyFJCNtsxXvllua5/uc8QTUepBbd8bqdvjdSsv9f3ohMRVG muj6fxAQeuOYcPyutmW09tnHDL5ax1yuUGpiL2xuTTxmC8pANJqCevD8WNvKzlLV8158 3InUDY/fDfY3msLIN4WF5bQyftjvCOa8PZmtu1seu/GtczOgXNo1bdRRx8NingfsWJC8 MFucQGR+e/dXRsIXWF5uGGoI8UarF/frTxNAfSe5t18R1dSj+4d8u7Y4hotxk6sjuxnm H4Lg== X-Forwarded-Encrypted: i=1; AJvYcCXGueSC2r2GuP2RmzFyhUQFt6+SAw7PERdyH/iMqlxT0oUEdAaSWDNXZTanIDiiIrjN0ImybWHdsicJUA0PgASDbSet X-Gm-Message-State: AOJu0Yxs5LKE41YO60aKKTE3Az+FoE55r3JNGcb/Z95+sDNC3SeezTVA G3ZAV54nMLY1Yb5xMZjtObdPf4gHIHmQHU6k2vY+MYbq2BgZzUAu5u9iXHsqDH4= X-Google-Smtp-Source: AGHT+IG8ABD9tEwAKr1/xa6bdVCx92iQnTrVgELPE/Lymo3q9zF8m5xvFoyu+g0K7+PoHeaETQDP6g== X-Received: by 2002:a05:620a:29d1:b0:795:967d:b1f4 with SMTP id af79cd13be357-798d26b5261mr1162014985a.70.1718632227786; Mon, 17 Jun 2024 06:50:27 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:27 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:00 -0400 Subject: [PATCH v3 20/41] iio: dac: stm32-dac-core: make use of regmap_set_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-20-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/dac/stm32-dac-core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/dac/stm32-dac-core.c b/drivers/iio/dac/stm32-dac-core.c index e150ac729154..2d567073996b 100644 --- a/drivers/iio/dac/stm32-dac-core.c +++ b/drivers/iio/dac/stm32-dac-core.c @@ -200,9 +200,8 @@ static int stm32_dac_core_resume(struct device *dev) if (priv->common.hfsel) { /* restore hfsel (maybe lost under low power state) */ - ret = regmap_update_bits(priv->common.regmap, STM32_DAC_CR, - STM32H7_DAC_CR_HFSEL, - STM32H7_DAC_CR_HFSEL); + ret = regmap_set_bits(priv->common.regmap, STM32_DAC_CR, + STM32H7_DAC_CR_HFSEL); if (ret) return ret; } From patchwork Mon Jun 17 13:50:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700749 Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (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 E39AB1C9ECE for ; Mon, 17 Jun 2024 13:50:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632234; cv=none; b=a0Ad3PEilDDEHQ9LrobFbO5qrdJqgA3qMO5T2ANu7h0LEL3REWuhdpQZF7SyatlhFfRhWhbnWUDek4kv3VjYKTh5SHOZi8jYYSdyAMaB+f7y5m7YLAGyJGJHOkYGPAyfQj4GVElSdNgVjsDftW5YurCeyt5nL/HdsNsfJ6dBR98= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632234; c=relaxed/simple; bh=QPP25hzXGRebbNyApfbw/ePtiR6pqeVKltbiG7kR1ck=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jvKg1F1Y1mQ833RVbrvk29jEEqQUOAySw7J6jRhRCPPKFeG4swkPwOn2C4YXgNsBPAl6YwjmcLjaWxIfqty1p/SwZPMKDdII4EqA/KevllxE0A0PiF8S40g4Msf2mAwt02gkxcTeQfxhuJLP3+eIytJ1829NQsM0fsJXH2AI3Yc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=veY7Eqav; arc=none smtp.client-ip=209.85.222.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="veY7Eqav" Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-795ca45c54cso246595085a.0 for ; Mon, 17 Jun 2024 06:50:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632230; x=1719237030; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=DerxFnnoYXb7MP4GOUVN2xlgxjAao77OyLSOrDCydO0=; b=veY7Eqav0akW6jsKdF3r72Us5iVW/gYA1pbtamlJlrhHHQWG2xQomRdmVMEueRZUvg N1YvH5X+tXIhu/vL8M27NzOpE9l+nHNpJW1r1FIQRn5UHJrQk3EEuWSiBEDBLzQaDblP SFQS/ETq9mvrteOSOYUEz+t4/b82YpNxBhO3tevrQmWYr1WpQdTh2EvgheGGMBwNV6me 9T76NRQ195XfbdRYDgndj1BBcGSrHNegbT0ZjyGyrwqXpDbYjCUBfalSZZgU/MkoDsO0 NFfMRFNNV/rxJ1PHPKkkgzO1adUp8EuPamqHxZwklxUZjsGAeBnUy1DYI85JWYf+K36b Z4OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632230; x=1719237030; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DerxFnnoYXb7MP4GOUVN2xlgxjAao77OyLSOrDCydO0=; b=cR2TprlrdQhoIjHoIQ7HDVFuRLkfMqCaSAWEZxe7UNOcEMhRLMOudAmvPphbTOXUov NO/iMso6ymMoFIFXMooV0zt0pToVQBdBJhpgYDVz6W+zwWOVgUQ4GHZlbPSdgKz1QQeB m0BsfNay7oNJtxtZXBFIrINDuT/k9M5qjFcubIL0ZagVW69ml8g1cJA9LcdCdr0dBYsK klR2L5KR/y+RhgJko1lrX30+j1jPb/Z5sC+57jCsJuUrDeeLeTjBdn0FOpmcGg9vk58J LNYUhDnMzHm4eyVKfInr9/Ao2zsofXqHUzQ0FgyMG4wlokIBhV0F0CLBm3Av4j+DLwqh wgZA== X-Forwarded-Encrypted: i=1; AJvYcCWqM6dmBbJbfOcBlw1YFCFNwkUAxRAk/hGTS9iY84++lB20Gcut3zpwWtwwGF/7aV+bwruVtOsotOWyaLKOCIAfD6Ta X-Gm-Message-State: AOJu0YzExw355lz9XYG/zOM+fZDY8PiWtcOo+5AfryIjSzXR5RmdXbnK 1SBxoRiGWR+fuT4mMWyI+QVP9IdOIY7CpjgyR462+IogdDWtC2YpJHpuvAr8XY4= X-Google-Smtp-Source: AGHT+IHxtzkdFJwlDchh8tO2N+M/GUfc/zgUMeSNzO08CBN63HSCP+uPJVwg8RWxzdMRcwiKU/TPZA== X-Received: by 2002:a05:620a:2443:b0:795:4e2c:eabf with SMTP id af79cd13be357-798d240dcf1mr1259752585a.26.1718632229931; Mon, 17 Jun 2024 06:50:29 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:29 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:01 -0400 Subject: [PATCH v3 21/41] iio: gyro: bmg160_core: make use of regmap_clear_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-21-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/gyro/bmg160_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/gyro/bmg160_core.c b/drivers/iio/gyro/bmg160_core.c index 0e2eb0e98235..10728d5ccae3 100644 --- a/drivers/iio/gyro/bmg160_core.c +++ b/drivers/iio/gyro/bmg160_core.c @@ -285,8 +285,8 @@ static int bmg160_chip_init(struct bmg160_data *data) data->slope_thres = val; /* Set default interrupt mode */ - ret = regmap_update_bits(data->regmap, BMG160_REG_INT_EN_1, - BMG160_INT1_BIT_OD, 0); + ret = regmap_clear_bits(data->regmap, BMG160_REG_INT_EN_1, + BMG160_INT1_BIT_OD); if (ret < 0) { dev_err(dev, "Error updating bits in reg_int_en_1\n"); return ret; From patchwork Mon Jun 17 13:50:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700750 Received: from mail-oa1-f51.google.com (mail-oa1-f51.google.com [209.85.160.51]) (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 DDF231CB30E for ; Mon, 17 Jun 2024 13:50:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632234; cv=none; b=VglthG+Rb7lBOibVz8HZCW5R8/bndCG0cq/LaKnXiHEr/ubeya9nmzicN+WIL6I9RTYEsSBvX0Gn1HDwg6mBqquCLfryofhKFg5ZJxqr1glWRtXwPYB7EHzdI5wWu6EQxHRdvz/stbUahywy3/Al4C8/XzgV6SS8tHDSH6ha/Gw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632234; c=relaxed/simple; bh=vYvxwaeOXd9WIOr0jyiodES08IYnBg0cNG1tIcDEAbo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HrpxP1Lx3YuJqA8fs2aO57OqsEyk5EDr0H7N5zqrxDfBwJN7xQO8hPIxXErbXQHZ/qyQzn6GsWgebMmTIPNknfjv++VE78JD44CTy5PkWZgf0KcoPDWUJMu62RnVd7ACXnvIh4Un0M9et7VcfYxA2i3d+EDlji0n4RVM9aUFees= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=S2GCEZSY; arc=none smtp.client-ip=209.85.160.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="S2GCEZSY" Received: by mail-oa1-f51.google.com with SMTP id 586e51a60fabf-24c9f6338a4so2178492fac.1 for ; Mon, 17 Jun 2024 06:50:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632232; x=1719237032; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=bPhEFIEI65Agzd+gTNE/8pf9Wc0auEQHD6gWw+Mp2Us=; b=S2GCEZSYlRoQPL8LssNEmU8rYcM84lAskkMtzEJOhlx/ELKhDJ4ZJb9bYtCzimPNtg J5AYNQn/KMax9SyfqOaD2bY4yh2167Yugpl5I6dnEiMjrPykAC25b/HtKzcspYELQ2s5 dopGJyk6doTrF7GaRiV1+SD8cu/OvaIvFHHxsy4qSPfGueDh8HwjQkkXTt+onnpmLkF1 ySjaSYEbwPcC410R4cuIIib3GSkdnbgWlxgkb9GbzoP0N8E57Uj2D1aeOsT8vGVULIUX NyhnQGPBg4dKSkBojS5EZ31IyscVpQDy3UcoUye2Dw8VjNaYv+8miDJPD6Ku+CHAhaCg o/Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632232; x=1719237032; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bPhEFIEI65Agzd+gTNE/8pf9Wc0auEQHD6gWw+Mp2Us=; b=oYNjnqGHIGk8AjzmoS2gFB78xcT+g+zDPaeWePLZRUzbXnyWWfGXxg5YeLVPa/VjdE fOIDGIdEXcCht91hOoLy0nrgZyFVviD7Ioxgwjwfn3O9gJvCcW6nUjn1UoHs2I9bdTEy lO36UU8amzIEAb4c5VUrXei9GQ0N2xMqA0gjl+ySnrRCpVHKNqLyNNWsuwslLbDKcG1+ pDOxGy+2IiO1TyZ1z9qApmfoKioqMs0r5Z7MI8ZefKnmKiHualBMgHrtlUkUpRX+fswF 7iTBkgoEF4TVGSF4HJwkQuLiXWpjZgww5HyI3Ni5ZYQBnmLtVRsmfFUIHKH20TK1/8nz lZ+w== X-Forwarded-Encrypted: i=1; AJvYcCUKEn37F7AfkTejlO+DY/Gbi5Orto3H+Ul7/O18/vegFm0BLazbLQ+eBVRpjbK+a80gu/ViKvMe7zPNKgHgboNblFdT X-Gm-Message-State: AOJu0Yw3mHT6vHMtYm/iDZC8gYzZOLP5ETCSnkmVV6Ir4WhyKjbXqAim 2bCl0TEk9P2bubAVxwzZbywNE9gK+/0GDCJPONTIdYB7TfwAMBW/uP80OyYJa1Y= X-Google-Smtp-Source: AGHT+IESOlQlf6WzweXkTkf8MrnVQGCcG3xC67OqCrm+RTbQElgJSgw2YCA/KexywnTT/s9UGGqyWA== X-Received: by 2002:a05:6870:c1d4:b0:24f:dd11:4486 with SMTP id 586e51a60fabf-25842ba209bmr11672904fac.36.1718632232087; Mon, 17 Jun 2024 06:50:32 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:31 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:02 -0400 Subject: [PATCH v3 22/41] iio: gyro: mpu3050-core: make use of regmap_clear_bits(), regmap_set_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-22-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/gyro/mpu3050-core.c | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/drivers/iio/gyro/mpu3050-core.c b/drivers/iio/gyro/mpu3050-core.c index a791ba3a693a..ff1c81553045 100644 --- a/drivers/iio/gyro/mpu3050-core.c +++ b/drivers/iio/gyro/mpu3050-core.c @@ -197,8 +197,8 @@ static int mpu3050_start_sampling(struct mpu3050 *mpu3050) int i; /* Reset */ - ret = regmap_update_bits(mpu3050->map, MPU3050_PWR_MGM, - MPU3050_PWR_MGM_RESET, MPU3050_PWR_MGM_RESET); + ret = regmap_set_bits(mpu3050->map, MPU3050_PWR_MGM, + MPU3050_PWR_MGM_RESET); if (ret) return ret; @@ -513,12 +513,8 @@ static irqreturn_t mpu3050_trigger_handler(int irq, void *p) "FIFO overflow! Emptying and resetting FIFO\n"); fifo_overflow = true; /* Reset and enable the FIFO */ - ret = regmap_update_bits(mpu3050->map, - MPU3050_USR_CTRL, - MPU3050_USR_CTRL_FIFO_EN | - MPU3050_USR_CTRL_FIFO_RST, - MPU3050_USR_CTRL_FIFO_EN | - MPU3050_USR_CTRL_FIFO_RST); + ret = regmap_set_bits(mpu3050->map, MPU3050_USR_CTRL, + MPU3050_USR_CTRL_FIFO_EN | MPU3050_USR_CTRL_FIFO_RST); if (ret) { dev_info(mpu3050->dev, "error resetting FIFO\n"); goto out_trigger_unlock; @@ -799,10 +795,8 @@ static int mpu3050_hw_init(struct mpu3050 *mpu3050) u64 otp; /* Reset */ - ret = regmap_update_bits(mpu3050->map, - MPU3050_PWR_MGM, - MPU3050_PWR_MGM_RESET, - MPU3050_PWR_MGM_RESET); + ret = regmap_set_bits(mpu3050->map, MPU3050_PWR_MGM, + MPU3050_PWR_MGM_RESET); if (ret) return ret; @@ -872,8 +866,8 @@ static int mpu3050_power_up(struct mpu3050 *mpu3050) msleep(200); /* Take device out of sleep mode */ - ret = regmap_update_bits(mpu3050->map, MPU3050_PWR_MGM, - MPU3050_PWR_MGM_SLEEP, 0); + ret = regmap_clear_bits(mpu3050->map, MPU3050_PWR_MGM, + MPU3050_PWR_MGM_SLEEP); if (ret) { regulator_bulk_disable(ARRAY_SIZE(mpu3050->regs), mpu3050->regs); dev_err(mpu3050->dev, "error setting power mode\n"); @@ -895,8 +889,8 @@ static int mpu3050_power_down(struct mpu3050 *mpu3050) * then we would be wasting power unless we go to sleep mode * first. */ - ret = regmap_update_bits(mpu3050->map, MPU3050_PWR_MGM, - MPU3050_PWR_MGM_SLEEP, MPU3050_PWR_MGM_SLEEP); + ret = regmap_set_bits(mpu3050->map, MPU3050_PWR_MGM, + MPU3050_PWR_MGM_SLEEP); if (ret) dev_err(mpu3050->dev, "error putting to sleep\n"); @@ -997,11 +991,8 @@ static int mpu3050_drdy_trigger_set_state(struct iio_trigger *trig, return ret; /* Reset and enable the FIFO */ - ret = regmap_update_bits(mpu3050->map, MPU3050_USR_CTRL, - MPU3050_USR_CTRL_FIFO_EN | - MPU3050_USR_CTRL_FIFO_RST, - MPU3050_USR_CTRL_FIFO_EN | - MPU3050_USR_CTRL_FIFO_RST); + ret = regmap_set_bits(mpu3050->map, MPU3050_USR_CTRL, + MPU3050_USR_CTRL_FIFO_EN | MPU3050_USR_CTRL_FIFO_RST); if (ret) return ret; From patchwork Mon Jun 17 13:50:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700751 Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) (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 9B3031CB300 for ; Mon, 17 Jun 2024 13:50:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632238; cv=none; b=IvrnAzbrMcq/pK6gJ8O5ioAvim50net5EIHSDNFLeQQXgEocBWQVr2Z0nQJXgmcygZSzLyTM8xCnWnq6vT3TeN6K+uw/NvribywFtzexGYC070Hi1WF6ONiu9RAqiGvtG+JkMh+XuQ6cRMztbtvk4aRFVveA/DmDjKVm3pYlSl0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632238; c=relaxed/simple; bh=TWHdKrtS1Us38JyZe9XnqcqTqye1G+StH2qcb0F+nZI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=O2NxVevukZE9bU2cStRrgneCy29cddGIs/xoAGTN8Cz9ZqFBskWz+VQOr2EcuqBn6ma8ZWk+nldnVPNcO1+pAzpn437tz7jX5sq5WIY4mAAUSit/ZtFgbCEh0BBWqZ2/fYqwkqav6QOURcgThTVXWmqgkKfXonIsKBDx2GleqVY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=piREPGbf; arc=none smtp.client-ip=209.85.167.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="piREPGbf" Received: by mail-oi1-f177.google.com with SMTP id 5614622812f47-3d215a594b9so2326064b6e.3 for ; Mon, 17 Jun 2024 06:50:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632236; x=1719237036; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=fGWBtK2gGzg6dOcIkV68NwvgEBcr/hA30WsTyKyEtwo=; b=piREPGbfnHnHm847O8QuhWeJdJtVj5SMgGHolIcTeZ3YgqIzDVVPPJPnpG3ZSNK1A8 LhULQgp34yblPsmHcNbI3Up5xiqZkypP17SbpurSejf9XGQMEDfg73ZO68Idm46ppZXG LYbum1+rjI6VaMwint5dv2XdjEzpUwnjR35Pz/rqE+HrGXs/mYvGAAA2AqQQ+0+3bBeZ kclPlQbczjGWn3bA0cETus8psXq8pdySF3mBKjcPb4owDK+DwAOyX4cnsmcwtdlwEDb+ qDnU+alq8F5nnRTrRTR3MbdMACf9zlPK8aKr80HIyB3pImfGp7q0r3O6L4BdHu9OpDls uc6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632236; x=1719237036; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fGWBtK2gGzg6dOcIkV68NwvgEBcr/hA30WsTyKyEtwo=; b=mGhTIT8CFkNOJcqOQ1TXWe/zp31KXa/un+X07DJm+HHkW4dEIV3EvCXsO+29UgfzUG JE82KwRxdRjf7jeqOVkCostM245aDlvU+40hGj3U9WL0Nqw4ZkhbUtk6kT63XKLDL309 cu2AIj+AlNxpvrPRrm9RUi9/1Ie6LoSVvaU3VtWTpDUZoC9kUfJGKndzSgslGYEF8Zlv ouMA5KVQGiyMDbIKeovA57R1ZbTnxJiqwYaLBhqQS2uwRBLgb9snSrXGrfYHMl9wi1kx gGwEGa19+hgATwq0UogdgAXj+SWgDwA5/BbTLiF7E3SGhiCZqgKwrVWbqCQCF00ACv6G w78Q== X-Forwarded-Encrypted: i=1; AJvYcCX3uIyqh5Q/1LhZ7YRtrot1OiQyzRZT5rkNs2x0wU5t/+4mJd6tH9LSd6E5UMmSxyJmCHkO1g+01uap3Vxmst0/GK6p X-Gm-Message-State: AOJu0YwBYKZGXkwWmVtatY/qRAnx9uq6BDIBBitGd7Sql/eH1Iefl5yR 0r1Nw971GHEP+XM38BvhbwgFJitQ2DC/cJQCST5rxMGOGeZDCuUdLUgj3uq/hpM= X-Google-Smtp-Source: AGHT+IENHYKm3NgqHa1MPYUPJeZqzEGABKtYhMj6CIPi8s9CW+uIlwWgMeUoLMPd9TX2TqZf6pVe1w== X-Received: by 2002:a05:6808:e83:b0:3d2:27d3:2928 with SMTP id 5614622812f47-3d24e8f5deamr10493207b6e.28.1718632234195; Mon, 17 Jun 2024 06:50:34 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:33 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:03 -0400 Subject: [PATCH v3 23/41] iio: health: afe4403: make use of regmap_clear_bits(), regmap_set_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-23-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/health/afe4403.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/iio/health/afe4403.c b/drivers/iio/health/afe4403.c index 1dbe48dae74e..52326dc521ac 100644 --- a/drivers/iio/health/afe4403.c +++ b/drivers/iio/health/afe4403.c @@ -422,9 +422,8 @@ static int afe4403_suspend(struct device *dev) struct afe4403_data *afe = iio_priv(indio_dev); int ret; - ret = regmap_update_bits(afe->regmap, AFE440X_CONTROL2, - AFE440X_CONTROL2_PDN_AFE, - AFE440X_CONTROL2_PDN_AFE); + ret = regmap_set_bits(afe->regmap, AFE440X_CONTROL2, + AFE440X_CONTROL2_PDN_AFE); if (ret) return ret; @@ -449,8 +448,8 @@ static int afe4403_resume(struct device *dev) return ret; } - ret = regmap_update_bits(afe->regmap, AFE440X_CONTROL2, - AFE440X_CONTROL2_PDN_AFE, 0); + ret = regmap_clear_bits(afe->regmap, AFE440X_CONTROL2, + AFE440X_CONTROL2_PDN_AFE); if (ret) return ret; From patchwork Mon Jun 17 13:50:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700752 Received: from mail-ua1-f48.google.com (mail-ua1-f48.google.com [209.85.222.48]) (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 68A0E1CB33A for ; Mon, 17 Jun 2024 13:50:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632239; cv=none; b=AdUxBKHMxFoae7AuSm6zcP++qkxps9GZDXhY6JpPArNdCurP3Ket4XH7/74wfUo8lGf7D+S53yw3QREEBdb8ulOoxn/fF7bBkofVg8D8nqw400Qe8MI5DhJ//vF+glPrMInYbNQ2UVRmJ2XwT0IivaEGb7t+BNXMdqB5lDLJ6pc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632239; c=relaxed/simple; bh=sY6AVptqGy7qaDiPpO+WIwajsbuS/yJwZlwaJuIwYwE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CO6F0HY9a3hwp/VOFbu/v3go3nIQn5nmcm++yKds5BOCiYiPmLy+BuX2MwLZ68C5GuJELDsOInGTzsM9pPKopDw3AA1AB9Rce9qjBlnntZKY2DgJ78HsURIxNPVrotxBA5jStI0m7tBQVgnLl6t9y4toMkwNzSKc7YD7UaQnu9o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=s2O1ijwl; arc=none smtp.client-ip=209.85.222.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="s2O1ijwl" Received: by mail-ua1-f48.google.com with SMTP id a1e0cc1a2514c-80d64c817a7so1226944241.3 for ; Mon, 17 Jun 2024 06:50:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632236; x=1719237036; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=yqMe4af98NHJiZdRmZKfGjAtSzwLMs3Usdpoxv76E0s=; b=s2O1ijwltIDsvoAFG5rH3scMHCtJ71wVYRSWwOl3GunRHctznY6z7/Unkr/ryVnfgq /8GzKGV0N9BZtZ4xF7OGx1aobAMv7eCs907RqPI02lptE9Hx+WYCasjzCwtQfiQb0LlN cwTDo1yBGt32az6NmBNM8DQ7iabeSTRSLUTUQdrhHEMRbb2jVRJiR/E8A3+0PsSDXlGw lPqUcCpu48w4SZC3yHKPObwsZaT9BqVueVROSZI5CAsWZHuiUoWjGWlTRaEf7CgDUXHQ olziuPdrrt3emBMFLuvG54K7UQQMFEN25ZcrpB7sBZJIYmzu7ELcNceSAIdGgRTb8g/a +rmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632236; x=1719237036; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yqMe4af98NHJiZdRmZKfGjAtSzwLMs3Usdpoxv76E0s=; b=DjTs5rlUYyom7DW3ZHdYDCl15vscEvXLIk3nSVZ/YjeECnFEX/nWJMOVPdv8So1Zs5 o8xDwkofEx4LwpJ6hwxoaXLaoOZDzhauMkQH4EhLbuJRNiKQxXFs93dTih7lw3Reo+fJ xar17NQpMs4YuaQJahdYjNi9VuJISK5YSShWMGh1nLRAM21L4Pj5c6BHXJi4ZO+8g8lk NffRXHkrMFx9l4OWWoz8r2Qx1damHOpfTKT+qxyj1XGeoDJ9re/g9pNDFDusACfnZYVe Pzs1EEUQtL94ISIItaTYjI5lUVPGk7c+JbtH726p0JABR+i20AiFsqHTEFiROYmaae3A 5FWA== X-Forwarded-Encrypted: i=1; AJvYcCWov+lkAImOkK4aQIZenaNS+/HRwseB40bdknGMdbDlWjJiyPSNuMytEpkwasEjF5FuKHHM4avfKEg8Hlb2Qtg5tvC+ X-Gm-Message-State: AOJu0YwFToURP4nJ+iaUiaf2624h/j4L4BUvHizsKTysM30NxN//rN7p /BhN7oM8vI0BndD9ccfQdzAeGqyQ6095fv1G0+U026DF3IJgLeuoX7XqgjtVq70= X-Google-Smtp-Source: AGHT+IFihHa6bMcNzaeLIOOLDw8PfmzIsl9aK4RVvUYriLx2jOAq5E+Axp1aames8cM1+wIsIKtc2A== X-Received: by 2002:a05:6102:3b96:b0:48c:19d7:eb83 with SMTP id ada2fe7eead31-48dae3f30ebmr8867679137.34.1718632236471; Mon, 17 Jun 2024 06:50:36 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:36 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:04 -0400 Subject: [PATCH v3 24/41] iio: health: afe4404: make use of regmap_clear_bits(), regmap_set_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-24-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/health/afe4404.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/iio/health/afe4404.c b/drivers/iio/health/afe4404.c index 7768b07ef7a6..51f4be39d20b 100644 --- a/drivers/iio/health/afe4404.c +++ b/drivers/iio/health/afe4404.c @@ -430,9 +430,8 @@ static int afe4404_suspend(struct device *dev) struct afe4404_data *afe = iio_priv(indio_dev); int ret; - ret = regmap_update_bits(afe->regmap, AFE440X_CONTROL2, - AFE440X_CONTROL2_PDN_AFE, - AFE440X_CONTROL2_PDN_AFE); + ret = regmap_set_bits(afe->regmap, AFE440X_CONTROL2, + AFE440X_CONTROL2_PDN_AFE); if (ret) return ret; @@ -457,8 +456,8 @@ static int afe4404_resume(struct device *dev) return ret; } - ret = regmap_update_bits(afe->regmap, AFE440X_CONTROL2, - AFE440X_CONTROL2_PDN_AFE, 0); + ret = regmap_clear_bits(afe->regmap, AFE440X_CONTROL2, + AFE440X_CONTROL2_PDN_AFE); if (ret) return ret; From patchwork Mon Jun 17 13:50:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700753 Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (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 99B451D47A4 for ; Mon, 17 Jun 2024 13:50:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632242; cv=none; b=h86VyAXi0HoA+O9AuGcQmqePz0NLqR1zbBzrxbkjhhxQAQ6I14zo/ekNDrM+X1m0I52yxeWQK0yS5qL9SgKZfdqND/byKmv/tZNWm0lx01WhVn59MD4ieGuV/L935+pwfY44QfjNdM2FnvwBatwAJr3hH3/YlF3JIwnEol6JuPc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632242; c=relaxed/simple; bh=l1cofpntirPxR2Ec7wzKzI6J9yRh6+FgHHryvnvZtdc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SCFowbzzlEKsn8RuM1D9tM7kQqx14IgzS8cx8vlerjh73auMO5DL+8N7Og9fe0wOD9tlj5CGxQQU/zVPzDuUcr9gQdPKGF3FhYRNdc9bwJU9/vaB1bBDl25hLYVVsqCyeuWYT/gdoJfdMX6+qlea83x9MNYtudSX+EPzfOsXD1k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=TIuRJV2v; arc=none smtp.client-ip=209.85.222.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="TIuRJV2v" Received: by mail-qk1-f177.google.com with SMTP id af79cd13be357-797a7f9b552so306641485a.0 for ; Mon, 17 Jun 2024 06:50:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632238; x=1719237038; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=7n1vQrJKdah20S8ZMrVRWoElzUuvEAd8XeagF8Tz1M4=; b=TIuRJV2vY9FtP9+6ESXAZ+PDIGY5Us9DIyKYpRXVtnitbzYQafmbT7Lb598oc+arh1 M0nbNLjv6kUooX5Ksc8A5ACi1cl0pCto1302EgL+foa3WzTWoa+c/Z/m8uEgiozRihb0 xeXq6uX1UC3RYT5NXriI1JCdEZiC2z8mfSWmmzuBtzwLKq+SuH+ibsKBaSqwX8I2C3EY GnkLybLvTgBgwLD28xEOZLiTVcXitXHtOuHcQr6Z4wNn8pSg6TX6/BT7p+Ts2QU6Tcun x+tUejW3S7d0NvFPvcV84iir1YH0ZdM36TvVxQ4L2AvjWfRxd+K+7Usl3rIbWnLj1uV3 C7sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632238; x=1719237038; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7n1vQrJKdah20S8ZMrVRWoElzUuvEAd8XeagF8Tz1M4=; b=RHJrCPI4r9MCOxSE8DjZXfW4xlfV2c3RKk2oHl503liV/ahDfEJR7XS8aXfTQ6kfwT 0jHnSJ6UNO/0CBQ3HevHjb16L4kKcdEQ+bvM6y9INX/8SWyASOagGmDExIwOH6J3EOMe 9p2oSwrco4BXosyrBVlOC9aCH0Y7czM/5i5ab8OPshMivmP1x6mUjbyRr7Vb99Jlzokj WghVOj251qEWtfyxkgwGDbrNbBO330SQ5J7AhfSle5AfJOQ+C0amEpT3DQpTdeWveEIs LTSOqkEPn9y0aXmCk27WmxrGFEzsos2YlbDeQMX42OCVT56dGRdtBlFafcZZzTBus3fk A5Vg== X-Forwarded-Encrypted: i=1; AJvYcCUxOoa+DAI1E1XDFPAFTl3LpJMxUc0OsT3qI1OrmFGTUzNojkzn2CPTuuxngEdqSlSlJjN+jdR5hpKpGiPNNoArXJTl X-Gm-Message-State: AOJu0YwxhBOeuSSwAraTU+OFay7e1wOKSSGfPQMvE4jdGtN1ipRxFn2i jv8JNd+XeJm5eFhFexWrWqRPaToLa8aPqknHToB7SOkuZrCfukMFxrF2w1Cpt+4= X-Google-Smtp-Source: AGHT+IFPBsXk8OC1fXhOsjN5sQEyfL0NaDJoRNSti0BCnQHlNJa0XX2KPq4TD0tgoqruv2mBvc8G+w== X-Received: by 2002:a05:620a:2947:b0:795:60b0:3f5 with SMTP id af79cd13be357-798d2430e27mr984123785a.34.1718632238585; Mon, 17 Jun 2024 06:50:38 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:38 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:05 -0400 Subject: [PATCH v3 25/41] iio: health: max30100: make use of regmap_set_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-25-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/health/max30100.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/health/max30100.c b/drivers/iio/health/max30100.c index 6236b4d96137..c1867c2ef8e2 100644 --- a/drivers/iio/health/max30100.c +++ b/drivers/iio/health/max30100.c @@ -363,9 +363,8 @@ static int max30100_get_temp(struct max30100_data *data, int *val) int ret; /* start acquisition */ - ret = regmap_update_bits(data->regmap, MAX30100_REG_MODE_CONFIG, - MAX30100_REG_MODE_CONFIG_TEMP_EN, - MAX30100_REG_MODE_CONFIG_TEMP_EN); + ret = regmap_set_bits(data->regmap, MAX30100_REG_MODE_CONFIG, + MAX30100_REG_MODE_CONFIG_TEMP_EN); if (ret) return ret; From patchwork Mon Jun 17 13:50:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700754 Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (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 C12D61CCCB4 for ; Mon, 17 Jun 2024 13:50:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632243; cv=none; b=ExGHrM/DDqi2qQ+wDqRSFI90Q7bPhjBlZ9ypBDDsYQqUSxZrzTudln301Ya9LZKBj3l4lbmXh5J8C3uStby9KPW4GMc1LQDHmcO48/LAdq0a+0mI0U4fbOx47NBojArxUtcVp/WaqScnuSEMUHw8PpeZr5Y4g7IN1VTcpcJSEmc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632243; c=relaxed/simple; bh=hNgP/6iNEg0nlsLXnblRZQOFGnL8J5KYM7/zOiP/Ot0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=APENY0QFN3N8dYeZun5SB3U+or4TSm/oiaAkLn0BNTfVCoFJokpyV61oRClE1K9hvwlIwv1RQtIBVLIU4o+sZ97kiuWcfl5w3nMffbf4eCkufXxBU+dBGnpr31X37ABzzQrF9XNMvKVd809NqmnoFw5+skFwoPCoUIO2zS9eXK8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=I3iouGma; arc=none smtp.client-ip=209.85.222.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="I3iouGma" Received: by mail-qk1-f173.google.com with SMTP id af79cd13be357-7955f3d4516so481905985a.1 for ; Mon, 17 Jun 2024 06:50:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632241; x=1719237041; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=s9IxtXAJpg0zoHi2O9sRGBPOMzr1DfcZ9EisZFYQElQ=; b=I3iouGmaLXdpresWg5VsnBYOvfFAkMa6c14Rd/mcKp2yg76a1gWap5l9JCqxnF3gUI lLR4uhHo/JwJRtRarXym4GYk3m8hWhsd6eKDWk32zdSkdKA+A4leqHYdxoxZQmrjZDX7 nCeKLoTu5j7UDLwlbrxGQIAsaKXSujs+QwByvnX+nBkcakTRgO8hgJ2XJ6M+jE50TiiE t43kLvz8YW3BT414Gq3vqbitp1adz8kLmYkayiyAPUC/CDrYuQZEZWuLCtpZV5IUusBH EQlHljrDvPPaHpI8RdRxidk/MrDm8qQ6YV3XjgkUWAmG/GcmRsKU8LKoe8yDEbfAnGoK hfzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632241; x=1719237041; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s9IxtXAJpg0zoHi2O9sRGBPOMzr1DfcZ9EisZFYQElQ=; b=MJTCtAZjbJeK8I+SE/X86Xi1821/F2Vu+QgrG+JOWQg8ce263Knvdo76MRdSAEUXHo i5rH6CHdFw2e1XCDJEXVmZ5S+aUhCw03CODKsHT6p8qWD6H65yeACD+wJ5fFAiRVbbjx ivJIZG13ON57yXkUCRRJs3jXiXZ+5wDsrHcF/UWwIH9Z6iAX6dvy2q4FpJujPDsyldPs Jnl6y4TxKNl8Y/tJnWv+gUHsNT6F2PJGIDyCGPS/bSMnr3RHZcTBN8SG7imxfpGb6aM0 7BdpZiGV6m2LXxbVlVeyu3hAteOm3xkO4k0aNZ7MeNQg/bXhpeSxa2diZrDdU0JJ5jtO wDLA== X-Forwarded-Encrypted: i=1; AJvYcCVQ05+3zwOuorhNjn1o629OaG2zA23AFVpcL8R6A5MTnrE35/f5180ruWnqG3Rmi8pbqVyR7ON1RVltGEmvbfoIx2r0 X-Gm-Message-State: AOJu0YzG4eUiSi238PKabGpR+bY+yJB5J8CLTYUJCPhvrTJOjriOnSid 5/tJbV5DDI3RqqXIn9FRxAUUDZoiB5KC1vczxu7nLgZrhItKMPvV8sngY8s1hsc= X-Google-Smtp-Source: AGHT+IEvNWEsHTIz+Kh5SLMDJk99l/NCyLAOM78IKPUk0tI5a9ZCslYv7WlkhqmAtTcQfPh0VS34pA== X-Received: by 2002:a05:620a:2981:b0:795:5469:1b32 with SMTP id af79cd13be357-798d0242f64mr1752044785a.18.1718632240726; Mon, 17 Jun 2024 06:50:40 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:40 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:06 -0400 Subject: [PATCH v3 26/41] iio: health: max30102: make use of regmap_set_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-26-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/health/max30102.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/health/max30102.c b/drivers/iio/health/max30102.c index 6616729af5b7..07a343e35a81 100644 --- a/drivers/iio/health/max30102.c +++ b/drivers/iio/health/max30102.c @@ -448,9 +448,8 @@ static int max30102_get_temp(struct max30102_data *data, int *val, bool en) } /* start acquisition */ - ret = regmap_update_bits(data->regmap, MAX30102_REG_TEMP_CONFIG, - MAX30102_REG_TEMP_CONFIG_TEMP_EN, - MAX30102_REG_TEMP_CONFIG_TEMP_EN); + ret = regmap_set_bits(data->regmap, MAX30102_REG_TEMP_CONFIG, + MAX30102_REG_TEMP_CONFIG_TEMP_EN); if (ret) goto out; From patchwork Mon Jun 17 13:50:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700755 Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (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 D03571D3654 for ; Mon, 17 Jun 2024 13:50:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632245; cv=none; b=Sy69dUFyLfbLdo6pLfJ7BoBSE5QXdrFcYO9ollatB8QLVaS8pDJAFenVn/ipSeAxSqH3Ntd6ivRf6z873T62kEH3a0cZ/fWJXkE3zD9yL/p0iB0Qm6f5T53KcD9eQJ+Aa+dPlbkjBE/8w8xaY8GFtGgKg/1u/jRpExjppvcHHzI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632245; c=relaxed/simple; bh=+4mUxpFBa9t5WO+gS7VMEdFKNqvRfouDWQBE4gXDtPo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FZYZuHqPAfX+jYZrtjAzj0h9FyvQ+uQRFHBKBVGGiroeegO0cSNghkBnNQHO0ewCuA3YyZvAIYhCVE87Y+71m+P7yACHnXoQXwLD9lrku0hIZyNlIgUezPWjwGR+/vWrSgZV6DHLajZICwSmqLF0ITYGwcXifZVusnrrx0uzBjo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=AqY95hz1; arc=none smtp.client-ip=209.85.222.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="AqY95hz1" Received: by mail-qk1-f171.google.com with SMTP id af79cd13be357-797f2d8b408so310934985a.1 for ; Mon, 17 Jun 2024 06:50:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632243; x=1719237043; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=S/wwf4Pyf9v8s/HS7lCuvhL4I665hNiJrFxeq5WtNz8=; b=AqY95hz1WfQ3S5aotw3MAbwfwp/M8vWqwrKpAVxy2x7HqYL+z7PmxlFFhMClmVZIt9 0kPt0IU4wrho1UDAZCpFd1Zo141gvnr5W7BGJLZPL8Kt77qAcnQ+B5YuLQjuekvCA/7Y kZZ+uKJ3+y0BOFn9hVozrjOx/y2D0OX2YwLAO2Cldwvj5rWLgjdxyqdQ3A2Q7uacZkAk 615mgTKSQcxeXEE5/kEtSbPAICaoGN9oB940YoqcCb+TaAhAQE9StNLSgT1R27KcoUAv GdswVyabJfb9w4sinpl2csTkfYDudA2CFh0gL2VFhwjC6F1NaeLjGYdj4EPFWZyJEZvg mRHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632243; x=1719237043; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=S/wwf4Pyf9v8s/HS7lCuvhL4I665hNiJrFxeq5WtNz8=; b=SP9W2k4v58lGK8LZqOS0fCnpWunBW3KVDxF6ZslSCzzSyx/OA/c12fE7V5lQ8GkVv9 mcT/diKxLSmjBalAoX2BRIGXy6+YqnYfvC/JKx5oQ0K2xSOzyWJ/XkYOzwlhqZ4liVRY YW/SnuTfx6+Ai4sNh2QFC8wGe/V/nVJmql+w+pChHtI9r54MOGDqfNBEjH/wDw68Szzc VetFYxT2KEb94w3p5p2GQ3seiJ3rgAmOnOxQvhUHVX/3ViLzsu4PLwU21pyAhWZvetEG aPgvgYe9YzYV/sRgHDK8U1HysT4ntrt17jZd8dQ+gjyR917gP1JMH0BfCCrg4QDb/85j 9eGw== X-Forwarded-Encrypted: i=1; AJvYcCUoGvNpfohKuOOy4Xz05bq/QJ7HnJaXi00I+0TNHBQVTBRDUZY/QrjtAQiPhLhaSQO6Y0aK44GQz/DzVgWzDF6tVUs2 X-Gm-Message-State: AOJu0Yy64RDZJSe7XRoZlsciaU6kLCiDfOptYHapZ2kX6OfvQS0/1eFq 3oYZPVamiVjEd3fnzApF6GP+HAqzjX0FMlvC6tB3cw4Tn/0ZMOHQvtHX0mGjcpA= X-Google-Smtp-Source: AGHT+IFGOx2s8Nnos2uW+1yz9gXjI96q1FUrsSHsvdHqjpAdDpOLj6w2PTD0THhqXhocLH6W1aVi0w== X-Received: by 2002:a05:620a:46a1:b0:79a:2613:9b40 with SMTP id af79cd13be357-79a26139e04mr977624785a.50.1718632242836; Mon, 17 Jun 2024 06:50:42 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:42 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:07 -0400 Subject: [PATCH v3 27/41] iio: imu: inv_icm42600: make use of regmap_clear_bits(), regmap_set_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-27-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin Acked-by: Jean-Baptiste Maneyrol --- drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c | 14 ++++++-------- drivers/iio/imu/inv_icm42600/inv_icm42600_core.c | 9 ++++----- drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c | 4 ++-- drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c | 4 ++-- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c index 63b85ec88c13..509fe6a3ae97 100644 --- a/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c +++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c @@ -262,9 +262,8 @@ int inv_icm42600_buffer_update_watermark(struct inv_icm42600_state *st) /* restore watermark interrupt */ if (restore) { - ret = regmap_update_bits(st->map, INV_ICM42600_REG_INT_SOURCE0, - INV_ICM42600_INT_SOURCE0_FIFO_THS_INT1_EN, - INV_ICM42600_INT_SOURCE0_FIFO_THS_INT1_EN); + ret = regmap_set_bits(st->map, INV_ICM42600_REG_INT_SOURCE0, + INV_ICM42600_INT_SOURCE0_FIFO_THS_INT1_EN); if (ret) return ret; } @@ -306,9 +305,8 @@ static int inv_icm42600_buffer_postenable(struct iio_dev *indio_dev) } /* set FIFO threshold interrupt */ - ret = regmap_update_bits(st->map, INV_ICM42600_REG_INT_SOURCE0, - INV_ICM42600_INT_SOURCE0_FIFO_THS_INT1_EN, - INV_ICM42600_INT_SOURCE0_FIFO_THS_INT1_EN); + ret = regmap_set_bits(st->map, INV_ICM42600_REG_INT_SOURCE0, + INV_ICM42600_INT_SOURCE0_FIFO_THS_INT1_EN); if (ret) goto out_unlock; @@ -363,8 +361,8 @@ static int inv_icm42600_buffer_predisable(struct iio_dev *indio_dev) goto out_unlock; /* disable FIFO threshold interrupt */ - ret = regmap_update_bits(st->map, INV_ICM42600_REG_INT_SOURCE0, - INV_ICM42600_INT_SOURCE0_FIFO_THS_INT1_EN, 0); + ret = regmap_clear_bits(st->map, INV_ICM42600_REG_INT_SOURCE0, + INV_ICM42600_INT_SOURCE0_FIFO_THS_INT1_EN); if (ret) goto out_unlock; diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c index 96116a68ab29..bb302f5540cf 100644 --- a/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c +++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c @@ -435,9 +435,8 @@ static int inv_icm42600_setup(struct inv_icm42600_state *st, return ret; /* sensor data in big-endian (default) */ - ret = regmap_update_bits(st->map, INV_ICM42600_REG_INTF_CONFIG0, - INV_ICM42600_INTF_CONFIG0_SENSOR_DATA_ENDIAN, - INV_ICM42600_INTF_CONFIG0_SENSOR_DATA_ENDIAN); + ret = regmap_set_bits(st->map, INV_ICM42600_REG_INTF_CONFIG0, + INV_ICM42600_INTF_CONFIG0_SENSOR_DATA_ENDIAN); if (ret) return ret; @@ -532,8 +531,8 @@ static int inv_icm42600_irq_init(struct inv_icm42600_state *st, int irq, return ret; /* Deassert async reset for proper INT pin operation (cf datasheet) */ - ret = regmap_update_bits(st->map, INV_ICM42600_REG_INT_CONFIG1, - INV_ICM42600_INT_CONFIG1_ASYNC_RESET, 0); + ret = regmap_clear_bits(st->map, INV_ICM42600_REG_INT_CONFIG1, + INV_ICM42600_INT_CONFIG1_ASYNC_RESET); if (ret) return ret; diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c index 8d33504d770f..ebb31b385881 100644 --- a/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c +++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c @@ -28,8 +28,8 @@ static int inv_icm42600_i2c_bus_setup(struct inv_icm42600_state *st) INV_ICM42600_INTF_CONFIG6_MASK, INV_ICM42600_INTF_CONFIG6_I3C_EN); - ret = regmap_update_bits(st->map, INV_ICM42600_REG_INTF_CONFIG4, - INV_ICM42600_INTF_CONFIG4_I3C_BUS_ONLY, 0); + ret = regmap_clear_bits(st->map, INV_ICM42600_REG_INTF_CONFIG4, + INV_ICM42600_INTF_CONFIG4_I3C_BUS_ONLY); if (ret) return ret; diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c index cc2bf1799a46..eae5ff7a3cc1 100644 --- a/drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c +++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c @@ -27,8 +27,8 @@ static int inv_icm42600_spi_bus_setup(struct inv_icm42600_state *st) if (ret) return ret; - ret = regmap_update_bits(st->map, INV_ICM42600_REG_INTF_CONFIG4, - INV_ICM42600_INTF_CONFIG4_I3C_BUS_ONLY, 0); + ret = regmap_clear_bits(st->map, INV_ICM42600_REG_INTF_CONFIG4, + INV_ICM42600_INTF_CONFIG4_I3C_BUS_ONLY); if (ret) return ret; From patchwork Mon Jun 17 13:50:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700756 Received: from mail-oa1-f51.google.com (mail-oa1-f51.google.com [209.85.160.51]) (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 B84281CD5AD for ; Mon, 17 Jun 2024 13:50:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632247; cv=none; b=sCrmCsVxMbJeFDoSXkHepKaLAWz508+dG1ORV31UnKR/9taE31TXkFuMccOm3fmLuRNOMUW7FPCWU48a8rVZqE0OP0sAhK+ov12QaSNk/j1dH+fQt7h6NULvY4TJnXXSRS7cO/NCBQle6tacJjLyYGTaqNTUvI+Ofx+atGkcaYM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632247; c=relaxed/simple; bh=1krSrNHMvqxkLSx9XrKqBiSQEiLu8ivJ1Vl5F9eXcBc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=O9DP/rbqbAx7pHknB7BE6SSQ17R5yDvvImctl/u/ZX5yLEtLZGHKB3K7Dl3jWU/9Y9uWAhMnJYIF8xoZdqcU8ePXiw/6MCotzf7xke2M3qfRl+TgclLsyEgdxMDOPWB66eq7fXIGlooDsG01pEB5zB+mo6V14wVRBrCXLP67tEA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=AT3nfl6C; arc=none smtp.client-ip=209.85.160.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="AT3nfl6C" Received: by mail-oa1-f51.google.com with SMTP id 586e51a60fabf-25545664f37so2394027fac.1 for ; Mon, 17 Jun 2024 06:50:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632245; x=1719237045; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=no5e4JgYnxUL9VEAR0MyhLfYZ2Dji3NZkE6FFtqTn2Y=; b=AT3nfl6CgaXHIHnNgo4/Bu19rjry3etee+XGrb0km2rkvRr5sbpH12FQuXQc9bO+Xl W4vq5Q1kUrUkAbAGmrCGiimLbV0v1ip4pujze94FOFVt2uDNAyxlOze1am6W4BwVjsHC K+iHG8F125YaHPa2mT8nj8bkYT8DFvch1QYAw2S/sdd35udmOEIpyz5rdEDIQsY8WU4W YdGPN7FWQHKaL6v/AicsJmKyIbCCDVpQolGD5aGAXdigOx+7piKj2J7bN1VADGooqaGV T08GLivpSbGRPisjOfF2SGAP/C3wxKJJnYJTI8+eK4OLB+OqtCkB0H3gtTwj30wKl4y/ C8FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632245; x=1719237045; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=no5e4JgYnxUL9VEAR0MyhLfYZ2Dji3NZkE6FFtqTn2Y=; b=ALBHG/EALqM5JTRT4vrFZgbEYrzqvcxwieR7qmS5ZetO/qHPzVasUgRGtywmlGTSYr F/D0ixOZpTCmTguAJPthcAmrmLfQw2vdoWdgfc6VfRQVNf8gvOj71jBX5ilsocJqlRgY bjb9jjqmK0Py6rbaZNxMZBMQpBS3BZ2SZO1Zbk6QB1Ko8NJZ5cvMnt2WTxn7sCmZWvEB 4tcEarom0Gt+kNk/g+CXO8R9yBjMRBQbBPW/WiHxwYdBbtkJX4lCRo6q8iOWNLebtCGm PAZ5j6UZz65Ntu2xNMMRD2DnuU15/KRLiagbX1Stnw76JzAd4Ws7qqvAAf7zzea7hJiQ zhfA== X-Forwarded-Encrypted: i=1; AJvYcCXko9p1oUgvvjHHlKnZkCC2/Bq3VbN5AzJwYmhv8MqElMx5cmayMFdr1xELPEcU7S5MF3AhT8Qb80BMS1OjGxOjrHOp X-Gm-Message-State: AOJu0Yx95NTtcC4fyxoc1n0uaw0hEdnULOrBaKsuOZEvF/0IH+GsN8sW WQtXRq0mUW9QuFRgIiKZc+eXdd3B1irh/+qKibb4inp8TPHTrVMDfwrcB7NoyI4= X-Google-Smtp-Source: AGHT+IGU9b+YnJX5hCRw1ClyleRAxjZc2rSg4p660bR5sIf4JFOEx4FbnA14YINHS71KeMJAZo8MSg== X-Received: by 2002:a05:6870:472c:b0:24f:c95b:ab6 with SMTP id 586e51a60fabf-2584288ca57mr11986485fac.8.1718632244964; Mon, 17 Jun 2024 06:50:44 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:44 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:08 -0400 Subject: [PATCH v3 28/41] iio: light: adux1020: make use of regmap_clear_bits(), regmap_set_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-28-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/light/adux1020.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/iio/light/adux1020.c b/drivers/iio/light/adux1020.c index aa4a6c78f0aa..34230e699d27 100644 --- a/drivers/iio/light/adux1020.c +++ b/drivers/iio/light/adux1020.c @@ -539,9 +539,8 @@ static int adux1020_write_event_config(struct iio_dev *indio_dev, * Trigger proximity interrupt when the intensity is above * or below threshold */ - ret = regmap_update_bits(data->regmap, ADUX1020_REG_PROX_TYPE, - ADUX1020_PROX_TYPE, - ADUX1020_PROX_TYPE); + ret = regmap_set_bits(data->regmap, ADUX1020_REG_PROX_TYPE, + ADUX1020_PROX_TYPE); if (ret < 0) goto fail; @@ -748,8 +747,8 @@ static int adux1020_chip_init(struct adux1020_data *data) dev_dbg(&client->dev, "Detected ADUX1020 with chip id: 0x%04x\n", val); - ret = regmap_update_bits(data->regmap, ADUX1020_REG_SW_RESET, - ADUX1020_SW_RESET, ADUX1020_SW_RESET); + ret = regmap_set_bits(data->regmap, ADUX1020_REG_SW_RESET, + ADUX1020_SW_RESET); if (ret < 0) return ret; @@ -764,8 +763,8 @@ static int adux1020_chip_init(struct adux1020_data *data) return ret; /* Use LED_IREF for proximity mode */ - ret = regmap_update_bits(data->regmap, ADUX1020_REG_LED_CURRENT, - ADUX1020_LED_PIREF_EN, 0); + ret = regmap_clear_bits(data->regmap, ADUX1020_REG_LED_CURRENT, + ADUX1020_LED_PIREF_EN); if (ret < 0) return ret; From patchwork Mon Jun 17 13:50:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700757 Received: from mail-vs1-f53.google.com (mail-vs1-f53.google.com [209.85.217.53]) (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 1EBF41CD5DA for ; Mon, 17 Jun 2024 13:50:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632249; cv=none; b=Ob/DBNdtefkSIa0yx2UaIjKzmKzy2g9Cai1gLyMPGibkH/hBr79SVnYbBKzf2WSc628D+8bqDZamy0mXRTm9u6ZJFO9lJX4j4KUzrByaYG8d9iRz9xbAX275L4DzBuFReLIqxRFoNXM9dc3n8lwooKD9/Gg2NuH7eIJBICBU1/k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632249; c=relaxed/simple; bh=kFbbephRGP7AE1Xa56t0vAiYHDMzoLghdVd3BAj9xjQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EfI/uOpRIEWUk7y32zCEhBHetIVJGBcJiIVckqqwZNXv8yWE/ABXJgOALaHwJ4Qz5yI65d+JXZfZbXM+8XaZG9w0WG5UR3Kreh1Fzlj0JU14ow16/UzII/sn9zQ8Hb2/3topONuziScd5oXj2PC6DJ+4UfnCOWlNPMSUr+zfqns= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=meSnDrQa; arc=none smtp.client-ip=209.85.217.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="meSnDrQa" Received: by mail-vs1-f53.google.com with SMTP id ada2fe7eead31-48c4c5c0614so1354182137.1 for ; Mon, 17 Jun 2024 06:50:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632247; x=1719237047; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=DclUw90neJHmAEodckLVU1MrMAClwpCF1mlaeSjcN+U=; b=meSnDrQa6ICu+oeFIyw1PmSFAIQlKvxv5Vv2iLTufdI3wxXUfp2G79oX6LCuUZsOP7 KleAUZMGeYS7q2iu7c2vnLhobReGCQN7nW84s3V3Yph9lNG2Oj6ZGiE+0LNsrfFch/uo yq1zDytSpuNGYDpEDZFjArA0urZaO/KYjmrNvBeqPbSxjhKkjnkTcXSAwWyGgbi0y+qb ID0WGdJD1JrmymWrlx+cZ7P3uI/bxI8mENpXgNL0W0149AwNWyQB4EyOW1yI7gy2UAka CIM5+/6fKrRapofj5lhYmJ7WH5Ucs/WqYUe7UhoY0/brh3wlHuV01YUpIwAjVaoo5Kdp iByg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632247; x=1719237047; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DclUw90neJHmAEodckLVU1MrMAClwpCF1mlaeSjcN+U=; b=RJYbse0GdNYA6XiYSBSfhSEJGZxTbxgrhzwJ+jJmp8yOv7Prn0QlfAsNfubNY50um6 fQxaYwQ7Tzf3Sgwww5bzmTN5hWmsJA52KYTne/2SuUYqMvEvh3FUkskvggdwDzgNRvDb 95XoXJUyBqhkM9HY0XZ23Knmz6jKIdPKixZEA4ZrPWUyiz/IGSBQyXioENINTk9MOMTo Uqkt0MHzX9s/iIpu1E22m5SdLQzpfDXuBctU19RmyceZEhaZquTZB4Ho1U+x2ZnaU/ZI /SkPao7qM0/pkCtIdPNDBmKHLRRipxMu0s96BR7I/P7ezRoSbN8A90vkJXKsGXizGcoJ eM5Q== X-Forwarded-Encrypted: i=1; AJvYcCXkhP+5W5vIimEN+GqWIGjtDt3Bjr+dCjkrp3ldPDPuhZW6YVJ0uqqtcTM0C79Ups78Vc2bBafcyXXmCv+NogWxSrgc X-Gm-Message-State: AOJu0Ywv2Mnej6l3pOdh1mOdQecv6DxncZZtK/QRD1uWghlseCU/dmlK 0TODu/M74fkZX3ezGwxc+ZKWTYv8w5DeZhqUPVxMgHFbwLc+lFSBWld1/ai30Rs= X-Google-Smtp-Source: AGHT+IEubRIeXP7Kagp49NVByjjGeveFz51rlB4BKjhqfHfpKBEa7G7VixyRzOvMhLylvoLMhbPrtQ== X-Received: by 2002:a67:ec98:0:b0:48d:c0ab:ac20 with SMTP id ada2fe7eead31-48dc0abad12mr7057846137.7.1718632247057; Mon, 17 Jun 2024 06:50:47 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:46 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:09 -0400 Subject: [PATCH v3 29/41] iio: light: iqs621-als: make use of regmap_clear_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-29-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/light/iqs621-als.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/light/iqs621-als.c b/drivers/iio/light/iqs621-als.c index 004ea890a4b2..6de33feada3a 100644 --- a/drivers/iio/light/iqs621-als.c +++ b/drivers/iio/light/iqs621-als.c @@ -86,8 +86,8 @@ static int iqs621_als_init(struct iqs621_als_private *iqs621_als) if (iqs621_als->prox_en) event_mask |= iqs62x->dev_desc->ir_mask; - return regmap_update_bits(iqs62x->regmap, IQS620_GLBL_EVENT_MASK, - event_mask, 0); + return regmap_clear_bits(iqs62x->regmap, IQS620_GLBL_EVENT_MASK, + event_mask); } static int iqs621_als_notifier(struct notifier_block *notifier, From patchwork Mon Jun 17 13:50:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700758 Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (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 314DB1CE084 for ; Mon, 17 Jun 2024 13:50:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632251; cv=none; b=Qse3ZGEX1LfAlUS60/deV6JkF31dbgUXeQw/PdofIeDlwzlovCER6DfhjK4ppUVeJheplRZR2PUe81WofTzA+f5dkcFFPvdwRiGVJZcvo/eiSzUxMNbyeK6ZrtCkBO9voKdBaTTqfpItKKRVhVoiRNWL++PK33Sy85cOl+Sykkc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632251; c=relaxed/simple; bh=smoODOKJzYbzSY7+vwmdsueBeuYxskf+h32ZLD9bbUs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=H0tBSNZh1Jg5dULJY6DAU/KcQPo9crGUzRdorYQt922Q4pqLiBGwYGE+lZNm45Ic7BV8z3feJV+xSWkRQWF6qBexTOvKRIN+y/IDe1bACtyC/rMFMYGdQL2w87y+T7h37848kXYXXPV3AQbKf8m0puMlFcAYm3q+SEw/bcp6pJE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=eVr56d2I; arc=none smtp.client-ip=209.85.222.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="eVr56d2I" Received: by mail-qk1-f180.google.com with SMTP id af79cd13be357-79776e3e351so312739585a.3 for ; Mon, 17 Jun 2024 06:50:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632249; x=1719237049; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=qNtak+2SP0bqKcAwBmLBKZAak83BgIl2xc15imfy8nI=; b=eVr56d2IW/LbawN4XINw/65Y+yi9f+5NVB4i6/9ERB1GpXvc2gRoUa9HkKiUy0pZG5 i8UR315eNPZj7+GviAQfdhYgEs03OKGpe52PjVXtz/wck+4yCdISgeSyU0CxZJmsciX5 Ef4uI6jQjNpKRFBnUUaxBQVwb6w6iTAJ5e/J9COY3LlW7OQPlvV3clK1Oqfd6pxzV5F8 0hFTXsOQNrEMs+1v0cuYSvMIQFkgmq3hFjyFihNATukjXL9TMiiqNByLzV3IJ4PO8zSA AdvgT4ObpktcJCoWx97HA7+u9wagl4d+pl5+yfZTyztwkagz9xlsYeDPbTk48a/48s/o 9obA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632249; x=1719237049; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qNtak+2SP0bqKcAwBmLBKZAak83BgIl2xc15imfy8nI=; b=htATfSvLjwKJSC16CZhOYGHkdqTZG+V9KaIvVZQD/XGl2dJtl4c9xHiIxa0wR2nSza BINTXjCbjDQAfxzP8x1ZFEXGKYIMeo1F5eBcsjkGDhDiyHcfh59PDWXg5EPkGt3BV+5A NZuB0TP6syybKszSUOnTT/Ox6ypuWmRLxowpll8EhRNJP7snMXPpyq+WlFKTjsXOebiV +GvyTp8x6inhNSNyfdBweZReLTr0kGD/a4dr6hOzlLXgRi6dV5JSVdy/HUJKie/t0Ff1 wmLCpJ0IIhqtLzKcvyaa2TQHlXrVIo/b3VA+rR1wIdqI7Yq7BRRe0xWeQMQFeDLpnVuN ABbw== X-Forwarded-Encrypted: i=1; AJvYcCVmzLy+BtvmyLC1sCpcrPgS3ZhDJ/MzQ+1jdu5UKQoQYdffLVjQ5ua1D+V75arLDRHv+ZJ9KeaYtyEAG29yONoy7jfK X-Gm-Message-State: AOJu0YxCsH1+WHg26fYLRqWXhulGGKBT/45d0fzHKYcZAXq/lpAZnram oM691UPyGtiYmMZ6fOUwOIRPdjUJKgXMZiSz2ICp6pco2PBbkqvu6lWlEkaenk4= X-Google-Smtp-Source: AGHT+IEff9Dln+tnuVCEmbJAGpzplXAkkgqJD6yK1MHCx8a+d/cYhrzz8V7ALZ8zTjCZj6a+ffKadQ== X-Received: by 2002:a05:620a:4088:b0:797:d55a:5166 with SMTP id af79cd13be357-798d258dd41mr1141019385a.58.1718632249174; Mon, 17 Jun 2024 06:50:49 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:48 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:10 -0400 Subject: [PATCH v3 30/41] iio: light: isl29018: make use of regmap_clear_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-30-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/light/isl29018.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iio/light/isl29018.c b/drivers/iio/light/isl29018.c index 43484c18b101..8dfc750e68c0 100644 --- a/drivers/iio/light/isl29018.c +++ b/drivers/iio/light/isl29018.c @@ -550,9 +550,9 @@ static int isl29018_chip_init(struct isl29018_chip *chip) return -ENODEV; /* Clear brownout bit */ - status = regmap_update_bits(chip->regmap, - ISL29035_REG_DEVICE_ID, - ISL29035_BOUT_MASK, 0); + status = regmap_clear_bits(chip->regmap, + ISL29035_REG_DEVICE_ID, + ISL29035_BOUT_MASK); if (status < 0) return status; } From patchwork Mon Jun 17 13:50:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700759 Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) (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 638851CE0B1 for ; Mon, 17 Jun 2024 13:50:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632253; cv=none; b=Qg9pLW0CAb4POvj7KIf9bjGtLZ8N2MZaeqwlm6Kq0F1mgOYsQSxLDsoCGxWszeB9AX4ormI1M9ZtlZof6KM2s+tkQ3lNkB1bXIhpVOT1ng3huLZwqefqFSCO3dexDaFhWMfZgFczpE71Pq58ebYZ7BRb7jMe0PNqqNb7aKb5VEM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632253; c=relaxed/simple; bh=ckMo8AE5ydYAYNgqLQ5pfM8APLagaTP89WYb9paKWrI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jfRp00ANmiwopKycizZC++yudrVa4+Rw4ht4m1nrGd2r/2BA55ozW17dum/Cz2eyVCnt18XgNTuVh/zTMz1iHDeuXAl+migvNiIbcf1rQIESnLDYq4KrZNoJaI0MJMlytPHtd0uUEn7JHf0nvDjRAznQXUSpIrX8K2/pBvn0Sz4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=mTI3JbQo; arc=none smtp.client-ip=209.85.222.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="mTI3JbQo" Received: by mail-qk1-f181.google.com with SMTP id af79cd13be357-797e2834c4eso366755185a.0 for ; Mon, 17 Jun 2024 06:50:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632251; x=1719237051; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=b+ymucZ3m6lrJGr3WTAeCvzidHKg4xOe2grvPyQxJhA=; b=mTI3JbQox6AllYwJGtQG1E1NoD8JUuvthxDm4wUWCu5YaQftmEsEWppEYDizPC4d/x Yspjj0JkQZTH1j5ftF2P+o/i77UIxEf/lvIrrlg6KMaFyLFLkSRhepKJoSU/mXbiZFcn OX8jkCSL/4mqgXe6Plxp23lpg7qgSuzYxSfkPhMBIrbbVELnrVSthvavmKSQtuNLQKA7 BGHpGnu4kGUquGq0k++5o/LB6H/elEI+aFRK1K2TVHECSuq8b0M0D1nq2Id25qEJAwaX ZRT40cpPzow9jEzweDu8dbvRGs4d2eYO15sfJ3JaSPq9lpdwLcDvbsCgn6D9kn+SzijK ZgEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632251; x=1719237051; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=b+ymucZ3m6lrJGr3WTAeCvzidHKg4xOe2grvPyQxJhA=; b=Uifu0KzyzccTyd5OJosdW25ZsK1OP5sVbPliRkXC4eP5J62uL2/YsOEm5HG9D+AI6H 1FyoW29aQA3jX1J5OemclGfkM84UuoVh6pfsOV24Ljj3XOYu+C/lJl8a7T6+6Fbi41wW 42YmtJhAip890pU4PXXnNpm0mgzzM3Ff69j3J5261FBKTa6Ua6lqhjF68UT6e9z1JjJ4 R87GIi8T0xYB5fTCxYkXisZpL6iHjQwI3TTSAvm84RC/Dz7jhgMfkkXYuZ7TzeJSyDYU 4S8EgThcYkjUvKtYligJUrPxW6oAzmsmkkl0S1Trk8ceigtJXL/KhtvnnGoN16VS1gp9 OgfA== X-Forwarded-Encrypted: i=1; AJvYcCXDvSRN8u4Nv6Dcxnx1PTKtJBuexPDtoq1AHPpoLC96QH720FOIzIgKFMTU8VjznwcARJ3e7V0+8h5uOc63HtwHmneL X-Gm-Message-State: AOJu0Yx5lfkX4bhSIrZM4Hz8pqeyLpkqW/Nwl/vICIngvLjxlISmHoT2 EoIitgdzxKtqU4zsYyV/o6NHxC4CMvXseBr5tJDVdcymWqmjRUJ839kt5Rvg5c0= X-Google-Smtp-Source: AGHT+IFhD2JefGeiJgsg6Ae7QRIe/BDndSP0Z/WiCRPC91zIn6+wpqBzLsiQzn3/JIP4kN+hagVe4g== X-Received: by 2002:a05:620a:4056:b0:795:56a1:6c0a with SMTP id af79cd13be357-798d03b78c4mr1852443685a.30.1718632251285; Mon, 17 Jun 2024 06:50:51 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:51 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:11 -0400 Subject: [PATCH v3 31/41] iio: light: st_uvis25_core: make use of regmap_clear_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-31-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/light/st_uvis25_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/light/st_uvis25_core.c b/drivers/iio/light/st_uvis25_core.c index d4e17079b2f4..fba3997574bb 100644 --- a/drivers/iio/light/st_uvis25_core.c +++ b/drivers/iio/light/st_uvis25_core.c @@ -330,8 +330,8 @@ static int st_uvis25_suspend(struct device *dev) struct iio_dev *iio_dev = dev_get_drvdata(dev); struct st_uvis25_hw *hw = iio_priv(iio_dev); - return regmap_update_bits(hw->regmap, ST_UVIS25_REG_CTRL1_ADDR, - ST_UVIS25_REG_ODR_MASK, 0); + return regmap_clear_bits(hw->regmap, ST_UVIS25_REG_CTRL1_ADDR, + ST_UVIS25_REG_ODR_MASK); } static int st_uvis25_resume(struct device *dev) From patchwork Mon Jun 17 13:50:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700760 Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) (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 667651CE9E3 for ; Mon, 17 Jun 2024 13:50:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632255; cv=none; b=lpu1MVdiS5Ign30SKJD3W7celsl0MZyfvctBZxbHa6ZwdzNBJvIf4eFep9zLJb6gvDn44w6yaCRVyerFahm37Aw8gGcmZPTb0sjzMd+TrZ2c15IW4vcTWOXq79yziIM8bpOBDoXtRzmeziygDJz5d8mSWd2FMnMGMhtfikjkeZY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632255; c=relaxed/simple; bh=9Ek5rCXvCt90Gabaa6g12uHkTZTPMxmCN9hdijlBa5U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Si6hs8oFBgDM46kOAsO7lwa5+Mz/7bL4jjc8f1TcXyEXsuif+2XVXmbN0AU4CbEMKw09oAURA03JlYl6zqiUndTmDZFiyLrGrYtxZrnv7x+Odyi/syPsfpp0qCGdqeQeMgvctOrVGSimLtoR1sd2DHo6oSoezvX5qq191PEJuOA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=VqNdoGo6; arc=none smtp.client-ip=209.85.222.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="VqNdoGo6" Received: by mail-qk1-f172.google.com with SMTP id af79cd13be357-795482e114cso363679385a.1 for ; Mon, 17 Jun 2024 06:50:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632253; x=1719237053; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=8+9CxU2CvbNCydIwkwVi62wLJsPjXvn/mOpa7x+p1k8=; b=VqNdoGo6MK9kXq3dFLGc/LxzOH/wV5LxIrhKXJvm7jUUr+kpf3nLB8vHny/GFtLsWn pR+DTxwg4x50yY5SnCp7ofHehV8UEcuOeS2DubOsyvBWSJIZKti2Dy1uVxyNQfZ2Dnry vo0FsVEqpWkcM7Y03zmWvKTRW56zkRoq0D1tlPf0fk56fklzrt6GFcpdqoLEtnjbGpc+ O3RtMtxzMqBhzP0m/JBjbmLul8x8U90yxbcPORiLcxacFq2yWqa1tUOg+fyuHmuwZlwc XzRwg/gbG41nGnBTOSmspkIPFcGxMpI8jUkytNhEGA78EtBI2vUzOaFBfp4wO6FdYmuK gDAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632253; x=1719237053; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8+9CxU2CvbNCydIwkwVi62wLJsPjXvn/mOpa7x+p1k8=; b=D/NgnMYtIW7+anEHS40m16rNfrkx0JKxG1vKBcLwkP3qVSyC3+IQZYDX4uf8DZ0TWN HYBpTiPNe/03UexHtqfEhcLH6C4lPd0rNtwjgDnKWUw8/Xix9znH+bc5grsBArd3s/RT acnVWJraxVeqjlykXhNphTtN2gKli+vmKF0cktBk+y8Fc+k4kRckYgddAGo9tLXvp+UU 340eRsaLsMkC0XJyHYHzGui0IhOKPHj7pClv9836oIPUqsEXsKMOSZiTseIdqGRwQOGY DhLLCHLMRaXgPQvR4qk3JSvKySgpprECmJrBso6zM/VF7HXr7vHeXJdMNlMW5T7au96H a6wg== X-Forwarded-Encrypted: i=1; AJvYcCVJ0ZHvRuyReaQ7AvIby5ijDBdkf1erXxru+uHflIRYWg8NiNzXS2ld7ST9hLHM1EHR0p0Jg08kH4vOr413nzqWQ0XQ X-Gm-Message-State: AOJu0YwiSAHOwy1lLX5Aa79EeRn+mHDlfcNZv+RA1pxONwCHKvSz4FsO Lso4M5a+ISjxoU4MD4Khj4pmGZtbd7fC/zVq4L1YP6+YZtlLx9nxMjLbN8l8g1s= X-Google-Smtp-Source: AGHT+IF0QBpD3doG6Fp1c+vnf+YJQ81FC5gB6//3DNzmC1F9GzI4GVFvf6U3tYk3LEdICO36nL3YKg== X-Received: by 2002:a05:620a:2a0a:b0:795:5c3e:eb45 with SMTP id af79cd13be357-798d2531f98mr1137480985a.34.1718632253384; Mon, 17 Jun 2024 06:50:53 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:53 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:12 -0400 Subject: [PATCH v3 32/41] iio: light: veml6030: make use of regmap_clear_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-32-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/light/veml6030.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/light/veml6030.c b/drivers/iio/light/veml6030.c index 043f233d9bdb..f7ccbce45f38 100644 --- a/drivers/iio/light/veml6030.c +++ b/drivers/iio/light/veml6030.c @@ -144,8 +144,8 @@ static const struct attribute_group veml6030_event_attr_group = { static int veml6030_als_pwr_on(struct veml6030_data *data) { - return regmap_update_bits(data->regmap, VEML6030_REG_ALS_CONF, - VEML6030_ALS_SD, 0); + return regmap_clear_bits(data->regmap, VEML6030_REG_ALS_CONF, + VEML6030_ALS_SD); } static int veml6030_als_shut_down(struct veml6030_data *data) From patchwork Mon Jun 17 13:50:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700761 Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) (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 AE72B1CEA0B for ; Mon, 17 Jun 2024 13:50:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632258; cv=none; b=it2b9Aj9ynSeqe32y2K/JtSEtwgPOIj3BkXIweUCo3LyjXFa5G8HRR3DIocCpvPalw+vIWkjz6gqj/U712nQHwZhqwDaepdKreRrlTYdoWW8RTHxquZVVpbDN/RzrcLB9f6GLNa+qsfsztubceIQo00n2BIZi3ygrC6ylCUVEMo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632258; c=relaxed/simple; bh=f/zX3HOWeL5TET6xFFyDUq7zdBoOXuLX6VMmAIvmM+E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kQtZYEXdN8KNXJVWbOzzivkwVHad0tE8gmNcPFoOjsz3V5aaQJvZiLF0AHyR0Cc7zCDnCEcw1q2btMn6eFmQMBy6dogNRgn0hIlam95nlHRWgs/KbjoJxEGUV5/zKLyijeUgzCwWIRgDZVMdiwpXfp0w8gFFNKEHvWC/JuATSmQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=lDDuLErN; arc=none smtp.client-ip=209.85.222.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="lDDuLErN" Received: by mail-qk1-f174.google.com with SMTP id af79cd13be357-7955af79812so246269885a.1 for ; Mon, 17 Jun 2024 06:50:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632255; x=1719237055; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Ia4Z2qLqqNhVaFO8MtaqZtGEmhpmvSbj7T0WFgyfsq8=; b=lDDuLErNS9/NmqEhtXzSYiVKtw0z+AXUcsj98s/tKDPF1/zbsFlhfkpMSUH2KBrcy2 EFgruxVxXKch5V1jZrnZXwXxC6PIQhvCY9csIhz/D8cPXgNf3YpCdRQAwfmCkaDr8i+i Uq9zkhgJQ9LUOEh28jlm2qx3ujypVHTlnymyvKov8THvRo0Z8XM5gbfI4TEFaXhDdYbv +a2gzBi6vAk5INPx2130//IbUE97dm4oFmDgx5BXMCFDA/pToaoyUqb1PbkzQvWo0DZu 2DO/Ch5jTDHW3yASj+hXvt7QO6zIFKY3OvcZUJsGTP0OyEd4ob0efEK4Ihg+lBDDmJft pMHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632255; x=1719237055; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ia4Z2qLqqNhVaFO8MtaqZtGEmhpmvSbj7T0WFgyfsq8=; b=gaSdQGk1MVYh2fLJkrVr8OxqmOCho2Fn9pfFW/tu17R4GgOEdFMXMwzmn0LeJZMFVZ Vs5AQhm9c9Ji33mVUyD6kK8Ttn2UMXiPDaniO6gtQ6RhIF9MzgGcWvq5Xnki7j2bDXjQ scjoRY5C0QsY3Awgd98YSa09XllcdDp3xtDHhwQhMMdVox1NI0J5zWPB0ZHZVV3Etfp8 +cMSdCTbMCY5jUBOTwUdZwxOTideP+IiJ+Tj8VGKWVj1+IXYVYYnC+dc3WWn9t1vzElC uEt5fdIUdydPFIspreHbNRqfCGGdBayYLRiF8qT4hCbcFaI+cuNLf0j7A4J/FUJPpKgD qmRg== X-Forwarded-Encrypted: i=1; AJvYcCXEAk9AKP2+1dOqkza53f+1MyDlqlq/ElU3VonD6QzQ+SI3IZLVSlwfqPOoRca5eQ5qh56ZPRdKRynyIShYXYSw8BJ1 X-Gm-Message-State: AOJu0Yzus/ifFen6xd022VAqClIwvnwA7jVEwoiEPJfmfKERaT4E7KEQ nwJ/a+7GiIJQptFDGBXk7ET6eWWWW9OUEQsArJz2Z7sEtMzFDjEvDYYSZwMI8gA= X-Google-Smtp-Source: AGHT+IEp5RQjN3OqXqNMmTgCMp6Y0MDh6HV8RUCzW71+lzqdiGZxksmwSY5WI1Xptssn8y0vJEqwfQ== X-Received: by 2002:a05:620a:1921:b0:797:74ba:8ab with SMTP id af79cd13be357-798d26b4a64mr1132760985a.73.1718632255523; Mon, 17 Jun 2024 06:50:55 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:55 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:13 -0400 Subject: [PATCH v3 33/41] iio: magnetometer: ak8974: make use of regmap_set_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-33-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin Reviewed-by: Linus Walleij --- drivers/iio/magnetometer/ak8974.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/iio/magnetometer/ak8974.c b/drivers/iio/magnetometer/ak8974.c index c74d11943ec7..70172b918e16 100644 --- a/drivers/iio/magnetometer/ak8974.c +++ b/drivers/iio/magnetometer/ak8974.c @@ -327,10 +327,7 @@ static int ak8974_trigmeas(struct ak8974 *ak8974) } /* Force a measurement */ - return regmap_update_bits(ak8974->map, - AK8974_CTRL3, - AK8974_CTRL3_FORCE, - AK8974_CTRL3_FORCE); + return regmap_set_bits(ak8974->map, AK8974_CTRL3, AK8974_CTRL3_FORCE); } static int ak8974_await_drdy(struct ak8974 *ak8974) @@ -438,10 +435,8 @@ static int ak8974_selftest(struct ak8974 *ak8974) } /* Trigger self-test */ - ret = regmap_update_bits(ak8974->map, - AK8974_CTRL3, - AK8974_CTRL3_SELFTEST, - AK8974_CTRL3_SELFTEST); + ret = regmap_set_bits(ak8974->map, AK8974_CTRL3, + AK8974_CTRL3_SELFTEST); if (ret) { dev_err(dev, "could not write CTRL3\n"); return ret; From patchwork Mon Jun 17 13:50:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700762 Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) (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 BE3A81CF3C3 for ; Mon, 17 Jun 2024 13:50:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632260; cv=none; b=pwTaHx/EP7xp8hTxM1ublgRgpLaz+hRambmc+sNIBMoAA2JBTcpUrbE4QZLsqi6oJRngxRrmoAAkM5HasFFou8wCv/6OgV1EgG4qo+AUjIlY9HwG0tt8HboUMZwJP+QyUN82OA4oYiHvxdUSq/2uSHRJ/SXVYjHbPhHNfbvwfqM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632260; c=relaxed/simple; bh=iu06Agy4gwP3mD/XsHj6uJ5NOzKIr+fvZxk9qZQspyI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=b9NHLDBwy3yLbC343Nu1hYSEpOWw81eWcMgtLSCMVAh6yFzFkV7pQFhYXI32MFOW41b392BLSRp1DKJFt3ChZz9PBsNgqSdfrVfIbRrgU/pC5BukOQHCpLvcKUMubakkgyIUlzPbs0J7DkdquPPfryTDqJS99jZA0mHmnfrViNg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=g9h9BIlB; arc=none smtp.client-ip=209.85.222.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="g9h9BIlB" Received: by mail-qk1-f178.google.com with SMTP id af79cd13be357-797a7f9b52eso343352785a.2 for ; Mon, 17 Jun 2024 06:50:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632258; x=1719237058; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Bd9TIH+WbKUd6xwGH770DEQhZI10Wa7zRAAyumCALaY=; b=g9h9BIlBU0M5AuB9h08RVsM4NM7/YbSMhmIT+p26nAruTXHl6/zpoz0UU3mUSh/bvj +5BtDd0FTb+SSnEkrF7ED9+kXrYRpM/rGln+MDZ8LwlsmeLL9OCzgVTWSfEThO8Nw/KP MS+Ot8FHsYKx8DHznjSgxqF11k4cClcFKFfp4Yme/c5UGe5YG7TlCs+oKtlS6riFL1O5 dAuGt/rbF3aKHav1mXMAU7QCvUox05i9hEgOtCJ5gccmgYJlCr0DOfeXt0/qyKqQ8jdR m/6GLGFN4RgUUOfKQCp1bGfNYXYYJ2CZOpJ4cyCAq7xh6tY2dXDJC3oAxcWYkOL3IAaQ azpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632258; x=1719237058; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Bd9TIH+WbKUd6xwGH770DEQhZI10Wa7zRAAyumCALaY=; b=XoqPiMCpMtheUr+VBTRnmlTGpnVuoJ8Iyll8ylEBIyZJqS3KkNNtPEyTG9OJyDlyMe yLBvJd0AsGGZE0uRLhgGocIHotMM/cAJlbz+OVIUIhUneGEcqPDKNsVi8USZFkLHAH6m qRv868meDdtNCcjxjLqcqFbbqQhF2braoBh4HmFGUeUJxLaD8cM5X/qNlOrMUDRB/LDW cO2Bl9o3NXumjWzrSp3DGouZOORsWYHR6Bv+HIZf9THh0zx8aWb2xXG/T/QJlL8LqUDo plVxAlWmYz4wcrm7Cb5KWTSHu64FHJELandY85SJ2TZ4qln1p88LcMGfDSktEFhbqpWh NiVQ== X-Forwarded-Encrypted: i=1; AJvYcCW9dmwsBXxobBWDoyE8NBw3Qt4P/jJ47c0O0PFpwR1FHvvePuwNx8V4WXDZH5KKC9MtiRpnpeZiFifAcYLIIAPjASCc X-Gm-Message-State: AOJu0YxO9kVzoTkADXS6KtbApveqNduChKLS4oBammOXl6uWup6FruqV wHAsX7hp/q4IoUIzTDTrgJojP4NNQ53X96J6+eaTt19+qgVoVFpTY1sM8OwKraE= X-Google-Smtp-Source: AGHT+IHIgplKyy0pftg/5a2SG9pITo7fxr5SdNNjpCXiI/wTi4jbCSV+DPabl4pWpKgzNJgkUownfQ== X-Received: by 2002:a05:620a:2684:b0:797:8ee3:9f01 with SMTP id af79cd13be357-798d2437ce1mr1017310785a.34.1718632257705; Mon, 17 Jun 2024 06:50:57 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:57 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:14 -0400 Subject: [PATCH v3 34/41] iio: magnetometer: mmc35240: make use of regmap_set_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-34-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/magnetometer/mmc35240.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/iio/magnetometer/mmc35240.c b/drivers/iio/magnetometer/mmc35240.c index 6b9f4b056191..ec35e9543a96 100644 --- a/drivers/iio/magnetometer/mmc35240.c +++ b/drivers/iio/magnetometer/mmc35240.c @@ -186,9 +186,8 @@ static int mmc35240_hw_set(struct mmc35240_data *data, bool set) * Recharge the capacitor at VCAP pin, requested to be issued * before a SET/RESET command. */ - ret = regmap_update_bits(data->regmap, MMC35240_REG_CTRL0, - MMC35240_CTRL0_REFILL_BIT, - MMC35240_CTRL0_REFILL_BIT); + ret = regmap_set_bits(data->regmap, MMC35240_REG_CTRL0, + MMC35240_CTRL0_REFILL_BIT); if (ret < 0) return ret; usleep_range(MMC35240_WAIT_CHARGE_PUMP, MMC35240_WAIT_CHARGE_PUMP + 1); @@ -198,8 +197,7 @@ static int mmc35240_hw_set(struct mmc35240_data *data, bool set) else coil_bit = MMC35240_CTRL0_RESET_BIT; - return regmap_update_bits(data->regmap, MMC35240_REG_CTRL0, - coil_bit, coil_bit); + return regmap_set_bits(data->regmap, MMC35240_REG_CTRL0, coil_bit); } From patchwork Mon Jun 17 13:50:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700763 Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) (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 DBE671CF3C4 for ; Mon, 17 Jun 2024 13:51:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632263; cv=none; b=FgwwLCOjaMcEezqgQtixlNlmj35jeqWDzSBLeRQz1yMnpFC3oWqu0Dm/4zhdPj3AMpq746nNKR48wvErJwkUMyoi5g8jy8+5eiqjOXQROEMhpo/NA4ULbraS5dQCryhTDELljcB+AwzMromuILRx1y9pwt7xr+Ghs9nb5jSwdlI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632263; c=relaxed/simple; bh=NDx/K6ep/W55tpcxMxrlQJ2+ADx4bn4sLDv234tkO70=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ODe/eR08gKPdB7BVfe7YNDvxk4SGCSd2icjf19QVZPB5QbC9Zjg3IVu6J74fCJ/Of/b4NLHS7HC8C2qiZW2lu8zrFblRthDOLPaKqjfpLfyeLUVAw0b8SFJpjeBL4ER6iUv2uk7i1W7Z3J62XPKelwZRR+zxXrE+NFu3yNAWZ3c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=OQm5iUxr; arc=none smtp.client-ip=209.85.222.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="OQm5iUxr" Received: by mail-qk1-f174.google.com with SMTP id af79cd13be357-795569eedcaso228741785a.3 for ; Mon, 17 Jun 2024 06:51:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632260; x=1719237060; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=cCh+HIY0adNQEnDSauX7K8bw5POFZegMypjkhgGy1wk=; b=OQm5iUxrRj6uXTUisqBJxOlEQ/wQzKa5RvOWgRi0Ct5UcSBKFESXJJF3hbkcUDDRvt Ft5peYiHxS+b2+KfIGBajBYXybwmXxn1xo6JMF3mTW7ES+RrBip6QxDuCuTIprN1jXGy Fv+0KUZEXUjkhaoX2v5x9PaoxSFvyTxubOtYf6UEdFinB6gWsBFsS+PM51BEuFyVglXQ 9M8v10AE3XMptSLaRFHdFz9z0V1X/mlgpgRsiT3miBN8dzhXgTTgAUQiS1n/NTo2muoZ RFGO0eqlBwn8nt9vuJr/CId+Z2x42dWJaGVU50AHLjdHLdczQk+FaTSe/dYbTMj5LajM NMGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632260; x=1719237060; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cCh+HIY0adNQEnDSauX7K8bw5POFZegMypjkhgGy1wk=; b=Q/S8qdFaN7e/bS1ojm9Ikx8ONnmFs3pTAAoztG92hoVy/PQ1XoRxZs1CxZMwtc3eJj xZ8MLAnhY/KrfkrwikRU1It/ARxQwLHiWevlUe202TmvcdXMSlsKuZFLEmz9HQfRFyb1 y6Y/PIRTXV6ZU1Nf5TzeHhSE9eJGEtwsCQPyBH7xBsQBp0fKbVJYBq7urY6YP1ViDTrO krSVWqWQSgBv3Y7HLrmPl8JXF22dQtDX2DoXGSPhB3O/IoQlxb446nAXF8Jteudgmy01 ZTh4SxLfcYFEolXH9q+0B3+MAN4U3n6llR5y+zh5Tn2MD8zegRpc3EdsicjLjQC5D6GA f6nw== X-Forwarded-Encrypted: i=1; AJvYcCWIgSsROUCuAAIZRYt9qATysrAAflePJBXUnWO6eWif1bqqgkK0kI6LK2TzbyWzw1rTBIZhcSCm1Lf6xtqGSwLavTeW X-Gm-Message-State: AOJu0YzaVn58SHHgMX45a38eYk3zg99Fro7KBBRYiC4GsopKdkAUA4gl 8muKcRZ9vMMFK9n+XdqVDfd6sBEJBog3wp/8g8pmjgB3P0ZEcl2vOp9UcYETdD0= X-Google-Smtp-Source: AGHT+IENId7QjpgihvaST50kcENjvnWyxdiSnte4lhDV+Skn20e41tG2cguOi5hNHA7+JrD8WB9kUA== X-Received: by 2002:a05:620a:1a29:b0:795:50fa:c0be with SMTP id af79cd13be357-798d243ab42mr1258423585a.39.1718632259895; Mon, 17 Jun 2024 06:50:59 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:59 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:15 -0400 Subject: [PATCH v3 35/41] iio: pressure: bmp280-core: make use of regmap_clear_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-35-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin Tested-By: Vasileios Amoiridis Reviewed-by: Linus Walleij --- drivers/iio/pressure/bmp280-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c index 09f53d987c7d..ef7f546839e4 100644 --- a/drivers/iio/pressure/bmp280-core.c +++ b/drivers/iio/pressure/bmp280-core.c @@ -1566,8 +1566,8 @@ static int bmp580_nvmem_write(void *priv, unsigned int offset, void *val, goto exit; /* Disable programming mode bit */ - ret = regmap_update_bits(data->regmap, BMP580_REG_NVM_ADDR, - BMP580_NVM_PROG_EN, 0); + ret = regmap_clear_bits(data->regmap, BMP580_REG_NVM_ADDR, + BMP580_NVM_PROG_EN); if (ret) { dev_err(data->dev, "error resetting nvm write\n"); goto exit; From patchwork Mon Jun 17 13:50:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700764 Received: from mail-oa1-f47.google.com (mail-oa1-f47.google.com [209.85.160.47]) (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 E71E11CF3EF for ; Mon, 17 Jun 2024 13:51:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632264; cv=none; b=aHzyXZQxnmvz/ebBjwmpA+Z8dy/0qofGmdn/5j99cT8s7XXgsvSb+wK2W8tTKo28pt+EbZKxIvF8+Sgis+N3r888c8blLrMJQ16ajH3KN+Z/MWYTD98iDHggrh8yTbrs5TCQmYAj/26OpijZrNiccy85/Jn99tKc8mI6TJTktAQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632264; c=relaxed/simple; bh=vM1JkJ0x/TYqTHqzgAuZC94s5MJ55op+dR9vjEILN4Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Lf9n/5t0wKv3rhHUKv49Ce53p+ub9L6h5uZleIhw58v6yGOeOk6UCH6TcZLDDExveyhZiCrT0yqFJFu9zouzHxk1mXkiBHntLLZLdNkYAVS/QlDhkkKFE0KEFRkITe0mlfVlZ7qtnYFSQfmyQ4URWHqwBQOexphQW4aAtU99v7Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=VDTW4JLT; arc=none smtp.client-ip=209.85.160.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="VDTW4JLT" Received: by mail-oa1-f47.google.com with SMTP id 586e51a60fabf-254d001d03dso2082879fac.3 for ; Mon, 17 Jun 2024 06:51:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632262; x=1719237062; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=1Tk27b9u+l0CzDHHIWu0wOizrcdk6I7Pf7l1UE2LHs0=; b=VDTW4JLT5V/OSsuHvtkJmgP4gpCxIxAp+6uVNi5hlo+t7bTgrpACfrriInMHybfoJ/ 4+/cUKJYriAYL72udYSEUkxHB+hymlGj/2tpEJpLp9/mnKSsez9covxk+SVtEE1RRSRo kFesI4d5bCNWDZ+eZ3NCwADEW9jSzgpznp0CaHK7kmxjidUHjT/WNhCy5WCKZOqcWAL4 RWTXCJ4gZbvaoN5SDqzeNNkZBHdXfys5T3CeGPto5u6vTAesYdqVgN7AGS3yaXbt3Yrv yPEqSlw0npG1q2FWVvsGGMwZSXTlxlZFujU0mXtUNQvpRUVNUsq1+Zm7dG5sZTcY6qdE YemQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632262; x=1719237062; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1Tk27b9u+l0CzDHHIWu0wOizrcdk6I7Pf7l1UE2LHs0=; b=MhNlRpJRV74hxcY63r3DfhFmO8tDqhBph3forcIn51FkKQ7AdHzeTvxF1P6ojoMToj 8QsBTLJ387emFckCEskPFnMfsJqYfK2HWggoua4MvFni6NCArzOdHwmfDYsY6uFSwhbU zzwGBmPuUVTM0+oARuwJTjhqNprpeBbL0ffnYgiue/RGOdQIC1li0lYQI41dK0rV/X3z gFpia8zRgB9k9hhJ0Y6GfGUiNKKRL5tmuZdE4PwDVorr9OWITRuaKtsTefr1EC3n7FHc 6WxIWlTnLrYZfmnGmEU4lcXfhmpizeK9gJw0t1ZpgdgW6oavqCoPqxPxwRfdmVdsz1OB pPjg== X-Forwarded-Encrypted: i=1; AJvYcCXWXfRgNm5z2WvOBK7rOI2T036hN84B39zrMZBrVERr7FErNFCRDMwxTy+y0rFS95BRacPwRed19z/A20fW3tl0MtOA X-Gm-Message-State: AOJu0YxrHMIgXcWXhRA2E1f66xDA6EHrwTkUW4UrpWt9Gu/8hj5xorcP gB3NJxiuZi2MSGCWyINGBLE98EoDPFtNF2Jg0iQN673v3wjQswTkLp4QdxL7JDQ= X-Google-Smtp-Source: AGHT+IFPuCaLYR0OC2CKxxs6bVWzV0l0Y4GqKpcVsLYm2jLp2HnQirR7TaXtLxRY2U4vfGwAEVGQmA== X-Received: by 2002:a05:6870:89a4:b0:254:7471:56b7 with SMTP id 586e51a60fabf-25842853b1bmr11345694fac.11.1718632262042; Mon, 17 Jun 2024 06:51:02 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.51.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:51:01 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:16 -0400 Subject: [PATCH v3 36/41] iio: proximity: sx9324: make use of regmap_set_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-36-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/proximity/sx9324.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/proximity/sx9324.c b/drivers/iio/proximity/sx9324.c index aa0d14a49d5e..629f83c37d59 100644 --- a/drivers/iio/proximity/sx9324.c +++ b/drivers/iio/proximity/sx9324.c @@ -835,9 +835,8 @@ static int sx9324_init_compensation(struct iio_dev *indio_dev) int ret; /* run the compensation phase on all channels */ - ret = regmap_update_bits(data->regmap, SX9324_REG_STAT2, - SX9324_REG_STAT2_COMPSTAT_MASK, - SX9324_REG_STAT2_COMPSTAT_MASK); + ret = regmap_set_bits(data->regmap, SX9324_REG_STAT2, + SX9324_REG_STAT2_COMPSTAT_MASK); if (ret) return ret; From patchwork Mon Jun 17 13:50:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700765 Received: from mail-oa1-f46.google.com (mail-oa1-f46.google.com [209.85.160.46]) (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 127951D0526 for ; Mon, 17 Jun 2024 13:51:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632268; cv=none; b=Bsw9yIg3/7HuoK9rsYUX7dIY5XzHtgfdUDcT3O2pvJBnTON37csbRW7dKWEwV5jDGlUDONrnmW6tlosKCOAxJPRSYxW21hw1UQdVF3zDWYM+Sq4bPbJyJp82mhUzhviYROPwM4IYcson8jFpRKKRlQbxO3lwpHJ+hMAvDY56Zxg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632268; c=relaxed/simple; bh=z9RyjZU19LnLgrucgjYl1CZ1GaGyJEE70HiZ5+JD4QI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=W0m9RsH5vf+AGXcj+u8ZI648JDHKvdXY3oa9H46smYmKFhEKYtCjebr+ij1zhk38aLCkkaU4WAs6swkENZ+XvciMy14xHTagB5NCxq/RE3y/b67EQBh4WBH2/iC8TY+2PrAhMM6czpHI6hij6B05d+OrAeL/SFIYpQAonvP8ASU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=IZWv3DmC; arc=none smtp.client-ip=209.85.160.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="IZWv3DmC" Received: by mail-oa1-f46.google.com with SMTP id 586e51a60fabf-254aec5a084so2101324fac.3 for ; Mon, 17 Jun 2024 06:51:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632264; x=1719237064; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=MWd9RIrs8wL0I/TcIsG/QAgGB9T5+fxOkhv6E/dAdZI=; b=IZWv3DmCgF9OnDcMzHPRv2z3sXrJFbY77BVKsOVV1+6wm9F/7Dqt9G6sS1DbRzodfG 5G66p7ZwMFvsyo+rZQbHp5mvEnjnH9SL0w+n6cThYEBFJdZ2uISP8R1SDremYQjcxTUp 8Yuj1jowcGVtuwQssXTnLLJ1BEgEurNJT/2jaVz7kKOqc/ICWtxbXfF96ZA4ZmgyHBWg 4GugOnrzkIH+nPntxntCj1edYvCX0f6azQvOoFQUEzGcJmrIZmyUIF2mq7GAQpDVKocN vZTUgOog3n6qQV5xXXbISuIKa5snAqLqvMsITwTCUYyLGaX4VYduZ/mL+SpYYkNMlOuV 4tBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632264; x=1719237064; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MWd9RIrs8wL0I/TcIsG/QAgGB9T5+fxOkhv6E/dAdZI=; b=PBHdD4e12u0w1HxpS9NdRPjojUqWqL+kEwP4vLPltkLiGWA8/3JP3lkDr3+UxnXsen Uo928mIxkDNoEWrWW7RRXEaYaO7YkSjsaPdtiaSgaHAzW+hrAdUyjxtBHpTtC7xGeN/6 tG3S1kKo/MOc9WgKT/u/Upsmpq8vd0xc0Fwl7H1zyTOYCViqYta3niMWLIV23EEZfB+/ S+ht5h31WR3ruCcR1OJRRkcVp9gwizp9VxqGCX2yfVYC3BCnV6hOA5grqTNRDboAFWFa kwl/qqhl/GclLcFkcc/6iBR3dfaIeZyX+vViIRLf4/mmG8AK0D3BLq8oClBkUvHY45vO O/ig== X-Forwarded-Encrypted: i=1; AJvYcCWTBO06Vv83/x/WdW4UM6P36qC0194fYQTRGcy62Nro1CdcNEfA6KLg/+gG0/xkAy2KhUhshBYKw0MB1m7VdLRzpQO9 X-Gm-Message-State: AOJu0YzTxaDZ+E85xz22dQhKwz581dCFWwxi639ZM+1WJS/4818sfceG emx2UQvq+rbe6ifFR05B841W/AsilQxOUeypiZrIeuBh/hYYp4YyklhD5JgurRs= X-Google-Smtp-Source: AGHT+IH8uTWV+X4VQg+Hvv7+Ss0V04PvnK1VdmrqhUaV/+VFOL4UdwUlA2xHiJMwUxJKiw4xuPCudA== X-Received: by 2002:a05:6870:15d5:b0:254:8bb9:d0bf with SMTP id 586e51a60fabf-2584298505cmr11157462fac.32.1718632264185; Mon, 17 Jun 2024 06:51:04 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.51.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:51:03 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:17 -0400 Subject: [PATCH v3 37/41] iio: proximity: sx9360: make use of regmap_set_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-37-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/proximity/sx9360.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/proximity/sx9360.c b/drivers/iio/proximity/sx9360.c index 75a1c29f14eb..2b90bf45a201 100644 --- a/drivers/iio/proximity/sx9360.c +++ b/drivers/iio/proximity/sx9360.c @@ -672,9 +672,8 @@ static int sx9360_init_compensation(struct iio_dev *indio_dev) int ret; /* run the compensation phase on all channels */ - ret = regmap_update_bits(data->regmap, SX9360_REG_STAT, - SX9360_REG_STAT_COMPSTAT_MASK, - SX9360_REG_STAT_COMPSTAT_MASK); + ret = regmap_set_bits(data->regmap, SX9360_REG_STAT, + SX9360_REG_STAT_COMPSTAT_MASK); if (ret) return ret; From patchwork Mon Jun 17 13:50:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700766 Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) (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 5B6EA1D0F49 for ; Mon, 17 Jun 2024 13:51:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632269; cv=none; b=MQVa8U8ODurcBrbGvDaH3/y48pNHwDs97JQRweyrejeGJ5UYZQV6glhpQ/X384vB8xItLZcLJw3dh/1CRebUICGte114Km7DND6Qi6fC7oUEzInXLtRTO4HtATEu4ZMin6U+cHOOb+Iv9BFO3HPcly+SeCU6AFTQy/aVNKk5oCs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632269; c=relaxed/simple; bh=Sz6h2pKfKvBPze6AioYNagC/2euAAaKQFjYWGhnXEKM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QsLpJfe/whHqN6fG5AB3LCb7X2sLjoSUp3IbIUIk8WSRrEvFe81EpBeO36DBvQ6dFBnsCUQFEsy55VjKJ/OQlgNSQ7E9cGT+QovmUIsBdlFIcblROgszN2O19FrT5CEIbuAcjLCuTL/w5HAwi5YHIOn0Xci31QfSL3VVg1YOsAo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=KQAd0JGn; arc=none smtp.client-ip=209.85.222.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="KQAd0JGn" Received: by mail-qk1-f174.google.com with SMTP id af79cd13be357-7954f8b818fso290940285a.1 for ; Mon, 17 Jun 2024 06:51:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632266; x=1719237066; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=79Hx9GfOVVYusy8xA5eoh/JX07K+FfT35u2XbTC3DMc=; b=KQAd0JGnJwy3pflNn4XR4GMSVq/0CHuRFznBqw72SMPmmShD+0t4z0G51XSFcQQyms 2jbC89tMQ2d7A8WlX07KoQqWWHueZSY2s3+vAfeF2z2ZAC7j/jpqAlLaZrTx3vMO5Ldo BC0pgYmcDfqHtbImtCft3zEshI4ZzPjJ5ZMbMx2MYchiPiAS7zDkhDvyZpoYaE58QmXm ajc9vRzEf3H+cAkfBfXi/dEjiIwR6zgyX8yVm3GcfX0ASvH2YAo9BRnsR9uFYOWPNOYl pvoanB1M1EwwX0/ncuzPAWRkHlM1FqBSSYOXLvvZIM50FcrqIBY/79QDDmU04MBFCpZ8 8S0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632266; x=1719237066; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=79Hx9GfOVVYusy8xA5eoh/JX07K+FfT35u2XbTC3DMc=; b=orczv2IxFbO9+am1EmzxesGfir45PcurZj2m3uyi0Ss8ps7EKhXf145m+1dEQGXJMP glAI+6s2uAOEVqp7vOdC4u6B0Q+2POI/ArBuNu7ZiVVYWs67FZaP6xnUx0DzmgltUADa 0X4QlC5TUejtoDMAue8sf7lru9Kwfmp1M+g9O5isP/4zFe28d3msu43ZZNN/ryqsd3gZ /TqoinZFzOHwUVe16knWwxYPUuDnvXZQLrnJeM9qYS5y8qQAQ0MdlwnqypJJs+LI45jh DtIJ8c27m31872o+91StVmFWtJt1S54cKcdG6GgbTxxnVZf08Wrm6pGz1I9Hu83/fYiD aAmw== X-Forwarded-Encrypted: i=1; AJvYcCVawH3BLgoOMrTuHv2U5dpthPYkiDOZcFFPCC0FWN1nc/1xkh0TV62IZ05foZVmeKUxIltHOr0vOX7/GHlRf3vEZary X-Gm-Message-State: AOJu0Yw+ub3AC2rlwqS6fMq2CYhceeqtg2+7aF0P54PMT5p4S3Xci8CI yMwBf+gEZ2J24vBqSZA7hR9VxB6lEKvOsR1rbBMxMNqxkreDZ9ySRZ71ktUDi5o= X-Google-Smtp-Source: AGHT+IEx2KbRAk7Gdof/baHhrw8Y3qRBi2Hyio6LTg74NUhbwR1HRET1Zcy3yDqPrTQiSKqEfswRkA== X-Received: by 2002:a05:620a:1a86:b0:795:5d6f:8bbd with SMTP id af79cd13be357-798d26a4644mr1303274985a.73.1718632266285; Mon, 17 Jun 2024 06:51:06 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.51.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:51:06 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:18 -0400 Subject: [PATCH v3 38/41] iio: proximity: sx9500: make use of regmap_clear_bits(), regmap_set_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-38-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/proximity/sx9500.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/iio/proximity/sx9500.c b/drivers/iio/proximity/sx9500.c index 550e7d3cd5ee..49f4ccd8a5c4 100644 --- a/drivers/iio/proximity/sx9500.c +++ b/drivers/iio/proximity/sx9500.c @@ -209,7 +209,7 @@ static int sx9500_inc_users(struct sx9500_data *data, int *counter, /* Bit is already active, nothing to do. */ return 0; - return regmap_update_bits(data->regmap, reg, bitmask, bitmask); + return regmap_set_bits(data->regmap, reg, bitmask); } static int sx9500_dec_users(struct sx9500_data *data, int *counter, @@ -220,7 +220,7 @@ static int sx9500_dec_users(struct sx9500_data *data, int *counter, /* There are more users, do not deactivate. */ return 0; - return regmap_update_bits(data->regmap, reg, bitmask, 0); + return regmap_clear_bits(data->regmap, reg, bitmask); } static int sx9500_inc_chan_users(struct sx9500_data *data, int chan) @@ -795,8 +795,8 @@ static int sx9500_init_compensation(struct iio_dev *indio_dev) int i, ret; unsigned int val; - ret = regmap_update_bits(data->regmap, SX9500_REG_PROX_CTRL0, - SX9500_CHAN_MASK, SX9500_CHAN_MASK); + ret = regmap_set_bits(data->regmap, SX9500_REG_PROX_CTRL0, + SX9500_CHAN_MASK); if (ret < 0) return ret; @@ -815,8 +815,8 @@ static int sx9500_init_compensation(struct iio_dev *indio_dev) } out: - regmap_update_bits(data->regmap, SX9500_REG_PROX_CTRL0, - SX9500_CHAN_MASK, 0); + regmap_clear_bits(data->regmap, SX9500_REG_PROX_CTRL0, + SX9500_CHAN_MASK); return ret; } From patchwork Mon Jun 17 13:50:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700767 Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) (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 5F8711D0F7C for ; Mon, 17 Jun 2024 13:51:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632270; cv=none; b=sxgoi6k4djDsj0c9WAXP/7saYIWXCLzyWPvz90ARqgpvbvQuaaemzDd7vRqjlnUB/r6fT9siZNoH8akjQH3cjtAjhOLHZ1AtP5aeot4Ua0PI46H99tosqqek7e+HqQlIeyEQ0qgAk3LOxcaBlpqATOdgVAmIP7EUN6YCWg/XBt8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632270; c=relaxed/simple; bh=lrT4UVJxbYPigfpUfvDqNd6ndl1eVcIzUfVJ/1QCCbs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Gexd6DaQRSmu6B0nW0TMi1C+InTI4G0Ylhd2sB0np1XYsZKILuKPfBaKA7IfoxgL2bz/WAF/MUMHPpxl95KdhkeHiBhF7wcjpVpIXipZl/hP1cTaOTJYWQrIoBX0E0mFDx2PtQr7esU7d+dWtyCdZ9mPqljtLRWCRSP4S4YwrKM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=uhrf5dnT; arc=none smtp.client-ip=209.85.160.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="uhrf5dnT" Received: by mail-qt1-f169.google.com with SMTP id d75a77b69052e-4405743ac19so37286281cf.0 for ; Mon, 17 Jun 2024 06:51:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632268; x=1719237068; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Tvabn+RMpG3uovvK1+JaZOuuhTQ0Y5v5qxh3XvN8Rq8=; b=uhrf5dnTx3rixb8Cg7Q6gyozegVsF9weTzhR5HTPOSO8zZJRljUamPoXtsZ/vRoIu9 wfWrzXHwr8oOKCH3hIFF/lT+JkxLq++sj1/nYr94M636+Vl+U7vy1c4MSBU9SAMHf+7Y e9JBBJMhnZXb3RLLwsWJOemlBKXwonx3IWyrnVSW/ZRi7UrmanfFuhF8wuFMpOHQ/fh6 ZviXu3oAENTyZUn/9QrKDpfoXvoPTKbPqFIeVlrHE6/UthVJF4I//I/r7wIobNzN5u4z hkvO7RRS2J9/YCSJ1cXZtvJDu+BZfKexxnu/V4H26kwNnxeaKn6f0cCBziMJgGQ5TPIt q4Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632268; x=1719237068; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Tvabn+RMpG3uovvK1+JaZOuuhTQ0Y5v5qxh3XvN8Rq8=; b=jlI13QKM0NapINE0j60I1mgiul/FozxXgih3HHwXlad/vlDi73KHbTLJZyYnGFzQfK HTCovl393XiY0rztnFcvhVgzeDV0CXTOf6K+8sBpinHDjZBd5bGH1meeyHXjAWkSi5QB ure3ZJpWNjOb0cJTJ2fnR4757BClJuO3Zb5CPrTvUbKRP9Kx5mz2rmbriqqCvANddziw kceUGJ1JL8k2d+qQTsc+/eDzYpke66FjxF+sYWLGIFtltSSk2DsJutNwf0iJ/o3dc/jw iv5U4J543I7JikyLn9yTAJXob7DWErdYz0uTaQllObwBF/FBuJH7Vj3YOH9IxvPLhj2G SUjg== X-Forwarded-Encrypted: i=1; AJvYcCVB86gc5lZ3BfVFWJ5Mm+b87C0PH8L/DeJ1tpYucoivaofoB0Ci3Jc33kBTNpgM5pkOKQcbbMiB9m8Y0gNx+doe1wt4 X-Gm-Message-State: AOJu0Yx0tfozmjzCcBs1a9C0bF4FZYacUZqUp95KrP4b4cdyQMwLSmXs wwIxtZVHqPpOsjoHQtUuOF4oMV9qqR+EFI2gxqnm7v3Bkd7Wb+Fa5kBx5bVd/2I= X-Google-Smtp-Source: AGHT+IGCNTX7XI85nrdMwm8HgjdhSBF2upAbofRDQ4N0lo0/7MseIEDdacRNTzR/tFRJhwns3PxO2A== X-Received: by 2002:ac8:71d7:0:b0:442:198e:cb9 with SMTP id d75a77b69052e-442198e0e4bmr132788711cf.27.1718632268400; Mon, 17 Jun 2024 06:51:08 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.51.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:51:08 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:19 -0400 Subject: [PATCH v3 39/41] iio: proximity: sx_common: make use of regmap_clear_bits(), regmap_set_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-39-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/proximity/sx_common.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/iio/proximity/sx_common.c b/drivers/iio/proximity/sx_common.c index fe07d1444ac3..a95e9814aaf2 100644 --- a/drivers/iio/proximity/sx_common.c +++ b/drivers/iio/proximity/sx_common.c @@ -111,17 +111,16 @@ static int sx_common_enable_irq(struct sx_common_data *data, unsigned int irq) { if (!data->client->irq) return 0; - return regmap_update_bits(data->regmap, data->chip_info->reg_irq_msk, - irq << data->chip_info->irq_msk_offset, - irq << data->chip_info->irq_msk_offset); + return regmap_set_bits(data->regmap, data->chip_info->reg_irq_msk, + irq << data->chip_info->irq_msk_offset); } static int sx_common_disable_irq(struct sx_common_data *data, unsigned int irq) { if (!data->client->irq) return 0; - return regmap_update_bits(data->regmap, data->chip_info->reg_irq_msk, - irq << data->chip_info->irq_msk_offset, 0); + return regmap_clear_bits(data->regmap, data->chip_info->reg_irq_msk, + irq << data->chip_info->irq_msk_offset); } static int sx_common_update_chan_en(struct sx_common_data *data, From patchwork Mon Jun 17 13:50:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700768 Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (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 8D10E1D18E9 for ; Mon, 17 Jun 2024 13:51:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632273; cv=none; b=sl5/kexv0rC7UpE25S2kNlOuRFWbNqYaQTFztOMCgBpO0KqV0hrsIjvMazuO3ATqROj2KOh6iPK8UBVeRwtOe1gFbLnwVuarYSHGXZmaP0+reHYQtxa8dTG/0TdxDNOONhww60aJcEmXYLUuKaIR286XoS9LgBFz6lXAdZtIlV8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632273; c=relaxed/simple; bh=/iTmUukNGLPGvGh+5363cpZBdKYe1qLwwMB3hsIs3J4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EykoAq29jn79nRJNPUJjpQ3ErHQg2XVyISJS1FicRq5/ctr4e0eKGSa6scswdlUzmb3JnD9mo5UW6X5VEly+HqYd38TGbg28S/NYwC2wzFNpoL0b7SdRyJqGhRqCrgBlphe12iIsG2yQ0sY+elJf/CDmq4V9/RT1hxjuZhyYdxg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=w9yfTBbb; arc=none smtp.client-ip=209.85.222.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="w9yfTBbb" Received: by mail-qk1-f180.google.com with SMTP id af79cd13be357-795ca45c54cso246640985a.0 for ; Mon, 17 Jun 2024 06:51:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632270; x=1719237070; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=DYef8rADT2ijxxEcxYPLN7/oRY6yNh5EaRUGzmb2a/I=; b=w9yfTBbbTmJgJ1ByDRTwqtbsDBIMo1PrNCnBYGtpe3NOJQlNen1vS5CsUr9IOxsadW 8S/GSa7vIz9zzi1LofG/Wpv121iqGSNG/8gfSDzxIrELsZrWd047X5b0HrS/pKtAAv1N sT5bpRJaJ0cJEAlsm0XVVdNqHOJpCkCtjanse3t8qDEDS0w1rpAVWLpKw8p8fpyIIZF2 l4ZfMgn/cBSRnS4qr5Tnewc5XrvRz7ZuYJ5cpxlBpEtgdlxuWqu1kBnWr0l38rRDQxpg ommfHQBl62FqbtAqQjfGk+YQhME8pkFYrnxJUqvQkQDJ4HP1Af3ftc1clgF4YFbF1Ldh qCzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632270; x=1719237070; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DYef8rADT2ijxxEcxYPLN7/oRY6yNh5EaRUGzmb2a/I=; b=vAgeD7jk7A91ZUZ/k73PBHqUBGPq84bAxjZZsBEsaYhMtlVR4ZkW5LBFFuN1wdh/aR CWWXUsOY7XAU/aH2uhKowFocz7qA84jmuW3C785qrQLCdkCEZwfi5xKbwOT8ZVmCgVBp AuuNUz/uchYAW9qU7ekIsq0NCOXlTv59G6Lx0b1x0en0Sry6xlnN0evZyyN2uRWzaGNd u+X1p9TVUYhOHk8j6w5VOMpt1OGx2vtyNj2MOOY6eYeVfXMteqHsbJ6mIZfXS6Yy2/tp 5Z4pZ670gKLSWnSkvp6LVtJFpuFlTl9o7ZvRoJAYonno7NnCDrfX2u0LTU1d85E6NqK6 XXCQ== X-Forwarded-Encrypted: i=1; AJvYcCWSEJNl8S3mgflU/Ocjn0YVpw953LKtDU8cVNPT/yfVvC1Cz650HLOzT9cDajdjQckA6KGP8FyR39TvfYx/9yVBjxrr X-Gm-Message-State: AOJu0YybC36S2btS0NC2Uz7KIs7ncZN0Xa5Ezb7udxRLTRIj7YlIuB7g /hcnWrxg9AEUYPRA+ropDg7OO6LnaM4cKF8Je0tlXb/RWmJt4SHFLszPMoqCccA= X-Google-Smtp-Source: AGHT+IG+NTpXbmfTtgLV5kgHRYZJqicJgvBNrkkmD2PI5YKClqNlpZ4QFEOEqllRaBP9Jcn3G+Ldqw== X-Received: by 2002:a05:620a:24d5:b0:795:50ef:4030 with SMTP id af79cd13be357-798d242f345mr1050763085a.41.1718632270523; Mon, 17 Jun 2024 06:51:10 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.51.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:51:10 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:20 -0400 Subject: [PATCH v3 40/41] iio: temperature: mlx90632: make use of regmap_clear_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-40-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Acked-by: Crt Mori Signed-off-by: Trevor Gamblin --- drivers/iio/temperature/mlx90632.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/temperature/mlx90632.c b/drivers/iio/temperature/mlx90632.c index 8a57be108620..e7de30f613d2 100644 --- a/drivers/iio/temperature/mlx90632.c +++ b/drivers/iio/temperature/mlx90632.c @@ -334,8 +334,8 @@ static int mlx90632_perform_measurement(struct mlx90632_data *data) unsigned int reg_status; int ret; - ret = regmap_update_bits(data->regmap, MLX90632_REG_STATUS, - MLX90632_STAT_DATA_RDY, 0); + ret = regmap_clear_bits(data->regmap, MLX90632_REG_STATUS, + MLX90632_STAT_DATA_RDY); if (ret < 0) return ret; From patchwork Mon Jun 17 13:50:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700769 Received: from mail-vk1-f173.google.com (mail-vk1-f173.google.com [209.85.221.173]) (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 E4305200119 for ; Mon, 17 Jun 2024 13:51:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632275; cv=none; b=LBk1UInn64hzemIx+Boe7Hh1yA7RDnONiUY79MwrqGmS1gjt3PgdOz02G2tu4dSckFKOIyTvGL/lJ7CktBxDTdJ3ZFDqK7+u4YZA37v0Xi/x93RJ2gFUq/1DggDL4ZJl9UhWP11xocrcO2s+ByHKzwejf+wbTlRh4m1kevNuPzE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632275; c=relaxed/simple; bh=IMPpMteq51LRPDW2gSf+ThyrqorBSKEQdFy+CzbJC88=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=drtyUZwuJfpNb0UZ9TzNp/d49cO+BdCk0/4GCduKk5ACLNLupZvnVF4m0p0vREkaK4fUNEeywY3KJOMJBGDXyrGwVJ8tmtcII6B35imoTK26VIu02aFLYw7YnZn/9w/jK0C7B4XmgxXVIlhrnaIipUJrH9P44hojw0Ies+AQVq4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=OoB5pxHu; arc=none smtp.client-ip=209.85.221.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="OoB5pxHu" Received: by mail-vk1-f173.google.com with SMTP id 71dfb90a1353d-4ee5662fde8so942854e0c.0 for ; Mon, 17 Jun 2024 06:51:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632273; x=1719237073; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=AKnuVsDBtdHGm81QL99oZtdVbIW3JEVTOu6hlNZPjXg=; b=OoB5pxHuiJlRu9IGE2segV51T9fDhJYh6HhZSt0hgLJPpG7dLvmsV0Ct+TqCE2VDNj AavTCAxs7dUo0fNQzHFoe8BWQFtaguJ2d7qXFmp/t53xskhyQue2F2qGHfy5t5GPMNkg rC/wNidE7whwPhqQbA6Hu119i9cqrZpwvfxWnsgvizaoIy/C5hPB3fVSNwoRg9qjZGzu nod2Od4IjxP8RTRRMRYsbRB9CPV8cRGxlIw506rZhhbDIe6gNQIYKAQZH1udROo5BaQY FkyBeE319rAxJ+bINcGini9/rM6MZ3/n2N7gx9ztiv4kKFN7532oHuj/lIVVdlSejib7 i1pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632273; x=1719237073; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AKnuVsDBtdHGm81QL99oZtdVbIW3JEVTOu6hlNZPjXg=; b=gzyol47KwIW2g7AeWRU+AV9lSZQiJlZx/l90TtOizcFYc8w5bLzs7Y/c5sd7Zfsep1 E+HMlMo9hTGWntFOwIRG9DxATBouzvwefQNMQrfqR4e/kWrkbsXHFxVC+YqgL3qfz8jD pHB88aODvxYf6q3YU78G12k2nfnokdS0931cWW0V97Zf6OJjVySDlnfry5iDCOL4nq7L fX3NmmjLGYQ0pwiFRcBffmrLh+jzdlcqJJMTEWZYWkKcV3XUf/okru6A71Ml7FYXMDYp eQ69B7GGDqZOlcoBTi4iYyL710ek3iwKD+FgPj6ekA3/a3TtCzHadpzScHPKvH+rroQh ISmw== X-Forwarded-Encrypted: i=1; AJvYcCUy7neAX8yRCzuCW6pmsmisoxRJtr5FtEx5ZTfMRb0U5Kk6HWz6twblz/HnRJdHw3AEAUdKUEPBPbrWUBgym8A4ABJJ X-Gm-Message-State: AOJu0YyTRgnCxZafK0tJaJ6OHiCSkgcu8lxQsYs3PMS/n32/qp2qZ7ur 9rRxE+zNbVuZdPjXQWcJ8UxfpHbQxtCnQEvG26s9kdInfBSxGjSuy33bLzPFbVE= X-Google-Smtp-Source: AGHT+IHFy1tuFMwxa7P6sFsjYvAHUS1dIKxzAj2HLRYOAmnW2Gug4qjgVMG/WpGom5Qua5PdHz8vPQ== X-Received: by 2002:a05:6122:915:b0:4ec:efca:d2b with SMTP id 71dfb90a1353d-4ee3e59c40amr7925275e0c.8.1718632272678; Mon, 17 Jun 2024 06:51:12 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.51.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:51:12 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:21 -0400 Subject: [PATCH v3 41/41] iio: trigger: stm32-timer-trigger: make use of regmap_clear_bits(), regmap_set_bits() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240617-review-v3-41-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/trigger/stm32-timer-trigger.c | 34 +++++++++++++++---------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/drivers/iio/trigger/stm32-timer-trigger.c b/drivers/iio/trigger/stm32-timer-trigger.c index d76444030a28..0684329956d9 100644 --- a/drivers/iio/trigger/stm32-timer-trigger.c +++ b/drivers/iio/trigger/stm32-timer-trigger.c @@ -158,7 +158,7 @@ static int stm32_timer_start(struct stm32_timer_trigger *priv, regmap_write(priv->regmap, TIM_PSC, prescaler); regmap_write(priv->regmap, TIM_ARR, prd - 1); - regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_ARPE, TIM_CR1_ARPE); + regmap_set_bits(priv->regmap, TIM_CR1, TIM_CR1_ARPE); /* Force master mode to update mode */ if (stm32_timer_is_trgo2_name(trig->name)) @@ -169,10 +169,10 @@ static int stm32_timer_start(struct stm32_timer_trigger *priv, 0x2 << TIM_CR2_MMS_SHIFT); /* Make sure that registers are updated */ - regmap_update_bits(priv->regmap, TIM_EGR, TIM_EGR_UG, TIM_EGR_UG); + regmap_set_bits(priv->regmap, TIM_EGR, TIM_EGR_UG); /* Enable controller */ - regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN, TIM_CR1_CEN); + regmap_set_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN); mutex_unlock(&priv->lock); return 0; @@ -189,19 +189,19 @@ static void stm32_timer_stop(struct stm32_timer_trigger *priv, mutex_lock(&priv->lock); /* Stop timer */ - regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_ARPE, 0); - regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN, 0); + regmap_clear_bits(priv->regmap, TIM_CR1, TIM_CR1_ARPE); + regmap_clear_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN); regmap_write(priv->regmap, TIM_PSC, 0); regmap_write(priv->regmap, TIM_ARR, 0); /* Force disable master mode */ if (stm32_timer_is_trgo2_name(trig->name)) - regmap_update_bits(priv->regmap, TIM_CR2, TIM_CR2_MMS2, 0); + regmap_clear_bits(priv->regmap, TIM_CR2, TIM_CR2_MMS2); else - regmap_update_bits(priv->regmap, TIM_CR2, TIM_CR2_MMS, 0); + regmap_clear_bits(priv->regmap, TIM_CR2, TIM_CR2_MMS); /* Make sure that registers are updated */ - regmap_update_bits(priv->regmap, TIM_EGR, TIM_EGR_UG, TIM_EGR_UG); + regmap_set_bits(priv->regmap, TIM_EGR, TIM_EGR_UG); if (priv->enabled) { priv->enabled = false; @@ -498,11 +498,9 @@ static int stm32_counter_write_raw(struct iio_dev *indio_dev, priv->enabled = true; clk_enable(priv->clk); } - regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN, - TIM_CR1_CEN); + regmap_set_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN); } else { - regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN, - 0); + regmap_clear_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN); if (priv->enabled) { priv->enabled = false; clk_disable(priv->clk); @@ -555,7 +553,7 @@ static int stm32_set_trigger_mode(struct iio_dev *indio_dev, { struct stm32_timer_trigger *priv = iio_priv(indio_dev); - regmap_update_bits(priv->regmap, TIM_SMCR, TIM_SMCR_SMS, TIM_SMCR_SMS); + regmap_set_bits(priv->regmap, TIM_SMCR, TIM_SMCR_SMS); return 0; } @@ -683,7 +681,7 @@ static ssize_t stm32_count_set_preset(struct iio_dev *indio_dev, return ret; /* TIMx_ARR register shouldn't be buffered (ARPE=0) */ - regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_ARPE, 0); + regmap_clear_bits(priv->regmap, TIM_CR1, TIM_CR1_ARPE); regmap_write(priv->regmap, TIM_ARR, preset); return len; @@ -757,9 +755,9 @@ static void stm32_timer_detect_trgo2(struct stm32_timer_trigger *priv) * Master mode selection 2 bits can only be written and read back when * timer supports it. */ - regmap_update_bits(priv->regmap, TIM_CR2, TIM_CR2_MMS2, TIM_CR2_MMS2); + regmap_set_bits(priv->regmap, TIM_CR2, TIM_CR2_MMS2); regmap_read(priv->regmap, TIM_CR2, &val); - regmap_update_bits(priv->regmap, TIM_CR2, TIM_CR2_MMS2, 0); + regmap_clear_bits(priv->regmap, TIM_CR2, TIM_CR2_MMS2); priv->has_trgo2 = !!val; } @@ -820,7 +818,7 @@ static void stm32_timer_trigger_remove(struct platform_device *pdev) /* Check if nobody else use the timer, then disable it */ regmap_read(priv->regmap, TIM_CCER, &val); if (!(val & TIM_CCER_CCXE)) - regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN, 0); + regmap_clear_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN); if (priv->enabled) clk_disable(priv->clk); @@ -841,7 +839,7 @@ static int stm32_timer_trigger_suspend(struct device *dev) regmap_read(priv->regmap, TIM_SMCR, &priv->bak.smcr); /* Disable the timer */ - regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN, 0); + regmap_clear_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN); clk_disable(priv->clk); }