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 3286FC77B72 for ; Wed, 12 Apr 2023 10:04:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230260AbjDLKET (ORCPT ); Wed, 12 Apr 2023 06:04:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230238AbjDLKER (ORCPT ); Wed, 12 Apr 2023 06:04:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A8A37A9E; Wed, 12 Apr 2023 03:04:16 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id CACC063283; Wed, 12 Apr 2023 10:04:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29E94C4339B; Wed, 12 Apr 2023 10:04:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681293855; bh=OrehFqW8/NTBq41+buEdl7J1qPg50LFC9ahWXbWfHL8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=g4Z9/965eaQPtuSLS4ih4Sbt0T0+A81oGGb8DSGiMqueah9K6KQNOL2IHfo37QeyP V6EQ41XvoDQ1YXrvyQFRdvIc7u1JlXXh3aKaPyR6PemQczLljoBRxhflyBqLodEtCb DR0JybIjy5f22YW/9LXebGSVI3EgpehVNmWdBvxlWfq8pkHAMuAvPdkGO8e7WocFa9 y9ib62FVyf99KyvgiZ+gstK94X9NV6JVdGjsVJwEXo8dWt5s3bJLv9L+zlcu+OnJep bsJZtWurhdbonr47xtnX7DXsiL/fJaMiz3ri81k9EQHoXv7rSHIw+gWF1vnxZBwtug KaRMmc1bEDmHw== Date: Wed, 12 Apr 2023 11:04:07 +0100 From: Lee Jones To: "Sahin, Okan" Cc: Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Liam Girdwood , Mark Brown , Jonathan Cameron , Lars-Peter Clausen , Cosmin Tanislav , Stephen Boyd , Caleb Connolly , Lad Prabhakar , "Bolboaca, Ramona" , ChiYuan Huang , "Tilki, Ibrahim" , William Breathitt Gray , Arnd Bergmann , ChiaEn Wu , Haibo Chen , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-iio@vger.kernel.org" Subject: Re: [PATCH v6 5/5] mfd: max77541: Add ADI MAX77541/MAX77540 PMIC Support Message-ID: <20230412100407.GA8371@google.com> References: <20230307112835.81886-6-okan.sahin@analog.com> <20230315175223.GI9667@google.com> <20230315175257.GJ9667@google.com> <20230329143615.GS2673958@google.com> <20230403140950.GF548901@google.com> <20230405133938.GD8371@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Sun, 09 Apr 2023, Sahin, Okan wrote: > >On Wed, 05 Apr 2023, Andy Shevchenko wrote: > > > >> On Mon, Apr 03, 2023 at 03:09:50PM +0100, Lee Jones wrote: > >> > On Mon, 03 Apr 2023, Sahin, Okan wrote: > >> > >> ... > >> > >> > >> > > In fact, one of the maintainers suggested assigning chip_info to data > >> > > instead of enumeration. Then I added chip_info and put devices into > >> > > sub-structure above. I will replace chip_info with id structure in max77541 > >> > > device structure, right? I will use enumeration for data as I will assign > >> > > it to id, and distinguish different devices. > >> > > >> > Yes, that's correct. Please remove chip_info altogether. > >> > >> Then it will provoke casting in the OF ID table which I believe is not what > >> we want. I would agree on your first suggestion to have a plain number in I²C > >> ID table, but I'm against it in OF and/or ACPI ID table. > > > >And I'm against passing MFD information through the OF/ACPI APIs. > > > >You can put through raw platform data or a device descriptor. > > > >Ref: git grep -A5 "struct of_device_id.*{" -- drivers/mfd > > > >-- > >Lee Jones [李琼斯] > > Hi Lee, > > Right now, as you suggested I rewrote code like below > For of_device_id, > . data = (void *)MAX77540, > .data = (void *)MAX77541, > For i2c_device_id, > .data = MAX77540, > .data = MAX77541 > I also rewrote other part as chip_info is excluded. I want to be sure before > sending new patch. > > Does it seem correct? This is one suitable method, yes. -- Lee Jones [李琼斯]