From patchwork Mon Jun 14 11:34:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 459838 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp3198513jae; Mon, 14 Jun 2021 04:35:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKKiSVglRDk15VbP80dkK/JByzDgz/zc0S9VSe4/cNm3VuelmS97hQiWLtWdzkmJsUBVoJ X-Received: by 2002:a05:6402:5244:: with SMTP id t4mr10277376edd.254.1623670533226; Mon, 14 Jun 2021 04:35:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623670533; cv=none; d=google.com; s=arc-20160816; b=ue4PEAtKq2TdZeU5E2raHbvFdPT7C5HL5ytrD9ugtSJvj/CuLOB4L79aLKUDu4cQKk Rw7+loENN+TpNc2JZdLUx8bQUWcLLE4YKIgna+kgw8H12R/ooCTfr7xPj6ghC2n4NHsW wndD8/3WcDaxUfNTlLNewSKFkQmQhRlS4iuIHYJamYsixi+BIZ6ShgctE7oH/xn6YKIM M4MjPfhtGoIuO2p4cgqVlHQ019eyhkUhZV3+tH1L0etDXfrr44ijRFfCwZshEDS2Rp/t AogokD3UA4d4VjU9zKfU5adcqqgTVhItE7Yv8g0uzupYTE/rMHBPTMbtNsHFfi7BhOHV 45Lw== 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 :dkim-signature; bh=T5WkXpY4/tfDrgVJg5+X67+6fctdMQE8PXE3DYCt2YU=; b=NhXmcpxXPCjINnBjPCUsyqkvzEesOKg8dmbQ2vqMD0XfEA2OhO+Jn4Rpdc3xBryAUW qUmsq7jE/AIEDKDRgUA8T8324RmyyCixp0OCJBEJ2OAq+7PQCRMHCAqBr04YsdgbGoc5 VeSqvax1YgPGjVB9WBQhlo1yyjnSYzsOv85nsS0QdiMnkkQTRXPBsFiHxlEkLuCMrPFR Y72Lnq84XZzE9stFM0ulotYVvu1V6QgOYiGdQ517khaos1MQ570X/gVt5wkSzulhDYSC wvEMK3xKWGZdiEXx3LkLK+Wv6ahLKM7U2E/ABU2PGDLqjQvGCl3cGsuKNg1/2v3W33cY XjPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LpQNKOz0; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j1si4280808ejj.668.2021.06.14.04.35.33; Mon, 14 Jun 2021 04:35:33 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-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=@kernel.org header.s=k20201202 header.b=LpQNKOz0; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235756AbhFNLhZ (ORCPT + 7 others); Mon, 14 Jun 2021 07:37:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:58730 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233249AbhFNLfX (ORCPT ); Mon, 14 Jun 2021 07:35:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D123B61209; Mon, 14 Jun 2021 11:33:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623670401; bh=DGEJhZj0RNHztUBk54pVFKT/l8A/xuK64FSh/emWbrE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LpQNKOz0rJYJasV7V+HjOCpDjppJddjTx3HiNAKqXNk+qlv+snnBIdLIEI3inI78c 5bPK1Cp+JOvYlCx8dbWJ3KO0xflDEeVcvIpnsSlu1InFCk1uX4xxdc8OIkQIloowRv NfxCHaUmBcqggAakxnUtQLLCbo+mxUEcL3imXiTPCQRvoNSlv/ALLFvkqVXRqaqhy6 MLbTxNmE12+sfbg3TBlGkiYHb+5OdJ67LjQBU8o4cGXLWzXS/Cl34IasKGxXyzxdPp wD3kRBhrKvmHbHbx7Ccw8Gi58MABYHhXM+F9Otg5cb6iFcNfoDA3zopeEf27hX/Oog N561Uo69/Kuhg== From: Jonathan Cameron To: linux-iio@vger.kernel.org, Rob Herring Cc: Michael.Hennerich@analog.com, lars@metafoo.de, devicetree@vger.kernel.org, Nuno Sa , Jonathan Cameron Subject: [PATCH 01/17] staging:iio:adc:ad7280a: Fix handing of device address bit reversing. Date: Mon, 14 Jun 2021 12:34:51 +0100 Message-Id: <20210614113507.897732-2-jic23@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210614113507.897732-1-jic23@kernel.org> References: <20210614113507.897732-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Jonathan Cameron 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") --- drivers/staging/iio/adc/ad7280a.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.32.0 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); }