From patchwork Mon Nov 4 23:12:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13862206 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2089.outbound.protection.outlook.com [40.107.104.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D2B11AF0B5 for ; Mon, 4 Nov 2024 23:12:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.104.89 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730761945; cv=fail; b=b+ocVNFRJ+FXDPP8y5RWl1owz1OAhu0CBsDWyrJn3xKksq+ng4lIDLFNjO57T4NXxqgskanogT2D3HOJQs1BwVSqiDpVu0q/dB/PjCdP+Q+5zV3xrI4y92mGRwzYxxp2vo+MqHfzc89i5jevT6OLmV0pgjZhSkx6rq0CpQzMBfw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730761945; c=relaxed/simple; bh=9A66vK6rBbTba+6yRSom+iwbF28M21m/zwp92UEkE/s=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=RnvskXREPsociinXIcvkX4oF2z8ACFKsN9M9dlCAGOLCA9h26sIcc/8nMu6OrCG44Rdm6kdXqqFUCt28buFhYibBT7zYynp4Y3sM9sdI49ZXteTmBMkg0mVZZllA+AQWe/HM+ZspkCz/oTNbk0ba1q5b24YBRsE0fn2NEOIaUxQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=eIgNwleS; arc=fail smtp.client-ip=40.107.104.89 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="eIgNwleS" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iiJtHeE3mq/HQPqCXU1RdTSA+5hSEAy2Fv6Vb5162kkHF1bITm+WGH4uuQwm4hnbf9/2SzwN4mZn3st0CFzym7iKALIK6fJltr6OfJMH2/C8F/yOR7pzz/7bnjiOJUPa61Xc9yPKX1Uq0AJmRN8umsJV31Jr4K7Vgb+e5QMpgH+23lsoGZQu/IOi+PWDyktCpOD5yUPDNZoM3oJs1KYnrgDVtXlsHARUnJhVzlY999i5Il93oVCfv+wXYG0Q4KCtOa4gbulDX+YfxCja8GonznJTwi3Te8kRTt3wS3cfYWdPxWrCNEc1G4PdzAsXTitaXdPF749E0AVeldLNUXfE6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kGES0RxWgd/uohnuz37fTKCIsQNEhCIfA2Q62dQ3BrA=; b=zWAax7dNdCETaezxVApTomlBm5Dd9Su4e8JuMIsK2v0CtfugUvcAdJXrSEx37RcFNobI/TUNjlpWGM+Q3yH5746kp4dOuAhyu7VjqCpiWdxfrQOohkFtSubHMUY/A5+p8hjqx6euZREqc7lQYwrdNBGxLODHXJBCl/6/vzgSz6oqLGKsqWKDO2cDhSOsUkwjn6xwBwvxkcddHLTF4xj9S9HWAjArxo7V/oJdE/n0kS6LZ9/X1YJYiKEdB1kxrsZ99RR9hYa8F1qC4eP7qOS2gphVzuCpBLOAZLO/OoSLl2Rhu6lNBoaS/aqdZGg+8STlH+M5nsUDvk86sXum5fHsug== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kGES0RxWgd/uohnuz37fTKCIsQNEhCIfA2Q62dQ3BrA=; b=eIgNwleSh09JtxUaXJMa6ssrbi/P2JMPXg+ZUU6MApJhiA6agrahC2GKVb5nrNUqeiUWFp044OREZIPXeyQ89PiWBu1l8IFaf66KkbnliN2IVX52YKhcA0GqTVqWCRPGVYoml6ETVxsUIQnmfHhY3mBs8EQBmfF7YySleebSWxs5eEEiRrdBa7Vnc7Pbr0VbR0psgyeOqRkShsBwRSPPZgFextHGQai6hyuO4PKSIQhFTNOJd5/7d4g29/oNBHcx5p+Zfrebwp9OKCJE9Hv0oUQ5dxOJBx8eh8n8XMHqzjTaLyL/A9Z6o4U6oNLPFwslaF6U2Rf7Z2TIeFPsc1qqeQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by VE1PR04MB7357.eurprd04.prod.outlook.com (2603:10a6:800:1ae::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.30; Mon, 4 Nov 2024 23:12:17 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.8114.028; Mon, 4 Nov 2024 23:12:17 +0000 From: Frank Li To: Haibo Chen , Jonathan Cameron , Lars-Peter Clausen , linux-iio@vger.kernel.org (open list:NXP i.MX 7D/6SX/6UL/93 AND VF610 ADC DRIVER), imx@lists.linux.dev (open list:NXP i.MX 7D/6SX/6UL/93 AND VF610 ADC DRIVER), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 2/2] iio: adc: vf610_adc: limit i.MX6SX's channel number to 4 Date: Mon, 4 Nov 2024 18:12:00 -0500 Message-Id: <20241104231200.2745342-2-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241104231200.2745342-1-Frank.Li@nxp.com> References: <20241104231200.2745342-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR13CA0160.namprd13.prod.outlook.com (2603:10b6:a03:2c7::15) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|VE1PR04MB7357:EE_ X-MS-Office365-Filtering-Correlation-Id: dda33822-0030-44f2-45ca-08dcfd262056 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|52116014|1800799024|376014|38350700014; X-Microsoft-Antispam-Message-Info: sFsEF1VHOCAGF1uKM8N8ZRGoUFGQ4KPkzVAZH5Trj3l6i2Z6PBwRygmKINdboWMEkqAQjNwcQLWvp1AAIx3SsAisSO5LfWIHarRA64cx5he350zzLdXNm5MTOCjan4m7NpZi99taCn8UL5f+D69PjkjE2uyJObPG/qZhhLXFbjVm6lmNrlrB+Amd0Mu1Wtj07spUMLvJa0ab9x+Fr799HKV0PAXGutTElsv62sytTwLrKKSYHGgIglrXRU6VIt8aSapN01OeVvVEWpWaXnbobsSDeMgZRjA/jnsgtWEeJEefkRB89lbfEiDiDOxx1MKteV+z3lFPPqKDhhxxLB/6VKz9zUwOp/A/nbygOxR3xqBDYiksypR8FwUbvtbHtAicWi1diyH/5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look.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(52116014)(1800799024)(376014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vlQJQ4we2l98HGI1a0luCxsjEMb9Rr90H4g2SgruoIq2BfYHadYSa5HWBHEZQUyZDEMchMSIdCShvhfQ9LIUiwC0OZXcyOkCPO5JSHohdSG9xYUlXHTev6FQSjJlZo3tqvDV3Oy/HDGKcVIA/3Fi96VNyrAlDGIQ0zpJUEDHNW4FyKvzgUoatYxX5DvJbrkfYPCKn11JWqdVGe4cxtGdF+lHS4+oDNv+iWJ7+MlZLrCeU7p3VgBozs2s7WO8WXmsJhIKqq4Xip5ZMYkrSXF8PWkHIC6qPR6CHJA5rVauJ9wJmcCvaeY2y3xqYRI7r+SMP1+u7Ze/iyMdf0pxzpVR7R190/pM99/RaDGa2LXZKYW3HSc+mReMyS1qYpIhgyWbxsgi0YfnAqoggakmw0uQSVypNBSGGEmJ03cALRX260/ubUeaK2H9AS1CJx3ljDJPIJMxSTnxbsMZv+1wjulODrvEC2LMyRkR09ghxhm7GPbf6pHYZHeda3fj9mIOOk2nzlpJA/m1xPMKHHOL2P7SgnA98pu2QTV8ibm1XKJh1XQz01W9Ez2x0KSuNLJtM1lzYrKNF2pqLTIDhQhR46OxalhBW2vMBpWtUfLb9gpG2ll3HxTs3xKh11mmSrAok1j8L6fYY4oSHLJd8G67oSXDkb03xq25c0CjdWaYsT/wrtgpkZefA6/Gk2G/8n8govG7BL088h14kpTRcWMK37XF+AUsWljiuUlDSz+W+SbEzV6MZOlN5CIGiYTfEmCahFpN2GNALX/WjgT+6qSeLvMalmOpeALnZqAU7neTdx2zkSpYnFLTfvar+YOJ31BJylHr78upWo+z3kyb6m5SDH2jePkOkJqymhTX1zoMlwuL3adtR5jxeq0d2EmCWmh5Lrmy0t6U6jKEDNWU3zjgDUk7F0zpmoqGutnXG2hwv73KP+igejDC6wc6R52hVp0qjE1CvQL7u1+eK45DoA+MQQHWkYdDfNXuitl5IFJwFNvlCS8rpVhxk2QXgU60N8L4VxBSNiuleiWj4VoT/j4qI9dkr8qOeaX5rdlCz73AfR1UHsBYbY+7tSkOqY3vS+YcN4pFaymnL+fcSrUd2BN5mNx9/q3cDZ05++vzNwPHr/KPk9wxCzoAlHQq1c3e8jGWKs5yaxOIeD2xSGu6mx7YfEVwBdEf5yafzdPQUkecgE0Tmx+Eo+WvYah55QuRWusKs3C7qSUhI8H8h1dguyv7SWzYJ2GsecaYQLzq1fyZLSCQv/DBnyJTZzltP3hSmrBqQYQozOr7BoxEKC2zDROJAXf4/SIznHP4jIJEl0272Mllu9s3uMS9UfggdXFBvm4Gx3ZBwhXxq3qUqG0loAVDkQACGKgXMEJFEeEa0VBbXWldXqzdrVtmMnqzgt5dZdrsH2dKLJWCVU7/V6jByK9ll7a7wufa3nQaRmVgmjD5oHez3vwMVpalyLLx3pLP9fKCsC9NWB4+5xvmAYPVmqbIDULP0haqggx054BHam7h+adUn6JSioTEhsdjojfRpkwzxskngGOLOGzXZes2WK4+9fafYJjbHWkJ1PlAvDQ6p9njUEk= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dda33822-0030-44f2-45ca-08dcfd262056 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Nov 2024 23:12:17.5842 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wWowfeWOM41nWI+zaOhdRY3Zs8yzUU7ntpd67/aj5y8VlzKkN9xbWa/S4ehzzh03Sz1kCN2+zlq4QxRaURBPvA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7357 i.MX6SX only has 4 ADC channels, so limit channel numbers to 4 for compatible string 'fsl,imx6sx-adc'. Signed-off-by: Frank Li Reviewed-by: Haibo Chen --- compatible string 'fsl,imx6sx-adc' already document in Documentation/devicetree/bindings/iio/adc/fsl,vf610-adc.yaml --- drivers/iio/adc/vf610_adc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/vf610_adc.c b/drivers/iio/adc/vf610_adc.c index 4e737b193c012..84573cdfce5da 100644 --- a/drivers/iio/adc/vf610_adc.c +++ b/drivers/iio/adc/vf610_adc.c @@ -809,7 +809,8 @@ static const struct iio_info vf610_adc_iio_info = { }; static const struct of_device_id vf610_adc_match[] = { - { .compatible = "fsl,vf610-adc", }, + { .compatible = "fsl,imx6sx-adc", .data = (void *)4}, + { .compatible = "fsl,vf610-adc", .data = (void *)ARRAY_SIZE(vf610_adc_iio_channels)}, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, vf610_adc_match); @@ -870,7 +871,7 @@ static int vf610_adc_probe(struct platform_device *pdev) indio_dev->info = &vf610_adc_iio_info; indio_dev->modes = INDIO_DIRECT_MODE; indio_dev->channels = vf610_adc_iio_channels; - indio_dev->num_channels = ARRAY_SIZE(vf610_adc_iio_channels); + indio_dev->num_channels = (u32)device_get_match_data(dev); vf610_adc_cfg_init(info); vf610_adc_hw_init(info);