From patchwork Wed Jan 19 11:45:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tretter X-Patchwork-Id: 12717479 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A02FFC433F5 for ; Wed, 19 Jan 2022 11:46:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=JeZ99xxErOmQV364HLTp0rS7rs6W7bOPwVEVwYcqRNA=; b=wAyTxwiYvFOPwt 1+JcABPIN3KIWfaYegp1z8FgAJLSZ9bTXxfMUhkK3xZbGcZ3nDbSpKSLTWc1axYjwt4lQJTuTMnOE WtM3GkSsT3YGzTlXtRvwHEq1/er2sWQ0v53fZ3i0KrgwLYfHSsGDpshc97sX0gtITN2La2BB9UAiA udhEvLmLDnG2euRzM4EHUEZXOXT+HQWZm+uWXRp5ltZGmsj9A119kUuy40GFYKPzk3R2Y2btvaH+8 kHX+lnM0AfAUpM6DWYbunuX+MvB0BDRyINMhga/8Odtw9Qqv9DIKiaTdw9bI87gWz3nPhZKp5ItXi XKMpzP3mvG7XZ0Zm6juA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nA9P2-005Dqk-0y; Wed, 19 Jan 2022 11:45:24 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nA9Oy-005Dpp-I7 for linux-arm-kernel@lists.infradead.org; Wed, 19 Jan 2022 11:45:21 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nA9Ot-0002Jc-6j; Wed, 19 Jan 2022 12:45:15 +0100 Received: from [2a0a:edc0:0:1101:1d::39] (helo=dude03.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1nA9Os-00BAZK-QA; Wed, 19 Jan 2022 12:45:14 +0100 Received: from mtr by dude03.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1nA9Or-008XZv-0v; Wed, 19 Jan 2022 12:45:13 +0100 From: Michael Tretter To: linux-iio@vger.kernel.org, anand.ashok.dumbre@xilinx.com, jic23@kernel.org Cc: linux-arm-kernel@lists.infradead.org, m.tretter@pengutronix.de, kernel@pengutronix.de Subject: [PATCH] iio: adc: xilinx-ams: Fix num_channels for PS channels Date: Wed, 19 Jan 2022 12:45:13 +0100 Message-Id: <20220119114513.2035609-1-m.tretter@pengutronix.de> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: mtr@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220119_034520_622764_E7AFE6B5 X-CRM114-Status: GOOD ( 13.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The IIO channels of the PS are not provided in the sysfs even if the ams_ps is enabled in the device tree. The reason is that the channels of the PS are not added to the overall number of IIO channels. The line somehow got lost between v11 and v12 of the patch series. Add the number of ams_ps_channels to the number of channels to correctly register all channels. Signed-off-by: Michael Tretter Fixes: d5c70627a794 ("iio: adc: Add Xilinx AMS driver") --- drivers/iio/adc/xilinx-ams.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iio/adc/xilinx-ams.c b/drivers/iio/adc/xilinx-ams.c index 8343c5f74121..ede968efb77f 100644 --- a/drivers/iio/adc/xilinx-ams.c +++ b/drivers/iio/adc/xilinx-ams.c @@ -1224,6 +1224,7 @@ static int ams_init_module(struct iio_dev *indio_dev, /* add PS channels to iio device channels */ memcpy(channels, ams_ps_channels, sizeof(ams_ps_channels)); + num_channels += ARRAY_SIZE(ams_ps_channels); } else if (fwnode_property_match_string(fwnode, "compatible", "xlnx,zynqmp-ams-pl") == 0) { ams->pl_base = fwnode_iomap(fwnode, 0);