From nobody Mon Sep 8 08:44:57 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B417C6FA82 for ; Tue, 13 Sep 2022 14:51:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233163AbiIMOv1 (ORCPT ); Tue, 13 Sep 2022 10:51:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234478AbiIMOsq (ORCPT ); Tue, 13 Sep 2022 10:48:46 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76A5D67146; Tue, 13 Sep 2022 07:25:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1A995614D8; Tue, 13 Sep 2022 14:25:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 356A0C433C1; Tue, 13 Sep 2022 14:25:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663079116; bh=5hxJ3oqyAEKDmEuRw590wfxEakDfEqdSs78Zl8PPydw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2HBeCMrkMOeSgCijZJ9Ny9jityxT13a3TrcXdB/YFsQT9GxQ2O99iVn8GHHidrxFz MAfOESjyRr4Dqtv4ss5qTnXCmRJ+g/cDxkAZHfTXaGnzJOu6TvY0s6m95Auta7SJBP Vvv3Df0A0Fbt9jiVysNm2rr1dmUKSfB3+y83lDRM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marcus Folkesson , Andy Shevchenko , Jonathan Cameron , Sasha Levin Subject: [PATCH 5.4 010/108] iio: adc: mcp3911: make use of the sign bit Date: Tue, 13 Sep 2022 16:05:41 +0200 Message-Id: <20220913140353.997325472@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220913140353.549108748@linuxfoundation.org> References: <20220913140353.549108748@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Marcus Folkesson [ Upstream commit 8f89e33bf040bbef66386c426198622180233178 ] The device supports negative values as well. Fixes: 3a89b289df5d ("iio: adc: add support for mcp3911") Signed-off-by: Marcus Folkesson Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220722130726.7627-2-marcus.folkesson@gmai= l.com Signed-off-by: Jonathan Cameron Signed-off-by: Sasha Levin --- drivers/iio/adc/mcp3911.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iio/adc/mcp3911.c b/drivers/iio/adc/mcp3911.c index dd52f08ec82e2..624ec5b075e5a 100644 --- a/drivers/iio/adc/mcp3911.c +++ b/drivers/iio/adc/mcp3911.c @@ -111,6 +111,8 @@ static int mcp3911_read_raw(struct iio_dev *indio_dev, if (ret) goto out; =20 + *val =3D sign_extend32(*val, 23); + ret =3D IIO_VAL_INT; break; =20 --=20 2.35.1