From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0399643F09C for ; Thu, 20 Aug 2026 12:26:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787228790; cv=none; b=rigRzld7SupHSHawtRFwLwMK+rRV0MBOpmP2W4DonQq4dey/ziPGtWodyN1ZlCwV7sOWAtLHICsW0SU1oFyQdj2vtafwqX+31iEu3ShcmYffDqr5fDbvd83oUszwUS4YLQtjYLWW/hHng9/uZijmvAh0nidco5DMxCK9a1FIHkA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787228790; c=relaxed/simple; bh=EIT7q6rGKbRYBsjvY4Hni82qKnXpt7oUOt261Pme79U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Q/dz5yLQr/lrPmP31izBDqxJesOjkNQMU+AGIBr9malSeEly1/oZrW8KiNVS/poNQNX9MIk+GXn42rAwP0vNshC2rPsTWZhq7BokZh6SzFmPwUx6DvP2dF5CD7wEJJvM3cBFWmTHBC3bximgWUd2zJmO+2jCQT/AIBaCITMdmo4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=N75dO9qe; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="N75dO9qe" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4980dc26022so22286825e9.1 for ; Thu, 20 Aug 2026 05:26:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787228786; x=1787833586; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=uKRxZy2kSNN7s+copbhEGB2/08qX7fHBu0PpcU+cI4Y=; b=N75dO9qeZ7wMWYbztUzl77T6ncgpfUEUTaKomqkNCZuDM7VNJ1fI3Vi67vNU/cYhMt 5uSaVMOsqRy8JlzVbfRkgAyTWaV35RTBV313JoFoUiCsJ98d1sUGvlzY0sVag4evkGFi dJKEe3JlKM1c55m+9fkdGp75dDHg5N3zSK4CI8M9U6EY6DBa+p0outH9RIUwjAINdHZB qUkR9WQRsJ5rzXgmPgezrS49hxZL7LYoSIRcnPV+qbQn8j4lMXgVrgNpG4peBn3Q0hz5 cB0xwXgVnpYdqj+/Zn3tzfvfWrbMWXLaIsD/auxmUQ3F8bqVVZd7Fs7BLOgUIg/JwnY8 Cp4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787228786; x=1787833586; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=uKRxZy2kSNN7s+copbhEGB2/08qX7fHBu0PpcU+cI4Y=; b=CS/oCktBTzISbSh05CV9SusiAdAxEZneFK7Osscm/CyVkOeIygNl14b6s/rTizR9mG xt/Oerl4u5w5msCfNsvRZmoUw1UZvWSt9rPTBHT8X77+fzAGeLm6kUM/tFuTime7viek u2IABzpoHSwAQRQ9hyZu/6MFOyLGGOAuAq8k2QPRyPfjlTO9qRilYMU99iQ493aTxvkZ CgbU5MQMKm/6A/VtxD16PjwwgDoqMoetULcrCsXIZ/imb7zO4FWICo90hV3LdIGp/FQb u6TVXzxgMtXTu2Zk8u9586EwODqlgeJ1ppAw312eFosSV3nJm4No4gmCdZ0y0io3zmZv ELXQ== X-Forwarded-Encrypted: i=1; AHgh+Rp4ZFZm6NLUakjI1W/EZdMfDb5Au0AGbXEHZ6Uzuh1mbUvB0TDkIJanVsyJZw+1f02JEL4HYp2JB75nBzE=@vger.kernel.org X-Gm-Message-State: AOJu0YzIhPKcgImbbL3FjhzWG5TS68AF8UgmsyrGCxVRNJDYIa3kfHSs 1FD/7gRfOHCT4ngU5AHLLag7TjQdg3bR9LB4ax/bPrMTvtspIJ/E3B/t X-Gm-Gg: AR+sD12JTS+Uif1+vZYrrpjUrwYXoE/C497tsU02dZPYZV5/6XRALJajr9gOCrkrFGM /BlR5s4iAc8NM2dG3hV8Wp0Oztann0NT5xzhnjTZzux730iLVem8aq/EsyCJ0sOQnq2CaTCJafX L+Js9Ihko2jO6u0fLXtx92z25Ttk/UGui2HPY3IchHCqSaPPoh22EndIEPHEezqwdGKOOtmFYnO CEjD4HinmS8Zg7KZURJqPAVVq3H96uHwsXhEy4sDjp28KCeGbSBM1mfBPrn3/OeiZBl8vLl04M9 THxR9dXCSFaQCh0jJGJQSOSa0vGRTWiH6yUErbVV3OVV8n3IC/JHglYGPP6L2Nu/N5hIjAyFtmI 2iYxDxbEJnSzls0qjuC16/RFSHV5Tlq2oOkFguZ6rLn3nTsgptFb4Ck1m7I6bBmC/i1dBlUc2jA mVG8wQb6BaIO/qZklRbhVEjBqzm3ZyGja4sgf2l6pcIjc+4FPwI8TkJw== X-Received: by 2002:a05:600c:4e8e:b0:493:aa0a:45ad with SMTP id 5b1f17b1804b1-499aa17dd15mr187045085e9.2.1787228786074; Thu, 20 Aug 2026 05:26:26 -0700 (PDT) Received: from luca-vm.. ([81.56.18.151]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-499ab2a8b34sm170494645e9.8.2026.08.20.05.26.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Aug 2026 05:26:25 -0700 (PDT) From: Luca Leonardo Scorcia To: linux-mediatek@lists.infradead.org Cc: Luca Leonardo Scorcia , AngeloGioacchino Del Regno , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sen Chu , Sean Wang , Macpaul Lin , Lee Jones , Matthias Brugger , Liam Girdwood , Mark Brown , Linus Walleij , Val Packett , Julien Massot , Fabien Parent , Akari Tsuyukusa , Chen Zhong , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, mfd@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org Subject: [PATCH v9 4/9] mfd: mt6397: Use MFD_CELL_* to describe sub-devices Date: Thu, 20 Aug 2026 14:20:02 +0200 Message-ID: <20260820122242.120039-5-l.scorcia@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260820122242.120039-1-l.scorcia@gmail.com> References: <20260820122242.120039-1-l.scorcia@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Use the MFD_CELL_* macros to describe sub-devices. No functional changes. Signed-off-by: Luca Leonardo Scorcia Reviewed-by: AngeloGioacchino Del Regno --- drivers/mfd/mt6397-core.c | 197 ++++++++++++-------------------------- 1 file changed, 63 insertions(+), 134 deletions(-) diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c index 1bdacda9a933..ccd97d66d7f1 100644 --- a/drivers/mfd/mt6397-core.c +++ b/drivers/mfd/mt6397-core.c @@ -124,159 +124,88 @@ static const struct resource mt6323_pwrc_resources[] = { }; static const struct mfd_cell mt6323_devs[] = { - { - .name = "mt6323-rtc", - .num_resources = ARRAY_SIZE(mt6323_rtc_resources), - .resources = mt6323_rtc_resources, - .of_compatible = "mediatek,mt6323-rtc", - }, { - .name = "mt6323-regulator", - .of_compatible = "mediatek,mt6323-regulator" - }, { - .name = "mt6323-led", - .of_compatible = "mediatek,mt6323-led" - }, { - .name = "mt6323-keys", - .num_resources = ARRAY_SIZE(mt6323_keys_resources), - .resources = mt6323_keys_resources, - .of_compatible = "mediatek,mt6323-keys" - }, { - .name = "mt6323-pwrc", - .num_resources = ARRAY_SIZE(mt6323_pwrc_resources), - .resources = mt6323_pwrc_resources, - .of_compatible = "mediatek,mt6323-pwrc" - }, + MFD_CELL_OF("mt6323-rtc", mt6323_rtc_resources, NULL, 0, 0, + "mediatek,mt6323-rtc"), + MFD_CELL_OF("mt6323-regulator", NULL, NULL, 0, 0, + "mediatek,mt6323-regulator"), + MFD_CELL_OF("mt6323-led", NULL, NULL, 0, 0, + "mediatek,mt6323-led"), + MFD_CELL_OF("mt6323-keys", mt6323_keys_resources, NULL, 0, 0, + "mediatek,mt6323-keys"), + MFD_CELL_OF("mt6323-pwrc", mt6323_pwrc_resources, NULL, 0, 0, + "mediatek,mt6323-pwrc"), }; static const struct mfd_cell mt6328_devs[] = { - { - .name = "mt6328-regulator", - .of_compatible = "mediatek,mt6328-regulator" - }, { - .name = "mt6328-keys", - .num_resources = ARRAY_SIZE(mt6328_keys_resources), - .resources = mt6328_keys_resources, - .of_compatible = "mediatek,mt6328-keys" - }, + MFD_CELL_OF("mt6328-regulator", NULL, NULL, 0, 0, + "mediatek,mt6328-regulator"), + MFD_CELL_OF("mt6328-keys", mt6328_keys_resources, NULL, 0, 0, + "mediatek,mt6328-keys"), }; static const struct mfd_cell mt6357_devs[] = { - { - .name = "mt6359-auxadc", - .of_compatible = "mediatek,mt6357-auxadc" - }, { - .name = "mt6357-regulator", - }, { - .name = "mt6357-rtc", - .num_resources = ARRAY_SIZE(mt6357_rtc_resources), - .resources = mt6357_rtc_resources, - .of_compatible = "mediatek,mt6357-rtc", - }, { - .name = "mt6357-sound", - .of_compatible = "mediatek,mt6357-sound" - }, { - .name = "mt6357-keys", - .num_resources = ARRAY_SIZE(mt6357_keys_resources), - .resources = mt6357_keys_resources, - .of_compatible = "mediatek,mt6357-keys" - }, + MFD_CELL_OF("mt6359-auxadc", NULL, NULL, 0, 0, + "mediatek,mt6357-auxadc"), + MFD_CELL_NAME("mt6357-regulator"), + MFD_CELL_OF("mt6357-rtc", mt6357_rtc_resources, NULL, 0, 0, + "mediatek,mt6357-rtc"), + MFD_CELL_OF("mt6357-sound", NULL, NULL, 0, 0, + "mediatek,mt6357-sound"), + MFD_CELL_OF("mt6357-keys", mt6357_keys_resources, NULL, 0, 0, + "mediatek,mt6357-keys"), }; /* MT6331 is always used in combination with MT6332 */ static const struct mfd_cell mt6331_mt6332_devs[] = { - { - .name = "mt6331-rtc", - .num_resources = ARRAY_SIZE(mt6331_rtc_resources), - .resources = mt6331_rtc_resources, - .of_compatible = "mediatek,mt6331-rtc", - }, { - .name = "mt6331-regulator", - .of_compatible = "mediatek,mt6331-regulator" - }, { - .name = "mt6332-regulator", - .of_compatible = "mediatek,mt6332-regulator" - }, { - .name = "mt6331-keys", - .num_resources = ARRAY_SIZE(mt6331_keys_resources), - .resources = mt6331_keys_resources, - .of_compatible = "mediatek,mt6331-keys" - }, + MFD_CELL_OF("mt6331-rtc", mt6331_rtc_resources, NULL, 0, 0, + "mediatek,mt6331-rtc"), + MFD_CELL_OF("mt6331-regulator", NULL, NULL, 0, 0, + "mediatek,mt6331-regulator"), + MFD_CELL_OF("mt6332-regulator", NULL, NULL, 0, 0, + "mediatek,mt6332-regulator"), + MFD_CELL_OF("mt6331-keys", mt6331_keys_resources, NULL, 0, 0, + "mediatek,mt6331-keys"), }; static const struct mfd_cell mt6358_devs[] = { - { - .name = "mt6359-auxadc", - .of_compatible = "mediatek,mt6358-auxadc" - }, { - .name = "mt6358-regulator", - .of_compatible = "mediatek,mt6358-regulator" - }, { - .name = "mt6358-rtc", - .num_resources = ARRAY_SIZE(mt6358_rtc_resources), - .resources = mt6358_rtc_resources, - .of_compatible = "mediatek,mt6358-rtc", - }, { - .name = "mt6358-sound", - .of_compatible = "mediatek,mt6358-sound" - }, { - .name = "mt6358-keys", - .num_resources = ARRAY_SIZE(mt6358_keys_resources), - .resources = mt6358_keys_resources, - .of_compatible = "mediatek,mt6358-keys" - }, + MFD_CELL_OF("mt6359-auxadc", NULL, NULL, 0, 0, + "mediatek,mt6358-auxadc"), + MFD_CELL_OF("mt6358-regulator", NULL, NULL, 0, 0, + "mediatek,mt6358-regulator"), + MFD_CELL_OF("mt6358-rtc", mt6358_rtc_resources, NULL, 0, 0, + "mediatek,mt6358-rtc"), + MFD_CELL_OF("mt6358-sound", NULL, NULL, 0, 0, + "mediatek,mt6358-sound"), + MFD_CELL_OF("mt6358-keys", mt6358_keys_resources, NULL, 0, 0, + "mediatek,mt6358-keys"), }; static const struct mfd_cell mt6359_devs[] = { - { - .name = "mt6359-auxadc", - .of_compatible = "mediatek,mt6359-auxadc" - }, - { .name = "mt6359-regulator", }, - { - .name = "mt6359-rtc", - .num_resources = ARRAY_SIZE(mt6358_rtc_resources), - .resources = mt6358_rtc_resources, - .of_compatible = "mediatek,mt6358-rtc", - }, - { .name = "mt6359-sound", }, - { - .name = "mt6359-keys", - .num_resources = ARRAY_SIZE(mt6359_keys_resources), - .resources = mt6359_keys_resources, - .of_compatible = "mediatek,mt6359-keys" - }, - { - .name = "mt6359-accdet", - .of_compatible = "mediatek,mt6359-accdet", - .num_resources = ARRAY_SIZE(mt6359_accdet_resources), - .resources = mt6359_accdet_resources, - }, + MFD_CELL_OF("mt6359-auxadc", NULL, NULL, 0, 0, + "mediatek,mt6359-auxadc"), + MFD_CELL_NAME("mt6359-regulator"), + MFD_CELL_OF("mt6359-rtc", mt6358_rtc_resources, NULL, 0, 0, + "mediatek,mt6358-rtc"), + MFD_CELL_NAME("mt6359-sound"), + MFD_CELL_OF("mt6359-keys", mt6359_keys_resources, NULL, 0, 0, + "mediatek,mt6359-keys"), + MFD_CELL_OF("mt6359-accdet", mt6359_accdet_resources, NULL, 0, 0, + "mediatek,mt6359-accdet"), }; static const struct mfd_cell mt6397_devs[] = { - { - .name = "mt6397-rtc", - .num_resources = ARRAY_SIZE(mt6397_rtc_resources), - .resources = mt6397_rtc_resources, - .of_compatible = "mediatek,mt6397-rtc", - }, { - .name = "mt6397-regulator", - .of_compatible = "mediatek,mt6397-regulator", - }, { - .name = "mt6397-codec", - .of_compatible = "mediatek,mt6397-codec", - }, { - .name = "mt6397-clk", - .of_compatible = "mediatek,mt6397-clk", - }, { - .name = "mt6397-pinctrl", - .of_compatible = "mediatek,mt6397-pinctrl", - }, { - .name = "mt6397-keys", - .num_resources = ARRAY_SIZE(mt6397_keys_resources), - .resources = mt6397_keys_resources, - .of_compatible = "mediatek,mt6397-keys" - } + MFD_CELL_OF("mt6397-rtc", mt6397_rtc_resources, NULL, 0, 0, + "mediatek,mt6397-rtc"), + MFD_CELL_OF("mt6397-regulator", NULL, NULL, 0, 0, + "mediatek,mt6397-regulator"), + MFD_CELL_OF("mt6397-codec", NULL, NULL, 0, 0, + "mediatek,mt6397-codec"), + MFD_CELL_OF("mt6397-clk", NULL, NULL, 0, 0, + "mediatek,mt6397-clk"), + MFD_CELL_OF("mt6397-pinctrl", NULL, NULL, 0, 0, + "mediatek,mt6397-pinctrl"), + MFD_CELL_OF("mt6397-keys", mt6397_keys_resources, NULL, 0, 0, + "mediatek,mt6397-keys"), }; struct chip_data { -- 2.43.0