Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp5862516ioo; Wed, 1 Jun 2022 14:21:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydv7U3PACtXG1ZEXm3yae3B0zuy7HP6ev/x9XuKPJjzEI1va1RwP2kfn7OcVwbHNbb+E8v X-Received: by 2002:a17:902:e8d6:b0:161:ea52:cd52 with SMTP id v22-20020a170902e8d600b00161ea52cd52mr1357551plg.71.1654118508279; Wed, 01 Jun 2022 14:21:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654118508; cv=none; d=google.com; s=arc-20160816; b=M4NMrEc633ZVAe4cp8H8k1o052lh8megQiwFh6F6dEx8pSgBqQAscFcDNYq4ynJpE9 TodD8ZppIEPuwcX2VYjb6HUzSYPhCPd+oCJHDvlUBXR557E8F9prucIjMhNH2gKfRBP1 F0tXobocBfqzdtLO4etp+B6SWmSskA7KMx6eS/qn7syJ1HLN4FKL6jM7UTiOVYQpEm8Q YEq9Xgr495WXcajWHGJYX4bbS7/GaeojwKN6i0rS2pXQXRw6rg7wGwW8Zd7AhJmzUViC uveoG0PhwBbAoF6FZEbkl9cfADONXcHTTR60vcNiqsZaDROQoT+0ozMgsw2cd54jGkU0 buxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=j2WptiZFrMPVKC6oFMmIy8W8fAs1p7FSZjkRo4TZHV0=; b=YHvUCDfupIYimC00NqXsD0XZSwlhgWjFRNshPWEos0/hFPAyfQRAQWb+b0l0wmK3XE PZ4aN/3JM45FJTFpjda0KsemUEtbkhm8X+slOyXpfe8dPQb/LykZfnzi3BPKHW5ZuxEq jeSJtSa2ISw/HL3hFwKCiLPZXxYdVphuoDSZdYnmcLZMXsgajJVJMcLDeDCa4Nd0oL86 P5Nbf67XZ0xVE/c+javfc9Aj/B1AYQnue2dD8Qy407ZKbe6I6ax6xnu9XT3J6nQrJkWj zxsNi5EDPcZtFDD5FKio2Jjdpku+VZHutiSQnTKCAG26IaAqe8hNc17T//ZpO6T7N2zP dbyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=AIVtraew; 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=quicinc.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id h11-20020a056a00218b00b005182fb67e66si3735733pfi.159.2022.06.01.14.21.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 14:21:48 -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=@quicinc.com header.s=qcdkim header.b=AIVtraew; 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=quicinc.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1AFE52F448A; Wed, 1 Jun 2022 13:12:17 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352605AbiFALTG (ORCPT + 99 others); Wed, 1 Jun 2022 07:19:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350587AbiFALTF (ORCPT ); Wed, 1 Jun 2022 07:19:05 -0400 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C0A3A76FA; Wed, 1 Jun 2022 04:19:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1654082343; x=1685618343; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=j2WptiZFrMPVKC6oFMmIy8W8fAs1p7FSZjkRo4TZHV0=; b=AIVtraew/9SX3q9818j9qKmyDg28YakAK5lNbC9tAJWoN1zI3HJtQT0N lrVvJfOcRqQRLUGPMXGXJDl0Tuo+ozEVEGYhD4MCXBHuVVTLYQScHpA4w vUJVHrCXP8OgVBzayHbKxvCPia48xDcEURlUUoYrpxMb15XLtJv7JHl3M g=; Received: from unknown (HELO ironmsg03-sd.qualcomm.com) ([10.53.140.143]) by alexa-out-sd-01.qualcomm.com with ESMTP; 01 Jun 2022 04:19:02 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg03-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2022 04:19:01 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 1 Jun 2022 04:19:01 -0700 Received: from [10.50.27.146] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 1 Jun 2022 04:18:55 -0700 Message-ID: Date: Wed, 1 Jun 2022 16:48:52 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH V13 7/9] regulator: Add a regulator driver for the PM8008 PMIC Content-Language: en-US To: Stephen Boyd , Bjorn Andersson , Rob Herring CC: Lee Jones , Liam Girdwood , Mark Brown , , , , , , 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: "Satya Priya Kakitapalli (Temp)" In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,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 On 6/1/2022 7:36 AM, Stephen Boyd wrote: > 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. Okay. If we are leaving it as is then, there is no need to add address in the table.