From nobody Thu Apr 16 05:20:42 2026 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (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 194BEC8EB for ; Mon, 2 Mar 2026 14:01:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772460095; cv=none; b=uaeheTzkGhnf1FcSXfW2JrQNxPB43VJEAM0ax7SZsr8oT11aISoUxy10j2GvcEv2k4AR5+GBD5ZFgfgJeVg2BiR1e1+n3dEfoBPStG1tucBoZGYaVXXEcWXTCjiKmui+DCGx1aGmKioosh4Y6ZO8udMVPFvAgNr85Zhj89pujDM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772460095; c=relaxed/simple; bh=DKjp2oWjpjqBerRyatHcp1VlocRFDB2KNWLaocyzf6I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kz4slPadq7Xrq6vFy2petSunE9CEF+oa7AH9vJVRghZd52T1GJFEmqVyCRRBsX8vG1D0SRePVjRtV9VtxWkwW4lZz8NPFsrIWqJMK57R9DdpNI2OuQHltvZ+5sfD8bmaLlrAGj2MZUcYfterY39D6Rn8NNtU8+mqz9O5uZk48Qo= 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=S+LsI6GZ; arc=none smtp.client-ip=209.85.216.53 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="S+LsI6GZ" Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-358ed696623so1815913a91.0 for ; Mon, 02 Mar 2026 06:01:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772460093; x=1773064893; 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=+BpP3A8r/Zsel4oeQ6sBuhbmtBjglFyQ+KJoiCGZoZ0=; b=S+LsI6GZrBjsRWv2SIAbOCIkHPxD40/iZDN9WFgqZN8HaxT749mSyiaTK5wG6s0T9Q zka7GvsbK2Wmjc5eLeBjvE/3xWIS3a0g7P9tY0qdl4jWnqByi4xexUOMpVsbsWGDUYHv jzH3p4nqg+TbLRlbfT8zDWME9tm2Cd4oiumCnLb+qnXaQJYbkVJGFwbfbmbiscZjA7pK iuOXRVNYI9HHH9X5NDj1waS060jw72olCS10oMJzDQgP+WfQjjv3dB6rDBPGmtHtjI4k LOm2VWrnsJVRwSvV9rCZfFEksQCz7hwGBFwwqkYQBrBrvOTg7dt3tGLhnH+4lg/Me9FC 5ZNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772460093; x=1773064893; 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=+BpP3A8r/Zsel4oeQ6sBuhbmtBjglFyQ+KJoiCGZoZ0=; b=VTnw1D8V/f6Ypvxl6pi2oSfj70o8StMimhkedYok0UoHC8zsvlzUZGsfzxuzWr8qgA GL6tYntjQtjl2ck75dIWUL8qoUEtjlT6gRY/FurZ2TQE+Ot0PyFa7f/RLIBRh7f4UgTs DgFORNV5hmgSLVdQpfUdLd6Z9oUtEVF/trkjnfNdtgSuUiZBwSIZS7ksmbgPVBOUPZSU jP0Y9NqyzugvM4TzQ4BH7QSAgdB5P0oLKCez54kn1oacf9UIcD1mQZr/ByJ9LqNGA3Y/ 7IHgJtoizFzS4FKM/lr3+eClpJ0vDiBLXyXwyugar/wa6MyzPeS2mU2zeckSI3aPb5Yk Valg== X-Forwarded-Encrypted: i=1; AJvYcCVC1poVqG+xplMFkXgGZFa9eNKFYYmtIAUD55gWBNaNQuT5dJLIA7jflEx+ONUBvtBBueoKCzhGocs/Vg0=@vger.kernel.org X-Gm-Message-State: AOJu0YwO/eW1CzZYQNE4A3//X2+CaqyZ/dueA2TQP0AZWgwX7+yDvauR WByWJHCg71iZrQxh/szQD2tOy6J2XLiphthWd7KN/JlCHkye3PAS2Osc3ax09v8n X-Gm-Gg: ATEYQzyqu8N3oYbSyCH51iWNkpfLWYkg20kIO7E5fGekT3ZhFkKbuIA7dqnjs5xkkp8 9QLca932GQLwD6AaKkKD8bDz7Ke//qoD8h39EVCwvUXw5QTdod8nV+bHePZ40cs4ZatLUFW9ctw HOFNE7WNpNnsgsHMj6o+kuuATE7xUuOibQ57VvFJA5R9IAgBacNXk7uavyFm/zP7lXrEuOrKypZ 9DQ/IuKyR9kfzmNk0kMLtO1bjJAdj1RBCRZxe961NKELerfMXKdARE2xgtHCo/blWXCKZr41Qyk uozWYHOuI11LeeVTk+hidX+Vzv4HvIZIqZIJzaEhAKVb3nTpBPJYot2TQRWbF0NOK4cCcO8v7YW OylSmgH7299Fo8BoMOWi0F9NbE9sEr2PtYovMF9EbL2evu2Wgp6SY8m1w9L7gSE5k9Lm1k7XArT FMG4YeVh6OiKBdTWf6EobWovjHcIa0E9rbr2GT2e320I2QE81EnHjf1NCxc0zmPCWseIXWXjA8c PJhtuaL8+g4Z+C54Q== X-Received: by 2002:a17:90b:5550:b0:359:8c21:ef46 with SMTP id 98e67ed59e1d1-3598c21f117mr3504906a91.13.1772460090604; Mon, 02 Mar 2026 06:01:30 -0800 (PST) Received: from buffalo-ssd.taila54753.ts.net (M014013071096.v4.enabler.ne.jp. [14.13.71.96]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3598d0b793bsm3330283a91.4.2026.03.02.06.01.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Mar 2026 06:01:29 -0800 (PST) From: Akari Tsuyukusa To: lee@kernel.org Cc: matthias.bgg@gmail.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, y.oudjana@protonmail.com, angelogioacchino.delregno@collabora.com, Akari Tsuyukusa Subject: [PATCH v2] mfd: mt6397: Properly fix CID of MT6328, MT6331 and MT6332 Date: Mon, 2 Mar 2026 23:00:45 +0900 Message-ID: <20260302140045.651727-1-akkun11.open@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260228190820.357538-1-akkun11.open@gmail.com> References: <20260228190820.357538-1-akkun11.open@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: quoted-printable Content-Type: text/plain; charset="utf-8" CIDs set for MT6328, MT6331 and MT6332 are not appropriate. Many Android downstream kernels define CID as below, MT6328: #define PMIC6328_E1_CID_CODE 0x2810 #define PMIC6328_E2_CID_CODE 0x2820 #define PMIC6328_E3_CID_CODE 0x2830 MT6331/MT6332: #define PMIC6331_E1_CID_CODE 0x3110 #define PMIC6331_E2_CID_CODE 0x3120 #define PMIC6331_E3_CID_CODE 0x3130 #define PMIC6332_E1_CID_CODE 0x3210 #define PMIC6332_E2_CID_CODE 0x3220 #define PMIC6332_E3_CID_CODE 0x3230 The current configuration incorrectly uses the revision code as the CID. Therefore, the driver cannot detect the same PMIC of different revisions. (E1/E2 for MT6328, E1/E3 for MT6331/MT6332) Based on these, the CID of MT6328, MT6331 and MT6332 should be corrected. Additionally, the incorrect MT6331/MT6332 CID overlaps with the MT6320's actual CID: #define PMIC6320_E1_CID_CODE 0x1020 #define PMIC6320_E2_CID_CODE 0x2020 This causes a conflict in the switch-case statement of mt6397-irq.c, this prevents adding support for MT6320. Signed-off-by: Akari Tsuyukusa Reviewed-by: AngeloGioacchino Del Regno --- Changes in v2: - Remove GitHub links from the commit message as they may become invalid. (= Requested by Angelo) - Add Reviewed-by tag. - No code changes. drivers/mfd/mt6397-core.c | 4 ++-- include/linux/mfd/mt6397/core.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c index 3e58d0764c7e..1bdacda9a933 100644 --- a/drivers/mfd/mt6397-core.c +++ b/drivers/mfd/mt6397-core.c @@ -297,7 +297,7 @@ static const struct chip_data mt6323_core =3D { =20 static const struct chip_data mt6328_core =3D { .cid_addr =3D MT6328_HWCID, - .cid_shift =3D 0, + .cid_shift =3D 8, .cells =3D mt6328_devs, .cell_size =3D ARRAY_SIZE(mt6328_devs), .irq_init =3D mt6397_irq_init, @@ -313,7 +313,7 @@ static const struct chip_data mt6357_core =3D { =20 static const struct chip_data mt6331_mt6332_core =3D { .cid_addr =3D MT6331_HWCID, - .cid_shift =3D 0, + .cid_shift =3D 8, .cells =3D mt6331_mt6332_devs, .cell_size =3D ARRAY_SIZE(mt6331_mt6332_devs), .irq_init =3D mt6397_irq_init, diff --git a/include/linux/mfd/mt6397/core.h b/include/linux/mfd/mt6397/cor= e.h index b774c3a4bb62..340fc72e22aa 100644 --- a/include/linux/mfd/mt6397/core.h +++ b/include/linux/mfd/mt6397/core.h @@ -12,9 +12,9 @@ =20 enum chip_id { MT6323_CHIP_ID =3D 0x23, - MT6328_CHIP_ID =3D 0x30, - MT6331_CHIP_ID =3D 0x20, - MT6332_CHIP_ID =3D 0x20, + MT6328_CHIP_ID =3D 0x28, + MT6331_CHIP_ID =3D 0x31, + MT6332_CHIP_ID =3D 0x32, MT6357_CHIP_ID =3D 0x57, MT6358_CHIP_ID =3D 0x58, MT6359_CHIP_ID =3D 0x59, --=20 2.52.0