Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1750352pxp; Mon, 7 Mar 2022 01:22:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJyr1cI7N0DwWwsos1PQthMYJfn3fhkMtH1odmRelF3RDdHuQG48WWU53LYGEXNpV+OrVKvx X-Received: by 2002:a17:90b:38ce:b0:1bf:a34:5bad with SMTP id nn14-20020a17090b38ce00b001bf0a345badmr23399001pjb.129.1646644930993; Mon, 07 Mar 2022 01:22:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1646644930; cv=pass; d=google.com; s=arc-20160816; b=J865WA2tzR05pCwFJsVgC1kH/z8yNecz0ce/khQXJCQkS3h5iDUM0bpoIzJTMkRceB yHofMhxkt6moR8qn02cvV9pU9YOa81J2Jz3taJcoM9Zht/Q0Oir/JkIRNG+rN2+dSQCT aBihp9QEbkMXMPiyiH2qRYl+HW6/q+BX1+MEbewUYwY7yGLyYwYs5e1+oQrSwji/+j1F Rzr8zorHNcH+9KxxxCDn8REKc5Qn5lnNldSyx4b7+uJLvCPVJrM7oy2WYL3dEasLQ4Yj Ft7WOLSqxquX+VtAB1p6jgHbeHc2U2dDx1NZDQdt7dv0YOz+0gBWLNlPozckcce3BkY0 mI6A== 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 :in-reply-to:content-language:references:cc:to:subject:from :user-agent:date:message-id:dkim-signature; bh=PBpYQCmvglytjmXTYjsCZqf6qka47l1kSWPxurn/kPs=; b=y6UYmLsnGMvaTRmMxsBOecvPSzPrwP5HQrf1lPdGLAyNJbOG2ObV6a48od8DtM0YTS gkAyx9lCUFNyyyYy38/wTfbdJnCXvt+TAkrwP1zHvxA2IFIfSWjpcdZW+2IL1Vy9Dscs ceRjnsnBW5B21DjVctEW6TmYXdkExoBnd3lrZYuN49MmU0CUzP+F3tsnXl2Tp5CvE6Pn b6bLe+CYWVjCPusHDmE4u+c7exypJzA9DfOGdagDtnrHzKga/I+69GdF1yKzuG4/2AVY qHfCOz9eoo53+MHc0oXHlG6VBHI7eiMDPIJCJv/nWig46JPmP6CSvHMURygfRW8XkbMA FuUA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=FrFU+6Hq; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h192-20020a636cc9000000b00372eb3a9c8fsi11324764pgc.138.2022.03.07.01.21.55; Mon, 07 Mar 2022 01:22:10 -0800 (PST) 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=@os.amperecomputing.com header.s=selector2 header.b=FrFU+6Hq; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236182AbiCGIdM (ORCPT + 99 others); Mon, 7 Mar 2022 03:33:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235209AbiCGIdK (ORCPT ); Mon, 7 Mar 2022 03:33:10 -0500 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2136.outbound.protection.outlook.com [40.107.223.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D034262A23; Mon, 7 Mar 2022 00:32:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TdNR5XU39GAwgJho/0Lh8fl/x14ZqZ0JJxXhCkibCZ2nDZQEukIVIoa8fRuo+huenr4JJThUymKRHX1x0Oe+dpWCh6AYPFvWcBRtACAH8q2WB8W6+VYcuqKooGTiTri2vaIXPfPtSIWlVxY7Gm6iU3yLuXl6aVUw5xM4gFddBZ4cwq51VgflzhpUSPS67wFCROq/5lDEFdOqSpQhzUqOTPoCry63NAUBn+ZnlR8+SfVgwx8UefkzbEz9xo5PL36RjdvyP0cgGamhQtxURunHf1ByKGs39wmfgZ/QfkdrV5lytM6A3cI5l8I54eupFpeVsh3Tz0adqcu1nx4ew2BZIA== 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=PBpYQCmvglytjmXTYjsCZqf6qka47l1kSWPxurn/kPs=; b=hNqUHA11yeQQKBJZqsb5rKW9Ss+Z1U5AxBkbGXMVk9mU1JhFD15OUVJjTQVVRqXVCrGrwLy3QlHmM9PjSmLO3r20PP9gMCsprttJQVo73GceKH9IoeeWSX32RI9FC12tDSdEPUGr9UZ3SwQrRDa8kTgmufOCS5AnByCAYuqtBE/QnWQHfb9+kb9us2z7bJDMJgALOPRdzILK2I5hs9OjvZTyYnYcbY5nOfWtaVRq/4m2ByMKlnQdwJSdtJzi+hcIXdfgieXI0vWtTdWJji/DvwIr0OZ7EApdMIQXpVt0ONWSMl38tn6fdSGxU6undxOcij6FYXUhxOsQ0iXZVLBF4A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PBpYQCmvglytjmXTYjsCZqf6qka47l1kSWPxurn/kPs=; b=FrFU+6HqOreBzQUjEsPCvsQcTa0s7jTDbZt0CrlXc4wZwx6cF5xD46ucqcGYly3UKpTB+NJvtvsfhuerZQ2QG31q45jMEmB4cFUkSCfycgVAgbdIEZsnlcTXA33+ShTUehSwNa4w3Hn43JjkLaza/Xe+lgE9w5rY3EkDGmMycOc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SJ0PR01MB7282.prod.exchangelabs.com (2603:10b6:a03:3f2::24) by MW2PR0102MB3498.prod.exchangelabs.com (2603:10b6:302:3::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.20; Mon, 7 Mar 2022 08:32:14 +0000 Received: from SJ0PR01MB7282.prod.exchangelabs.com ([fe80::cd24:39ed:7042:46d6]) by SJ0PR01MB7282.prod.exchangelabs.com ([fe80::cd24:39ed:7042:46d6%6]) with mapi id 15.20.5038.026; Mon, 7 Mar 2022 08:32:14 +0000 Message-ID: Date: Mon, 7 Mar 2022 15:31:59 +0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 From: Quan Nguyen Subject: Re: [PATCH v6 2/9] mfd: smpro-mfd: Adds Ampere's Altra SMpro MFD driver To: Lee Jones Cc: Open Source Submission , Phong Vo , "Thang Q . Nguyen" , Joel Stanley , Andrew Jeffery , Jean Delvare , Guenter Roeck , Rob Herring , Jonathan Corbet , linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-aspeed@lists.ozlabs.org, openbmc@lists.ozlabs.org, Mark Brown , Greg Kroah-Hartman , "Rafael J . Wysocki" , Derek Kiernan , Dragan Cvetic , Arnd Bergmann , Gustavo Pimentel References: <20211224041352.29405-1-quan@os.amperecomputing.com> <20211224041352.29405-3-quan@os.amperecomputing.com> Content-Language: en-US In-Reply-To: <20211224041352.29405-3-quan@os.amperecomputing.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SG2PR06CA0252.apcprd06.prod.outlook.com (2603:1096:4:ac::36) To SJ0PR01MB7282.prod.exchangelabs.com (2603:10b6:a03:3f2::24) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: eedae702-8637-4c1e-88e2-08da0014fb08 X-MS-TrafficTypeDiagnostic: MW2PR0102MB3498:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: u+JCyaHdR1euJrsSgDTDwAQv+zpM6iyeRQ3YWgrvjaB89iinfs9oYolJGTIP4eQSv4K509Eni0wuvfCUtY8z5FNcHzDIoFiN+LStSHjVGRUIKtA/FXlFEQiShGu/AZdHJtST3dPj4BSfmSI5aPdh4VY7C0Bki2S2Nqi+p+pbzsvCdJu8ULpxSK5vdiigOcRmFFLfJHZyeKBCExBpwtDRI1d5ZkGAn98kcgnacqot429j2LY1tN1L0Rs6hdkrgWczGYeVcc7H8gvsj6c5O23DSIgWRfLRYW9pAyh8/DIUZpPZVBFAoSgmFbmhI/2KRb582i2H0mzNrFyd0xlGZjrDhid45cDTDd3l9JpI0dNXfmA/BATEFEk4aYwC9Wq7xiV6iD1d8bWSBq6XIcqnpnVlS51c+H9raOl/dHQz9S6ts5Uzv08DTyv5lnI5UmY0VPvjph4FUbMd6t3eq2D1YjFaaGWQpc5EP5mjgLFFnA8/9MwrWc4rjnPkENszLyh+sofzzI3iT/7NKRdL2b/2h94FecrGyTYjV8M3SbcGZveZyjrns9zuULAJIpfkYa+jg7XnqhB4OG2ySSbCZHgZ3DqyqkBtv4mC3MSDe3CjwYUPnRD66Di/vSyz+6nhZHP0oj2LOhsC2/YTTPzQByndB4o8tu913k8BWv/67b3YZFaoofBNTu3xF0mcCdwagyeVBq4i5ALspf5O+cGoTT9rxL695h0TG/Pag7Djltd9KvByZuBzeJY7zZNwstHji+rZ1fUV8DqUegZU6dbiAOahgPuYPlHi7pDtdTGeeTYBzeRwa3Uhjr6tv6C7eXmXhdh1e8zN X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR01MB7282.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(6512007)(5660300002)(52116002)(6916009)(31686004)(6506007)(26005)(38350700002)(8676002)(66476007)(6666004)(966005)(86362001)(6486002)(55236004)(53546011)(54906003)(316002)(31696002)(2906002)(186003)(66556008)(4326008)(83380400001)(508600001)(8936002)(66946007)(7416002)(38100700002)(2616005)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VXVBaWZkWGxjeko2QjRjaWh0ZXpHRVFHekJ3cmEvT0dmV1dvQnBXeFJjbWxo?= =?utf-8?B?ZjYwU2EvN1dzZ29DY2dVbmp3SUI4ZmYwQzNhUTM0ZVBUd2M3ZTFPR3FpVVJI?= =?utf-8?B?ZWtxOFhjS2R6SXhYYzNNOS9yTWE1b0ZKR3NjR1pjZmxTZ0dTcXBJQTluWjdo?= =?utf-8?B?Z1h1NEFLdU9lN2JEZmlvOVg2ZX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TEVhb3RDSFd5NFNMUFdsQXF5Y1VxOSs4RWh5RFhwR1JGNWRHR3FIOFZmWjdT?= =?utf-8?B?WkZnR3M2QXVPb3N1b1N2N2dyb1FiOTlkejlUTUNGMHBNN2hRdFlJQlVUcndC?= =?utf-8?B?dE5NWDdkOTRNZFEyZmVxbDRqWXNQQXZUNmNBRC9VbXZVTjREaGtTaXAwd0Nx?= =?utf-8?B?U1VOUEJyZUZTZzBrK1orWGt4dHF0MGRrSXFhS1ZCdzlTYlJ5QWdVRmR0OWFy?= =?utf-8?Q?BGLAHfrQfCQ3gzfzZQAchORJVbSERw/2FqU/vxkGGA=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: eedae702-8637-4c1e-88e2-08da0014fb08 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR01MB7282.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2022 08:32:13.9207 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mfbxNgFvoii+/k0VbXAx9LWo/6k6se8/4yZanAHSbZe8yjXulXygn6/HPq/Ip7Alg8aPz2okHlg9ooji/w0TbKGkLGHl/e1xPcoq8ctxazQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR0102MB3498 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Dear Lee Jone, My apologize as I did not see any of your replys for this series. Maybe due to my bad junk setting, So this email is to address your comment in https://lkml.org/lkml/2022/2/8/254 Please see my inline below. Thanks for the review, - Quan On 24/12/2021 11:13, Quan Nguyen wrote: > Adds Multi-function devices driver for SMpro co-processor found on the > Mt.Jade hardware reference platform with Ampere's Altra processor family. > > Signed-off-by: Quan Nguyen > --- > Changes in v6: > + Update license part to reflect that this driver is clone from > simple-mfd-i2c driver [Quan] > > Changes in v5: > + Dropped the use of simple-mfd-i2c driver [Quan] > + Introduced drivers/mfd/smpro-mfd.c driver to instantiate > sub-devices. This is to avoid DT nodes without resource issue [Quan] > + Revised commit message [Quan] > > Changes in v4: > + Add "depends on I2C" to fix build issue found by kernel test > robot [Guenter] > > Changes in v3: > + None > > Changes in v2: > + Used 'struct of_device_id's .data attribute [Lee Jones] > > drivers/mfd/Kconfig | 12 +++++++ > drivers/mfd/Makefile | 1 + > drivers/mfd/smpro-mfd.c | 76 +++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 89 insertions(+) > create mode 100644 drivers/mfd/smpro-mfd.c > > diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig > index a21cbdf89477..a886da5018b1 100644 > --- a/drivers/mfd/Kconfig > +++ b/drivers/mfd/Kconfig > @@ -77,6 +77,18 @@ config MFD_AS3711 > help > Support for the AS3711 PMIC from AMS > > +config MFD_SMPRO > + tristate "Ampere Computing MFD SMpro core driver" > + depends on I2C > + select MFD_CORE > + select REGMAP_I2C > + help > + Say yes here to enable SMpro driver support for Ampere's Altra > + processor family. > + > + Ampere's Altra SMpro exposes an I2C regmap interface that can > + be accessed by child devices. > + > config MFD_AS3722 > tristate "ams AS3722 Power Management IC" > select MFD_CORE > diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile > index 4d53e951a92d..fbcd09dce5ce 100644 > --- a/drivers/mfd/Makefile > +++ b/drivers/mfd/Makefile > @@ -267,6 +267,7 @@ obj-$(CONFIG_MFD_QCOM_PM8008) += qcom-pm8008.o > > obj-$(CONFIG_SGI_MFD_IOC3) += ioc3.o > obj-$(CONFIG_MFD_SIMPLE_MFD_I2C) += simple-mfd-i2c.o > +obj-$(CONFIG_MFD_SMPRO) += smpro-mfd.o > obj-$(CONFIG_MFD_INTEL_M10_BMC) += intel-m10-bmc.o > > obj-$(CONFIG_MFD_ATC260X) += atc260x-core.o > diff --git a/drivers/mfd/smpro-mfd.c b/drivers/mfd/smpro-mfd.c > new file mode 100644 > index 000000000000..132d4e2dde12 > --- /dev/null > +++ b/drivers/mfd/smpro-mfd.c > @@ -0,0 +1,76 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* > + * Ampere Altra Family SMPro MFD - I2C > + * > + * Copyright (c) 2021, Ampere Computing LLC > + * Author: Quan Nguyen > + * > + * Based on simple-mfd-i2c.c: [Lee Jones] Why aren't you just using this? Mainly, on this series, is because we need to add empty DT nodes for child drivers to be instantiated which was NAK because DT nodes should be for describe HW specific other than to instantiate drivers. And, as other reason, in my new version, I found that we will need separate MFD driver so that multiple type of bus access could be handled (by using regmap_bus->read/write()). > + * Copyright (c) by Michael Walle > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > + > +/* Identification Registers */ > +#define MANUFACTURER_ID_REG 0x02 > +#define AMPERE_MANUFACTURER_ID 0xCD3A > + > +static const struct regmap_config simple_word_regmap_config = { > + .reg_bits = 8, > + .val_bits = 16, > +}; > + > +static const struct mfd_cell smpro_devs[] = { > + MFD_CELL_NAME("smpro-hwmon"), > +}; [Lee Jones] What are the other devices? The other devices are smpro-errmon (to query HW error reported by Altra Family processor) and smpro-misc (to handle other miscellaneous info). > + > +static int smpro_mfd_probe(struct i2c_client *i2c) > +{ > + const struct regmap_config *config; > + struct regmap *regmap; > + unsigned int val; > + int ret; > + > + config = device_get_match_data(&i2c->dev); > + if (!config) > + config = &simple_word_regmap_config; > + > + regmap = devm_regmap_init_i2c(i2c, config); > + if (IS_ERR(regmap)) > + return PTR_ERR(regmap); > + > + /* Check for valid ID */ > + ret = regmap_read(regmap, MANUFACTURER_ID_REG, &val); > + if (ret) > + return ret; > + > + if (val != AMPERE_MANUFACTURER_ID) > + return -ENODEV; > + > + return devm_mfd_add_devices(&i2c->dev, PLATFORM_DEVID_AUTO, > + smpro_devs, ARRAY_SIZE(smpro_devs), NULL, 0, NULL); > +} > + > +static const struct of_device_id smpro_mfd_of_match[] = { > + { .compatible = "ampere,smpro", .data = &simple_word_regmap_config }, > + {} > +}; > +MODULE_DEVICE_TABLE(of, smpro_mfd_of_match); > + > +static struct i2c_driver smpro_mfd_driver = { > + .probe_new = smpro_mfd_probe, > + .driver = { > + .name = "smpro-mfd-i2c", > + .of_match_table = smpro_mfd_of_match, > + }, > +}; > +module_i2c_driver(smpro_mfd_driver); > + > +MODULE_AUTHOR("Quan Nguyen "); > +MODULE_DESCRIPTION("SMPRO MFD - I2C driver"); > +MODULE_LICENSE("GPL v2");