From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.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 7F73F397682 for ; Fri, 12 Jun 2026 20:26:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781296005; cv=none; b=RD4C3QYzIm5pyrU7Od71oPzV4Tz/kK7SzIWyylhENqhbjENMdYTjj+tvN2O8gE1wevsF9mLFdbeepUmqddR4zXdkDfpHeAMjCyAB9DxjuWVAfIEQlPpAVOBMCBGkT/VY/u+VByNRVoRZPIYytcLmvKAuHQNiHgWkQMB4BC1T+UA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781296005; c=relaxed/simple; bh=wE5Q9Xg7USSAMSy5zl2zGIA6YjNggw0brQRJdx3w5Fg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KDkd+sJ9r9hWjAmq6h2p7fZYhicp1/ECB2TUs4U08BVCYNagSIb/VvIgLlfWKY0zJj1x/aROJ9jURvUHoekIwb8XrQDtltxzk6eqNanRuErxc74hGBBu72qxISi33S/ZGRrLntU81iJA+EqbLjkPfjQv4iibeVy4RDyL+U+yML0= 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=cXtxy8fR; arc=none smtp.client-ip=209.85.221.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="cXtxy8fR" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-45eea68dd6fso817424f8f.2 for ; Fri, 12 Jun 2026 13:26:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781296001; x=1781900801; 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; bh=xcNf9P062CSvgzCfpV9k046WyE9GXOM/2prf3wJMe38=; b=cXtxy8fRBv3f4ERRPWedgijQZ32kx2zTOj9FmWIxgQpztXIrLjqg6KNWtNp9X+RBeZ uMlYH5DmB1++c2doCXwsxxgWBxUn3kPEPOswns8Nu5bwLN9XWf2HEk26a/lZej14TOng ZPc8qWUR+agbi6YFwtcPA3Fethu+0U6bXWqySi8zLbOZM/MoUGA/BLMkTtCf8nxNyD5j Wta1Hn63l1zNia+szarSppAzKOP8WpTVxhaH6nmkI8SURFdBUCqi3fJ23fDynKCD8ce1 Hu2G8ZyI8ad4L8NMzCo/qIzrn7y2OCs+iMvLJoae//AL/TDCOVlYjsS2Veghv6SHseNK gmwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781296001; x=1781900801; 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; bh=xcNf9P062CSvgzCfpV9k046WyE9GXOM/2prf3wJMe38=; b=AoOBZCoN4qbERZWepJcPdIXSJo21+wHSiIg9QrwitNI4ME/tgBEGzs5vB8HHjqPJmm b/V+h7Fg0F/LW7cvh82PjeB0ZD6Ys6SErfF6a2wnqovKsEk7kiuqeVgGUDPhBr7vBMTB 2Sp3FbJaDLmdiCOMAXL0tKeeuqgnjg60SZp3brnO455hYBv19priTrgF3wQoH4Zydd9P Jcoq9UHTTrzK6qsNeWW0xF2iltLP973Aq+Hhjq03B/mdGW7ARQfObbyH8XBZ1UEtN3U2 3md5gm0AYKwXm2LsFADhoyNdplARYT7ebDlfNw66jKOyH5E7WNbbplDXKeClvdNTjrXB lbOg== X-Forwarded-Encrypted: i=1; AFNElJ8cg06FR2UVPVfa47g67DF1xMW2IoLILgm71zW2LqiEFBNSFKTNd0OHpkGgaH1ay+DALWz+i8vtBrDV@vger.kernel.org X-Gm-Message-State: AOJu0YzCBnJKbegjm7FS+oTNgr0Zx7dN/5MWOcOA4RdWXnH9o+AbTb2d +dBKnDNarc5Uc6VTbSik2hT5F8PghTNdOeKn79MOW4SRXBIFeBhsUyRL X-Gm-Gg: Acq92OHm4vh3yTbltMKq9N5I5AhtA7rOblGa/Mx2WTS6Anf0Ok9usQzs31YYlcszhA7 hod/jEZ5sa05QYM5Wy4b9HFB001U90ZCjb68k3C+CHYbhdAV3M/33ZHB94xXhKHzNMeHhNFvelo UsCqNXWdidqTEBJAg9FtxjM3IEbAD4uIOxuAPYL/+eBLDpOfccYeA1dBV+71LH6ypmAz+nkLQSL aapsrQdVqGilpVBZQdSoaLyyQH6orC5RvVGi6chNzh1e50qtYLrnAmV1WguVYuL/g1WoIo8h53S K8bxa4zt/FwMgGN51M3Fd0CmezF95aWtzQckKiBfZi18+xb8nRxo7Olj37k50wTXHiU5RJ5qxH6 mrgQVJHvpmdiMzrn9g8sjBaltK7PUC+3o14OXpy+VpU45mpQRtkeyKUfs/aeLljVXDdzQ9msCag Fw0UG1IjA2LS2WyqDb X-Received: by 2002:a05:6000:4013:b0:45e:e3ea:1101 with SMTP id ffacd0b85a97d-4606da66ce1mr6381063f8f.17.1781296000837; Fri, 12 Jun 2026 13:26:40 -0700 (PDT) Received: from luca-vm.. ([81.56.18.151]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4606f26434dsm9173261f8f.1.2026.06.12.13.26.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jun 2026 13:26:40 -0700 (PDT) From: Luca Leonardo Scorcia To: linux-mediatek@lists.infradead.org Cc: Luca Leonardo Scorcia , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sen Chu , Sean Wang , Macpaul Lin , Lee Jones , Matthias Brugger , AngeloGioacchino Del Regno , Linus Walleij , Louis-Alexis Eyraud , Julien Massot , Val Packett , 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, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org Subject: [PATCH v6 3/7] mfd: mt6397: Use MFD_CELL_* to describe sub-devices Date: Fri, 12 Jun 2026 22:04:08 +0200 Message-ID: <20260612200717.361018-4-l.scorcia@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260612200717.361018-1-l.scorcia@gmail.com> References: <20260612200717.361018-1-l.scorcia@gmail.com> Precedence: bulk X-Mailing-List: linux-gpio@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 --- 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