Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp934160pxb; Wed, 6 Apr 2022 04:44:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTrfsx0+R0KswI2nm9zpcx2r0lw8VbTeQtea57NsxNTnUpqHoaHVUOvpFSSlRX8itGG8Rm X-Received: by 2002:a65:6e9a:0:b0:382:1804:35c8 with SMTP id bm26-20020a656e9a000000b00382180435c8mr6857083pgb.584.1649245442778; Wed, 06 Apr 2022 04:44:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649245442; cv=none; d=google.com; s=arc-20160816; b=fOFfUDGQN421ufP2qLIqs3ozXgkmnhyMwu8AKU32+ZQ5+4idxLbJoV0ihucUeKdhx+ 3etjRgwkCzIlYli6IB394wAzhdNMjq+ZArlvIaM9iQpo0RZ4C41+M5f6Z9WYEPKYzszn OQTD9m8/9CN0zl0vU6Jw39oleUAi+0jSG6uS8DL2I3cXrwwoPdEOFujq+WjtrRaneeOv +Rhs9IBqYREJtcCk3SLbeeeIWJTFl7FUhyQtbDPkYaYbt1ksRFJYHkhlZDoFGbZpPq8V z+ICClA46T6Wi12ONebjeM2aBiOkKOk40BM7M0+TIsskJCu1/kVI6Q3F+jXKBVPqTpoM b4OQ== 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=eEYhVhquCzjbHx6hkS7NU2Om8H27Y0F0tQ4IXOKiAck=; b=Vz8JLtpI1wBtdBs2k4kn9FaObUDKi8rbssZhx6kMhrq4ab34sw85Stx/7qwqNS+FMB PgWX1TxWbBFqxWaG7izcz9UmS3JHkOnNbr3nqze2xnJg6uxGizDDaeAhZuNXXYPDmJ6E hmgX60I6O26o/rVCGUizYtyXv2IAQ1PABFV+aYvYESAPaTtSQH0L4iarmObZHo8Hq47r zNSdDijQ1m5KH+c/MGHCP/ApoXTGcDHqR0zggoVFgjWb6e38Tjxs3XOdBWAtc7panjRE /uRLL/0hQk47R7YLxGB44IBzkDzXVbkY0Pzlxi/brFr5N9orWcdB6So7cVRNRcfUqCwU RNIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Ahvqw/D8"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id v12-20020a17090a4ecc00b001c638bda95bsi5582544pjl.6.2022.04.06.04.44.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 04:44:02 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Ahvqw/D8"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 408D761E406; Wed, 6 Apr 2022 03:01:06 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1846694AbiDFCIN (ORCPT + 99 others); Tue, 5 Apr 2022 22:08:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349425AbiDEJtu (ORCPT ); Tue, 5 Apr 2022 05:49:50 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58AD822BFD; Tue, 5 Apr 2022 02:45:34 -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 ams.source.kernel.org (Postfix) with ESMTPS id 068D8B818F3; Tue, 5 Apr 2022 09:45:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F8FCC385A1; Tue, 5 Apr 2022 09:45:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151931; bh=MMP6k/LNUR1jVifTaiPGoAePLM2M7XdwQlkDS3TOkuU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ahvqw/D85LTq4YZpIhKbGjbec1BZfBKVRTXX/zOnXq72fH9BPihDCn7qdJOPaqQlF ofBROGXliKuFT0KaKnEC1CAOD1H3eVX8SYQhKcza7GU1WlY4bsGlJCBPEhu8TTVNP2 VeQllPDy5Cbpr3x2DrsmuSGWQHIsEGR3XHPDSQ+Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jonathan Cameron , Marcelo Schmitt , Sasha Levin Subject: [PATCH 5.15 594/913] staging:iio:adc:ad7280a: Fix handing of device address bit reversing. Date: Tue, 5 Apr 2022 09:27:36 +0200 Message-Id: <20220405070357.647708324@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jonathan Cameron [ Upstream commit f281e4ddbbc0b60f061bc18a2834e9363ba85f9f ] The bit reversal was wrong for bits 1 and 3 of the 5 bits. Result is driver failure to probe if you have more than 2 daisy-chained devices. Discovered via QEMU based device emulation. Fixes tag is for when this moved from a macro to a function, but it was broken before that. Signed-off-by: Jonathan Cameron Fixes: 065a7c0b1fec ("Staging: iio: adc: ad7280a.c: Fixed Macro argument reuse") Reviewed-by: Marcelo Schmitt Link: https://lore.kernel.org/r/20220206190328.333093-2-jic23@kernel.org Signed-off-by: Sasha Levin --- drivers/staging/iio/adc/ad7280a.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c index fef0055b8990..20183b2ea127 100644 --- a/drivers/staging/iio/adc/ad7280a.c +++ b/drivers/staging/iio/adc/ad7280a.c @@ -107,9 +107,9 @@ static unsigned int ad7280a_devaddr(unsigned int addr) { return ((addr & 0x1) << 4) | - ((addr & 0x2) << 3) | + ((addr & 0x2) << 2) | (addr & 0x4) | - ((addr & 0x8) >> 3) | + ((addr & 0x8) >> 2) | ((addr & 0x10) >> 4); } -- 2.34.1