Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp521540lqb; Wed, 17 Apr 2024 03:35:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUr3UtBFDsWDJvk9Dn4xz/zK68e91ftUDLYGJqEPVnoodbGHpzbG2Sw5fjI2OUIiQbkoX/+dc6QNEd8R7pkF9rajmRYEDwbrrBKlTZJOQ== X-Google-Smtp-Source: AGHT+IHpViIuBQxVDw7XvwsKpioi0kE/zPLbGJUmknQ0xjJhFd00G2mDlnQXQHeJFFOtcN2czf/B X-Received: by 2002:a50:d54f:0:b0:56d:fbea:40ae with SMTP id f15-20020a50d54f000000b0056dfbea40aemr10875207edj.23.1713350152347; Wed, 17 Apr 2024 03:35:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713350152; cv=pass; d=google.com; s=arc-20160816; b=Xecoh5crt9ekeTkNNSTDL6V2sI3S+iaNCedUXWA+d7xukuLvhmK1sbYIb8vxcfuFWw v7mvSr5kXi8uczgFvFvMbtcWGwWCMFMvwrpdgk6EurHj5svxwow2eeA9BDkUPZzpKeKn yUlGg391ZJizvYe0rZf/BdFebsErJVHId6T40LrWEAMiuADA5tF/jidMckw4bOtkou1E A+E3SKEn2ShvW2zz9UhwoH4Py4wslUN0IMJWLPqAfKj/w8b4cXo6ZIF2Nbp2n9+N2bHW LIC57tNjslLvJLm8aSBdOFUz8iZFZz1C0Xo9sF/m1ata/HMDCa/CL5l/aDg+aSxL5kd7 Qk+g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-signature; bh=usmsQESKrdy9x5H0XUVVERdm4BRybUQIwk+3KTih8B4=; fh=dI83eZeBlmjKb4/RUtPCbzqP8+eNJjjaU2tZLyN2D4k=; b=Bt6zzb9ZYxwZsJhJvdraawmJKGkpIg5t3wQdacvay3eNxgvhlM84KdOozkBL0Eq5vC /lYi8FRtYCuwKcInYp/g7ciR9XVWcQz3DjES+jV24Tn26+ZXbbuV+j3epx6zAbILWkHB 5S3vHzbpGpHwlWMb7xsepjo546TSIrVe1BWXy15oFZGDBSSvQ3RtRN86iObrRQUCxzKL oDDQFms4AmLXTx2vhoyOKkAUc2bCyCS82gDjbjaAJTOVY1A0ZhWezAjt/ryARB+wFxjb by/+5NgAM6tjAJ8b06Wnj1d4xsxna4gMRvcnMu9YMwEToI8MTr9R7lGC2gCoGnrHu7za 1Icg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ltts.com header.s=i3fe3efcd4pbz7ipgssfqjhzqx347xbc header.b=BI6QR0uj; dkim=pass header.i=@amazonses.com header.s=rlntogby6xsxlfnvyxwnvvhttakdsqto header.b=g1xXHKQ1; arc=pass (i=1 spf=pass spfdomain=ap-south-1.amazonses.com dkim=pass dkdomain=ltts.com dkim=pass dkdomain=amazonses.com dmarc=pass fromdomain=ltts.com); spf=pass (google.com: domain of linux-kernel+bounces-148331-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148331-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ltts.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id m14-20020a056402510e00b0056c3f718c8fsi6735973edd.340.2024.04.17.03.35.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 03:35:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-148331-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@ltts.com header.s=i3fe3efcd4pbz7ipgssfqjhzqx347xbc header.b=BI6QR0uj; dkim=pass header.i=@amazonses.com header.s=rlntogby6xsxlfnvyxwnvvhttakdsqto header.b=g1xXHKQ1; arc=pass (i=1 spf=pass spfdomain=ap-south-1.amazonses.com dkim=pass dkdomain=ltts.com dkim=pass dkdomain=amazonses.com dmarc=pass fromdomain=ltts.com); spf=pass (google.com: domain of linux-kernel+bounces-148331-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148331-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ltts.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 169DB1F21076 for ; Wed, 17 Apr 2024 10:35:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6BCCC13C66D; Wed, 17 Apr 2024 10:35:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ltts.com header.i=@ltts.com header.b="BI6QR0uj"; dkim=pass (1024-bit key) header.d=amazonses.com header.i=@amazonses.com header.b="g1xXHKQ1" Received: from c180-18.smtp-out.ap-south-1.amazonses.com (c180-18.smtp-out.ap-south-1.amazonses.com [76.223.180.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB81D80BE0; Wed, 17 Apr 2024 10:35:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=76.223.180.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713350144; cv=none; b=V9QFYReWWASkz44IZLISJyujeWZ2uw6KCZ5vk+mr5qdxRDjJsdT0eCnTMSYVv9ZDXmjCBFOd+W6BU/TXhqVyt4VB70Gp7dGZkzvXwyh9rCiUR4QAghh1gt4VakRTPctqJjQ+YkIh+7ePlBqbRfEowyHXqmvfWvuxdPECIpbXdew= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713350144; c=relaxed/simple; bh=MPA/yCGAeV9r3zQj7UZwA1/FORgOEaCJc7t+9vex2kY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cKubOoKu27fKs5r5z03jfRGBP6x+spsiHd4SzcxEoTT1GijJMePXEQXzswTOTHhxTGGZy3K/gZp7MvuovFNTSfLtuItVL7tTTOzch8Lyzq6TTY4QEVr3YdMptMiIWwLPviFAjKSaPYE9drjaiXKFAZ6w4051YZBVTHlnBL5KiqU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ltts.com; spf=pass smtp.mailfrom=ap-south-1.amazonses.com; dkim=pass (2048-bit key) header.d=ltts.com header.i=@ltts.com header.b=BI6QR0uj; dkim=pass (1024-bit key) header.d=amazonses.com header.i=@amazonses.com header.b=g1xXHKQ1; arc=none smtp.client-ip=76.223.180.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ltts.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ap-south-1.amazonses.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=i3fe3efcd4pbz7ipgssfqjhzqx347xbc; d=ltts.com; t=1713350138; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=MPA/yCGAeV9r3zQj7UZwA1/FORgOEaCJc7t+9vex2kY=; b=BI6QR0ujVVqAvr+8gEtHK+VZQxEiwpZB74n8cBP7ctcA8BW/qjQxmFEuFKEH2x3Q I0Nt1zPwyyxknt8rCtMnELyTNbWvtoDI9TGqVNoYcvgRR8S/eChyZ+yeflBIPdsade/ +XZJAUTgskd3kabFLEuqqoy7kbmFr+pkrYzCIJzm6cyAy/gEv9A/ZeGIDVIVG0sycEn rWE7QzD5gNFGkHEfrq4xdOV6kozY7wJreDAAJX4TXnKVCe/8RBLhIfv9XPDY6yr4GjB 0ytMfU6zRWPTvCTCrJPNiNQEDMg//qeIvx2yWOBWar/+cmVl7PScsiAw2BXicHr8NR3 WneEsE9eaA== DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=rlntogby6xsxlfnvyxwnvvhttakdsqto; d=amazonses.com; t=1713350138; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=MPA/yCGAeV9r3zQj7UZwA1/FORgOEaCJc7t+9vex2kY=; b=g1xXHKQ1vAtrtjihxlrA6d7AQPBE/IEEz3uez8vIIqiX+lONosMproEb/sYQTj4J g4A54PqyPxUEfMc4SXTht8W/+SDxg336Ys0boWR2kfpQIEfZ8qIknizraNbgthTKdvA 6SmKiOSgqM4mAFy0BNVh3+wDWRnCwCU7CRJMQXS0= From: Bhargav Raviprakash To: lee@kernel.org Cc: arnd@arndb.de, bhargav.r@ltts.com, broonie@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org, eblanc@baylibre.com, gregkh@linuxfoundation.org, jpanis@baylibre.com, kristo@kernel.org, krzysztof.kozlowski+dt@linaro.org, lgirdwood@gmail.com, linus.walleij@linaro.org, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, m.nirmaladevi@ltts.com, nm@ti.com, robh+dt@kernel.org, vigneshr@ti.com Subject: Re: [PATCH v6 03/11] mfd: tps6594: add regmap config in match data Date: Wed, 17 Apr 2024 10:35:38 +0000 Message-ID: <0109018eeba05ad9-f837b6c7-70cf-4a2a-9aeb-3ef245e18862-000000@ap-south-1.amazonses.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240411170344.GK2399047@google.com> References: <20240411170344.GK2399047@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Feedback-ID: 1.ap-south-1./RC/PI2M8xOxQmTMPi0M1Q8h2FX69egpT62QKSaMPIA=:AmazonSES X-SES-Outgoing: 2024.04.17-76.223.180.18 Hello, On Tue, 16 Apr 2024 13:25:04 +0100, Lee Jones wrote: > > Hello, > > > > On Wed, 14 Feb 2024 10:10:17 -0800, Lee Jones wrote: > > > On Mon, 08 Apr 2024, Bhargav Raviprakash wrote: > > > > > > > Introduces a new struct tps6594_match_data. This struct holds fields for > > > > chip id and regmap config. Using this struct in of_device_id data field. > > > > This helps in adding support for TPS65224 PMIC. > > > > > > > > Signed-off-by: Bhargav Raviprakash > > > > Acked-by: Julien Panis > > > > --- > > > > drivers/mfd/tps6594-i2c.c | 24 ++++++++++++++++-------- > > > > drivers/mfd/tps6594-spi.c | 24 ++++++++++++++++-------- > > > > include/linux/mfd/tps6594.h | 11 +++++++++++ > > > > 3 files changed, 43 insertions(+), 16 deletions(-) > > > > > > > > diff --git a/drivers/mfd/tps6594-i2c.c b/drivers/mfd/tps6594-i2c.c > > > > index c125b474b..9e2ed48b7 100644 > > > > --- a/drivers/mfd/tps6594-i2c.c > > > > +++ b/drivers/mfd/tps6594-i2c.c > > > > @@ -192,10 +192,16 @@ static const struct regmap_config tps6594_i2c_regmap_config = { > > > > .write = tps6594_i2c_write, > > > > }; > > > > > > > > +static const struct tps6594_match_data match_data[] = { > > > > + [TPS6594] = {TPS6594, &tps6594_i2c_regmap_config}, > > > > + [TPS6593] = {TPS6593, &tps6594_i2c_regmap_config}, > > > > + [LP8764] = {LP8764, &tps6594_i2c_regmap_config}, > > > > > > Nit: There should be spaces after the '{' and before the '}'. > > > > > > > Sure! will fix it in the next version. > > > > > > +}; > > > > + > > > > static const struct of_device_id tps6594_i2c_of_match_table[] = { > > > > - { .compatible = "ti,tps6594-q1", .data = (void *)TPS6594, }, > > > > - { .compatible = "ti,tps6593-q1", .data = (void *)TPS6593, }, > > > > - { .compatible = "ti,lp8764-q1", .data = (void *)LP8764, }, > > > > + { .compatible = "ti,tps6594-q1", .data = &match_data[TPS6594], }, > > > > + { .compatible = "ti,tps6593-q1", .data = &match_data[TPS6593], }, > > > > + { .compatible = "ti,lp8764-q1", .data = &match_data[LP8764], }, > > > > > > Not keen on this. Why do you pass the regmap data through here and > > > leave everything else to be matched on device ID? It would be better to > > > keep passing the device ID through and match everything off of that. > > > > > > > > > -- > > > Lee Jones [李琼斯] > > > > Thanks for the feedback! > > > > These changes were made because of the following message: > > https://lore.kernel.org/all/7hcysy6ho6.fsf@baylibre.com/ > > > > Please let us know which one to follow. > > Right, except this doesn't eliminate "any \"if (chip_id)\" checking". > Instead you have a hodge-podge of passing a little bit of (Regmap) data > via match and the rest via "if (chip_id)". So either pass all platform > type data via .data or just the chip ID. My suggestion 99% of the time > is the latter. Got it. Thanks! Will revert back to .data having chip_id. Regards, Bhargav