Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp417264rdb; Sat, 30 Sep 2023 09:19:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGCjjj20cqICMl+Eook7uTHfyswQ+KAh9i3OZvU2XeFmB7TpJG3DgjnMG8t2Ey1A4W4jlLv X-Received: by 2002:a05:6a00:1d0b:b0:68f:b986:ff69 with SMTP id a11-20020a056a001d0b00b0068fb986ff69mr11566007pfx.6.1696090776717; Sat, 30 Sep 2023 09:19:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696090776; cv=none; d=google.com; s=arc-20160816; b=CbUd7eKxtZu2wt+/vMf32tcHE/ZbCbUEiDxgLyN9u1sgje/ZX3cJB5NLL61XGaO4TQ BF5U2chmjxzuMHYFav4gk5kfmP1e0euGdkugQ8RujmH8ezxVsXP/71lxMZR4HQMhcufD 9P5piB+sxRwOwWnxR7gi0WroaxKYzf6NhMokakcMEuOVLcoz6hIByqhRcQ1wrLKO0Aa7 ruCgybIPgQxBSPH6DnKgB+d1skfXQskghtK05bLKtGCVF3f3JLYV6CxwzgMj+Oetn+pg L2sC+paDZ0MkAfFQvgKZnuuezJg4ipKyPP55Jii+QT9CJgrLJCag/aSqEEoJsRpLR8zu vTxA== 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:subject:cc:to:from:date :dkim-signature; bh=el8MLsekvriqNlnjAcvtYCOecF65Cwp+BVoiGaUYzcw=; fh=tSICWW+iHpxAdSUEVdVnQoLVd+cvCsEU4sCsiYsZAZg=; b=mdiZANzB6WkTfGUSbqE2SFJk1/q/N9OgrYm+rc2HC//wt/FNmXRtKRg5SToLYsAmQ3 Cjrj1gRhFtfRJQ3iEaG8Ly0xNXSJv+dqNhwI9ulLraGGMFCSBNLkJlCyk4MV7VPqHDsB 63iioqzqZXQpT3PRo4x9K0l0d5iWHOgVdSI1NF/K8OXpRN/743VtDK8VYUdQaDrhRdEF JCKHMne9LEK2MI4YIH8nFU+ry6Rj44ratZg/YNqESvzf/sUiT38BPbYEcFZ/MK40XX9W S95lL1Jr3CSNDN+weAgsA24VfxMjDBDljAn2teJV2lz/3Uiz7kRddMspvUVMRPDVdkaD LRHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Nf6Y0KE2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id l23-20020a63ea57000000b005789db12724si23402490pgk.353.2023.09.30.09.19.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 09:19:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Nf6Y0KE2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 79DB3802F7C6; Sat, 30 Sep 2023 09:18:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234498AbjI3QSC (ORCPT + 99 others); Sat, 30 Sep 2023 12:18:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232221AbjI3QSB (ORCPT ); Sat, 30 Sep 2023 12:18:01 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 865DDC6; Sat, 30 Sep 2023 09:17:59 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE0D3C433C9; Sat, 30 Sep 2023 16:17:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696090679; bh=Dzx0SZ8RA3eipu/LBIHEROksssiobsemvjwf/Cv4maY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Nf6Y0KE2FMbWYzx415ksQJJ0Hp5B5JNV39YRLplF0CCkteNNWZx1EaSHApH1TX0Pb AIiRQlKI4Vks0Va2FVZ2U3xfOtcSASCBRSvlZ0cKQ59nNXpKHgivtIfV3j8Xh/TZJZ LScpXhtzgt+0wkU2Pad2RBrBfbiZI3ThAQ0z2akUSNUzEF+VdzOu9S5LbXgkKk2vKs 1/AyvBkHYZYXjhKE608mX36MEar0LU75qfWzi6k2BSY5Dv0cZzJUmstra395UGCeGJ 2JlNiLADV1yY6mlUM9Jv8FBf2m52T/bMRT7Zy9FzTHXFVtMc9b811Ezjw85eZ3e+e7 zyyo88ZYe0i0Q== Date: Sat, 30 Sep 2023 17:17:58 +0100 From: Jonathan Cameron To: Jagath Jog J Cc: Denis Benato , andriy.shevchenko@linux.intel.com, lars@metafoo.de, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC 2/2] iio: imu: Add driver for BMI323 IMU Message-ID: <20230930171758.34689af6@jic23-huawei> In-Reply-To: References: <20230918080314.11959-1-jagathjog1996@gmail.com> <20230918080314.11959-3-jagathjog1996@gmail.com> <20230924153055.0b3486f9@jic23-huawei> <5eb148b4-25eb-460d-9ec8-0a40bec1dc6f@gmail.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sat, 30 Sep 2023 09:18:14 -0700 (PDT) On Fri, 29 Sep 2023 13:29:13 +0530 Jagath Jog J wrote: > Hi Denis, >=20 > On Thu, Sep 28, 2023 at 2:55=E2=80=AFAM Denis Benato wrote: > > > > Hello, > > > > Some devices (as my asus rog ally) have an ACPI node describing a BOSC0= 200 sensor. The IC being used in those devices is a bmi323 but as a result= of how the ACPI table reports that device, it is detected by the existing = kernel module and we have no way of differentiating until after the chip ID= probe. > > > > The module loaded is bmc150-accel-i2c.c which currently doesn't support= the bmi323 and the loading of the module just fails at chip check. =20 >=20 > bmc150 driver supports multiple accelerometer sensors such as > bma222, bma280, bmi055 and all of them are having similar > register map, but the bmi323 register map is completely different > from bmc150. Horrible bios hacks that depend on a particular driver stack are always a pain. Hmm. Andy (handy ACPI expert), any suggestion? We could maybe do a wrapper driver that does appropriate checks and wraps the probe + remove from the two drivers? Whilst we can obviously have a single driver that deals with radically different devices I'm not particularly keen on that as it tends to make things less maintainable. Jonathan >=20 >=20 > > > > I have solved the problem by expanding the current bmc150-accel-i2c.c a= nd bmc150-accel-core.c files to handle that IC in almost every part: gyrosc= ope, accelerometer and temperature sensor. > > > > What is the best way of organizing code to have this module mainlined? = Is it correct leaving files called bmc150-accel-* even if it is managing an= other IC and and not just the accelerometer part anymore? > > > > TIA for your time. > > > > Best regards, > > Denis Benato =20 >=20 > Regards >=20 > Jagath