Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3032014pxb; Mon, 18 Oct 2021 06:59:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyRfAP0B+49rWQboF5NdLr355NkXQImZBPK5auYRNoeETMR7p1LRJKCQj0R4n7R+qmrfVC X-Received: by 2002:a05:6a00:8c7:b0:44c:a7f9:d8d1 with SMTP id s7-20020a056a0008c700b0044ca7f9d8d1mr29134822pfu.49.1634565574392; Mon, 18 Oct 2021 06:59:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634565574; cv=none; d=google.com; s=arc-20160816; b=MJzNgLW/RM4KbRwkDX+uM921x0LQwb9ZiWCb32dwutVqbh1x4rNJjSwR5J6mL7tZbG PVBWEJIarm4yR1HmbEF/Pq0krJp3MGl/l2eAlEXpIcLoxB+jJsqJklgOen4yOWlljiT5 VmeChkBQh3VG7akVCKv95LDYB2szr2FUTTk2Gxl1HioWmbGK2EgkaQqq8ddxXHTTR5MZ HL2THN3hkxCMZr6ragsGg/WgnsEiM2Wun8LN9XTskdPMgFy16NmKcF8L8uLyvSZOnHlk QKMNGgeywZqV1ujKxaaesNsJZExOZjGyHjAdRT27upk3g7YuXFT5lpR9mRpkgtahae8M FFiQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hSui4hCGQqmVJfcUi68cit/ueVi/VVFazdSxgIaXMfk=; b=tL9LaY7jDcZX6NEcjfYSdIDRsrf59bKQx+T0KyM0d0ZC/hyBXDLJQKeFK8KWY0VEZF VwdNYfHw1c5wDkxlCYD/96IQtdIGQWJmPuktyJmO7o9iBrm5hqyxgkQUOaHRuQRwRcRC JS7yfp1upSXetQNTbC1JSwy00br5PM9twzJBMw2ATLriwLOvJHiQ/gYXd+AVVaPB/sTE 1bPAX6HRlJT27a/tzQR/0/DWlJcYLhf2eNkjttDr9+fZuyjCobua2y1Lb7Jv5q1y1vlj LuDmuEo1OM/J7kJy1+6HKiaGJ8JlOBgAmtN72dsEbIxBgkUlMweYcUAPdgSY9LyGlyBY gcDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ib0beblP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z6si26445139pjq.23.2021.10.18.06.59.21; Mon, 18 Oct 2021 06:59: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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ib0beblP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234481AbhJROAU (ORCPT + 99 others); Mon, 18 Oct 2021 10:00:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:59130 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234577AbhJRN6R (ORCPT ); Mon, 18 Oct 2021 09:58:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C635561391; Mon, 18 Oct 2021 13:41:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634564484; bh=d4mqd3nmx/pe/KPLfNiqal5aAW2JmfUWtp/RMsjIN7o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ib0beblPaqJZAMJgv9GNoGzk7TXFYTkXBUfjBDupv5RQ43orIA7FqoLN6oNdfppWo Ia8ycQ8snJJc9bm9cNMbkZR4uQMIMQrWnIvWO7p8Av46kSWkRU6OzrKt0Fdkks+AvP kIop2oWkArZxix9RmcrXDrETf4dPd4l7y3qRx1lc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miquel Raynal , =?UTF-8?q?Nuno=20S=C3=A1?= , Jonathan Cameron Subject: [PATCH 5.14 073/151] iio: adc: max1027: Fix wrong shift with 12-bit devices Date: Mon, 18 Oct 2021 15:24:12 +0200 Message-Id: <20211018132343.058624724@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211018132340.682786018@linuxfoundation.org> References: <20211018132340.682786018@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Miquel Raynal commit 732ae19ee8f58ecaf30cbc1bbbda5cbee6a45043 upstream. 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 Reviewed-by: Nuno Sá Link: https://lore.kernel.org/r/20210818111139.330636-2-miquel.raynal@bootlin.com Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/adc/max1027.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/iio/adc/max1027.c +++ b/drivers/iio/adc/max1027.c @@ -103,7 +103,7 @@ MODULE_DEVICE_TABLE(of, max1027_adc_dt_i .sign = 'u', \ .realbits = depth, \ .storagebits = 16, \ - .shift = 2, \ + .shift = (depth == 10) ? 2 : 0, \ .endianness = IIO_BE, \ }, \ }