From patchwork Mon Oct 17 07:57:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 3261 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1324774wrs; Mon, 17 Oct 2022 01:04:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM62AKTcIh2KBGZ0PvgTPe9ySjmk0q7LpDHNJe0ejLr5jQQl6ae7Wo2MfUi+V8tFGiRftFBR X-Received: by 2002:a05:6402:3512:b0:45d:4f99:6151 with SMTP id b18-20020a056402351200b0045d4f996151mr9000611edd.74.1665993857569; Mon, 17 Oct 2022 01:04:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1665993857; cv=pass; d=google.com; s=arc-20160816; b=sguG/ATkjG2xDP7DfHm+VGuG1+JUT4r8oLBjqry3+uv3QXDPg4igNfxBt0wByMlooH YGJNbgRCSnfSsmU5bbwZ9qBLcUk/lkd/7NEn4AyNcDhsIaHHb/G/kVj/4qsKjFeuN7Zr gsnkq1JHZoxE0NiakdB+qCdquudkIFI4JQrya/WaNF9/p3RUcqZzz2giPht9BlvgEbvi 4HWnNYrIcd4LIraNuq/ku5KsPLubItnCbEENYEoOzM/OMtNta0rHkGx/JZKf2qf05Ftv eNd5VuvUETlSECTX+ZyPGxNBB7JpO9xlfObtrJhj/xQB2vz/K5KPLmI665RsZRKGFGLf P4Hg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=HZs9EwRcvyBhiPjvrXkzBGtVv4YzM4h7cDGib0j0o80=; b=U7e7T4bIpw6TZ0aYm9OzbkanyamcFK5Do04IWLeHiVr20lsOD6j4pbG3uJ7mlQaR65 VcUJX+LTbAV1PWVeqmHEXjH1sWkLiXAP+1qZ7z1TyXTozTwMtopA8ljzCPR6i98uQFuE jNK0giA3Y0F8qprREvOWjLDX43BVsEp+wi6B37QxYhpmmCCD2+ticpmmMaGUfRw1EqAj mgar4g/p43xIiwazdmbsdr08doiJKH3nBC2DXcY7hpwGYdqPZC6MEv0E0NlclJ5Em8Iq EjCo+3m3tx0yJqa4a5H0DGM2SYUkgocatARTDdbD0E7PaG/NIRaTPb39l8rThDHusPuv dYQQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=ro8lgTX0; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z12-20020a056402274c00b0045c786162f5si10795515edd.567.2022.10.17.01.03.42; Mon, 17 Oct 2022 01:04:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=ro8lgTX0; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230169AbiJQHz4 (ORCPT + 99 others); Mon, 17 Oct 2022 03:55:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230127AbiJQHzx (ORCPT ); Mon, 17 Oct 2022 03:55:53 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60057.outbound.protection.outlook.com [40.107.6.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3767B5B50E for ; Mon, 17 Oct 2022 00:55:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XzvGdnPDDnALf4Y1Sy4vzK+xnoZyJXlZ1RD0WlLcnYXgINsuDLTYmIpOybp1OL0kqWe0bza4kpyj6wfJ4G+/84uySwaM17NAEmQGm0Rt3d3KU6aMMg3xlvzqJp8pFZqpxrY2XEdFESMKSviWuFaXeHT7gk+8/nYXhHXuhYc7SQwqGN/vYn0p94PTdZccvkLp1wz959XLXCAR+qhgyhdBtezLlc64Tm/mV86G8xB1EsTF5vlVoS+xUpYLk+nd5lfHhGrSV58co8K1sRl9XRM3HEIoYN+vmdC1b1Wl1g7UrozgROI9zs29P75XbPYGyD8X+mMCo+A4/d73C/sAeTJXLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=HZs9EwRcvyBhiPjvrXkzBGtVv4YzM4h7cDGib0j0o80=; b=M3L2Uhugbg1e2fANcipVfGBZq2Szbzi7b36YEG/imVmt79GxURf6BOlLS+6tEl7N5GZTNXuPNOJfKUOXK8lHYEsEFOgJH9AH9wzXI53CuT0j/iDBhtOQ2thEKqC41zQHonCOX0f3QbSjPBDsk99PjAvpwqWt0hCzM/oZ/lN8hFRRYSrSJHBPPAEm9pXCEkOtX0ML+dHS9vHkmoCy6HEQMifA8/M3R2cIDK9GyRJjZcY50QEPHQ5CU5vDPb+0UUFEtrn13IcfrUbOKwgO7BCMJphsT7sfcuCllxuAfPZzYPjvA6ZZ42IaYTn+O7BSx6alBniabvrs8NnT6947Jc492A== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HZs9EwRcvyBhiPjvrXkzBGtVv4YzM4h7cDGib0j0o80=; b=ro8lgTX0pz6Ou4xVcge7Ev00tPsyzXXpAqJLEjWB9aG5UXeFCgm4lj504Z6ZGuR2+d9lBMJ2of9HBVWRHAt6aDLxAf73nlBDuKgVU1xtiwc8zQzGDS0oy0BB4LlqeIiIHJYhosaQI4PIUVC4SNqVvaC5I3ZHEA0KmRhPJm8sdGk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) by PAXPR04MB8543.eurprd04.prod.outlook.com (2603:10a6:102:216::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.26; Mon, 17 Oct 2022 07:55:48 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::181b:75f7:dbc8:b4bc]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::181b:75f7:dbc8:b4bc%6]) with mapi id 15.20.5723.032; Mon, 17 Oct 2022 07:55:48 +0000 From: Liu Ying To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: lee@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com Subject: [PATCH RESEND] mfd: Add Freescale i.MX8qxp Control and Status Registers (CSR) module driver Date: Mon, 17 Oct 2022 15:57:02 +0800 Message-Id: <20221017075702.4182846-1-victor.liu@nxp.com> X-Mailer: git-send-email 2.37.1 X-ClientProxiedBy: SI1PR02CA0015.apcprd02.prod.outlook.com (2603:1096:4:1f7::18) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|PAXPR04MB8543:EE_ X-MS-Office365-Filtering-Correlation-Id: 382cffec-8129-47f2-1aa4-08dab01500ef X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FSJm2WVbbxR9U5pvametWs4v75mjCFECk7sPXFdrnl5qqE5QsIkywa/lQQ03870ZoBUdmOS/rghP/G0WeIG+FK2/MaEu/CWWAYj0w78OGOr+ee+J9w5MGZPVWLMufDDpNdNVHuI+zp4xp5rM4n9mQe4wmbXqyv5R64EPpH/aAYZPAbXs91pm7a/xhRYCuDRQiD+NPDN1UxlC7nNQWvAssMnxLG4k4MB9zpRzx/JrHoGjwa5gKFw+Elp54czYOV43zyOD4SMOyXe69XOWbEDHD+N79nlrGgW9ThDXdS2qdo2dbOdBOjn5WXDme0ogz/APB1G2KlMzINNXYn1wvdGXOlrTPQpdy2mEgv3i1azEsDiCRG0HNLG3REnIT14qA0oUchho9qwS3pAHCQ3rVbXrMy3esQUOEFp/mGUAeeJYT8GakOwE3zBzs2fju5hMrphMzvLIocgM0SVbPsK4F+UR9eR24AjW2hhKooTwuQ6Rvr7oYaIxRGUZnRpRkj6QU+086tTHrY7p50pl8aBP7RVQY6au7GJx7Ko9MVi5Oe/Rsuy2Bt+Pkvf3ZDe5q6VrD0aWPt+J2vLCh3k1k93af3jWFjnYJvngwa19XfslACv9ZRWjU7Gg50dPtcRla2DRPubFJlJyoWNa5QpuHnCUj35ciJvj/4E8nqw/Na0K7xCNzMpRQWOJmnAMq643q9IdCqzhjkjl4mc31461Q/7yOOieL6QtqVEUgYj3YLwoH8n3AnRpxghIqaYtMrAKYwuS7t8a275T5z5+La+rp/z63062Bw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM7PR04MB7046.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(366004)(346002)(396003)(376002)(136003)(451199015)(38350700002)(6486002)(478600001)(38100700002)(2616005)(186003)(1076003)(316002)(8676002)(4326008)(66946007)(66556008)(66476007)(6666004)(6506007)(5660300002)(36756003)(26005)(52116002)(41300700001)(6512007)(8936002)(86362001)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: G2m5/yZvFN6il0IFj+WqrHn2OBE3KHQVu8y6tY5y6m7ohAOeU/rLIf3ngKTMHknDF9W5HDfhHKbGZfF2DRgGFJsReN8Lvtz+pS+Mmm4++IYFaXmXltbu88XI6+AOI0poizUDR1bo8yE+UBtd0PFhltUB2EICND6BDCkvVsBR1/4eCh9bIpvS2R8rnlC3qn1bnLJOrCBGzuWUZ5NbuOtz0bCa3B65SzBSnLZ8eJL5bTJ3TsRHtXpewS4n4xQMehXMuC67W/FEfMQZdKDhUFozBEKMT8IgCjw0Ex+irqdG+e2w4UjE5aaIzdYUD97V7+J+ljiuhbOm9D878hijxnQVw15suyWaEPTTgAkTepAB5J9VQQydh+BHiSwlzH3QuwdUbCLgmdlPxQb6OlI3FTT5y+wSQcGmvFhFbgipip12VJuULKrjxVJc2T64G4z3HEUWoQuTBHk8QgnzsDVI3sKD+F+oVpPcg6K4Pol3+zba1x3tWrv8amMA8gqlViHFeao2wA+kBsOx1Do7Hxm+OwC3paFzmOD+cvSsJtMilfj7MFiw1+MEfVrmNmXWDqnQbclIxdf8XGKTs0PHkC+4e1Ch5RdNU/jEhQilBjyN+ZLTPcDteR6jBIfFMKsg7rsWeXF3KtDZagnhZYNS80COat0ql4+voNtQPUOppw6E/O1+6PSUIj5rLKdWZlqcF5NPWmu9kSA7KH13SP1O3MiQJtOJ7C7ipFbk1thdimhGG28KR0wPU6mDAfAU6QBlfTS1yH4vnQKb4crAvw881g+6usG+IZgh+17DaGeQ7OZ1LkmdwDw0+QzWttr73svGjcFq3yNR+nqEA6RqEqVv3DmvkCgckW0J0pOu9itA4KlCcpXzhYhuYVhEbEBI+8zhJCSjDzK1liKYKm9CI4r56AZmJ86EUAOzekSYypZxjJhXFwM1jpF9XH0K3x8JNHDZzykm0h6wgaJtPAvJt7UU5cBtuDjcCa4Zlp8QU5PZpViiOrXOpXYeGcP7hpcuX/0qRXhRAtwFsuOfvXrSYTvceVH6/y0A7VWkNwpNSzWN4+GHVOSGRl8+ghiOKBb0etsvwDYs5JmA0boDGizsITWNGxWsP1epoSwvOBU8HYnRKvwTNY56Me5YciS6CoXl5giHxs6xym0oawiWtQrY7c+ogP4qVRlWFfFzJ8mLjD4RNVbktHsh05hzJKiwHnQkTiF1C6gdtZJGKTnB/w++Qa7kpPdkFnpl76ZeYvGgAdP0ytudryNsEtMILNtUw1OUs9xIEw7J/wxDUSh3q2JAR3hY3JmdSdi4yNostMm9LtQMcG0/V5ULn12NKBEGLI6jym+XHaGeIdDjXqwrxhwub7Dmp/rjKCbdgrb9E8QG9w/ZMQS8q5b+JX0CR29L+OWHZC7fYxC1Yq7oziOzfWqehHT8wWi0YQi6hOPysfHClstmdBZe89VIyWVybn/fVqQY1ofDOsV5bUkdQuQQZCScFFYHJ+eTEgf3RLYXo7jiU1VNSYoXASqBcBjBvt2a+7Z/cbqggQaTKb1w7CQI+EttsdPWdgmpWgLRWrsl1VcoRAUG+SdfO7jdM71/hjIGWpmzUrRiZnNa4N1x X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 382cffec-8129-47f2-1aa4-08dab01500ef X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2022 07:55:48.5004 (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: 7lH1QvqqCDqgrRNHOACYacIjBnSdhR99Gneeep09ElDWL9Ubv9HA4lgqQEqXkC9qVLalfuQJFpJ9WZWUJeUFXg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8543 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746921175606373155?= X-GMAIL-MSGID: =?utf-8?q?1746921175606373155?= Freescale i.MX8qxp Control and Status Registers (CSR) module is a system controller. It represents a set of miscellaneous registers of a specific subsystem. It may provide control and/or status report interfaces to a mix of standalone hardware devices within that subsystem. The CSR module in i.MX8qm/qxp SoCs is a child node of a simple power-managed bus(i.MX8qxp pixel link MSI bus). To propagate power management operations of the CSR module's child devices to that simple power-managed bus, add a dedicated driver for the CSR module. Also, the driver would populate the CSR module's child devices. Signed-off-by: Liu Ying --- The Freescale i.MX8qxp CSR DT bindings is at Documentation/devicetree/bindings/mfd/fsl,imx8qxp-csr.yaml. Resend the patch based on v6.1-rc1. drivers/mfd/Kconfig | 10 +++++++ drivers/mfd/Makefile | 1 + drivers/mfd/fsl-imx8qxp-csr.c | 53 +++++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 drivers/mfd/fsl-imx8qxp-csr.c diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 8b93856de432..966a250d7910 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -499,6 +499,16 @@ config MFD_MX25_TSADC i.MX25 processors. They consist of a conversion queue for general purpose ADC and a queue for Touchscreens. +config MFD_MX8QXP_CSR + tristate "Freescale i.MX8qxp Control and Status Registers (CSR) Module" + depends on (ARCH_MXC && OF) || COMPILE_TEST + help + Enable support for Freescale i.MX8qm/qxp Control and Status Registers + (CSR) Module. As a system controller, CSR represents a set of + miscellaneous registers of a specific subsystem. It may provide + control and/or status report interfaces to a mix of standalone + hardware devices within that subsystem. + config MFD_HI6421_PMIC tristate "HiSilicon Hi6421 PMU/Codec IC" depends on OF diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 7ed3ef4a698c..5c3c13d7ce85 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -113,6 +113,7 @@ obj-$(CONFIG_MFD_TWL4030_AUDIO) += twl4030-audio.o obj-$(CONFIG_TWL6040_CORE) += twl6040.o obj-$(CONFIG_MFD_MX25_TSADC) += fsl-imx25-tsadc.o +obj-$(CONFIG_MFD_MX8QXP_CSR) += fsl-imx8qxp-csr.o obj-$(CONFIG_MFD_MC13XXX) += mc13xxx-core.o obj-$(CONFIG_MFD_MC13XXX_SPI) += mc13xxx-spi.o diff --git a/drivers/mfd/fsl-imx8qxp-csr.c b/drivers/mfd/fsl-imx8qxp-csr.c new file mode 100644 index 000000000000..3915d3d6ca65 --- /dev/null +++ b/drivers/mfd/fsl-imx8qxp-csr.c @@ -0,0 +1,53 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/* + * Copyright 2022 NXP + */ + +#include +#include +#include +#include + +static int imx8qxp_csr_probe(struct platform_device *pdev) +{ + int ret; + + pm_runtime_enable(&pdev->dev); + + ret = devm_of_platform_populate(&pdev->dev); + if (ret < 0) { + dev_err(&pdev->dev, "failed to populate sub-devices: %d\n", ret); + pm_runtime_disable(&pdev->dev); + } + + return ret; +} + +static int imx8qxp_csr_remove(struct platform_device *pdev) +{ + pm_runtime_disable(&pdev->dev); + return 0; +} + +static const struct of_device_id imx8qxp_csr_of_match[] = { + { .compatible = "fsl,imx8qxp-mipi-lvds-csr", }, + { .compatible = "fsl,imx8qm-lvds-csr", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, imx8qxp_csr_of_match); + +static struct platform_driver imx8qxp_csr_driver = { + .probe = imx8qxp_csr_probe, + .remove = imx8qxp_csr_remove, + .driver = { + .name = "imx8qxp-csr", + .of_match_table = imx8qxp_csr_of_match, + }, +}; + +module_platform_driver(imx8qxp_csr_driver); + +MODULE_DESCRIPTION("Freescale i.MX8qm/qxp Control and Status Registers Module Driver"); +MODULE_AUTHOR("Liu Ying "); +MODULE_LICENSE("GPL v2");