From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.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 B70C837A820 for ; Tue, 14 Jul 2026 11:31:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784028705; cv=none; b=nJ/HUtJib+xFhE/6IIEmEruO0FydMIGvce2K/FyU6c032MAGm1dYN4R7FT8n1S8x+HDyNnpx9MjKptkMLQ241YPSs3eJQliupBZEDM5YNgMFKG0F10ZEaP+i+WCwqD8idjcxR5olr0grtjo53A823W1nazXb38IlPQIZrdMa224= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784028705; c=relaxed/simple; bh=PcZYP0s/LLbxYZ1l/StzN0wsFguTXZWmYdbg1dHBg1g=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=acyb3a0JXJCQ4kfXKz05wlsucZrP0l2Vgqj4quSrcMlPPV1UxyoTCrs2Opw4kzVL/RlHeEOavs2771pZI86OecO2d+T/0a8QhFpnlrVEAKGoFxNDm5O7226IBk7WJx2HyM28095/0YSBzN6lZJ8qHnv+AcJjWyIup9Ed8FuwVlU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=j9n4om7T; arc=none smtp.client-ip=209.85.215.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="j9n4om7T" Received: by mail-pg1-f177.google.com with SMTP id 41be03b00d2f7-c99eaa1f020so738921a12.2 for ; Tue, 14 Jul 2026 04:31:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784028703; x=1784633503; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=WmXULsheCa3K8LRrfmjt/jRlfBRLh2F63wTT6/Iom50=; b=j9n4om7TARJln/MsILhP2HOYSN1xv1voQ6RKymcfzyHhl0ku/oSIe75KHlE0Yx5WsF Oo4+PiE39bYlE0sKPNQxwybCNM3oZeUYNu3ID7V4LhGl5TaID5EpcCvgWMX/TgOLfjPr se7zLWZXZw4A/7mnYSbmZXGgyl1mUpObBIu8liF91VZUUWqAI8wSDmkMz5ucdKkwLPu/ SGyo7popsWXyLYB9dWZS4qC/35K2oNoVk8z4fiZDM2TUgkraZe/bnyFd8blVOzjSPDx9 fXf3l4AsjDAE5/pFzSW7B0cwQUuYM7LMFgiGOjrkX9cs7AhYPeokfvpJggxx8cfpt4HO XeRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784028703; x=1784633503; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=WmXULsheCa3K8LRrfmjt/jRlfBRLh2F63wTT6/Iom50=; b=PpyOsQpKO9lBhje+iUFZzkLuKF56ccjVTren0BHmIOVfoPl4y2hFMJOwntr9zJbB7v 7siEOjjG2yfaLpSYoz+GoNrZrupgv6HUyoqXes/dB5VIb/Uf7usRvWwGyNDCaRhvL0UF F+ipUUAM1Bf3eQHeR2H6pGN8ZS/O9sO9RD6bPTGnlu+7jjMb7opRDKJORhGqlQRHAeZK z0RRTa3zNamTJE8z4EerMz5cNyc6lTWISdbm3vy/Z2dEq3xFr00NtN7oDp90kluOrUkT qDkW1Chcu3WKBZOkRb70QJcIL9MAilpMBe/tne+b1L8p+6huS7hkKtWQdbdESQLPuNWt Flrw== X-Forwarded-Encrypted: i=1; AHgh+Rol6+Zy2G/ry3Byie7wnz8oVyjBnkniLCVC5JcnYMgDCmvGMkXN8rVOYCA8NcFw8V1qJnUGzQamS8/lF2Q=@vger.kernel.org X-Gm-Message-State: AOJu0YzwgE8Jvgw38VCy8q+d4a7YcMiMAYWHlQHcsextdVfK9Ob1q6ze zkQ7dklCAthCJNNX5LlQUOiIDIhV6aE5hDg1Awxd+Gx8ll8HN9pEoFQum2DN1Po= X-Gm-Gg: AfdE7clB+OrQirznvjW+bmZlAf8anJF1aTe/qccZGL73TsDAef+iv8yGxnxztg2+VjJ bNw/8qWZ5vCQ3UKhuI541Yw0yUCwnVWYqpgL4gZfKlGxP/kYIAFBx/8d72U9skAa3dhNiBMx44S vg+udYF9nj/BBu8sZMoNLxyGuS7D74Ps99ZDZKkFYBu58t8L2m4okEv85gJI3T8bkkdRid1Ikhr sJCatkJQO2nhnm6abEbNbvZKjIpxh/Gr56wQam+TP/2228aHz3ODZJUnkxzAQowpubttROeMNMD eINloAwrwqcf8qLPEw/9kFnTJHmassofZj+wfPEWtpQnxfTxyR7Jyiil9ZJdxIjTsT0Omv2HFnU Z4RIW8tQ2U8d/c16Ofqugf8AKE062Z884B5pwmE/m7aTNPR85OJKZXdILUEU5v23QcAcR6V/oyQ muCruluxsYxMggJacJ2pyYwa3uO/TRmTwW2k1c9nISNDf6JltB4l92 X-Received: by 2002:a05:6a21:3995:b0:3bf:6c08:2840 with SMTP id adf61e73a8af0-3c11077478fmr14168126637.47.1784028702844; Tue, 14 Jul 2026 04:31:42 -0700 (PDT) Received: from localhost.localdomain ([101.0.63.168]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-311747f72a6sm95357368eec.1.2026.07.14.04.31.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2026 04:31:42 -0700 (PDT) From: Nikhil Gautam To: Jonathan Cameron Cc: David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Stefan Windfeldt-Prytz , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Nikhil Gautam Subject: [PATCH v3 0/4] iio: light: opt4001: Fixes from code review Date: Tue, 14 Jul 2026 17:01:30 +0530 Message-Id: <20260714113134.3445-1-nikhilgtr@gmail.com> X-Mailer: git-send-email 2.39.5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi, This series fixes a number of issues found while reviewing the opt4001 driver. All of them date back to the initial submission of the driver in commit 9a9608418292 ("iio: light: Add support for TI OPT4001 light sensor"). Patch 1 fixes the power down path, which read the device ID register instead of the control register in a read-modify-write, corrupting the CTRL configuration on the way to power down. Patch 2 fixes an incompatible pointer type passed as the remainder argument to div_u64_rem(). No functional impact. Patch 3 makes opt4001_write_raw() reject integration time writes with a non-zero integer (seconds) part, which were previously accepted silently based on the microseconds part alone. Patch 4 fixes reversed GENMASK() arguments in the (currently unused) fault count mask definition and adds the _MASK suffix for consistency. Changes in v3: - Patch 4: replaced tabs by spaces as suggested by Andy Changes in v2: - Add Fixes: tags to all patches - Patch 1: use regmap_clear_bits() directly in the opt4001_chip_off_action and drop opt4001_power_down() (Jonathan) - Patch 2: document that there is no functional impact (Jonathan) - Patch 3: add blank line after the early return (Jonathan) - Patch 4: fix whitespace alignment of the new define Regards, Nikhil Nikhil Gautam (4): iio: light: opt4001: Fix power down clearing bits of the wrong register iio: light: opt4001: Fix incompatible pointer type passed to div_u64_rem() iio: light: opt4001: Reject integration times with a non-zero seconds part iio: light: opt4001: Fix reversed GENMASK() arguments in fault count mask drivers/iio/light/opt4001.c | 37 +++++++++++-------------------------- 1 file changed, 11 insertions(+), 26 deletions(-) -- 2.39.5