Received: by 2002:ab2:7988:0:b0:1f4:b336:87c4 with SMTP id g8csp108520lqj; Thu, 11 Apr 2024 11:09:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVaIWSsaWbVbBD6BnmTRicTjlOy+cTcdZU7Dl74BTsPoukbpzlQYPyLiPrYstYj0iNwjqdI9/jrWWUnNfzcqb5OBUIOFoFbXYVOWHhsmQ== X-Google-Smtp-Source: AGHT+IGSU4ZXRHf9vCtFywwG1lXpG2hA5TstQoCktabNRtWs7e7XYbcD011JgbS/1TbXt6PBKMPO X-Received: by 2002:a50:cc94:0:b0:56e:2d93:3f7f with SMTP id q20-20020a50cc94000000b0056e2d933f7fmr474704edi.39.1712858997621; Thu, 11 Apr 2024 11:09:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712858997; cv=pass; d=google.com; s=arc-20160816; b=n8P8B/QnHGMf+i0GbqWn2i1ATIKPHTH5k7voh+HTl1hbkRB6FdDiiDayuEvaSD3PJC FZn5peqK9XEybwrIgLWdTwbKA2n8ADo/2c6P078WFI1DDUYPdmIu9UBl+fQx9IyVplYw Uf/u+tjOB5TdW/dkTGeHGNsPE9a/I96lVaqG7jfdgCSijjs8RDqkEHn0C5W+1LbBBx8s VcSc3jQih6hFgMrgS5m8cWar0Sh+Q7GNBHcCxxi5qL7JN6zt6z/Sx8WQT/0VhKPxgrq8 3E2TLQEB8lInXZoC36MyyA1lLcEP4JI9ei4xE16bgyGU5a9FMLj/M1YhiegNXt+2BO41 X8TQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=cEuyOZ/+5gI2ojI9fkFwanAj23x0qULifp46lARiR+A=; fh=NpB1cigfGn1oO/TOmiuB6T5Q1I2XIDRIbElFqm4bJ1U=; b=a9yuRcrziobJX+YyiLChrBL2BWbxlGD6L5gtTReIGwkEFfT9AqNjLqa4W21Yeq9cRT Vm6hRb6GpII8/ZqJILr8XhymoOi++CRX7t4dS8hLSPx8HpaIzUc8i8NOzgk9ikvW1hUA k4PdkVTrpdYZXoVkf8CQ39GZJ31EFHPrlFJ2Qlb6awBeqPs2zVrbPuRMvu0QghF5bLU8 FJTJtU1M6AOynyqc5VI2rTUBlUjlLai6OGccdxK+ggapkI1rUATOfMZn1xmXGc2Rz4y6 4+y4/IF0W4KIE3t7rv2FLebEpoCa4pAPXgvlNiDnXO0uS73j+JOabfySc0LDhdzEQ5m1 y5NQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="P5iM75U/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-141372-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141372-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id v8-20020a50a448000000b0056fea10e6casi764645edb.449.2024.04.11.11.09.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 11:09:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-141372-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="P5iM75U/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-141372-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141372-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 5CFDC1F21839 for ; Thu, 11 Apr 2024 18:09:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AB9B11D637C; Thu, 11 Apr 2024 17:03:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="P5iM75U/" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE0771D42B0; Thu, 11 Apr 2024 17:03:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712855031; cv=none; b=a3MGateQUzF5OqDeIFJTo1WfbuXd12UWadkk4dbcHpfy92wrRaiW/2kz6n9PQghg1Pj0MH1uUzoPIffu2LlQoyDR/mdZBk11fh2qPVYcXkUpZ7SBXmZvcBjuaa8NYElSZ2fa79QU3uWTEwRpm62I8sizLzjwZK+7hfsu3XBuxBM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712855031; c=relaxed/simple; bh=lPpn/1lYAEX/RQWD3CCHP7J3qXj3FuqzX1qZWbKaxOg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iGT3btVJNOqc70s2iyC3yLD3pakyUxUgZAnuDFspaqTk3lPuPgYgQzlaUvzjaWVyOGB0p1EXgfCHwJM5oY++wVLrd3r/8H5uu0hl5Mz116goASDeVQv9rIw8zhTMyGPWdUvOu9MeoBdGaPCJdMNYevVUqm9Vlxe7YVGgtJSd71E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=P5iM75U/; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0F8DC072AA; Thu, 11 Apr 2024 17:03:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712855031; bh=lPpn/1lYAEX/RQWD3CCHP7J3qXj3FuqzX1qZWbKaxOg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=P5iM75U/t7PYTCi8TtGpwLMD5ieVL5+YT9KZ46/LNzwwR/aSgh9Ar/RljmXmBIbRx QJF+cxKGcEZ8+6XvtS9lVsF0mWec4sC/zIzwY+Jp/UqoM7wDe1UTckiN/i0xCnd53F nwEpmQwFloWIRagKAy82womP1csk32tyu3WZ+EhQ3csrBQxD1JkN8ACQUuYCRMWx8T LOdUXHGCT9RH68HLn74m5fmPCuciByXi0Iu+3CczesHPrFrHNn9j2OB5NZ7L/586hO kfZsNw1fVw99FffvbS9aVrCE8fQtHnDo+c8/yHBApzPtpCB4ltNXG0xf9WhYs5w9eS d7oOYz+1dsWsQ== Date: Thu, 11 Apr 2024 18:03:44 +0100 From: Lee Jones To: Bhargav Raviprakash Cc: linux-kernel@vger.kernel.org, m.nirmaladevi@ltts.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, jpanis@baylibre.com, devicetree@vger.kernel.org, arnd@arndb.de, gregkh@linuxfoundation.org, lgirdwood@gmail.com, broonie@kernel.org, linus.walleij@linaro.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, nm@ti.com, vigneshr@ti.com, kristo@kernel.org, eblanc@baylibre.com Subject: Re: [PATCH v6 03/11] mfd: tps6594: add regmap config in match data Message-ID: <20240411170344.GK2399047@google.com> References: <20240408124047.191895-1-bhargav.r@ltts.com> <20240408124047.191895-4-bhargav.r@ltts.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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240408124047.191895-4-bhargav.r@ltts.com> 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 '}'. > +}; > + > 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 [李琼斯]