From patchwork Sun Jan 23 19:01:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 12721126 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 509CDC433F5 for ; Sun, 23 Jan 2022 19:01:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234780AbiAWTBq (ORCPT ); Sun, 23 Jan 2022 14:01:46 -0500 Received: from mail-bn8nam12on2066.outbound.protection.outlook.com ([40.107.237.66]:33152 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234863AbiAWTBk (ORCPT ); Sun, 23 Jan 2022 14:01:40 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AcQAUI43CeN5MKUTdwA6Qaa77rm+4fkZ5IM6le4K1T5RJhIS8rSLySeqmASy6eDSw/B7EjIvTeTfDB10gff03iSxKHLZ/XiWT0LvvQ/8DwV8kGCJ+9jGNPfydTJCNrbWn9XZ03iE/3E59Cg1ldIfv1P97KXm/2e/wjeYmTeuHWHNCLSYWvG+hxI1W3mGL10TeEE3l035WxwalaVIqYTWNQan5U16ofIoE4GpgbGcWkniX+uEZShMShDk3reW5vBPQ4SH/BK6Ui3hRiLIDqGc+f3kWRx5SKmTUp+/4+k7QJyknbJFonUdRvY1lJA9O8c8/V4ZPTz7asILnkkCzeoaeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=jFQpbrP7ACT0+u3PZFyi9v+3R9NztBvcPaYwDUZ8Tc0=; b=hHBCY95HmoqrbjxEqqVYaAfff/4P2Btw0tj3RWabs80WhCv4BzOCVMcMhweH5FpeWLeSdnmR7oXjTeUOJMUf85UfqwoLY5xW6MHzjvUQioWTpyBbz9+igTU5cxdbTzy6dUQQSTmDyi5Nincn+xZ9q8xKpMofSkc4zz1yURyhO/Ka5ZxTZOwAQ8zarx5ICIX19od7NEY7qNr2EXecI6Re0zVhiYyR2ftH167sUPE3XAZWXV5VMJfUnoOpz/0vz3iScQMpLMZ4HGwjCZeg65zZQr7SIo5jVg4ABD6LKUs+bYgWd+I8ZWmYM2Yho8paFVLRAMwQ5v+eguAMkPZeb8T/iQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NETORG5796793.onmicrosoft.com; s=selector1-NETORG5796793-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jFQpbrP7ACT0+u3PZFyi9v+3R9NztBvcPaYwDUZ8Tc0=; b=pJb19aSXwoKVHkwxCB+CLREhydQ4IDrYvfRfQQ98RvQeLUMznBMW0AqTj74Mi0GLwZDQY6vGVMWd7NgFmIO+bn6o5/7XX1xVTlKxQuUFomh1PW4u91+Je9jwDYCUI+85Tbu3uW14ci/91PIvLR1mv14RHOCgzbDjXLur/SYO2n0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=labundy.com; Received: from SJ0PR08MB6544.namprd08.prod.outlook.com (2603:10b6:a03:2d3::16) by BN7PR08MB3892.namprd08.prod.outlook.com (2603:10b6:406:84::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.7; Sun, 23 Jan 2022 19:01:35 +0000 Received: from SJ0PR08MB6544.namprd08.prod.outlook.com ([fe80::e8be:49c5:397e:d3ba]) by SJ0PR08MB6544.namprd08.prod.outlook.com ([fe80::e8be:49c5:397e:d3ba%5]) with mapi id 15.20.4909.017; Sun, 23 Jan 2022 19:01:35 +0000 From: Jeff LaBundy To: lee.jones@linaro.org, jic23@kernel.org Cc: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, Jeff LaBundy Subject: [PATCH 1/2] mfd: iqs62x: Provide device revision to sub-devices Date: Sun, 23 Jan 2022 13:01:05 -0600 Message-Id: <20220123190106.80591-2-jeff@labundy.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220123190106.80591-1-jeff@labundy.com> References: <20220123190106.80591-1-jeff@labundy.com> X-ClientProxiedBy: SA9PR11CA0004.namprd11.prod.outlook.com (2603:10b6:806:6e::9) To SJ0PR08MB6544.namprd08.prod.outlook.com (2603:10b6:a03:2d3::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a705ce3d-47de-4ccf-f6ec-08d9dea2c703 X-MS-TrafficTypeDiagnostic: BN7PR08MB3892:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ye+HwHJ54Y+6yjXg8vQgGmQ3mrQCZbQndyFKXUd7IhlOjrTIsfrp4FaMRMkq1jgqpcgErOqCJsiFNxAray1V4JUuj9VAbsYzGYsUtrRqEGIZL1ckTfQT0jXBoHqCjamiqyrrwat6+4hEPyW1EnsRy18z16wDKkuAlg01mLpmax0BTWXWlNv0VrY7teFF/FuV2LCcdEkqSuYKm5pXwBLx4zfc0MvClVMJ2yGDAA52CrfV8P6GEa6X8sDBYWUL515fDVYwakxubCKdsHn/p4sJxPuDwpKnD036S1D9MkujMPTY4YyC/6DYktgMKewkhOgR1Ee6cZ/Ga41IQjwx/xLoWugINdlflojK1j55vw7FtPfbGgyfkdLAovm4vZvbyugfdTUBKMhbukpILjg+fq/C7OSbYgLiyeBQ/CBfqyrGm9S2/puB3trUS8RrDwDAJNjlGfHO9wWYqXtZIM61D4e3xdZc3mXXycRHE5A+RQlBxV1PSX03/8orPquxWpUY1/nKNxK7mz122tmrWBT+LjJXn5bCAyDECgBUjWZ/+kA//AdgJf3yN3pJeagG96CzVI+cr4nT2ZymuajJFQT1UwM0My7hoyBHaV53FPggENIeLf1oDwssLY/eTH1JGrnZIgNGop3Nv+6Fmw+X8p2kHwAU7zYzKj6z/Wgaeqc+rO/X4PHpgmWrdLkPKrOCdRBkt5YZP5LGr0BvzUZiul3c7pzDNw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR08MB6544.namprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(136003)(366004)(346002)(39830400003)(376002)(396003)(66476007)(8676002)(66556008)(186003)(1076003)(508600001)(107886003)(6486002)(38100700002)(66946007)(52116002)(5660300002)(38350700002)(6506007)(2906002)(36756003)(83380400001)(6666004)(6512007)(2616005)(86362001)(4326008)(26005)(8936002)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qcDJ2KZKlzU0RdluXhe/+TlyultbkmG0J7dgGr6cXKrK8k3CNtVDEByaSpOy7LnRJCvfgSk4W+H8IfLWra2MEHgSQ6CUJwk0pfa6e138ewrDj33Oc58938D4OfpWiOKql7f/2B/koQmLmXr8AUYRxKA2zKje2KFTEnjDXBiDdOrVD4lLsadUTpuS4wE729cJIsFLH7ksqYpju5BQQv+xhZk6eoQuoG1XXdNtwPAdP7qVwIAdVXc0kRtQB/n3GIr4q0oq0dq4dKWMrwgv09ysRBxKAXWhNZ6lDBVe2dsElzmCZf4gMicEqO/nvR8mhKZPqRAhiKg866GFG2o1by/D3TvPA4YNivoVoUNiqIzlQWSLSKPdubGt/whvKpuHPUIYwAOJbCEsQiwgrsDdfuDrLVdWg98ljk7w+xTwQm8RegSWAfnYH6Prvlt2EUjgPeJe7X1U6cIWI3+wWxjMYcsZ0oq91XymOHu7Zr6LRbiuw5CqVD1oGj2psKMhv91joSDLMTnav2eDlNrgjPzKToMcTEomGFm38ZusMvMacMFUzlXBl6xep8r+8sihd9KBSTTUyxwuPkMVm7vheMErnZYLh69BkVv6CdZXefk2jxRoa3oq49W53f7Tjk4+Irrg51lkwcWQ//3+VDgCBMDq3wvaih37sjHpEOTG40ihjDf7fRHqlnFehH6xE1YD9wJM2IaUvhFMzNnND8thkcr7uUaRluTwY0xJItaJ5/T+hRzrl0BcOd6aF7wwAJbj6GQWAMpB716mbDH1531JpeeFnHmW7mHBQTp8Vy6x83Vigdi4FytkifWr8J9BWYk2cCDS5kX/IRjC6UF/w8294c6JkYCNxVXybUdwweLLxu21Bu+3I4X1Bu3OKOLaDNWmDxYUcMOhp9uruqzWiivUHqF+SBrJ6QHwg3fBWVtFX+QRm62QvVpJCzNwAnolLtpFAyhY9LcJ22qpK9Ck3R/OLAhcygEHvwc/ICemtPwPiyzLvfK9cfkjeieOnh0GZLmPYM2RX8idCikEq5K4jZDEwSs3jwqTxvHKwbgzvpo1Ncr1Dd6ClZp9RbpRH+MXCXQpQ7iA5EgHicVu9WZUT83FxurAaUP2Tla5RgiB3qE+Ka5pdRePsXhplYt24O4a8yScQ4h39GgiHBQmnsTqL/z/qi1jq2OXrSGCDnSal2hgGGhhHidqlwyhyN4agdiE7Ac4Xjlhn5ml38grVQNyn12+W2KTjq4cpDkyvws/01B+tAKN5Wv99s04lLPDUViJTcOFh+YNZduclrruvpUY/ostXaKO7VkxKnkK/199mJRSlNI/3yjHF6mHPX9diEP4jRo+SfNtL0nzkmMQZLk/7GDKGXiC2hz45xqFaYmOq2Yxjl2N1IgzIc0AFoc9YQOzFNsortHX3pIOGfiLrcrzxVH8YqRtYPoQfD4Yw/xm7YDhco7Bo1k3GYKTtayu4iCf0qVjxOGN+6qpvcLnyNXrLQj4O1UX5RZmHED3nRZi/q634oUIX+2xActA4bZUdrvNIW8znYiffFMJjw0TKOamxBillARwNceRzVpXezTX9tbR8GZsI9BUFL5tzoDytdnImAgY3AM+Eki1aaiHqSO5CT0qYa6+niXyR2U2h09IgwjNQPVAh+i1t2Y= X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: a705ce3d-47de-4ccf-f6ec-08d9dea2c703 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR08MB6544.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2022 19:01:35.6179 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 00b69d09-acab-4585-aca7-8fb7c6323e6f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: HHDkBZ2qNcyFl1sNC8aY3KJuCNDKFN3xSnKBOyBA2sMLWQMFTMBwa8YivR5GJp+YLHlA1I238ynCiYYghUF0IA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR08MB3892 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Individual sub-devices may elect to make decisions based on the specific revision of silicon encountered at probe. This data is already read from the device, but is not retained. Pass this data on to the sub-devices by adding the software and hardware numbers (registers 0x01 and 0x02, respectively) to the iqs62x_core struct. Signed-off-by: Jeff LaBundy --- drivers/mfd/iqs62x.c | 6 +++--- include/linux/mfd/iqs62x.h | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/mfd/iqs62x.c b/drivers/mfd/iqs62x.c index 9805cf191245..575ab67e243d 100644 --- a/drivers/mfd/iqs62x.c +++ b/drivers/mfd/iqs62x.c @@ -898,7 +898,6 @@ static int iqs62x_probe(struct i2c_client *client) struct iqs62x_info info; unsigned int val; int ret, i, j; - u8 sw_num = 0; const char *fw_name = NULL; iqs62x = devm_kzalloc(&client->dev, sizeof(*iqs62x), GFP_KERNEL); @@ -949,7 +948,8 @@ static int iqs62x_probe(struct i2c_client *client) if (info.sw_num < iqs62x->dev_desc->sw_num) continue; - sw_num = info.sw_num; + iqs62x->sw_num = info.sw_num; + iqs62x->hw_num = info.hw_num; /* * Read each of the device's designated calibration registers, @@ -985,7 +985,7 @@ static int iqs62x_probe(struct i2c_client *client) return -EINVAL; } - if (!sw_num) { + if (!iqs62x->sw_num) { dev_err(&client->dev, "Unrecognized software number: 0x%02X\n", info.sw_num); return -EINVAL; diff --git a/include/linux/mfd/iqs62x.h b/include/linux/mfd/iqs62x.h index 5ced55eae11b..ffc86010af74 100644 --- a/include/linux/mfd/iqs62x.h +++ b/include/linux/mfd/iqs62x.h @@ -14,6 +14,11 @@ #define IQS624_PROD_NUM 0x43 #define IQS625_PROD_NUM 0x4E +#define IQS620_HW_NUM_V0 0x82 +#define IQS620_HW_NUM_V1 IQS620_HW_NUM_V0 +#define IQS620_HW_NUM_V2 IQS620_HW_NUM_V0 +#define IQS620_HW_NUM_V3 0x92 + #define IQS621_ALS_FLAGS 0x16 #define IQS622_ALS_FLAGS 0x14 @@ -129,6 +134,8 @@ struct iqs62x_core { struct completion fw_done; enum iqs62x_ui_sel ui_sel; unsigned long event_cache; + u8 sw_num; + u8 hw_num; }; extern const struct iqs62x_event_desc iqs62x_events[IQS62X_NUM_EVENTS]; From patchwork Sun Jan 23 19:01:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 12721127 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77A61C433FE for ; Sun, 23 Jan 2022 19:01:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239449AbiAWTBs (ORCPT ); Sun, 23 Jan 2022 14:01:48 -0500 Received: from mail-bn8nam12on2066.outbound.protection.outlook.com ([40.107.237.66]:33152 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234869AbiAWTBl (ORCPT ); Sun, 23 Jan 2022 14:01:41 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GikFaHX/Qdu7ewNGq5Ld44RMWMeopHqtbIQdHGHrFalaH2wtuOQlMmxSeK4KRYNyPY3vgLRrHENKKs2bP2ghJegGqmMl10DAElYGIyNTHx2LOlAzRFQibiTKrf3F1hoUqA605zJCHE3k19FF34XcdIPmtdOe1KspxSpPlrn//S5veHZWGeB+jiZ9mXIs4ztdSOQb22So+WL5ZoxwUb9lJ4AidPkoEIA6LlTvD2yrb0bU02pANwZuI4ir0V7H/1PHIi55KuKnymDMe8VKXJC1RaKCOvsZVa2I/tpra9UsP4q4DWudPR6UVnvRciTRnPA1s4GaLq9UVSnLrd18yqM1gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=VCotiCMVgLUr41O+wynPGLKGrJ3fIgEseIl8rU+u2oA=; b=KyrB/hJqPlBNJv9Qoyv8n2euxDVqUzmpxho/2b/DNY+yxff2yhL0oNCCCXYzrG1l0snxn6bXWOiaS3e1BoVCe/GU8O6BdVtINf1E9z36NIAjFvu2tHIjiSrthvMBevYXlX9lEUTVFv6VDVqHXBzY4u9cKOrnxuy3KAbhfeRFyX0dT0zFrRWKcqUzAjBpxL/FqzYffw1sXiPNjQ6qA5jWL2D8tJX5p3OpONBcupEuH8SrFXniw/yGILofkWb/TdqJEjB05V+G0VSjVuKWVdP3S3n5QK/Oo1dlGurIjfSs1f2fIdsuaWFbHbmANNVDaCNPw2ufycXYmRBcKfNALzlmeg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NETORG5796793.onmicrosoft.com; s=selector1-NETORG5796793-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VCotiCMVgLUr41O+wynPGLKGrJ3fIgEseIl8rU+u2oA=; b=WKwsKBjL52rw09V8yturvUGAmpjmZycy6+deeBH06vmz8E+d3BrSq6vZL7MmmZ9HUg47QSCqrKzTdZX/GHpiHlCNu+RvpBoAWp50apNfpWjc87txd3nj//IeKJyyHLAh/Gq8PYWtFl9aDM52rNlNgb+Z/To2NILhj3+SdmmUPuw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=labundy.com; Received: from SJ0PR08MB6544.namprd08.prod.outlook.com (2603:10b6:a03:2d3::16) by BN7PR08MB3892.namprd08.prod.outlook.com (2603:10b6:406:84::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.7; Sun, 23 Jan 2022 19:01:36 +0000 Received: from SJ0PR08MB6544.namprd08.prod.outlook.com ([fe80::e8be:49c5:397e:d3ba]) by SJ0PR08MB6544.namprd08.prod.outlook.com ([fe80::e8be:49c5:397e:d3ba%5]) with mapi id 15.20.4909.017; Sun, 23 Jan 2022 19:01:36 +0000 From: Jeff LaBundy To: lee.jones@linaro.org, jic23@kernel.org Cc: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, Jeff LaBundy Subject: [PATCH 2/2] iio: temperature: iqs620at-temp: Add support for V3 silicon Date: Sun, 23 Jan 2022 13:01:06 -0600 Message-Id: <20220123190106.80591-3-jeff@labundy.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220123190106.80591-1-jeff@labundy.com> References: <20220123190106.80591-1-jeff@labundy.com> X-ClientProxiedBy: SA9PR11CA0004.namprd11.prod.outlook.com (2603:10b6:806:6e::9) To SJ0PR08MB6544.namprd08.prod.outlook.com (2603:10b6:a03:2d3::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 47b270ad-661a-49c2-ccb2-08d9dea2c761 X-MS-TrafficTypeDiagnostic: BN7PR08MB3892:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oAgDfwCUF1sYMT861Zn0FG/i81tcpbxu41MHByPvnpi83frPvC3FWD7vD7SDNQdYl0FjwqgIW4apSomcaePMSEtGH7hLyJX+M2TVMyXdoslA0AQPhncX0WeKcxaVhkksh8v8DueSoPPNgeSr4pNg1GyyBgT0i/7K+z/twRoeNE2I6FbVyuod8L2PRhqEWxW2PymlCnnZURdn3DpyxmDyPBnKI+9tnt9O1Rltol3sUSob4JvslQZtnLnsbXJJ8F/Bjk7amJkBpmtRF5X+FalMQhFe2C2GgwYYwX3nqIB0wJodo8/DftgxWklv43PtaeaT3Xk5xGJJdrrD8E+0/hAB5ppHVAxZ74o0LOCiFGl7vlwYLCGimHPwY+J6wnl3ygkV1F9GBdBQ4cZdK0InIxWhT2meI5n7rra76MwsXoeSWQTd3j7RtnUHRDDrZ+lUNpBqef2SimYPdeYQ6aBMtkwJPlMhFTojOWz4XDhwcimZdQ3h18BnIAFYvB3PCn/q+SHADEjaCSYFinEomG5Ujd2mWur/ObzlOBbiURH+K1lbLCX+9cEFwacr8fnfkh0kSa4gi6r+6IqFYiLKJHsaWnujMy5k2yDyWSqF/Cjumc92/+3GkXJdH2rzC7U3C4oc4qcPJb6NBiUPlTMrKFmUAxdbF2cOuZKcf1hnmqPiSzAYgtXM4awBliSkYckPYhpIYw9ctmCFH6nnQ8ChUn6xMUVxBg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR08MB6544.namprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(136003)(366004)(346002)(39830400003)(376002)(396003)(66476007)(8676002)(66556008)(186003)(1076003)(508600001)(107886003)(6486002)(38100700002)(66946007)(52116002)(5660300002)(38350700002)(6506007)(2906002)(36756003)(83380400001)(6666004)(6512007)(2616005)(86362001)(4326008)(26005)(8936002)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Q8FI8v5G1Kwe0c5MPgdtBNrwiHdBnE3uZ891cC5SetSfjBZFOU5EHPTRwskdXM8jfiKvPxapV5Aaki1pN2Ws5+lfCVBu0QzaWNjgG82gzTzj7gBfTsQaBP6pcNGMNe951wVSnphSp2pOCKHEM6Fo1oSv29LMaaMIlKDN4U3chDisKlurpDrb9qT7TM8MLhibkwVjCFKhgz42egwhtmNdXClMvC4vVrYIJMHFh+YXEBWYa3nbpPC4mQXmyYL75H4UANBnpLKzDz2FjeVNI15y8APWZvl6GNeVG+xpyZUDVATGwE2NU1rGOYAdMeb5fMPCbqH4euV2PQnc5h+EAvOdS9fKk/6apUB5ZYtJleiX2sqYN7yKfSfxSeDbLEsh77j6v4urzN3eQ5QZn+CqGwjgWb5FJ4QxckmK2QACQn5HB7blCEgIuZp5BUee60HpXppIUo8KOSQkr4xlCnjekkrr37ylmuDgw+IieNekHi3vUFN8oI8tEoDl216arrtYTFPPBtr+LHHO9a3TFnnXIWgsFk9Ump0mAuCMtKedHeCrq3JpCRKdp4aq0CPm+YHGX/qWSzswviaT89UGL+cufMEg/SG+9cYxDqEVOF9lgsE3OVlQHo+kmilKKeOT+ygzyApmK5c70ug5Q+6hasRvCVQWY/8tuRDWwWwkQWqAAxVsk80ttT+Dp2A/VtJ+ch0OnCjjaeXf4sI/DJQV3TOXhhpmaoFrQ3ivAI4olK3oho77W/8cFjmq5W5qJunR6cHObcCcH48Vyaou5sErTbmM8pGefGL/qoC+lsD4HgNGSCoZQF2N5rkxvE9dV1XHhU9S11gmyZ6wAMjUsm6GP2WtFDOKFcy0hzz7aUU5rw9hpCcpv5OR1Gkr28Zj8MttlArOqCU442N/p7zrwpiyB0xHZiEB4mSp8T0XAZEUd6RGnTzrmlFyTdUVnD7Nb2JIRc2sqTZci9arYcvIkjafsobOVdB6mUUuvmeV2YjDVRiGE3TBUJ6olUI928+qsI4zE7r/bLSDts5XwoHQO1F6aE55VGmePVdoT1hS+zCwKEMjb+uURtkG0JKQH4WqHHyN8NWUMhcN4NlmDOV5nQVkL4SfpkVV2K2IVHVbiY8nMGNgckGayMyfD1WqzH1XREvw3nrhiqQOOpwyMBrym2u+h1iiY14/FI0VnQwIWEjHZwe5qf4V6IysjIjljF1y6mASLiWLDvUwgtBsQMzGlVJT866uydk2HTpUezU73lZj96xL8cwTWBafER3goUmF2Xt80B1l51s6t+UUV8CYYmeYk3S9zMM0fX7QesTxgUdtljjo6wgGFc69jT4lwz8yMYPVReD33WjmzT5MlNTWe1bs1/G7lLotrYGPPofYCI0lnUy9t4Xba5EMIJULArRWtzJZt2IHsjZnpm8nei7nNYNKysKlFqCsvc1M8rHD5BUwiPNtMb8GjfwDD6s2JnPqNqGfyk2jzx3qiGrUFinUaUyvkV9jLeCzOzIoDLukWDaXDNR9IjzLBtSEysOvrL301/LsWnL246ugySNSw7HBd3mP2qhlOP5dYhNhnLpbXHbL6sIswmVZkUc4YdNeIgpdN5Ji1rB6GqR5a5B7/vIo39rOnaR8P176rjQU+cYXPUectc7H6yrEtRA= X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 47b270ad-661a-49c2-ccb2-08d9dea2c761 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR08MB6544.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2022 19:01:36.2810 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 00b69d09-acab-4585-aca7-8fb7c6323e6f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pKmfLil3SapFy84D6saqSZXbOIi5xoVUba3LYZTegPLKjvi0I1JiFE5NtUFKEX+lQnLhWSNxTYVsXosoMTKtQw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR08MB3892 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org The vendor introduced an updated revision of IQS620A(T) silicon which is backwards-compatible with previous revisions, the only exception being the offset used to derive temperature. Enable this new revision by returning the appropriate offset as a function of the hardware number provided by the parent MFD. Signed-off-by: Jeff LaBundy Acked-by: Jonathan Cameron --- drivers/iio/temperature/iqs620at-temp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iio/temperature/iqs620at-temp.c b/drivers/iio/temperature/iqs620at-temp.c index fe126e1fb783..e2f878d57af7 100644 --- a/drivers/iio/temperature/iqs620at-temp.c +++ b/drivers/iio/temperature/iqs620at-temp.c @@ -17,6 +17,7 @@ #define IQS620_TEMP_SCALE 1000 #define IQS620_TEMP_OFFSET (-100) +#define IQS620_TEMP_OFFSET_V3 (-40) static int iqs620_temp_read_raw(struct iio_dev *indio_dev, struct iio_chan_spec const *chan, @@ -41,7 +42,8 @@ static int iqs620_temp_read_raw(struct iio_dev *indio_dev, return IIO_VAL_INT; case IIO_CHAN_INFO_OFFSET: - *val = IQS620_TEMP_OFFSET; + *val = iqs62x->hw_num < IQS620_HW_NUM_V3 ? IQS620_TEMP_OFFSET + : IQS620_TEMP_OFFSET_V3; return IIO_VAL_INT; default: