[RESEND] mfd: Add Freescale i.MX8qxp Control and Status Registers (CSR) module driver
Message ID | 20221017075702.4182846-1-victor.liu@nxp.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> 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 <rfc822;ouuuleilei@gmail.com> + 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; 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 <victor.liu@nxp.com> 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 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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: <linux-kernel.vger.kernel.org> 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?= |
Series |
[RESEND] mfd: Add Freescale i.MX8qxp Control and Status Registers (CSR) module driver
|
|
Commit Message
Liu Ying
Oct. 17, 2022, 7:57 a.m. UTC
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 <victor.liu@nxp.com>
---
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
Comments
On Mon, 2022-10-17 at 15:57 +0800, Liu Ying wrote: > 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 <victor.liu@nxp.com> > --- > 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 [...] Gentle ping... Any comments please? Thanks, Liu Ying
On Mon, 31 Oct 2022, Liu Ying wrote: > On Mon, 2022-10-17 at 15:57 +0800, Liu Ying wrote: > > 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 <victor.liu@nxp.com> > > --- > > 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 > > [...] > > Gentle ping... Content-less pings will never be received well. > Any comments please? You're in the queue.
On Mon, 17 Oct 2022, Liu Ying wrote: > 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 <victor.liu@nxp.com> > --- > 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 <linux/module.h> > +#include <linux/of_platform.h> > +#include <linux/platform_device.h> > +#include <linux/pm_runtime.h> > + > +static int imx8qxp_csr_probe(struct platform_device *pdev) > +{ > + int ret; > + > + pm_runtime_enable(&pdev->dev); > + > + ret = devm_of_platform_populate(&pdev->dev); The use of this API does not constitute a MFD. Please use "simple-mfd" instead. > + 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 <victor.liu@nxp.com>"); > +MODULE_LICENSE("GPL v2");
Hi Lee, On Mon, 2022-10-31 at 15:40 +0000, Lee Jones wrote: > On Mon, 17 Oct 2022, Liu Ying wrote: > > > 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 <victor.liu@nxp.com> > > --- > > 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/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 <linux/module.h> > > +#include <linux/of_platform.h> > > +#include <linux/platform_device.h> > > +#include <linux/pm_runtime.h> > > + > > +static int imx8qxp_csr_probe(struct platform_device *pdev) > > +{ > > + int ret; > > + > > + pm_runtime_enable(&pdev->dev); > > + > > + ret = devm_of_platform_populate(&pdev->dev); > > The use of this API does not constitute a MFD. > > Please use "simple-mfd" instead. simple-mfd devices have "ONLY_BUS" set in simple-pm-bus.c, so the simple-pm-bus driver would not populate child devices of simple-mfd devices. Also, the simple-pm-bus driver would not enable runtime power management for simple-mfd devices due to "ONLY_BUS", which means it would not propagate power management operations from child devices of simple-mfd devices to parent devices of simple-mfd devices. That's why a dedicated fsl-imx8qxp-csr driver is needed. Regards, Liu Ying [...]
Hi Lee, On Tue, 2022-11-01 at 13:53 +0800, Liu Ying wrote: > Hi Lee, > > On Mon, 2022-10-31 at 15:40 +0000, Lee Jones wrote: > > On Mon, 17 Oct 2022, Liu Ying wrote: > > > > > 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 <victor.liu@nxp.com> > > > --- > > > 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/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 <linux/module.h> > > > +#include <linux/of_platform.h> > > > +#include <linux/platform_device.h> > > > +#include <linux/pm_runtime.h> > > > + > > > +static int imx8qxp_csr_probe(struct platform_device *pdev) > > > +{ > > > + int ret; > > > + > > > + pm_runtime_enable(&pdev->dev); > > > + > > > + ret = devm_of_platform_populate(&pdev->dev); > > > > The use of this API does not constitute a MFD. > > > > Please use "simple-mfd" instead. > > simple-mfd devices have "ONLY_BUS" set in simple-pm-bus.c, so the > simple-pm-bus driver would not populate child devices of simple-mfd > devices. Also, the simple-pm-bus driver would not enable runtime > power management for simple-mfd devices due to "ONLY_BUS", which > means it would not propagate power management operations from child > devices of simple-mfd devices to parent devices of simple-mfd > devices. That's why a dedicated fsl-imx8qxp-csr driver is needed. One more point which might be overlooked - as mentioned in commit message, the CSR module is a child node of a simple power-managed bus(i.MX8qxp pixel link MSI bus), which means the child devices of the CSR module(as a simple-mfd device) won't be populated by of_platform_default_populate() from of_platform_default_populate_init() because "simple-pm-bus" is not listed in of_default_bus_match_table[] and hence recursion of of_platform_bus_create() will stop at the simple-pm-bus. This is also a reason why a dedicated fsl-imx8qxp-csr driver is needed to populated those child devices of the CSR module. The patch set to support i.MX8qxp pixel link MSI bus can be found at: https://lore.kernel.org/lkml/20221017074039.4181843-1-victor.liu@nxp.com/ Regards, Liu Ying
On Wed, 02 Nov 2022, Liu Ying wrote: > Hi Lee, > > On Tue, 2022-11-01 at 13:53 +0800, Liu Ying wrote: > > Hi Lee, > > > > On Mon, 2022-10-31 at 15:40 +0000, Lee Jones wrote: > > > On Mon, 17 Oct 2022, Liu Ying wrote: > > > > > > > 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 <victor.liu@nxp.com> > > > > --- > > > > 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/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 <linux/module.h> > > > > +#include <linux/of_platform.h> > > > > +#include <linux/platform_device.h> > > > > +#include <linux/pm_runtime.h> > > > > + > > > > +static int imx8qxp_csr_probe(struct platform_device *pdev) > > > > +{ > > > > + int ret; > > > > + > > > > + pm_runtime_enable(&pdev->dev); > > > > + > > > > + ret = devm_of_platform_populate(&pdev->dev); > > > > > > The use of this API does not constitute a MFD. > > > > > > Please use "simple-mfd" instead. > > > > simple-mfd devices have "ONLY_BUS" set in simple-pm-bus.c, so the > > simple-pm-bus driver would not populate child devices of simple-mfd > > devices. Right, simple-pm-bus will not populate child devices, because: /* * These are transparent bus devices (not simple-pm-bus matches) that * have their child nodes populated automatically. So, don't need to * do anything more. We only match with the device if this driver is * the most specific match because we don't want to incorrectly bind to * a device that has a more specific driver. */ So "simple-mfd" must be populated elsewhere i.e. drivers/of/platform.c. > > Also, the simple-pm-bus driver would not enable runtime > > power management for simple-mfd devices due to "ONLY_BUS", which > > means it would not propagate power management operations from child > > devices of simple-mfd devices to parent devices of simple-mfd > > devices. That's why a dedicated fsl-imx8qxp-csr driver is needed. This is more of an issue. Why can't this device use "simple-pm-bus" to have support for both auto-registration AND Runtime PM? > One more point which might be overlooked - as mentioned in commit > message, the CSR module is a child node of a simple power-managed > bus(i.MX8qxp pixel link MSI bus), which means the child devices of the > CSR module(as a simple-mfd device) won't be populated by > of_platform_default_populate() from of_platform_default_populate_init() > because "simple-pm-bus" is not listed in of_default_bus_match_table[] > and hence recursion of of_platform_bus_create() will stop at the > simple-pm-bus. This is also a reason why a dedicated fsl-imx8qxp-csr > driver is needed to populated those child devices of the CSR module. Not sure I know the semantics well enough (anymore) to get a meaningful picture of what you're trying to explain, and I do not have any suitable H/W here to mock-up a real-world test-bed / concept demonstrator to debug this for you. The long and the short of it is; we have a bunch of automatic child-device-registering helpers in the kernel. One of the mechanisms is bound to work for you if you structure your code appropriately. Introducing an empty, meaningless driver, simply to call a single function it not acceptable. Please make the infrastructure already offered specifically to solve this category of issue work for your use-case.
Hi Lee, On Mon, 2022-11-07 at 09:05 +0000, Lee Jones wrote: > On Wed, 02 Nov 2022, Liu Ying wrote: > > > Hi Lee, > > > > On Tue, 2022-11-01 at 13:53 +0800, Liu Ying wrote: > > > Hi Lee, > > > > > > On Mon, 2022-10-31 at 15:40 +0000, Lee Jones wrote: > > > > On Mon, 17 Oct 2022, Liu Ying wrote: > > > > > > > > > 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 <victor.liu@nxp.com> > > > > > --- > > > > > 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/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 <linux/module.h> > > > > > +#include <linux/of_platform.h> > > > > > +#include <linux/platform_device.h> > > > > > +#include <linux/pm_runtime.h> > > > > > + > > > > > +static int imx8qxp_csr_probe(struct platform_device *pdev) > > > > > +{ > > > > > + int ret; > > > > > + > > > > > + pm_runtime_enable(&pdev->dev); > > > > > + > > > > > + ret = devm_of_platform_populate(&pdev->dev); > > > > > > > > The use of this API does not constitute a MFD. > > > > > > > > Please use "simple-mfd" instead. > > > > > > simple-mfd devices have "ONLY_BUS" set in simple-pm-bus.c, so the > > > simple-pm-bus driver would not populate child devices of simple-mfd > > > devices. > > Right, simple-pm-bus will not populate child devices, because: simple-pm-bus.c may populate child devices of simple-pm-bus devices because "ONLY_BUS" is _not_ set for simple-pm-bus devices. simple-pm-bus.c would _not_ populate child devices of simple-mfd devices because "ONLY_BUS" is set for simple-mfd devices. > > /* > * These are transparent bus devices (not simple-pm-bus matches) that > * have their child nodes populated automatically. So, don't need to > * do anything more. We only match with the device if this driver is > * the most specific match because we don't want to incorrectly bind to > * a device that has a more specific driver. > */ > > So "simple-mfd" must be populated elsewhere i.e. drivers/of/platform.c. If simple-mfd device is a child device of one device listed in of_default_bus_match_table[], then it may be populated by drivers/of/platform.c. But, in my case, simple-mfd device is a child device of simple-pm-bus device(not listed in that table), so it will not be populated by drivers/of/platform.c. Instead, drivers/bus/simple-pm-bus.c would populate the simple-mfd device. > > > > Also, the simple-pm-bus driver would not enable runtime > > > power management for simple-mfd devices due to "ONLY_BUS", which > > > means it would not propagate power management operations from child > > > devices of simple-mfd devices to parent devices of simple-mfd > > > devices. That's why a dedicated fsl-imx8qxp-csr driver is needed. > > This is more of an issue. > > Why can't this device use "simple-pm-bus" to have support for both > auto-registration AND Runtime PM? If I change the compatible string of the CSR module from "fsl,imx8qxp-mipi-lvds-csr", "syscon", "simple-mfd" to "fsl,imx8qxp-mipi-lvds-csr", "syscon", "simple-pm-bus", all devices I'm interested in are populated and all relevant drivers can probe. But, this change makes 'make dt_binding_check' for the existing fsl,imx8qxp-csr.yaml fail: --------------------------------8<------------------------------------ /kernel/linux/Documentation/devicetree/bindings/mfd/fsl,imx8qxp- csr.example.dtb: syscon@56221000: $nodename:0: 'syscon@56221000' does not match '^bus(@[0-9a-f]+)?$' From schema: /kernel/linux/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml /kernel/linux/Documentation/devicetree/bindings/mfd/fsl,imx8qxp- csr.example.dtb: syscon@56221000: '#address-cells' is a required property From schema: /kernel/linux/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml /kernel/linux/Documentation/devicetree/bindings/mfd/fsl,imx8qxp- csr.example.dtb: syscon@56221000: '#size-cells' is a required property From schema: /kernel/linux/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml /kernel/linux/Documentation/devicetree/bindings/mfd/fsl,imx8qxp- csr.example.dtb: syscon@56221000: 'ranges' is a required property From schema: /kernel/linux/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml --------------------------------8<------------------------------------ The error log basically complains two things: 1) The example nodename 'syscon@56221000' should match '^bus(@[0-9a-f]+)?$'. 2) Missing '#address-cells', '#size-cells' and 'ranges' properties as required by simple-pm-bus. Regarding 1), if I change 'syscon@56221000' to 'bus@56221000', then the below error comes along: --------------------------------8<------------------------------------ /kernel/linux/Documentation/devicetree/bindings/mfd/fsl,imx8qxp- csr.example.dtb: bus@56221000: $nodename:0: 'bus@56221000' does not match '^syscon@[0-9a-f]+$' From schema: /kernel/linux/Documentation/devicetree/bindings/mfd/fsl,imx8qxp- csr.yaml --------------------------------8<------------------------------------ So, it looks like "syscon" and "simple-pm-bus" can not be in compatbile string at the same time. Note that "syscon" is needed because other device nodes may reference the CSR module through a phandle, like the "fsl,imx8qxp-mipi-dphy" device. Regarding 2), I may try to add those required properties, but it would break the existing schemas of the child devices of the CSR module, like the "fsl,imx8qxp-ldb" device, because "reg" property is not allowed. So, it looks like the CSR module still should be simple-mfd device but not simple-pm-bus device, right? > > > One more point which might be overlooked - as mentioned in commit > > message, the CSR module is a child node of a simple power-managed > > bus(i.MX8qxp pixel link MSI bus), which means the child devices of the > > CSR module(as a simple-mfd device) won't be populated by > > of_platform_default_populate() from of_platform_default_populate_init() > > because "simple-pm-bus" is not listed in of_default_bus_match_table[] > > and hence recursion of of_platform_bus_create() will stop at the > > simple-pm-bus. This is also a reason why a dedicated fsl-imx8qxp-csr > > driver is needed to populated those child devices of the CSR module. > > Not sure I know the semantics well enough (anymore) to get a > meaningful picture of what you're trying to explain, and I do not have > any suitable H/W here to mock-up a real-world test-bed / concept > demonstrator to debug this for you. I understand you have no hardware to debug this directly. But, the example in dt-binding doc for the i.MX8qxp pixel link MSI bus(a simple- pm-bus) may give you a kinda full picture of what the relevant devices look like. I mentioned the patch set to add the MSI bus previously, however, you may find the binding doc directly here - https://lore.kernel.org/lkml/20221017074039.4181843-3-victor.liu@nxp.com/ > > The long and the short of it is; we have a bunch of automatic > child-device-registering helpers in the kernel. One of the mechanisms > is bound to work for you if you structure your code appropriately. > > Introducing an empty, meaningless driver, simply to call a single > function it not acceptable. Please make the infrastructure already > offered specifically to solve this category of issue work for your > use-case. Yeah, I tried to not to introduce a new driver for the CSR module, but it seems that it is needed. Regards, Liu Ying
> -----Original Message----- > From: Ying Liu > Subject: Re: [PATCH RESEND] mfd: Add Freescale i.MX8qxp Control and Status > Registers (CSR) module driver > > Hi Lee, > > On Mon, 2022-11-07 at 09:05 +0000, Lee Jones wrote: > > On Wed, 02 Nov 2022, Liu Ying wrote: > > > > > Hi Lee, > > > > > > On Tue, 2022-11-01 at 13:53 +0800, Liu Ying wrote: > > > > Hi Lee, > > > > > > > > On Mon, 2022-10-31 at 15:40 +0000, Lee Jones wrote: > > > > > On Mon, 17 Oct 2022, Liu Ying wrote: > > > > > > > > > > > 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 <victor.liu@nxp.com> > > > > > > --- > > > > > > 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/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 <linux/module.h> > > > > > > +#include <linux/of_platform.h> > > > > > > +#include <linux/platform_device.h> > > > > > > +#include <linux/pm_runtime.h> > > > > > > + > > > > > > +static int imx8qxp_csr_probe(struct platform_device *pdev) > > > > > > +{ > > > > > > + int ret; > > > > > > + > > > > > > + pm_runtime_enable(&pdev->dev); > > > > > > + > > > > > > + ret = devm_of_platform_populate(&pdev->dev); > > > > > > > > > > The use of this API does not constitute a MFD. > > > > > > > > > > Please use "simple-mfd" instead. > > > > > > > > simple-mfd devices have "ONLY_BUS" set in simple-pm-bus.c, so the > > > > simple-pm-bus driver would not populate child devices of simple-mfd > > > > devices. > > > > Right, simple-pm-bus will not populate child devices, because: > > simple-pm-bus.c may populate child devices of simple-pm-bus devices > because "ONLY_BUS" is _not_ set for simple-pm-bus devices. > > simple-pm-bus.c would _not_ populate child devices of simple-mfd > devices because "ONLY_BUS" is set for simple-mfd devices. > > > > > /* > > * These are transparent bus devices (not simple-pm-bus matches) that > > * have their child nodes populated automatically. So, don't need to > > * do anything more. We only match with the device if this driver is > > * the most specific match because we don't want to incorrectly bind to > > * a device that has a more specific driver. > > */ > > > > So "simple-mfd" must be populated elsewhere i.e. drivers/of/platform.c. > > If simple-mfd device is a child device of one device listed in > of_default_bus_match_table[], then it may be populated by > drivers/of/platform.c. But, in my case, simple-mfd device is a child > device of simple-pm-bus device(not listed in that table), so it will > not be populated by drivers/of/platform.c. Instead, > drivers/bus/simple-pm-bus.c would populate the simple-mfd device. > > > > > > > Also, the simple-pm-bus driver would not enable runtime > > > > power management for simple-mfd devices due to "ONLY_BUS", which > > > > means it would not propagate power management operations from > child > > > > devices of simple-mfd devices to parent devices of simple-mfd > > > > devices. That's why a dedicated fsl-imx8qxp-csr driver is needed. > > > > This is more of an issue. > > > > Why can't this device use "simple-pm-bus" to have support for both > > auto-registration AND Runtime PM? > > If I change the compatible string of the CSR module from > "fsl,imx8qxp-mipi-lvds-csr", "syscon", "simple-mfd" > to > "fsl,imx8qxp-mipi-lvds-csr", "syscon", "simple-pm-bus", > all devices I'm interested in are populated and all relevant drivers > can probe. But, this change makes 'make dt_binding_check' for the > existing fsl,imx8qxp-csr.yaml fail: > > --------------------------------8<------------------------------------ > /kernel/linux/Documentation/devicetree/bindings/mfd/fsl,imx8qxp- > csr.example.dtb: syscon@56221000: $nodename:0: 'syscon@56221000' does > not match '^bus(@[0-9a-f]+)?$' > From schema: > /kernel/linux/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml > /kernel/linux/Documentation/devicetree/bindings/mfd/fsl,imx8qxp- > csr.example.dtb: syscon@56221000: '#address-cells' is a required > property > From schema: > /kernel/linux/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml > /kernel/linux/Documentation/devicetree/bindings/mfd/fsl,imx8qxp- > csr.example.dtb: syscon@56221000: '#size-cells' is a required property > From schema: > /kernel/linux/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml > /kernel/linux/Documentation/devicetree/bindings/mfd/fsl,imx8qxp- > csr.example.dtb: syscon@56221000: 'ranges' is a required property > From schema: > /kernel/linux/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml > --------------------------------8<------------------------------------ > > The error log basically complains two things: > 1) The example nodename 'syscon@56221000' should match > '^bus(@[0-9a-f]+)?$'. > 2) Missing '#address-cells', '#size-cells' and 'ranges' properties as > required by simple-pm-bus. > > Regarding 1), if I change 'syscon@56221000' to 'bus@56221000', then the > below error comes along: > --------------------------------8<------------------------------------ > /kernel/linux/Documentation/devicetree/bindings/mfd/fsl,imx8qxp- > csr.example.dtb: bus@56221000: $nodename:0: 'bus@56221000' does not > match '^syscon@[0-9a-f]+$' > From schema: > /kernel/linux/Documentation/devicetree/bindings/mfd/fsl,imx8qxp- > csr.yaml > --------------------------------8<------------------------------------ > So, it looks like "syscon" and "simple-pm-bus" can not be in compatbile > string at the same time. Note that "syscon" is needed because other > device nodes may reference the CSR module through a phandle, like the > "fsl,imx8qxp-mipi-dphy" device. > > Regarding 2), I may try to add those required properties, but it would > break the existing schemas of the child devices of the CSR module, like > the "fsl,imx8qxp-ldb" device, because "reg" property is not allowed. > > So, it looks like the CSR module still should be simple-mfd device but > not simple-pm-bus device, right? > > > > > > One more point which might be overlooked - as mentioned in commit > > > message, the CSR module is a child node of a simple power-managed > > > bus(i.MX8qxp pixel link MSI bus), which means the child devices of the > > > CSR module(as a simple-mfd device) won't be populated by > > > of_platform_default_populate() from of_platform_default_populate_init() > > > because "simple-pm-bus" is not listed in of_default_bus_match_table[] > > > and hence recursion of of_platform_bus_create() will stop at the > > > simple-pm-bus. This is also a reason why a dedicated fsl-imx8qxp-csr > > > driver is needed to populated those child devices of the CSR module. > > > > Not sure I know the semantics well enough (anymore) to get a > > meaningful picture of what you're trying to explain, and I do not have > > any suitable H/W here to mock-up a real-world test-bed / concept > > demonstrator to debug this for you. > > I understand you have no hardware to debug this directly. But, the > example in dt-binding doc for the i.MX8qxp pixel link MSI bus(a simple- > pm-bus) may give you a kinda full picture of what the relevant devices > look like. I mentioned the patch set to add the MSI bus previously, > however, you may find the binding doc directly here - > https://lore.kernel.org/lkml/20221017074039.4181843-3-victor.liu@nxp.com/ > > > > > The long and the short of it is; we have a bunch of automatic > > child-device-registering helpers in the kernel. One of the mechanisms > > is bound to work for you if you structure your code appropriately. > > > > Introducing an empty, meaningless driver, simply to call a single > > function it not acceptable. Please make the infrastructure already > > offered specifically to solve this category of issue work for your > > use-case. > > Yeah, I tried to not to introduce a new driver for the CSR module, but > it seems that it is needed. After more experiments, I think it's appropriate to take the CSR module as a simple-pm-bus device instead of a simple-mfd device. This requires to change the existing DT bindings for the CSR module and it's child devices. I'll send the change out once it is ready. Thanks for Lee's review and comments. Liu Ying
On Tue, 08 Nov 2022, Liu Ying wrote: > Hi Lee, > > On Mon, 2022-11-07 at 09:05 +0000, Lee Jones wrote: > > On Wed, 02 Nov 2022, Liu Ying wrote: > > > > > Hi Lee, > > > > > > On Tue, 2022-11-01 at 13:53 +0800, Liu Ying wrote: > > > > Hi Lee, > > > > > > > > On Mon, 2022-10-31 at 15:40 +0000, Lee Jones wrote: > > > > > On Mon, 17 Oct 2022, Liu Ying wrote: > > > > > > > > > > > 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 <victor.liu@nxp.com> > > > > > > --- > > > > > > 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/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 <linux/module.h> > > > > > > +#include <linux/of_platform.h> > > > > > > +#include <linux/platform_device.h> > > > > > > +#include <linux/pm_runtime.h> > > > > > > + > > > > > > +static int imx8qxp_csr_probe(struct platform_device *pdev) > > > > > > +{ > > > > > > + int ret; > > > > > > + > > > > > > + pm_runtime_enable(&pdev->dev); > > > > > > + > > > > > > + ret = devm_of_platform_populate(&pdev->dev); > > > > > > > > > > The use of this API does not constitute a MFD. > > > > > > > > > > Please use "simple-mfd" instead. > > > > > > > > simple-mfd devices have "ONLY_BUS" set in simple-pm-bus.c, so the > > > > simple-pm-bus driver would not populate child devices of simple-mfd > > > > devices. > > > > Right, simple-pm-bus will not populate child devices, because: > > simple-pm-bus.c may populate child devices of simple-pm-bus devices > because "ONLY_BUS" is _not_ set for simple-pm-bus devices. > > simple-pm-bus.c would _not_ populate child devices of simple-mfd > devices because "ONLY_BUS" is set for simple-mfd devices. > > > > > /* > > * These are transparent bus devices (not simple-pm-bus matches) that > > * have their child nodes populated automatically. So, don't need to > > * do anything more. We only match with the device if this driver is > > * the most specific match because we don't want to incorrectly bind to > > * a device that has a more specific driver. > > */ > > > > So "simple-mfd" must be populated elsewhere i.e. drivers/of/platform.c. > > If simple-mfd device is a child device of one device listed in > of_default_bus_match_table[], then it may be populated by > drivers/of/platform.c. But, in my case, simple-mfd device is a child > device of simple-pm-bus device(not listed in that table), so it will > not be populated by drivers/of/platform.c. Instead, > drivers/bus/simple-pm-bus.c would populate the simple-mfd device. > > > > > > > Also, the simple-pm-bus driver would not enable runtime > > > > power management for simple-mfd devices due to "ONLY_BUS", which > > > > means it would not propagate power management operations from child > > > > devices of simple-mfd devices to parent devices of simple-mfd > > > > devices. That's why a dedicated fsl-imx8qxp-csr driver is needed. > > > > This is more of an issue. > > > > Why can't this device use "simple-pm-bus" to have support for both > > auto-registration AND Runtime PM? > > If I change the compatible string of the CSR module from > "fsl,imx8qxp-mipi-lvds-csr", "syscon", "simple-mfd" > to > "fsl,imx8qxp-mipi-lvds-csr", "syscon", "simple-pm-bus", > all devices I'm interested in are populated and all relevant drivers > can probe. Okay, that's good. > But, this change makes 'make dt_binding_check' for the > existing fsl,imx8qxp-csr.yaml fail: > > --------------------------------8<------------------------------------ > /kernel/linux/Documentation/devicetree/bindings/mfd/fsl,imx8qxp- > csr.example.dtb: syscon@56221000: $nodename:0: 'syscon@56221000' does > not match '^bus(@[0-9a-f]+)?$' > From schema: > /kernel/linux/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml > /kernel/linux/Documentation/devicetree/bindings/mfd/fsl,imx8qxp- > csr.example.dtb: syscon@56221000: '#address-cells' is a required > property > From schema: > /kernel/linux/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml > /kernel/linux/Documentation/devicetree/bindings/mfd/fsl,imx8qxp- > csr.example.dtb: syscon@56221000: '#size-cells' is a required property > From schema: > /kernel/linux/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml > /kernel/linux/Documentation/devicetree/bindings/mfd/fsl,imx8qxp- > csr.example.dtb: syscon@56221000: 'ranges' is a required property > From schema: > /kernel/linux/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml > --------------------------------8<------------------------------------ > > The error log basically complains two things: > 1) The example nodename 'syscon@56221000' should match > '^bus(@[0-9a-f]+)?$'. > 2) Missing '#address-cells', '#size-cells' and 'ranges' properties as > required by simple-pm-bus. > > Regarding 1), if I change 'syscon@56221000' to 'bus@56221000', then the > below error comes along: > --------------------------------8<------------------------------------ > /kernel/linux/Documentation/devicetree/bindings/mfd/fsl,imx8qxp- > csr.example.dtb: bus@56221000: $nodename:0: 'bus@56221000' does not > match '^syscon@[0-9a-f]+$' > From schema: > /kernel/linux/Documentation/devicetree/bindings/mfd/fsl,imx8qxp- > csr.yaml > --------------------------------8<------------------------------------ > So, it looks like "syscon" and "simple-pm-bus" can not be in compatbile > string at the same time. Note that "syscon" is needed because other > device nodes may reference the CSR module through a phandle, like the > "fsl,imx8qxp-mipi-dphy" device. > > Regarding 2), I may try to add those required properties, but it would > break the existing schemas of the child devices of the CSR module, like > the "fsl,imx8qxp-ldb" device, because "reg" property is not allowed. > > So, it looks like the CSR module still should be simple-mfd device but > not simple-pm-bus device, right? It sounds like the generic auto-probing functionality provided by the kernel works well to give you with a fully self-registering mechanism. All you need to do now is figure out why the DT checker is not happy with your solution. Please work with the Device Tree maintainers on this. > > > One more point which might be overlooked - as mentioned in commit > > > message, the CSR module is a child node of a simple power-managed > > > bus(i.MX8qxp pixel link MSI bus), which means the child devices of the > > > CSR module(as a simple-mfd device) won't be populated by > > > of_platform_default_populate() from of_platform_default_populate_init() > > > because "simple-pm-bus" is not listed in of_default_bus_match_table[] > > > and hence recursion of of_platform_bus_create() will stop at the > > > simple-pm-bus. This is also a reason why a dedicated fsl-imx8qxp-csr > > > driver is needed to populated those child devices of the CSR module. > > > > Not sure I know the semantics well enough (anymore) to get a > > meaningful picture of what you're trying to explain, and I do not have > > any suitable H/W here to mock-up a real-world test-bed / concept > > demonstrator to debug this for you. > > I understand you have no hardware to debug this directly. But, the > example in dt-binding doc for the i.MX8qxp pixel link MSI bus(a simple- > pm-bus) may give you a kinda full picture of what the relevant devices > look like. I mentioned the patch set to add the MSI bus previously, > however, you may find the binding doc directly here - > https://lore.kernel.org/lkml/20221017074039.4181843-3-victor.liu@nxp.com/ > > > > > The long and the short of it is; we have a bunch of automatic > > child-device-registering helpers in the kernel. One of the mechanisms > > is bound to work for you if you structure your code appropriately. > > > > Introducing an empty, meaningless driver, simply to call a single > > function it not acceptable. Please make the infrastructure already > > offered specifically to solve this category of issue work for your > > use-case. > > Yeah, I tried to not to introduce a new driver for the CSR module, but > it seems that it is needed. It's not. :)
On Wed, 09 Nov 2022, Ying Liu wrote: > > Yeah, I tried to not to introduce a new driver for the CSR module, but > > it seems that it is needed. > > After more experiments, I think it's appropriate to take the CSR module as a > simple-pm-bus device instead of a simple-mfd device. This requires to change > the existing DT bindings for the CSR module and it's child devices. I'll send the > change out once it is ready. Thanks for Lee's review and comments. Excellent, well done. No problem, you're very welcome.
On Mon, Nov 7, 2022 at 9:58 PM Liu Ying <victor.liu@nxp.com> wrote: > > Hi Lee, > > On Mon, 2022-11-07 at 09:05 +0000, Lee Jones wrote: > > On Wed, 02 Nov 2022, Liu Ying wrote: > > > > > Hi Lee, > > > > > > On Tue, 2022-11-01 at 13:53 +0800, Liu Ying wrote: > > > > Hi Lee, > > > > > > > > On Mon, 2022-10-31 at 15:40 +0000, Lee Jones wrote: > > > > > On Mon, 17 Oct 2022, Liu Ying wrote: > > > > > > > > > > > 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 <victor.liu@nxp.com> > > > > > > --- > > > > > > 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/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 <linux/module.h> > > > > > > +#include <linux/of_platform.h> > > > > > > +#include <linux/platform_device.h> > > > > > > +#include <linux/pm_runtime.h> > > > > > > + > > > > > > +static int imx8qxp_csr_probe(struct platform_device *pdev) > > > > > > +{ > > > > > > + int ret; > > > > > > + > > > > > > + pm_runtime_enable(&pdev->dev); > > > > > > + > > > > > > + ret = devm_of_platform_populate(&pdev->dev); > > > > > > > > > > The use of this API does not constitute a MFD. > > > > > > > > > > Please use "simple-mfd" instead. > > > > > > > > simple-mfd devices have "ONLY_BUS" set in simple-pm-bus.c, so the > > > > simple-pm-bus driver would not populate child devices of simple-mfd > > > > devices. > > > > Right, simple-pm-bus will not populate child devices, because: > > simple-pm-bus.c may populate child devices of simple-pm-bus devices > because "ONLY_BUS" is _not_ set for simple-pm-bus devices. > > simple-pm-bus.c would _not_ populate child devices of simple-mfd > devices because "ONLY_BUS" is set for simple-mfd devices. > > > > > /* > > * These are transparent bus devices (not simple-pm-bus matches) that > > * have their child nodes populated automatically. So, don't need to > > * do anything more. We only match with the device if this driver is > > * the most specific match because we don't want to incorrectly bind to > > * a device that has a more specific driver. > > */ > > > > So "simple-mfd" must be populated elsewhere i.e. drivers/of/platform.c. > > If simple-mfd device is a child device of one device listed in > of_default_bus_match_table[], then it may be populated by > drivers/of/platform.c. But, in my case, simple-mfd device is a child > device of simple-pm-bus device(not listed in that table), so it will > not be populated by drivers/of/platform.c. Instead, > drivers/bus/simple-pm-bus.c would populate the simple-mfd device. > > > > > > > Also, the simple-pm-bus driver would not enable runtime > > > > power management for simple-mfd devices due to "ONLY_BUS", which > > > > means it would not propagate power management operations from child > > > > devices of simple-mfd devices to parent devices of simple-mfd > > > > devices. That's why a dedicated fsl-imx8qxp-csr driver is needed. > > > > This is more of an issue. > > > > Why can't this device use "simple-pm-bus" to have support for both > > auto-registration AND Runtime PM? > > If I change the compatible string of the CSR module from > "fsl,imx8qxp-mipi-lvds-csr", "syscon", "simple-mfd" > to > "fsl,imx8qxp-mipi-lvds-csr", "syscon", "simple-pm-bus", > all devices I'm interested in are populated and all relevant drivers > can probe. But, this change makes 'make dt_binding_check' for the > existing fsl,imx8qxp-csr.yaml fail: As 'simple-bus' is for MMIO devices, so is 'simple-pm-bus' with the addition of PM capabilities. That means you have registers defined (reg), but you don't. Either you have a block with mixed functions or you have separate blocks. If the register space is all mixed together, then it is the former and an MFD. Don't be designing your binding based on Linux behavior. Rob
On Mon, 2022-11-14 at 14:54 -0600, Rob Herring wrote: > On Mon, Nov 7, 2022 at 9:58 PM Liu Ying <victor.liu@nxp.com> wrote: > > Hi Lee, > > > > On Mon, 2022-11-07 at 09:05 +0000, Lee Jones wrote: > > > On Wed, 02 Nov 2022, Liu Ying wrote: > > > > > > > Hi Lee, > > > > > > > > On Tue, 2022-11-01 at 13:53 +0800, Liu Ying wrote: > > > > > Hi Lee, > > > > > > > > > > On Mon, 2022-10-31 at 15:40 +0000, Lee Jones wrote: > > > > > > On Mon, 17 Oct 2022, Liu Ying wrote: > > > > > > > > > > > > > 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 <victor.liu@nxp.com> > > > > > > > --- > > > > > > > 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/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 <linux/module.h> > > > > > > > +#include <linux/of_platform.h> > > > > > > > +#include <linux/platform_device.h> > > > > > > > +#include <linux/pm_runtime.h> > > > > > > > + > > > > > > > +static int imx8qxp_csr_probe(struct platform_device *pdev) > > > > > > > +{ > > > > > > > + int ret; > > > > > > > + > > > > > > > + pm_runtime_enable(&pdev->dev); > > > > > > > + > > > > > > > + ret = devm_of_platform_populate(&pdev->dev); > > > > > > > > > > > > The use of this API does not constitute a MFD. > > > > > > > > > > > > Please use "simple-mfd" instead. > > > > > > > > > > simple-mfd devices have "ONLY_BUS" set in simple-pm-bus.c, so the > > > > > simple-pm-bus driver would not populate child devices of simple-mfd > > > > > devices. > > > > > > Right, simple-pm-bus will not populate child devices, because: > > > > simple-pm-bus.c may populate child devices of simple-pm-bus devices > > because "ONLY_BUS" is _not_ set for simple-pm-bus devices. > > > > simple-pm-bus.c would _not_ populate child devices of simple-mfd > > devices because "ONLY_BUS" is set for simple-mfd devices. > > > > > /* > > > * These are transparent bus devices (not simple-pm-bus matches) that > > > * have their child nodes populated automatically. So, don't need to > > > * do anything more. We only match with the device if this driver is > > > * the most specific match because we don't want to incorrectly bind to > > > * a device that has a more specific driver. > > > */ > > > > > > So "simple-mfd" must be populated elsewhere i.e. drivers/of/platform.c. > > > > If simple-mfd device is a child device of one device listed in > > of_default_bus_match_table[], then it may be populated by > > drivers/of/platform.c. But, in my case, simple-mfd device is a child > > device of simple-pm-bus device(not listed in that table), so it will > > not be populated by drivers/of/platform.c. Instead, > > drivers/bus/simple-pm-bus.c would populate the simple-mfd device. > > > > > > > Also, the simple-pm-bus driver would not enable runtime > > > > > power management for simple-mfd devices due to "ONLY_BUS", which > > > > > means it would not propagate power management operations from child > > > > > devices of simple-mfd devices to parent devices of simple-mfd > > > > > devices. That's why a dedicated fsl-imx8qxp-csr driver is needed. > > > > > > This is more of an issue. > > > > > > Why can't this device use "simple-pm-bus" to have support for both > > > auto-registration AND Runtime PM? > > > > If I change the compatible string of the CSR module from > > "fsl,imx8qxp-mipi-lvds-csr", "syscon", "simple-mfd" > > to > > "fsl,imx8qxp-mipi-lvds-csr", "syscon", "simple-pm-bus", > > all devices I'm interested in are populated and all relevant drivers > > can probe. But, this change makes 'make dt_binding_check' for the > > existing fsl,imx8qxp-csr.yaml fail: > > As 'simple-bus' is for MMIO devices, so is 'simple-pm-bus' with the > addition of PM capabilities. That means you have registers defined > (reg), but you don't. > > Either you have a block with mixed functions or you have separate > blocks. If the register space is all mixed together, then it is the > former and an MFD. Don't be designing your binding based on Linux > behavior. Thanks for clarifying how to differetiate MFD and 'simple-bus'/'simple- pm-bus'. I would say the register space of the CSR module is mixed together, e.g., LVDS PHY child device has a register offset 0x00, PXL2DPI child device has a register offset 0x40 and LDB child device has register offsets 0x20 and 0xe0 in i.MX8qxp MIPI DSI/LVDS combo subsystem CSR module register space. So, it appears to be a MFD. Lee, what do you think? If it is indeed an MFD, a new MFD driver for the CSR module is needed then. Regards, Liu Ying
On Mon, Nov 14, 2022 at 11:22 PM Liu Ying <victor.liu@nxp.com> wrote: > On Mon, 2022-11-14 at 14:54 -0600, Rob Herring wrote: > > On Mon, Nov 7, 2022 at 9:58 PM Liu Ying <victor.liu@nxp.com> wrote: > > > Hi Lee, > > > > > > On Mon, 2022-11-07 at 09:05 +0000, Lee Jones wrote: > > > > On Wed, 02 Nov 2022, Liu Ying wrote: > > > > > > > > > Hi Lee, > > > > > > > > > > On Tue, 2022-11-01 at 13:53 +0800, Liu Ying wrote: > > > > > > Hi Lee, > > > > > > > > > > > > On Mon, 2022-10-31 at 15:40 +0000, Lee Jones wrote: > > > > > > > On Mon, 17 Oct 2022, Liu Ying wrote: > > > > > > > [...] > > > > > > > > + ret = devm_of_platform_populate(&pdev->dev); > > > > > > > > > > > > > > The use of this API does not constitute a MFD. > > > > > > > > > > > > > > Please use "simple-mfd" instead. > > > > > > > > > > > > simple-mfd devices have "ONLY_BUS" set in simple-pm-bus.c, so the > > > > > > simple-pm-bus driver would not populate child devices of simple-mfd > > > > > > devices. > > > > > > > > Right, simple-pm-bus will not populate child devices, because: > > > > > > simple-pm-bus.c may populate child devices of simple-pm-bus devices > > > because "ONLY_BUS" is _not_ set for simple-pm-bus devices. > > > > > > simple-pm-bus.c would _not_ populate child devices of simple-mfd > > > devices because "ONLY_BUS" is set for simple-mfd devices. > > > > > > > /* > > > > * These are transparent bus devices (not simple-pm-bus matches) that > > > > * have their child nodes populated automatically. So, don't need to > > > > * do anything more. We only match with the device if this driver is > > > > * the most specific match because we don't want to incorrectly bind to > > > > * a device that has a more specific driver. > > > > */ > > > > > > > > So "simple-mfd" must be populated elsewhere i.e. drivers/of/platform.c. > > > > > > If simple-mfd device is a child device of one device listed in > > > of_default_bus_match_table[], then it may be populated by > > > drivers/of/platform.c. But, in my case, simple-mfd device is a child > > > device of simple-pm-bus device(not listed in that table), so it will > > > not be populated by drivers/of/platform.c. Instead, > > > drivers/bus/simple-pm-bus.c would populate the simple-mfd device. > > > > > > > > > Also, the simple-pm-bus driver would not enable runtime > > > > > > power management for simple-mfd devices due to "ONLY_BUS", which > > > > > > means it would not propagate power management operations from child > > > > > > devices of simple-mfd devices to parent devices of simple-mfd > > > > > > devices. That's why a dedicated fsl-imx8qxp-csr driver is needed. > > > > > > > > This is more of an issue. > > > > > > > > Why can't this device use "simple-pm-bus" to have support for both > > > > auto-registration AND Runtime PM? > > > > > > If I change the compatible string of the CSR module from > > > "fsl,imx8qxp-mipi-lvds-csr", "syscon", "simple-mfd" > > > to > > > "fsl,imx8qxp-mipi-lvds-csr", "syscon", "simple-pm-bus", > > > all devices I'm interested in are populated and all relevant drivers > > > can probe. But, this change makes 'make dt_binding_check' for the > > > existing fsl,imx8qxp-csr.yaml fail: > > > > As 'simple-bus' is for MMIO devices, so is 'simple-pm-bus' with the > > addition of PM capabilities. That means you have registers defined > > (reg), but you don't. > > > > Either you have a block with mixed functions or you have separate > > blocks. If the register space is all mixed together, then it is the > > former and an MFD. Don't be designing your binding based on Linux > > behavior. > > Thanks for clarifying how to differetiate MFD and 'simple-bus'/'simple- > pm-bus'. I would say the register space of the CSR module is mixed > together, e.g., LVDS PHY child device has a register offset 0x00, > PXL2DPI child device has a register offset 0x40 and LDB child device > has register offsets 0x20 and 0xe0 in i.MX8qxp MIPI DSI/LVDS combo > subsystem CSR module register space. So, it appears to be a MFD. > > Lee, what do you think? If it is indeed an MFD, a new MFD driver for > the CSR module is needed then. There already exists a driver which does what you need, so why create a 2nd one? Just add the "fsl,imx8qxp-mipi-lvds-csr" compatible to the simple-pm-bus match table and don't set ONLY_BUS. Isn't that enough? Rob
On Tue, 2022-11-15 at 07:33 -0600, Rob Herring wrote: > On Mon, Nov 14, 2022 at 11:22 PM Liu Ying <victor.liu@nxp.com> wrote: > > On Mon, 2022-11-14 at 14:54 -0600, Rob Herring wrote: > > > On Mon, Nov 7, 2022 at 9:58 PM Liu Ying <victor.liu@nxp.com> wrote: > > > > Hi Lee, > > > > > > > > On Mon, 2022-11-07 at 09:05 +0000, Lee Jones wrote: > > > > > On Wed, 02 Nov 2022, Liu Ying wrote: > > > > > > > > > > > Hi Lee, > > > > > > > > > > > > On Tue, 2022-11-01 at 13:53 +0800, Liu Ying wrote: > > > > > > > Hi Lee, > > > > > > > > > > > > > > On Mon, 2022-10-31 at 15:40 +0000, Lee Jones wrote: > > > > > > > > On Mon, 17 Oct 2022, Liu Ying wrote: > > > > > > > > > > [...] > > > > > > > > > > + ret = devm_of_platform_populate(&pdev->dev); > > > > > > > > > > > > > > > > The use of this API does not constitute a MFD. > > > > > > > > > > > > > > > > Please use "simple-mfd" instead. > > > > > > > > > > > > > > simple-mfd devices have "ONLY_BUS" set in simple-pm-bus.c, so the > > > > > > > simple-pm-bus driver would not populate child devices of simple-mfd > > > > > > > devices. > > > > > > > > > > Right, simple-pm-bus will not populate child devices, because: > > > > > > > > simple-pm-bus.c may populate child devices of simple-pm-bus devices > > > > because "ONLY_BUS" is _not_ set for simple-pm-bus devices. > > > > > > > > simple-pm-bus.c would _not_ populate child devices of simple-mfd > > > > devices because "ONLY_BUS" is set for simple-mfd devices. > > > > > > > > > /* > > > > > * These are transparent bus devices (not simple-pm-bus matches) that > > > > > * have their child nodes populated automatically. So, don't need to > > > > > * do anything more. We only match with the device if this driver is > > > > > * the most specific match because we don't want to incorrectly bind to > > > > > * a device that has a more specific driver. > > > > > */ > > > > > > > > > > So "simple-mfd" must be populated elsewhere i.e. drivers/of/platform.c. > > > > > > > > If simple-mfd device is a child device of one device listed in > > > > of_default_bus_match_table[], then it may be populated by > > > > drivers/of/platform.c. But, in my case, simple-mfd device is a child > > > > device of simple-pm-bus device(not listed in that table), so it will > > > > not be populated by drivers/of/platform.c. Instead, > > > > drivers/bus/simple-pm-bus.c would populate the simple-mfd device. > > > > > > > > > > > Also, the simple-pm-bus driver would not enable runtime > > > > > > > power management for simple-mfd devices due to "ONLY_BUS", which > > > > > > > means it would not propagate power management operations from child > > > > > > > devices of simple-mfd devices to parent devices of simple-mfd > > > > > > > devices. That's why a dedicated fsl-imx8qxp-csr driver is needed. > > > > > > > > > > This is more of an issue. > > > > > > > > > > Why can't this device use "simple-pm-bus" to have support for both > > > > > auto-registration AND Runtime PM? > > > > > > > > If I change the compatible string of the CSR module from > > > > "fsl,imx8qxp-mipi-lvds-csr", "syscon", "simple-mfd" > > > > to > > > > "fsl,imx8qxp-mipi-lvds-csr", "syscon", "simple-pm-bus", > > > > all devices I'm interested in are populated and all relevant drivers > > > > can probe. But, this change makes 'make dt_binding_check' for the > > > > existing fsl,imx8qxp-csr.yaml fail: > > > > > > As 'simple-bus' is for MMIO devices, so is 'simple-pm-bus' with the > > > addition of PM capabilities. That means you have registers defined > > > (reg), but you don't. > > > > > > Either you have a block with mixed functions or you have separate > > > blocks. If the register space is all mixed together, then it is the > > > former and an MFD. Don't be designing your binding based on Linux > > > behavior. > > > > Thanks for clarifying how to differetiate MFD and 'simple-bus'/'simple- > > pm-bus'. I would say the register space of the CSR module is mixed > > together, e.g., LVDS PHY child device has a register offset 0x00, > > PXL2DPI child device has a register offset 0x40 and LDB child device > > has register offsets 0x20 and 0xe0 in i.MX8qxp MIPI DSI/LVDS combo > > subsystem CSR module register space. So, it appears to be a MFD. > > > > Lee, what do you think? If it is indeed an MFD, a new MFD driver for > > the CSR module is needed then. > > There already exists a driver which does what you need, so why create > a 2nd one? Just add the "fsl,imx8qxp-mipi-lvds-csr" compatible to the > simple-pm-bus match table and don't set ONLY_BUS. Isn't that enough? Adding "fsl,imx8qxp-mipi-lvds-csr" and "fsl,imx8qm-lvds-csr" compatible strings to the simple-pm-bus match table does work, but it tends to make people think the CSR module is a bus instead of a MFD. It's kinka straightforward if a MFD device driver lives in drivers/mfd directory. However, since "simple-mfd" compatible is also in that match table, I would add the CSR module's compatible strings to that match table if no objections. Thanks, Liu Ying
On Wed, 16 Nov 2022, Liu Ying wrote: > On Tue, 2022-11-15 at 07:33 -0600, Rob Herring wrote: > > On Mon, Nov 14, 2022 at 11:22 PM Liu Ying <victor.liu@nxp.com> wrote: > > > On Mon, 2022-11-14 at 14:54 -0600, Rob Herring wrote: > > > > On Mon, Nov 7, 2022 at 9:58 PM Liu Ying <victor.liu@nxp.com> wrote: > > > > > Hi Lee, > > > > > > > > > > On Mon, 2022-11-07 at 09:05 +0000, Lee Jones wrote: > > > > > > On Wed, 02 Nov 2022, Liu Ying wrote: > > > > > > > > > > > > > Hi Lee, > > > > > > > > > > > > > > On Tue, 2022-11-01 at 13:53 +0800, Liu Ying wrote: > > > > > > > > Hi Lee, > > > > > > > > > > > > > > > > On Mon, 2022-10-31 at 15:40 +0000, Lee Jones wrote: > > > > > > > > > On Mon, 17 Oct 2022, Liu Ying wrote: > > > > > > > > > > > > > [...] > > > > > > > > > > > > + ret = devm_of_platform_populate(&pdev->dev); > > > > > > > > > > > > > > > > > > The use of this API does not constitute a MFD. > > > > > > > > > > > > > > > > > > Please use "simple-mfd" instead. > > > > > > > > > > > > > > > > simple-mfd devices have "ONLY_BUS" set in simple-pm-bus.c, so the > > > > > > > > simple-pm-bus driver would not populate child devices of simple-mfd > > > > > > > > devices. > > > > > > > > > > > > Right, simple-pm-bus will not populate child devices, because: > > > > > > > > > > simple-pm-bus.c may populate child devices of simple-pm-bus devices > > > > > because "ONLY_BUS" is _not_ set for simple-pm-bus devices. > > > > > > > > > > simple-pm-bus.c would _not_ populate child devices of simple-mfd > > > > > devices because "ONLY_BUS" is set for simple-mfd devices. > > > > > > > > > > > /* > > > > > > * These are transparent bus devices (not simple-pm-bus matches) that > > > > > > * have their child nodes populated automatically. So, don't need to > > > > > > * do anything more. We only match with the device if this driver is > > > > > > * the most specific match because we don't want to incorrectly bind to > > > > > > * a device that has a more specific driver. > > > > > > */ > > > > > > > > > > > > So "simple-mfd" must be populated elsewhere i.e. drivers/of/platform.c. > > > > > > > > > > If simple-mfd device is a child device of one device listed in > > > > > of_default_bus_match_table[], then it may be populated by > > > > > drivers/of/platform.c. But, in my case, simple-mfd device is a child > > > > > device of simple-pm-bus device(not listed in that table), so it will > > > > > not be populated by drivers/of/platform.c. Instead, > > > > > drivers/bus/simple-pm-bus.c would populate the simple-mfd device. > > > > > > > > > > > > > Also, the simple-pm-bus driver would not enable runtime > > > > > > > > power management for simple-mfd devices due to "ONLY_BUS", which > > > > > > > > means it would not propagate power management operations from child > > > > > > > > devices of simple-mfd devices to parent devices of simple-mfd > > > > > > > > devices. That's why a dedicated fsl-imx8qxp-csr driver is needed. > > > > > > > > > > > > This is more of an issue. > > > > > > > > > > > > Why can't this device use "simple-pm-bus" to have support for both > > > > > > auto-registration AND Runtime PM? > > > > > > > > > > If I change the compatible string of the CSR module from > > > > > "fsl,imx8qxp-mipi-lvds-csr", "syscon", "simple-mfd" > > > > > to > > > > > "fsl,imx8qxp-mipi-lvds-csr", "syscon", "simple-pm-bus", > > > > > all devices I'm interested in are populated and all relevant drivers > > > > > can probe. But, this change makes 'make dt_binding_check' for the > > > > > existing fsl,imx8qxp-csr.yaml fail: > > > > > > > > As 'simple-bus' is for MMIO devices, so is 'simple-pm-bus' with the > > > > addition of PM capabilities. That means you have registers defined > > > > (reg), but you don't. > > > > > > > > Either you have a block with mixed functions or you have separate > > > > blocks. If the register space is all mixed together, then it is the > > > > former and an MFD. Don't be designing your binding based on Linux > > > > behavior. > > > > > > Thanks for clarifying how to differetiate MFD and 'simple-bus'/'simple- > > > pm-bus'. I would say the register space of the CSR module is mixed > > > together, e.g., LVDS PHY child device has a register offset 0x00, > > > PXL2DPI child device has a register offset 0x40 and LDB child device > > > has register offsets 0x20 and 0xe0 in i.MX8qxp MIPI DSI/LVDS combo > > > subsystem CSR module register space. So, it appears to be a MFD. > > > > > > Lee, what do you think? If it is indeed an MFD, a new MFD driver for > > > the CSR module is needed then. > > > > There already exists a driver which does what you need, so why create > > a 2nd one? Just add the "fsl,imx8qxp-mipi-lvds-csr" compatible to the > > simple-pm-bus match table and don't set ONLY_BUS. Isn't that enough? > > Adding "fsl,imx8qxp-mipi-lvds-csr" and "fsl,imx8qm-lvds-csr" compatible > strings to the simple-pm-bus match table does work, but it tends to > make people think the CSR module is a bus instead of a MFD. MFDs don't exist. They're a figment of our imagination. If you want PM enabled and wish for your child devices to be auto-magically registered for you, simple-pm-bus is what you need. > It's kinka > straightforward if a MFD device driver lives in drivers/mfd directory. > However, since "simple-mfd" compatible is also in that match table, I > would add the CSR module's compatible strings to that match table if no > objections. Fine by me if it saves authoring a pointless driver.
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 <linux/module.h> +#include <linux/of_platform.h> +#include <linux/platform_device.h> +#include <linux/pm_runtime.h> + +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 <victor.liu@nxp.com>"); +MODULE_LICENSE("GPL v2");