Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp422844pxv; Thu, 8 Jul 2021 05:48:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLCwzUUANLdRu9eIqDXaGK1I1VJeB8Ljn37WzG1dXvKYnbsSi6W/HU5mBo3eI7NOyHYLGX X-Received: by 2002:a92:c503:: with SMTP id r3mr8209557ilg.148.1625748511742; Thu, 08 Jul 2021 05:48:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625748511; cv=none; d=google.com; s=arc-20160816; b=ufFTf8CJs2LrPKSv9o3IugmDLhym58lMEP3bNmBzgieHwvzERbNdHtQDY+dg5fM3wr TPFyEqRdArLcmGz4WkhyknklZb/yMCxGLzVzb3+e7Td5kgvlmU46UDE/ohBIuQPvUJER 5LA8PZHirs8tCGrpKoDimk9vgm10DBPfw0gkdHPZOt75Dke93x043TIea0N85315tInS zJSQ2h63AZ4zTJe6cpwBphgPKlPTe56JJWQEZltY9MqfMKlgrtG2DsP+HarGaGHrqDUw Rw90Hv0puSwpaQO48wOdwVxFwuIA2lF5PMRZbRBYas8eRLTjWj00Me8wwAnCZ0L0NLKC 0pMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=G5Cx284bJE2XKfvh4KWIUQ5AHnVId0RoYqnTdEgX9Lc=; b=DVS9Llto6rZXqamnODnQVnIdcOX6cSqVcgNSvTsok9KkHAT7ANO+T9+KVqzACvYEzQ whb/NNM83Q/LaPiTelaMBVjFAUMAR2vjwzT8ayslJ2cAsDNGs+S2ZNPBTd1JjRLt0HjW 5mVLJosahF2m4KBhctcRhtR63CzulG/v2lV9mWR0utTkOZjKBTRwlnZ+oQP1W7dC5cvd TanZPT1rQRBgcO+AbLOSaexyetwNE4Kc8ecyOIamsVDUIPxnyitlWJe6ERC2ySEWBomS vkoLNHfFBlRCrKJnXwqfWQxt7kRDe6x345/JlWRR/YAEOBGeRsjEAot6+Tg9R5ZHM9h4 B8Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tnDYG3S0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j19si2269291jat.116.2021.07.08.05.48.20; Thu, 08 Jul 2021 05:48:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tnDYG3S0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231543AbhGHMty (ORCPT + 99 others); Thu, 8 Jul 2021 08:49:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231270AbhGHMtx (ORCPT ); Thu, 8 Jul 2021 08:49:53 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18388C061574 for ; Thu, 8 Jul 2021 05:47:12 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id i8so7340149wrp.12 for ; Thu, 08 Jul 2021 05:47:12 -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=G5Cx284bJE2XKfvh4KWIUQ5AHnVId0RoYqnTdEgX9Lc=; b=tnDYG3S0kkLnhciBQsuqUjAtt8UjLLkoMFe9BFx2vpnaXfCtYBB9e7qlaRZl/MdtXE dijuaYpJt2WEJ9ejzeOylDMiKsPyVmeN6sRHtGU/tIFPa7m1sN1P3BMdNalDsIVktzpK +P0S4rkvq/FcoscxLxXJqhx7ag5awGu2i5pfYEk1y3ELLRqXOhNOG5x/0NaGsi/WBSqW /FiJ0ypPCFaXYcMpz8RB2OLVx2I+yVcvJmPUKL94yuHUdbsn5ozpo+1K5bPea/9sQQTt +/ORFNz7BnLZMEkwdVlJmkN+fkaBXkh472D2tp+KHQCgvLFR6/f2If9gwAywiI4U+SwG H68A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=G5Cx284bJE2XKfvh4KWIUQ5AHnVId0RoYqnTdEgX9Lc=; b=ot67pU0TbikyyY54DKk5bc6nDmdQGW+iA48mZiyWdH6PUu3lhaqVRGURt8RppW0qo4 vRYtkOubwRXptfigYTgazEfqN7GlBH50jIVtlxwyp+fs+5/5iFnzUs9/hkPa7tq6oZEV CohZgpgvZ9PnrtTE3oqH8xoeTl2I7QkujlE+Kid9+uw662/cr/dEOaeFeVKduT5vb+SJ OMcyHwNDl3EkhRw3V7T9yilOqodQvoP5fWjzaAm4JnBall6bHDJE4T2D9pKl4bGrcyzh S+VcTW3eMxDLBmKNYZNEg7brrVyNY/INa02Z/aJa/apSUsjQ6MtRWtYr0/5tyd/TeBEV oU/Q== X-Gm-Message-State: AOAM533cpcjwNpGSV4a7sb1UtFgnmJQ07a7T3sqN70mIUQYgv67KvTZC 4SHbbj2CsvbjCxiLb1y79xa2jQ== X-Received: by 2002:a5d:5048:: with SMTP id h8mr3712857wrt.292.1625748430627; Thu, 08 Jul 2021 05:47:10 -0700 (PDT) Received: from google.com ([109.180.115.218]) by smtp.gmail.com with ESMTPSA id s9sm2156709wrn.87.2021.07.08.05.47.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jul 2021 05:47:10 -0700 (PDT) Date: Thu, 8 Jul 2021 12:47:08 +0000 From: Lee Jones To: Alistair Francis Cc: Alistair Francis , Rob Herring , lgirdwood@gmail.com, Mark Brown , dl-linux-imx , Sascha Hauer , devicetree , Linux Kernel Mailing List Subject: Re: [PATCH v6 2/5] mfd: sy7636a: Initial commit Message-ID: References: <20210615103400.946-1-alistair@alistair23.me> <20210615103400.946-2-alistair@alistair23.me> 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-kernel@vger.kernel.org On Thu, 08 Jul 2021, Alistair Francis wrote: > On Thu, Jun 17, 2021 at 7:20 PM Lee Jones wrote: > > > > On Thu, 17 Jun 2021, Alistair Francis wrote: > > > > > On Wed, Jun 16, 2021 at 8:56 PM Lee Jones wrote: > > > > > > > > On Tue, 15 Jun 2021, Alistair Francis wrote: > > > > > > > > > Initial support for the Silergy SY7636A Power Management chip. > > > > > > > > > > Signed-off-by: Alistair Francis > > > > > --- > > > > > drivers/mfd/Kconfig | 9 ++++ > > > > > drivers/mfd/Makefile | 1 + > > > > > drivers/mfd/sy7636a.c | 82 +++++++++++++++++++++++++++++++++++++ > > > > > include/linux/mfd/sy7636a.h | 47 +++++++++++++++++++++ > > > > > 4 files changed, 139 insertions(+) > > > > > create mode 100644 drivers/mfd/sy7636a.c > > > > > create mode 100644 include/linux/mfd/sy7636a.h > > > > > > > > > > diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig > > > > > index 5c7f2b100191..7d6cf32b1549 100644 > > > > > --- a/drivers/mfd/Kconfig > > > > > +++ b/drivers/mfd/Kconfig > > > > > @@ -1339,6 +1339,15 @@ config MFD_SYSCON > > > > > Select this option to enable accessing system control registers > > > > > via regmap. > > > > > > > > > > +config MFD_SY7636A > > > > > + tristate "Silergy SY7636A Power Management chip" > > > > > + select MFD_CORE > > > > > + select REGMAP_I2C > > > > > + depends on I2C > > > > > + help > > > > > + Select this option to enable support for the Silergy SY7636A > > > > > + Power Management chip. > > > > > + > > > > > config MFD_DAVINCI_VOICECODEC > > > > > tristate > > > > > select MFD_CORE > > > > > diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile > > > > > index 4f6d2b8a5f76..f95e1e725a95 100644 > > > > > --- a/drivers/mfd/Makefile > > > > > +++ b/drivers/mfd/Makefile > > > > > @@ -265,6 +265,7 @@ obj-$(CONFIG_MFD_STMFX) += stmfx.o > > > > > obj-$(CONFIG_MFD_KHADAS_MCU) += khadas-mcu.o > > > > > obj-$(CONFIG_MFD_ACER_A500_EC) += acer-ec-a500.o > > > > > > > > > > +obj-$(CONFIG_MFD_SY7636A) += sy7636a.o > > > > > obj-$(CONFIG_SGI_MFD_IOC3) += ioc3.o > > > > > obj-$(CONFIG_MFD_SIMPLE_MFD_I2C) += simple-mfd-i2c.o > > > > > obj-$(CONFIG_MFD_INTEL_M10_BMC) += intel-m10-bmc.o > > > > > diff --git a/drivers/mfd/sy7636a.c b/drivers/mfd/sy7636a.c > > > > > new file mode 100644 > > > > > index 000000000000..e08f29ea63f8 > > > > > --- /dev/null > > > > > +++ b/drivers/mfd/sy7636a.c > > > > > @@ -0,0 +1,82 @@ > > > > > +// SPDX-License-Identifier: GPL-2.0+ > > > > > +// > > > > > > > > Only the SPDX with C++ style comments please. > > > > > > > > > +// MFD parent driver for SY7636A chip > > > > > > > > Drop the MFD part. It's a Linuxisum that doesn't really exist. > > > > > > > > > +// Copyright (C) 2021 reMarkable AS - http://www.remarkable.com/ > > > > > +// > > > > > +// Authors: Lars Ivar Miljeteig > > > > > +// Alistair Francis > > > > > +// > > > > > +// Based on the lp87565 driver by Keerthy > > > > > + > > > > > +#include > > > > > +#include > > > > > +#include > > > > > +#include > > > > > + > > > > > +#include > > > > > + > > > > > +static const struct regmap_config sy7636a_regmap_config = { > > > > > + .reg_bits = 8, > > > > > + .val_bits = 8, > > > > > +}; > > > > > + > > > > > +static const struct mfd_cell sy7636a_cells[] = { > > > > > + { .name = "sy7636a-regulator", }, > > > > > + { .name = "sy7636a-temperature", }, > > > > > + { .name = "sy7636a-thermal", }, > > > > > +}; > > > > > + > > > > > +static const struct of_device_id of_sy7636a_match_table[] = { > > > > > + { .compatible = "silergy,sy7636a", }, > > > > > + {} > > > > > +}; > > > > > +MODULE_DEVICE_TABLE(of, of_sy7636a_match_table); > > > > > > > > Hold on. This driver doesn't really do anything. If you create OF > > > > nodes for all the sub-devices, you can use simple-mfd-i2c. > > > > > > > > Any reason you can't do that? > > > > > > Just to confirm, you mean something like this? > > > > > > diff --git a/arch/arm/boot/dts/imx7d-remarkable2.dts > > > b/arch/arm/boot/dts/imx7d-remarkable2.dts > > > index 9327d1c06c96..3577104b3853 100644 > > > --- a/arch/arm/boot/dts/imx7d-remarkable2.dts > > > +++ b/arch/arm/boot/dts/imx7d-remarkable2.dts > > > @@ -382,6 +382,21 @@ epd_pmic: sy7636a@62 { > > > pinctrl-0 = <&pinctrl_epdpmic>; > > > #thermal-sensor-cells = <0>; > > > > > > + regulator@0 { > > > + compatible = "sy7636a-regulator"; > > > + reg = <0>; > > > + }; > > > + > > > + temperature@0 { > > > + compatible = "sy7636a-temperature"; > > > + reg = <0>; > > > + }; > > > + > > > + thermal@0 { > > > + compatible = "sy7636a-thermal"; > > > + reg = <0>; > > > + }; > > > + > > > regulators { > > > compatible = "silergy,sy7636a-regulator"; > > > diff --git a/drivers/mfd/simple-mfd-i2c.c b/drivers/mfd/simple-mfd-i2c.c > > > index 87f684cff9a1..622a05318cff 100644 > > > --- a/drivers/mfd/simple-mfd-i2c.c > > > +++ b/drivers/mfd/simple-mfd-i2c.c > > > @@ -39,6 +39,7 @@ static int simple_mfd_i2c_probe(struct i2c_client *i2c) > > > > > > static const struct of_device_id simple_mfd_i2c_of_match[] = { > > > { .compatible = "kontron,sl28cpld" }, > > > + { .compatible = "silergy,sy7636a" }, > > > {} > > > }; > > > MODULE_DEVICE_TABLE(of, simple_mfd_i2c_of_match); > > > > Essentially. Take a look at how the other users are implementing. > > > > The reg entries look bogus to me though. Maybe just leave them out? > > So I tried this and didn't have any luck. > > After some Kconfig changes to allow it to build, I managed to get it > probing, but I never got it to power up. It doesn't seem to be the > same. I need a more technical reason why this is not the correct approach for you. "I can't get it to work" doesn't quite reach the quality line I'm afraid. Did you try enabling the debug prints in of_platform_bus_create() and friends to see if your devices are probing correctly? -- Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog