Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp5815573ioo; Wed, 1 Jun 2022 13:10:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHcfZwrFz3+Bv7VY2E4JOoMlOuk1NoFIoccdkIe323OT5ChMHHe5J1+OXQiiEuc7gs8z5x X-Received: by 2002:a17:903:22c9:b0:163:e49d:648c with SMTP id y9-20020a17090322c900b00163e49d648cmr1165939plg.54.1654114247238; Wed, 01 Jun 2022 13:10:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654114247; cv=none; d=google.com; s=arc-20160816; b=wJaoylIwSUXwrlgRMTF4x8237qOjytA5lwu/cCe0Q3Faj08XIWkgWKL05RMjXGQZ0Q tkE8XiXZ35e1N1thXROg3UakmcEgOxVSzRPFd0e2+HvKtMGCCN/afwfeGSphgdRnv9Ra vfv1dMpbUuilULZYTJABLjA3qW0rLl+8vH6Owy0ZYbpU4isKELV28I88CZI4pU0Ha6JN 0LysEEQnx6f6iaS4qz+tMifkUMDgAqR3erY5jPfZEGElx5hK/qepFw0y5WSdFH7NEmmx /th7OBpXbK90UDbl6ZedUquno3fIB6X4t5oG5NFX+T++44us22KQGIwkTNKqYgj0QG8S cz8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:user-agent:from :references:in-reply-to:mime-version:dkim-signature; bh=AOE+maVk5InZYmJxq3fFhzfqd22A3DYPkKeLdVjuAXk=; b=f/7FoaMfLnWLvbK+hScFu334N1cTb/eVYWB8e48sRfrIAyWxvITTLCEGRmfTgVZB6m 71xtT1WALvMkDSpO7apiyBl0tB0MY+QaLGamnf47aPiIY8PRKJ+RrmfbfaLD/wpuEtEa nEbxGqa3hn9Wuhra66aHRmn5RR4wG55SrkApMKdkiHd/3Cz7EOzpn2w6PwbaNhKmVUHg FdvsXyLyOcl5JOYzkEzVgr+kCNInJD15bQKi0szQITHBnKoQJR7BLtQ4NyErICN2IOoM JG01IGcx92yunFfPYuuvDxLQeUz4y0M51fK03mCJblkVbIx/b6X1afCXzd7I2wV9W22g ldZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=f418KBsu; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id y16-20020a056a001c9000b005182fda1b23si2740627pfw.236.2022.06.01.13.10.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 13:10:47 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=f418KBsu; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 36CC823A02B; Wed, 1 Jun 2022 12:26:19 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349054AbiFACGP (ORCPT + 99 others); Tue, 31 May 2022 22:06:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233582AbiFACGM (ORCPT ); Tue, 31 May 2022 22:06:12 -0400 Received: from mail-oa1-x29.google.com (mail-oa1-x29.google.com [IPv6:2001:4860:4864:20::29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED8F572E18 for ; Tue, 31 May 2022 19:06:11 -0700 (PDT) Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-f2cd424b9cso860664fac.7 for ; Tue, 31 May 2022 19:06:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:user-agent:date:message-id :subject:to:cc; bh=AOE+maVk5InZYmJxq3fFhzfqd22A3DYPkKeLdVjuAXk=; b=f418KBsuUtPiY0sjTEprLPFRqYykXYxhDm3pCbzhRk0tBeu2jD9ibbibHZNVHnhd8i uC8Rjv7AS1geBjT2NNE1+sUcZYazcFXFchxAUW8ydsGAZC8v2OMmSAg393T8YOzZGBwD oxueJieo+f0E9wLol0w8P9QBTTCx2n1SUhbZ4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from :user-agent:date:message-id:subject:to:cc; bh=AOE+maVk5InZYmJxq3fFhzfqd22A3DYPkKeLdVjuAXk=; b=f47jpY8UBrcY1WZidJ6D4VO+fmbiaOJLI3P51gZCAZJ0SyxC3ZMjhio4i3D6htGrm6 jZHDf5SCTnziFuI/yVDfLSVJSTyVPvCWYgujyJmPlN4G59EPDKAA8zKqJ+O6VlBAZp3f X/saKIm0m5SDBMzahqEGkNBM4+fSjf2XRwHMLSmPoMFKZjCIQml6rlOrwsZ98xt8n4uW V+MOVIfRvgqtfsiOXWf6/e5sIlZKcX3jh/4akzfmS1cKYL6EjQK0d41HW+zNSpEm+ElZ C65MmtCmfl5bYdpUSdfJaYLLEIuL3GJ1wl2zk0tue+Wq6dLi96JVJBbISuB11zDRj8LX XxFg== X-Gm-Message-State: AOAM530wp1QupJyI9MvKmcyFNpNu2yQSAOIpo/NazvJA+BqSnCH8xAaL kG4TR2z1b9/jbAigC1Mz6a3W3YnOF2y7yBVIdqwsjQ== X-Received: by 2002:a05:6870:558e:b0:e1:db7c:26aa with SMTP id n14-20020a056870558e00b000e1db7c26aamr15376480oao.63.1654049171244; Tue, 31 May 2022 19:06:11 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 31 May 2022 19:06:10 -0700 MIME-Version: 1.0 In-Reply-To: <4b9a2abe-c462-81d9-2098-d430da24f030@quicinc.com> References: <1653043777-24003-1-git-send-email-quic_c_skakit@quicinc.com> <1653043777-24003-8-git-send-email-quic_c_skakit@quicinc.com> <4b9a2abe-c462-81d9-2098-d430da24f030@quicinc.com> From: Stephen Boyd User-Agent: alot/0.10 Date: Tue, 31 May 2022 19:06:10 -0700 Message-ID: Subject: Re: [PATCH V13 7/9] regulator: Add a regulator driver for the PM8008 PMIC To: Bjorn Andersson , Rob Herring , Satya Priya Kakitapalli Cc: Lee Jones , Liam Girdwood , Mark Brown , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, quic_collinsd@quicinc.com, quic_subbaram@quicinc.com, quic_jprakash@quicinc.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Satya Priya Kakitapalli (Temp) (2022-05-30 03:33:47) > > On 5/28/2022 2:32 AM, Stephen Boyd wrote: > > Quoting Satya Priya Kakitapalli (Temp) (2022-05-27 01:24:19) > >> On 5/21/2022 8:26 AM, Stephen Boyd wrote: > >> + } > >> + > >> + pm8008_reg->dev = dev; > >> + > >> + rc = of_property_read_string(dev->of_node, "regulator-name", &name); > >> + if (rc) > >> + return rc; > >> + > >> + /* get the required regulator data */ > >> + for (i = 0; i < ARRAY_SIZE(reg_data); i++) > >> + if (strstr(name, reg_data[i].name)) > >> > >> Why not find this via reg/address instead? It would save storing the > >> regulator name in the reg_data table. > >> > >> > >> You mean match this using base address? then we should add base address in the > >> reg_data table. We will need the name to be stored in reg_data table anyway for > >> the pm8008_reg->rdesc.of_match > > Why? Now that this driver binds to each node individually the usage of > > of_match doesn't make any sense to me. Can you set 'struct > > regulator_config::dev' instead and not set of_match? > > > Currently we are setting regulator_config::dev as dev->parent i.e., > pm8008@8, because the parent supplies are present under pm8008@8, to get > the regulators mapped correctly to the parent supplies we are using > dev->parent. > > If we do not set of_match in regulator descriptor, > regulator_of_get_init_node() would return NULL, causing init_data to be > NULL during regulator_register and regulators are not getting probed. > This can be resolved, if we get the init_data during pm8008_probe > itself. I'll do that in the next version. > Ok then it seems ok to leave it as is. I suspect getting init data during probe is more code vs. having the node name and the address in the table.