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 760A4282F0A for ; Sat, 20 Jun 2026 20:01:45 +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=1781985707; cv=none; b=IX4Cd8xBQWgjwM3oQ1o2WYvQn5w8XGRnOrOqnOERRLc0snwL5OwLuRvBfm162JA/tqguYgb95etlQHuDWf+CMxxO+sbDa1o5y3CHaxlSUBoA3OcxuBf3QhrooYzBOW7hoUFq1dQPkYAzhR8vIvs2kXnJOWjQxSftul9vE9K/xtI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781985707; c=relaxed/simple; bh=wE5Q9Xg7USSAMSy5zl2zGIA6YjNggw0brQRJdx3w5Fg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OMauIUQPmrzk9qfD7VSJHvh9oobvBzoWfj/r9vHK8cPG/H7fBgkJdkIgH92BQd8s8EWquWQlBNDepSVxkKeg0+xNdHtPq+uW6Wrwkr6Xp9UV7tIYRm2yoRnNHCNMfu3K72KYeIxd1b8v+isXAMbyQX2rQ/3UI36wZQ4L1BqFFKc= 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=rY3l9fcY; 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="rY3l9fcY" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-46255b269c2so2342061f8f.3 for ; Sat, 20 Jun 2026 13:01:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781985704; x=1782590504; 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=rY3l9fcYsorsiLDdn3cuAf33+I8iVK4uMTw0d0uSMVKNEpAh6YkIKtKdLb8QIdgFDy CvREIwuMCUYImIHecCzIYq2+imvaCoWxcSC/jtNMtZdPyylaBVLamXDe23Wnsifq4R5J pxf0nH5FPUcFmJFWjP3Ks2HpYhGnjGwV0ShrQsYANpa97BCvth7idqcCV2ftQcY4OyaC LX58vNIJAvI4Lef21yxlRaM6G+8psxQMaWLqbc+QNoTVI0U/egp0cyR3l5uX2f8XJZP7 pHnnHaNsrgN2AkDgEHlrQsX7liH58R+N6vVDdqXFoCbwIprSppMtLDQ8ha+Hj7ZNNIzH YE3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781985704; x=1782590504; 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=f6PL44jeT7YgIaVVQbE5H0NxqKwVYh+g/dxq04+oIIbGxYuOtwpartkgbiUWew1gCg 24BwnK7zz7hpigKA2+xT5N76Dy5RPye2xTUkBdKPpROctx8QmOhst51VTYpx2/V4o6Q3 sM2yFTWF5MpMlAwQclgVC2q553oKCz5p3ixZHEPhdy9n+ZsXIc+NSna1GN0QklbYRfM7 a/d4QI0OV4BdGOMQFxMFcZC7YKYNV2OEyr2zPVTN3LxLh7g9KywVrF4fWijbZ3NoImIH XX36SJvX3r/iopUIlYjKnETCLeNOX3NahMAMjs2ZtyYyXEwt7r5k1GFstgvXnSmYyP6U QAmw== X-Forwarded-Encrypted: i=1; AFNElJ+r+qXOaJaN5Xhr5HBvrZIRFHtMO55pROBYRTpaN3HPjrcyGW/59IiHWNfSqENkf30A6xUtUfAcyQ==@vger.kernel.org X-Gm-Message-State: AOJu0YxD/paS+SLwL6o8BmOhI0OqMYM4FmrqAD9OpmwlMjBAAIJMTvQq FHSvgvrjjvJb7bDEy2y8b8gYSoRg3xDXyyDtctdAu7ZRkym6cMeV+TJ4 X-Gm-Gg: AfdE7cl7MUSvvcUUEE234QkTlQfHlzOPFPaBA4wTs8N6n9tqQEj2Qzy/z02LCaCU/Sx hv//IP1mkUmszjCvYvUl5sqhdDDRfrxZqVyNeAWGNswT/cSAUW0+64kPDN49rQQfUrlfDwPAueb +U/k863clL6LFGWNFm3LjJzClHWOn/mQGzE5E0d8vFevdIXx/XEyJfYW6ewHka+mEv4Mmczd485 n2Odg2XkhVUpfc6crMwKGVmslQLOLjMVW2/FwREnqoNFFcSRnaCfvSdzSOR+/iIR0Fto7jhlOsL xXC8FXJDKlyLLqcExxIhrlH+gqIV05Tme/Pz4mUn2IYrgd+1L4F2Kz2Y+q2xiko5Sdluqdmfp3l gu8JLB+dFYBDNbNgJKFitv/5zQmzZnQHCoZpW72c9iKNG6tpf3mA51cIHc7VsBC/LkGcFucrHs5 8L6/QYNQ== X-Received: by 2002:a05:600c:5494:b0:485:9a50:3370 with SMTP id 5b1f17b1804b1-4923ef53be4mr140375125e9.8.1781985703708; Sat, 20 Jun 2026 13:01:43 -0700 (PDT) Received: from luca-vm.. ([81.56.18.151]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-46666788226sm10708354f8f.23.2026.06.20.13.01.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Jun 2026 13:01:42 -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 , Liam Girdwood , Mark Brown , Linus Walleij , Julien Massot , Val Packett , Louis-Alexis Eyraud , 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 v8 4/9] mfd: mt6397: Use MFD_CELL_* to describe sub-devices Date: Sat, 20 Jun 2026 21:56:50 +0200 Message-ID: <20260620200032.334192-5-l.scorcia@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260620200032.334192-1-l.scorcia@gmail.com> References: <20260620200032.334192-1-l.scorcia@gmail.com> Precedence: bulk X-Mailing-List: linux-pm@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