From patchwork Thu Dec 5 16:51:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13895792 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2055.outbound.protection.outlook.com [40.107.241.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 95F62227B90 for ; Thu, 5 Dec 2024 16:51:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.241.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733417509; cv=fail; b=TSje3yYqZXwPWR1Xj5h9R0lvOTyhCbJ1gmnI+xHoL1nfA3vgoPwua71j41wfxSBVNw2r/QHYfMU2Jwxx/Fr50f0xUob7TlZq0BFnouQ4eSzFyfR1y5vH7GbWG8aZfMeXnmnlKK4iLYEGE6tcAkA8+oqpHEagMy3XSoRLylnPMWs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733417509; c=relaxed/simple; bh=A6EGTfjYKIlj3aLC4u90rwGEbg95UGx6KHV3w/eCA1U=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=D/B0OLAx+pp6wCsHDvgI8jyC6LS5GHQnLK2CnWTS8BkHAPA365dfMjsL5/DtKgEqieYN0hor4cHST82BKXvRtW+DF131YFcFFUu+WP7ONcjAfjuIg8Ub990VqcEMppl0WZM/gK79uKiu42uIM0myS+xtyQBoVk/hOb8nX6eo4fQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=JFXqK96s; arc=fail smtp.client-ip=40.107.241.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="JFXqK96s" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Pey/FepVroH0o30gxNagJ4BMrh2slsCQKoaNPOrfcgwi6kBPXlPTFVwv/j7zTPS/+y57xQyhAYrIPyVB2KEzfEdZC/98acf67gSKuZAjT21Ilawi3ymI1QgUIOodqfkzcxtcl1WvYBXC1xGQAFmBHhCqi7tAKaYuE2RG9VPaVsn+k1377/Fr+ilSxymr1idB4rkZGiRWGeUNu/c/mlTldwCsBYwtovLpvySRB6fam8Ci0pClO4KZYyxH0z9O532g5sGVM4LMHvgwSBu+IiLS/nP16b+8WRDBTZruscfHImAWuLBZtkBopi/MjVo6Q9PdKgTxSW9WD3Zm6cObH9KJhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9iOsC7M6f/+sDyrSnuCZDi4tzufpgAqP+k9gXU0kg3g=; b=mojQsTgLttfRqBELrpXGUWDl4hIIhDx1lZ40SY4GtvYiQ7lB1vnLwCNXnNM6sUNRMYfoaqs/9FNObYScEoBtGNDsZJPDhODSS807a8yWGruVMus/PBPnLCSPhtgzQJDos655lN/qxrw3raN7Xhd/fBr1UKv1KpKnntxQ+fiukm7nohJz+nzwscPmXYG4LhA5I9TM5FZVTZsvRL3oVfeRLcitdg8PLvlZHh6MDV1U05H6W5eBdxQTlEjEoW/Xi+Hsb6odGaE1TaF97jx7zsB8FtbmyzjdjiO4y7eA3IXtgP41qGK51nKQ+gdW0WUs3+7L9u3B6XPSh92Cc/tmvoSuqQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9iOsC7M6f/+sDyrSnuCZDi4tzufpgAqP+k9gXU0kg3g=; b=JFXqK96sDADyltipA4j/g70ZWHrI1/gM59Tv7wbdwbvNN4PAPth3QuScfiu/vffe/dyaGTaQ7bbkBXv2m7tGGzn3hmKYGcRL3O9x/w91VnhBDxcOVEASnKpzMMguYOBbUD6DOdVF02zluXcMGxBlhEtDVkzulyb+rKqAU9tcVAkhwfm189I1YYcxt8s/1Zcy1FrrkIrZ3GZ9d3diy7tepaviWNHUHbrEHXamJ1N7KFuoSjs7aQuD6+2SlP+5qH3pu/Vm+blSp6cfGRrPrm+DmrZ3TGtCrjzWgzzhw8mmyKMQbFfjdzL5iZMPrTnsho5uEmrgwoLJBmnGV17lPoo5kQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB9626.eurprd04.prod.outlook.com (2603:10a6:10:309::18) by DBAPR04MB7446.eurprd04.prod.outlook.com (2603:10a6:10:1aa::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.12; Thu, 5 Dec 2024 16:51:44 +0000 Received: from DB9PR04MB9626.eurprd04.prod.outlook.com ([fe80::e81:b393:ebc5:bc3d]) by DB9PR04MB9626.eurprd04.prod.outlook.com ([fe80::e81:b393:ebc5:bc3d%4]) with mapi id 15.20.8230.010; Thu, 5 Dec 2024 16:51:43 +0000 From: Frank Li Date: Thu, 05 Dec 2024 11:51:12 -0500 Subject: [PATCH 4/5] regulator: pca9450: Add PMIC pca9452 support Message-Id: <20241205-pca9450-v1-4-aab448b74e78@nxp.com> References: <20241205-pca9450-v1-0-aab448b74e78@nxp.com> In-Reply-To: <20241205-pca9450-v1-0-aab448b74e78@nxp.com> To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Robin Gong , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, imx@lists.linux.dev, joy.zou@nxp.com, linux-arm-kernel@lists.infradead.org, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1733417480; l=3178; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=YhFm3p5cBgT6Des25s41MlZZ8qNGl5iYh7kvogdCttY=; b=8oYM0LYk8ORGCJI5h+oKgyIGzWgqX6Eu41kI3ln2PepM11O9RPorP2B6SmZb8CuqDvA/bunzO z+qlisrKLDoCUS5ZROrR55fvI7F8KdX8vBE7ahrC1IBYrcCFLFyShpd X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BYAPR02CA0029.namprd02.prod.outlook.com (2603:10b6:a02:ee::42) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB9PR04MB9626:EE_|DBAPR04MB7446:EE_ X-MS-Office365-Filtering-Correlation-Id: 85d9e0d1-b387-4c24-5fb8-08dd154d18cc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|7416014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?X4KEtf87CDq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Ddsbl?= =?utf-8?q?1gJk4htgNoCMDFLkcXIeb1wOnEcxgGSu/5y51s25dOOmtBijJMhbF6tPPja01tH2C?= =?utf-8?q?nDs8Jl/gdMd4YmKFb46mW3DEmJJ2O/ErN9VS/VJJVZzZaRMKdh6lZiM50QCBgfkIX?= =?utf-8?q?FW8MNdn/aNVO3Alcu97X8MzljrHfAZrhdve4JqQkef5ek/mGQRyVLKmCFyXkSeOSD?= =?utf-8?q?vC3TCWZQIp3o3KJ/3JQ38rjtaw0EaWTF5ysbkgVokAkOrQH+QYKWG9zHyRzO3znXj?= =?utf-8?q?ehrIs4OqmAAqfwWI/Qv+d1LKbVPE3NhyjpTOa4V8QAEi9XYEXfPObhSsxAdxvjqkh?= =?utf-8?q?3KJbT+kea0Epg3DsdsP3+jA7Szvc8vg2N8wSFEjYzB/PKnCH3LrfmEj8x44XM9pFW?= =?utf-8?q?QY1mEZgji99/7sVTXjP92bDB96nQ0UaJChl/LpWbqYgwFzid2HIa6q/9lCOHRDrMf?= =?utf-8?q?XhOQINqGxmK8odYPpnyqdxFj71SGfqdoUvBoTIuqTBCLMM68OQqhEk4=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR04MB9626.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(52116014)(7416014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?5KX6MljCZWFPNCtabUAOC3CGgiLe?= =?utf-8?q?ELDI+vITqqMk3SUSdSX8yOtEj8wSfp/3X80w5NV4W7wO+tzrs/xfmql5FXxc1+Qh0?= =?utf-8?q?IQOLiNPSkItmL5F/PLEw97JfbFaTPPfqld73HOOYp5nz6Hp4Ey3nNfryh4EY0Zhoj?= =?utf-8?q?cCite51kpwmS1ruKHVZgNRW7M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k37E5uGVayhq+KITnEraYGr/+C+k?= =?utf-8?q?C2x7xNWU/b5Y6b7r7F0KmHcWzd2+F7rUESDsdk1Fh68GfRqw7lSt5wYy8Fmjus974?= =?utf-8?q?sP6rwxoa8PK3HTTD2JNL27pkP0nSDmCQYFLT/SwQ3envxJ51Oeij3OXJotRC7REWW?= =?utf-8?q?TxcRGm2kdiaUTiGujZv/6HSAAj6UDy/+hmAqvvSyjQm8pElGdIUWjV3qJsmcB2PWc?= =?utf-8?q?R9yvxH2I/NcEcYfH6biT6YZ/1QWsC0BOIQf6452t1zLJpovLcWoBjnuwHw6UPPwXy?= =?utf-8?q?VNOqnRhopEvwG8C3Rf8ScrvKIIHhcrj0TDVffK5WLNt9z3XdcL4V25pa6/k111RND?= =?utf-8?q?MZbfDuFh9962DVzqokN2WWjusmzMyVUdSV6mJG7QdKKSL2z7QVQIVYiELANbNlGz1?= =?utf-8?q?DRcdD8n8P6rqDXCAcCFCHKmWE3O8RMxHuhXUne5Af5ZIS3HGWE19lfIYMc7+mEboi?= =?utf-8?q?4O42atOBqdso?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 85d9e0d1-b387-4c24-5fb8-08dd154d18cc X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2024 16:51:43.2223 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: zcwiqlSE7AZLSb5hvFX2wVcq4/aTbxeGPt0Knbqp1Exl/YIp7BPMhZlaJe5p4iP2QDqvjY2Egj3+XsdF8wvtqw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7446 From: Joy Zou Add the PMIC pca9452 support, which add ldo3 compared with pca9451a. Signed-off-by: Joy Zou Signed-off-by: Frank Li --- drivers/regulator/pca9450-regulator.c | 29 ++++++++++++++++++++++++++++- include/linux/regulator/pca9450.h | 1 + 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/pca9450-regulator.c b/drivers/regulator/pca9450-regulator.c index 0b1f099fdd5ee..faa6b79c27d75 100644 --- a/drivers/regulator/pca9450-regulator.c +++ b/drivers/regulator/pca9450-regulator.c @@ -815,6 +815,24 @@ static const struct pca9450_regulator_desc pca9451a_regulators[] = { .owner = THIS_MODULE, }, }, + { + .desc = { + .name = "ldo3", + .of_match = of_match_ptr("LDO3"), + .regulators_node = of_match_ptr("regulators"), + .id = PCA9450_LDO3, + .ops = &pca9450_ldo_regulator_ops, + .type = REGULATOR_VOLTAGE, + .n_voltages = PCA9450_LDO3_VOLTAGE_NUM, + .linear_ranges = pca9450_ldo34_volts, + .n_linear_ranges = ARRAY_SIZE(pca9450_ldo34_volts), + .vsel_reg = PCA9450_REG_LDO3CTRL, + .vsel_mask = LDO3OUT_MASK, + .enable_reg = PCA9450_REG_LDO3CTRL, + .enable_mask = LDO3_EN_MASK, + .owner = THIS_MODULE, + }, + }, { .desc = { .name = "ldo4", @@ -916,6 +934,7 @@ static int pca9450_i2c_probe(struct i2c_client *i2c) pca9450->rcnt = ARRAY_SIZE(pca9450bc_regulators); break; case PCA9450_TYPE_PCA9451A: + case PCA9450_TYPE_PCA9452: regulator_desc = pca9451a_regulators; pca9450->rcnt = ARRAY_SIZE(pca9451a_regulators); break; @@ -943,7 +962,8 @@ static int pca9450_i2c_probe(struct i2c_client *i2c) /* Check your board and dts for match the right pmic */ if (((device_id >> 4) != 0x1 && type == PCA9450_TYPE_PCA9450A) || ((device_id >> 4) != 0x3 && type == PCA9450_TYPE_PCA9450BC) || - ((device_id >> 4) != 0x9 && type == PCA9450_TYPE_PCA9451A)) + ((device_id >> 4) != 0x9 && type == PCA9450_TYPE_PCA9451A) || + ((device_id >> 4) != 0x9 && type == PCA9450_TYPE_PCA9452)) return dev_err_probe(&i2c->dev, -EINVAL, "Device id(%x) mismatched\n", device_id >> 4); @@ -955,6 +975,9 @@ static int pca9450_i2c_probe(struct i2c_client *i2c) r = ®ulator_desc[i]; desc = &r->desc; + if (type == PCA9450_TYPE_PCA9451A && !strcmp(desc->name, "ldo3")) + continue; + config.regmap = pca9450->regmap; config.dev = pca9450->dev; @@ -1043,6 +1066,10 @@ static const struct of_device_id pca9450_of_match[] = { .compatible = "nxp,pca9451a", .data = (void *)PCA9450_TYPE_PCA9451A, }, + { + .compatible = "nxp,pca9452", + .data = (void *)PCA9450_TYPE_PCA9452, + }, { } }; MODULE_DEVICE_TABLE(of, pca9450_of_match); diff --git a/include/linux/regulator/pca9450.h b/include/linux/regulator/pca9450.h index 243633c8dceb3..b427b5873de1a 100644 --- a/include/linux/regulator/pca9450.h +++ b/include/linux/regulator/pca9450.h @@ -10,6 +10,7 @@ enum pca9450_chip_type { PCA9450_TYPE_PCA9450A = 0, PCA9450_TYPE_PCA9450BC, PCA9450_TYPE_PCA9451A, + PCA9450_TYPE_PCA9452, PCA9450_TYPE_AMOUNT, };