From mboxrd@z Thu Jan 1 00:00:00 1970 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 D0A09C54EBE for ; Sun, 8 Jan 2023 12:27:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232900AbjAHM1m (ORCPT ); Sun, 8 Jan 2023 07:27:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229716AbjAHM1l (ORCPT ); Sun, 8 Jan 2023 07:27:41 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2ED85FF6; Sun, 8 Jan 2023 04:27:40 -0800 (PST) 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 6CCFDB803F1; Sun, 8 Jan 2023 12:27:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE89CC433D2; Sun, 8 Jan 2023 12:27:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673180858; bh=SysmkJ2JIR01nOEshO/fIKEwvXowTeVYSoVagST5Cpg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=B0OmM6FuLJMP+S/U9VXdgGJwlah8jcdY+zNTEKHLZZ3bD6krzhav+Y3/kI2vHtFa6 qVvE7K+r9Uj/GyL1/QcxXUAj+7QkY9/gQ4Hlvo/+vEG6QZM9BxiRy5MwzcZE0q8PDF I6GMStTpDkCbfgLZxfjpY/6whUoxtyit9d/KdcxuoZRPj4WUN/QFFS4Kv9E33OYAdZ iggZdHjxPBGvD4yQipewfC7QH41fft4i1HwN4M6h7iZw92bqzM0sUz11ts7QY3aqLF PeyqLyGjs9aDslKSBcI45ghzlN3tliOsi4pzP4i7HNI5eWU/pBDwGxN1Nk/A0pW1zX f39ZNtbjKcrUw== Date: Sun, 8 Jan 2023 12:41:05 +0000 From: Jonathan Cameron To: Angel Iglesias Cc: Andy Shevchenko , linux-iio@vger.kernel.org, Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Nikita Yushchenko , Paul Cercueil , Ulf Hansson , "Rafael J. Wysocki" , Andreas Klinger , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/5] iio: pressure: bmp280: Add enumeration to handle chip variants Message-ID: <20230108124105.1cdc5627@jic23-huawei> In-Reply-To: References: X-Mailer: Claws Mail 4.1.1 (GTK 3.24.36; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Sun, 01 Jan 2023 12:04:40 +0100 Angel Iglesias wrote: > On Tue, 2022-12-27 at 23:37 +0200, Andy Shevchenko wrote: > > On Mon, Dec 26, 2022 at 03:29:20PM +0100, Angel Iglesias wrote: > > > Adds enumeration to improve handling the different supported sensors > > > on driver initialization. This avoid collisions if different variants > > > share the same device idetifier on ID register. > > > > As per v1, use pointers in the ID tables. > > > > Taking your suggestion and Jonathan's remarks into account seems to me like the > best approach here is using chip_info pointer for each driver as the pointer set > on the id tables. Yes. > As in the i2c and spi drivers, the enum is used to fetch the > correct regmap configuration, and later in the shared probe, the chip_info. The > logical follow-up would be adding the regmap configuration to the chip_info, > right? Makes sense. > Or is there a better solution I'm not seeing right now? If I'm understanding what you have above, then this is exactly what we would want to do here. Thanks, Jonathan > > Thanks for your time, > Angel