Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp358814pxb; Wed, 18 Aug 2021 04:13:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJrPgt+TGvorxxRU58d44+VGejM4nRXAEEJcpxD8xe/JBNAGnP60ulEfh6630g/wiNuhL+ X-Received: by 2002:a17:906:b052:: with SMTP id bj18mr9292031ejb.55.1629285214446; Wed, 18 Aug 2021 04:13:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629285214; cv=none; d=google.com; s=arc-20160816; b=uskmqYmntkORY+BhZVgPO+7Fj2cRFbjiDGkM+txGl449OujjIzNResuxGoP2yvGmbA +OMEX4JV+OesF9g3S+bLY5n3ptgi6HO7DVLoNXHtKIdFnkeLvGtpAF/POUTPM8AOo0Dx KIiwC6PZSdEkSLmqldhy1av+UgKHutnvXnAIeO8JWj6GN2vo0pCvKwwFdVS2OKhULiVj hncNlECv2+FJeXUBXWyN5GIyimSxZwvk4H5+xuFf1aVAUpUBZrEamJWHsNGOheLM2UuZ rzIEwKgVbEIoVSxlOHLyYEp9jSwZL/VXxvVSO2WmeSi/PePkzWGblTOELWvJOM6LatYB 00rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=fRpKN+Dan6xQgD0438SWvg6rxY8SDzU1EOLTC0xedVE=; b=z7BIp7wunqD77on0iXlyhv4FtgQctsThWs66h1RRtnL6NwU5DCd+ISwFb7IrIy2Bnh TCi6y2GK2mKKXUNMQOybkmDK8GFtY9tgAQOqjw+F1BEA9swxi+qP2eVe0KFXKqCy71QD pu6U7BJXgx4qpOFlmqAENTr2b8NBKRNOZVhWLRiHHs+DZ1Yw9swGkYp1ZPuUDnDW9+4G iCE0RmGCZSfo1YMiCFoQNxz5s82iLpWHYCl0R9O+HOvQmvzuKnT7w2Pil9Z7UcNMTI4D riPS2aPBDHmyxdBD5TnLrFrkCu+ZkEK6xcwk2gDHhOCo7lll5Tx3rEuIMgMRv9WQxQgI TdZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j14si5008927edw.120.2021.08.18.04.13.09; Wed, 18 Aug 2021 04:13:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235465AbhHRLMU (ORCPT + 99 others); Wed, 18 Aug 2021 07:12:20 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:45679 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235207AbhHRLMR (ORCPT ); Wed, 18 Aug 2021 07:12:17 -0400 Received: (Authenticated sender: miquel.raynal@bootlin.com) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 6DBF66000A; Wed, 18 Aug 2021 11:11:40 +0000 (UTC) From: Miquel Raynal To: Jonathan Cameron , Lars-Peter Clausen Cc: Thomas Petazzoni , linux-iio@vger.kernel.org, , Miquel Raynal , stable@vger.kernel.org Subject: [PATCH 01/16] iio: adc: max1027: Fix wrong shift with 12-bit devices Date: Wed, 18 Aug 2021 13:11:24 +0200 Message-Id: <20210818111139.330636-2-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210818111139.330636-1-miquel.raynal@bootlin.com> References: <20210818111139.330636-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 10-bit devices must shift the value twice. This is not needed anymore on 12-bit devices. Fixes: ae47d009b508 ("iio: adc: max1027: Introduce 12-bit devices support") Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal --- drivers/iio/adc/max1027.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/max1027.c b/drivers/iio/adc/max1027.c index 655ab02d03d8..4a42d140a4b0 100644 --- a/drivers/iio/adc/max1027.c +++ b/drivers/iio/adc/max1027.c @@ -103,7 +103,7 @@ MODULE_DEVICE_TABLE(of, max1027_adc_dt_ids); .sign = 'u', \ .realbits = depth, \ .storagebits = 16, \ - .shift = 2, \ + .shift = (depth == 10) ? 2 : 0, \ .endianness = IIO_BE, \ }, \ } -- 2.27.0