From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 301D329992D; Mon, 12 May 2025 18:08:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747073335; cv=none; b=X+3gYAZlDnRb27OdiQCFhfUJpJUyPAor98MzumRV58wduO7xL88vKU5Oy9Mt6QvPZtt++AIHtETxrzPhxQAahOxaNntQh1BWOGv9xISD819d+wzoWLCd7gC4xw+0FWkqejO1vnmIN3JFfmiiqmHNbtkNhZeOBBKcj4txi9AtNPo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747073335; c=relaxed/simple; bh=TiWiTs0chhxtlUaL+ooJRi5ZpK3QwIpnuqhYRSkqugM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LvDmhOPvDHcuR/fhwdXB+eThhE951lD+sRa8DE+dfxL0Hoi40ovFv9GZF/1k3EzE5Yvp2yDPkKbTd9U5aPseS6AMpIEFqNGhMC5DnU5bnPWKYbd/e3iD+wrqnxrVDTU2ql7Z/iylqv9WiMQcYnsoIvtKgsJDfRpM28YxY5tHZQI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=FT+6XVlE; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="FT+6XVlE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B070C4CEF6; Mon, 12 May 2025 18:08:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1747073335; bh=TiWiTs0chhxtlUaL+ooJRi5ZpK3QwIpnuqhYRSkqugM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FT+6XVlEInOOcUvPupJ+gyZQiz7NX0ii3coyder3Nyd79VCtcPL+8/598WVCnApMA Rogrrf+Lr279AcsZV9O/N10sSVCguzx9kBQSaaMvUwcEFh7pElKCr+qemy7OcPIK/h Hwz7uPOmh3YKKGzevq+e9WqXW+g6YeP7ezqW0wxs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, David Lechner , Angelo Dureghello , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 6.6 042/113] iio: adc: ad7606: fix serial register access Date: Mon, 12 May 2025 19:45:31 +0200 Message-ID: <20250512172029.381962291@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250512172027.691520737@linuxfoundation.org> References: <20250512172027.691520737@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Angelo Dureghello commit f083f8a21cc785ebe3a33f756a3fa3660611f8db upstream. Fix register read/write routine as per datasheet. When reading multiple consecutive registers, only the first one is read properly. This is due to missing chip select deassert and assert again between first and second 16bit transfer, as shown in the datasheet AD7606C-16, rev 0, figure 110. Fixes: f2a22e1e172f ("iio: adc: ad7606: Add support for software mode for ad7616") Reviewed-by: David Lechner Signed-off-by: Angelo Dureghello Link: https://patch.msgid.link/20250418-wip-bl-ad7606-fix-reg-access-v3-1-d5eeb440c738@baylibre.com Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/adc/ad7606_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/iio/adc/ad7606_spi.c +++ b/drivers/iio/adc/ad7606_spi.c @@ -127,7 +127,7 @@ static int ad7606_spi_reg_read(struct ad { .tx_buf = &st->d16[0], .len = 2, - .cs_change = 0, + .cs_change = 1, }, { .rx_buf = &st->d16[1], .len = 2,