From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.49 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792517847; b=CXzkBDOHpNKRcxXejFvpuWhR6XLmr0VKkhT4uyiJqnogEuhyrFO46E2fd6dGfnKG5eG1 19VvyuC4kcISTpPLKtE9L6JH30fgui/OfjDS7PojMXIc4m/6FO/cZrZUuNi4RSh11sAyj r9E7aoLJI1Gjv3Xrcq/qThzS9wV06a+CKTJSJduRhTZ5ZWmKyZBUdFhkHYdHwsaYgnz6h avFE0FHqM3lfHDZuNLUz/QvD1juYztHIhVJQ4vRdFiQHD3wItfARRCBr3YZLTz01lMcac GS6D2GpiEFVg15/Qngwob9uIjdH929HjpEEStrRF6tzNBLTxjlLzdBdgZ23+xQ6jngg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792517847; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=khjjDBK0J2xOtnMH1muymGK2fwTqPXy0k/z60K/0+xY=; b=wsr33l1VJCBU3t1bs/cPCB4aGlBezcMPierr9idPPYBpYWUZ08tr4uoP/YnConzFLSDY MaFnQXYqJP/7ueRzGqqnHjm/9II6Ffsr/nVlc6aVeRbEhnDYL6Hmlrgfw6BrY2Prd/6Vj Ehj4fCRGJxyUyTVcis2T+pEABLO/j8kibg4T/oPG+/syiB+0sJuJNmPrnaoIFL8nfxjaV 3/exv1r2ItRyvW+ibNV3vVASd5JLC0gjwG+Y95mS8/4Q35Snm2G8lGREMCgWdlPiKGzMx 3HDnc9TReYYdsYfQ+RtXkltpmVSgwdF5GQk7yRUWDiQEYbjceyW3PG9XJ2oFGb+hBtg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=izFxMg2B; arc=none smtp.remote-ip=209.85.128.49 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 17E35606A329 for ; Tue, 20 Oct 2026 17:37:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 17E35606A329 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, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=izFxMg2B Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4a1dfd49525so22776125e9.0 for ; Tue, 20 Oct 2026 10:37:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1792517845; x=1793122645; 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=khjjDBK0J2xOtnMH1muymGK2fwTqPXy0k/z60K/0+xY=; b=izFxMg2B2XO2JkZDfcRB4TTlaDp/uiTNWBhiLPKzLei5PlxZZV1t0TIJWAsH2spM/j JHfwecKkFcVjgb8vxgalah7s2TnwsreeIDS3MZLksAoyrymukpOKuID/lfxfkAsVtXol ueEm/r2NU1jZD9oDPPGV6nrjIMtNs1wfkKToqHjoPko8BXO1+KSRmhGeXa3zjFFx/eYn KcmxuwbmDvFllNK8f+pFGbLjNmUBxJTOTW3fK9B3PHJViggEXOIjjqy5G/9aQEat6S8F ARG2azyWDZd+Ku85bFUmn7DdD4BmA4eUmE6oHYo9GTkUjvYI17zIxMI/fM6UpqaPY9p9 8xgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792517845; x=1793122645; 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=khjjDBK0J2xOtnMH1muymGK2fwTqPXy0k/z60K/0+xY=; b=szVnbpTmqqi5juvoOczG5UpSN9YegRgChCjo3NH1k4CJ4MlqgQbOP/BlYHP1F0m8rK iI6D90cwkKMukBEhUhskeMXSj+1ndPWuylt7ffOfNlW2nlFyg9fKdsOmHI/Uz08pIrX8 XOJ5vnM8L7HDtkGtL2nHrihAInpaGuJqMgpGbiNh6WU63/2H9EPvERnB3GaRba/bCffH BXhFPl4KZ8sIg2uv77Ngu91r+RZVHtWvk/hJTkEcCLSK31Tl8I+76Wd5WNbKpaz/HFKT e1U+3i7yE2viH1Bl1bYIL6JUGvjbOMlzWjAvve/Kx3gLh9DZm+JhgeGKF7aDjWhU6nLv s8Lw== X-Forwarded-Encrypted: i=1; AKwUvBxS4wDInQzAPRUfdZeqNn2GqxZ6DT9lgHfgrsli3bfyoydfscGmBUxUnbmfZG1kz5fZnUqT/DRzKMJ0/7Q=@vger.kernel.org X-Gm-Message-State: AFq9FYIrsgVVlVoXmMbt0PxsC8uXNxjUaTtXyrlzsDTYJOjSHi9bwdw5 WIpwhQ5jdqzg4rdB0An5tAOvA+b/czvoBOSw+CY9qdrlBqZDWjHNjJZO X-Gm-Gg: AYBFou09qxdvcw4lJ9wID1GIGiWXyEz5Ufn9wy+ABGjXn2TU73udnk9edXZaI6EcN9Y MoFAHdthuyNbeacxGrddP7+ALvHWxBlQNJH4dx17dc3y9+vyChTC1ShJntI0DyQsyAY40NBapD9 hlP+lE2e68LF3AnwP0OSQw32XFNDmLdpugZxv80ULmgP28zW7Qy5oKbG0HMNcmlO6rSk8ftvhvU ObMTM2YBVaQQRH9KV0YubUhPTFjnWvlrbQaYdNxu7eFi6txb3hNwp8ggUY35S257DQhFGXhd4XB P56gcKvfLZbyxKFp6lDk7GlBbybrQZ2fcAoyEfm4AE0RqA1buOgLFwuDy166hr/aTo4emSjbpDA 5YhVwQ0mDgme+tc+XT1Jk6/xe16wLgdYSRG5zEYnwEMTnIJFWKCQVeVNETrPTM8OpZhNXV1ywNh QGV2FJAK+kh+JFXVrVPQ1AXXizhMPZe/DbxpSgcuv6Vx7BMnMKWtTf1Y0Y30FyyNi+Ww== X-Received: by 2002:a05:600c:34c2:b0:4a1:a45a:88f with SMTP id 5b1f17b1804b1-4a1d76039d7mr227410065e9.20.1792517845273; Tue, 20 Oct 2026 10:37:25 -0700 (PDT) Received: from luca-vm.lan ([154.61.61.58]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4a1f8016c93sm52505235e9.5.2026.10.20.10.37.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Oct 2026 10:37:24 -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 , 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 RESEND v10 4/9] mfd: mt6397: Use MFD_CELL_* to describe sub-devices Date: Tue, 20 Oct 2026 19:33:25 +0200 Message-ID: <20261020173556.632798-5-l.scorcia@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261020173556.632798-1-l.scorcia@gmail.com> References: <20261020173556.632798-1-l.scorcia@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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 | 207 ++++++++++++-------------------------- 1 file changed, 67 insertions(+), 140 deletions(-) diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c index 9ec951996588..3e08179002fa 100644 --- a/drivers/mfd/mt6397-core.c +++ b/drivers/mfd/mt6397-core.c @@ -124,165 +124,92 @@ static const struct resource mt6323_pwrc_resources[] = { }; static const struct mfd_cell mt6323_devs[] = { - { - .name = "mt6323-auxadc", - .of_compatible = "mediatek,mt6323-auxadc", - }, { - .name = "mt6323-efuse", - .of_compatible = "mediatek,mt6323-efuse", - }, { - .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-auxadc", NULL, NULL, 0, 0, + "mediatek,mt6323-auxadc"), + MFD_CELL_OF("mt6323-efuse", NULL, NULL, 0, 0, + "mediatek,mt6323-efuse"), + 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