From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA8FDC43334 for ; Wed, 13 Jul 2022 08:04:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234817AbiGMIEb (ORCPT ); Wed, 13 Jul 2022 04:04:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233739AbiGMIE3 (ORCPT ); Wed, 13 Jul 2022 04:04:29 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 613D6E1900 for ; Wed, 13 Jul 2022 01:04:27 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id a5so14327953wrx.12 for ; Wed, 13 Jul 2022 01:04:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=yaBi5+j2aB+gOEpu/CS6a4crTXK1oluI+G7cSMbxelM=; b=MduZJ4LcUwia674sobuaUywFu/y9XJbPCqF8UXjn0wnRaCT+QZ3XOGx+YAje4xxfsx x9gPEEwK6l26zgKylqiCX6kg+6Qcrx6/7WQ/ytwHvcda4vtybERuZ4s70YTn/BNqLy24 5MeZn8161zhdqCh3Gug8o1zPTpESCgZp9pNlebMEHS9aj8RGpd5fMetXcNCgQ8tnZWl2 oITFcoQoNbdZcmx8uMXLq2HS15pvFWibAtvysAkVPH+IejhAt1//CsNF6qnytW3Sp+Yo iZrLyWZCZeToIHPCPlOTz9lFBuwhiDKL4zdw/LqWzu1dOoE8C4t19oUDKrZTd7BZsh3v b4DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=yaBi5+j2aB+gOEpu/CS6a4crTXK1oluI+G7cSMbxelM=; b=S90fKajvrm1q4sjo/Nvc79g41lgwN/0s2ubMncI3K9A5cBwEU5jjF5orJcDKLxx8Ji sCSRTE22LeTGbIbmQXThViWKDSwDB2aGEJYDpAJAhtV7hB6iNv6PAqNPOXvfbJ5ekIc7 ul16bnCCM8iR4aPjDv2wj2w0hN/1RZU6YI+UKm1+PfFRpwtgeKSEJy2I5P0ZgeXExPdG yVxfAG2LhDl2RX+RHfqGhaYDh83X6lr1cev51RwJYAQVWY6JOGnVxNXqk+SbKy7bryyX 9nw4Z1bK2QwBmcKBlWJIKgYdwCy/LErsbN0xw+5aKXX5CTMgU81E96Y4IQ6ex+VS6QHv nCkA== X-Gm-Message-State: AJIora97sXmEPgQIepqKsZvt7Fu40jMBi2V9ZnVbY0nJtPxzpqF31S63 2XZF/EHvK+gdsofQtsurRl6ICg== X-Google-Smtp-Source: AGRyM1sox2gwD2oOUs0Po8YP6r0hOoKvkq7xKaXz/jSSA3VY7uq2zQIZPBxBD2yVdN4jLfilFwtkQw== X-Received: by 2002:a5d:4890:0:b0:21d:9bf3:89b5 with SMTP id g16-20020a5d4890000000b0021d9bf389b5mr1887795wrq.153.1657699465867; Wed, 13 Jul 2022 01:04:25 -0700 (PDT) Received: from google.com (cpc155339-bagu17-2-0-cust87.1-3.cable.virginm.net. [86.27.177.88]) by smtp.gmail.com with ESMTPSA id l29-20020a05600c1d1d00b0039749b01ea7sm1616879wms.32.2022.07.13.01.04.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jul 2022 01:04:25 -0700 (PDT) Date: Wed, 13 Jul 2022 09:04:22 +0100 From: Lee Jones To: ChiaEn Wu Cc: Daniel Thompson , Jingoo Han , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , Sebastian Reichel , Chunfeng Yun , Greg Kroah-Hartman , Jonathan Cameron , Lars-Peter Clausen , Liam Girdwood , Mark Brown , Guenter Roeck , "Krogerus, Heikki" , Helge Deller , ChiaEn Wu , Alice Chen , ChiYuan Huang , dri-devel , Linux LED Subsystem , devicetree , linux-arm Mailing List , "moderated list:ARM/Mediatek SoC support" , Linux Kernel Mailing List , Linux PM , USB , linux-iio , "open list:FRAMEBUFFER LAYER" , szuni chen Subject: Re: [PATCH v3 07/14] mfd: mt6370: Add Mediatek MT6370 support Message-ID: References: <20220623115631.22209-1-peterwu.pub@gmail.com> <20220623115631.22209-8-peterwu.pub@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On Wed, 13 Jul 2022, ChiaEn Wu wrote: > Hi Lee, > > Thanks for your reply. > > Lee Jones 於 2022年7月12日 週二 晚上11:29寫道: > > > > On Thu, 23 Jun 2022, ChiaEn Wu wrote: > > > > > From: ChiYuan Huang > > > > > > Add Mediatek MT6370 MFD support. > > > > No such thing as "MFD support". > > > > And you're not getting away with submitting a 370 line patch with a 5 > > word change log either. :) > > > > Please at least tell us what the device is and what it's used for. > > I sincerely apologize. > We will add more descriptions of the MT6370 feature in the v5 patch. > > > > > > Signed-off-by: ChiYuan Huang > > > --- > > > > > > v3 > > > - Refine Kconfig help text > > > - Refine error message of unknown vendor ID in > > > mt6370_check_vendor_info() > > > - Refine return value handling of mt6370_regmap_read() > > > - Refine all probe error by using dev_err_probe() > > > - Refine "bank_idx" and "bank_addr" in mt6370_regmap_read() and > > > mt6370_regmap_write() > > > - Add "#define VENID*" and drop the comments in > > > mt6370_check_vendor_info() > > > - Drop "MFD" in MODULE_DESCRIPTION() > > > --- > > > drivers/mfd/Kconfig | 13 ++ > > > drivers/mfd/Makefile | 1 + > > > drivers/mfd/mt6370.c | 358 +++++++++++++++++++++++++++++++++++++++++++++++++++ > > > 3 files changed, 372 insertions(+) > > > create mode 100644 drivers/mfd/mt6370.c [...] > > > +static int mt6370_probe(struct i2c_client *i2c) > > > +{ > > > + struct mt6370_info *info; > > > + struct i2c_client *usbc_i2c; > > > + int ret; > > > + > > > + info = devm_kzalloc(&i2c->dev, sizeof(*info), GFP_KERNEL); > > > + if (!info) > > > + return -ENOMEM; > > > + > > > + info->dev = &i2c->dev; > > > + > > > + usbc_i2c = devm_i2c_new_dummy_device(&i2c->dev, i2c->adapter, > > > + MT6370_USBC_I2CADDR); > > > + if (IS_ERR(usbc_i2c)) > > > + return dev_err_probe(&i2c->dev, PTR_ERR(usbc_i2c), > > > + "Failed to register USBC I2C client\n"); > > > + > > > + /* Assign I2C client for PMU and TypeC */ > > > + info->i2c[MT6370_PMU_I2C] = i2c; > > > + info->i2c[MT6370_USBC_I2C] = usbc_i2c; > > > + > > > + info->regmap = devm_regmap_init(&i2c->dev, &mt6370_regmap_bus, info, > > > + &mt6370_regmap_config); > > > > Apart from in mt6370_check_vendor_info() where is this actually used? > > Well... from my understanding, we use this MFD driver to make other > drivers of MT6370 (e.g. charger, ADC, led...) use the same regmap > settings. > Thus, this regmap is not only used in mt6370_check_vendor_info(). Well for that to happen you need to store the data somewhere for the child devices to fetch from. I don't see that happening in this patch? What did I miss? -- Lee Jones [李琼斯] Principal Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog