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 X-Spam-Level: X-Spam-Status: No, score=-16.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B765C07E99 for ; Thu, 8 Jul 2021 12:47:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5F3E761450 for ; Thu, 8 Jul 2021 12:47:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231482AbhGHMty (ORCPT ); Thu, 8 Jul 2021 08:49:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230493AbhGHMtx (ORCPT ); Thu, 8 Jul 2021 08:49:53 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 185E6C06175F for ; Thu, 8 Jul 2021 05:47:12 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id v5so7400252wrt.3 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=KCN39qTQRmAxkyG05eUOEEDbEhh8XeelBfcID67cjYAZIFIxdFhXMck1P06PmlrSBc uzZkK1qR7W19GJ8aIQ/LYCCTpbv7MZoZoGIKUedHATCQCsUs8FF8Vi83sevxlaskCZ3p dQQ/q9I6SoliygS0xeJ983IKJ+z0849vzJHVuSzm2kem6mjUeuOs9M/ohWYw69VYrS7o UisacdANAGX2NCOZ25aubbXbb3klQHbRyg6/zhvvRm4Gwr9PDeSHB/P/L2LfZwjDSW2e gwztie2df3AnJgtI6546HsKZSADEqu4NxQRPbvREJYy9t4SwRbl2Ms2uUB7+z01oo9Hi P1Qw== X-Gm-Message-State: AOAM530vfW153LrHa/SllWa0oaNcx+qB+/r2oTN2IoOuBKvhOrUAzTae OBlmJGxpskHMIlrOOozW7OnhuA== X-Google-Smtp-Source: ABdhPJxsJBEdEeJpWYGQmIEWKDbDKwPhhk1u8LceEwzGCPjHIM54Q6EjJ9Uvw9Sw9HeaO1jMxu0zhA== 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: devicetree@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