Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp725332pxb; Tue, 5 Apr 2022 20:29:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgxexvSi4Fq2J2i/t/dniec5zb7uinEFQGROD8KbL9lJWVajOH5EZJkZZ6YJZDfT8x4NEe X-Received: by 2002:a17:90b:1b10:b0:1c7:3413:87e0 with SMTP id nu16-20020a17090b1b1000b001c7341387e0mr7617985pjb.132.1649215778091; Tue, 05 Apr 2022 20:29:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649215778; cv=none; d=google.com; s=arc-20160816; b=LQpwQqq1YEXCCvvKOxcwyac8lLZAdWnY/DqT2bgFw0UVwqCJ2V8FhIG3CoUIqYzizo kAiKESc7CdBXJwLJKAKrfIkYkni0aX1zCKMsgsv29cga6iN2kjPFBFmSFpr+6XtMoyKG 5At2UOr879qHq6T8SPLH5+yQ2pFhyDlcEKkn+KNEWLO1znkejMJiciOqP4XTchrLgzQv QehQchdThU7gT0Rxopqti3FpKLivCzkleuIHdYXDQQJmDOb8fT0XMPRawA3e5jJm3DAe 38FP9qKQa4PF1tRAezyTkUSAiDV4G8bis/eMuRLRp15aRAhadokKYtnkdaflL5mmpqmZ UW8w== 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=kUf6tdqw0MRPPks5tBlykXkF6Gd0i7FkORSBZkm7lx8hYAGVj7IaQH3aTIZP8TLC1l iGb4EwAxH/TTbEt9virke0pW3MJ+LRRybyP/DL/QnT1tPQg0RllTx6NGjFGSH8+orcc4 E+AN8GzzUudR69bBZ2CByOFwcE49bxN6BP81RvCzI3Ej4kcOvs79z8KrntcCvOERXoJ0 T5zG/K05xro3ZMGIcnszuxpyJUhwvl+TCHxSvrO6P1eumIBErnvLGBXzHNrVqx4YNpWN CRuQMnMkYV4hLIm2NcWJfZREnticuVImzP10ALqUsvdQvcuDBk5IMrQz5pn8PIXsvzSC YohQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lR2yM8mo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id u7-20020a170903124700b00153be6474c2si15250393plh.531.2022.04.05.20.29.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 20:29:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lR2yM8mo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8FB2ADAFF8; Tue, 5 Apr 2022 20:01:45 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1386656AbiDEMzC (ORCPT + 99 others); Tue, 5 Apr 2022 08:55:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243706AbiDEJPM (ORCPT ); Tue, 5 Apr 2022 05:15:12 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 651FC939F6; Tue, 5 Apr 2022 02:01:26 -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 0AA47B81A12; Tue, 5 Apr 2022 09:01:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57D7EC385A1; Tue, 5 Apr 2022 09:01:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649149283; bh=MMP6k/LNUR1jVifTaiPGoAePLM2M7XdwQlkDS3TOkuU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lR2yM8molgt48rX8ykBsenQ7pjbqBtrSVDDHQ8soi7+WmXvhPsyI+vg/CWMaEy7dM 5QqfRJdlulIzg8Wi4EUdR+5EDPyhqoMsDUYSBOZb9cDddoZF1kXuQgBypuzLUOxMyK PBNS1z/zVpLnvQ/s+5CykpK92mFhYrkfl4f2EhtQ= 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.16 0659/1017] staging:iio:adc:ad7280a: Fix handing of device address bit reversing. Date: Tue, 5 Apr 2022 09:26:12 +0200 Message-Id: <20220405070413.843905470@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@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