Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5533949pxj; Wed, 26 May 2021 12:53:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcDr23DmWSY+nayZ8PAcSaVF2oz7gAFbQQ6jsvMaGkH59YCBvdcR8vrqt5x5Kt5osy/QiN X-Received: by 2002:a05:6402:4389:: with SMTP id o9mr39114791edc.368.1622058831062; Wed, 26 May 2021 12:53:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622058831; cv=none; d=google.com; s=arc-20160816; b=oSK+mEwLFEqQKz07u+Z3HM/O5DkKM/0eOtHhHcPHVRLP3TuvVfZSGF28XhtrWrshJK Tc6mSxpUP3FiTAuWkjge4hZgYfi3PzdYLjYX+xuRy47IyIqUw2GokX2SfrwZESMKy76Q JjnsdV/3gFJfZfJQZ14FBdxu4IhpQ2v+i65+ChAwqcJnE0nrshNMSQPUM9NilBnJfF85 cOKXLAQ7zXqsGX/MHJvxj+eN6uQxNQ6hv9H1aMzF1FC1xbK/HcKRrXWsG+uGtyoKyoxP IME1yq/55k3uQbKCUbL774EPkENL+Bpze4+ZNUsT8Rn4iuh0rqBTvfk+n6zVG5vCCoOe gMIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=XFPiHuMmgB1diVIK7dUPVf8VcVw6JsgY/PRpvldEVQ0=; b=UvEXiEppBl6FN1XxiymjCA64EZA0zj5vQKRmNqxgQt2dt9dl3/NwTwaPat1S12hp4D UYfqNIe1BK5dcHwiFPO97DyB0ro6wot62AF3nQEclxGN1jpKZ3mNZWjd9fDgO7SZsbP6 LQd5XYE+8j4VeRzTXJbDtrW8VINX/9sTgs/Atjc/nXVRw8H4etn1xxHsRnRwqj3WJXs9 BIc2UxrynIsglIRBhyO6qqUBtM97pv6e3Kh+Qe09pXQ0gdygTsBRQ8xfs4c5slu5s6UE 9wn6ObmhUGGehZVZ50Ub+K0y6re0WaBqAJUr6AHdD4GkGYASjso0iLEcdodibDKozgT7 /VoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qaSvn6PI; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cn17si183545edb.73.2021.05.26.12.53.06; Wed, 26 May 2021 12:53:51 -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=@gmail.com header.s=20161025 header.b=qaSvn6PI; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235567AbhEZSmq (ORCPT + 99 others); Wed, 26 May 2021 14:42:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235564AbhEZSmp (ORCPT ); Wed, 26 May 2021 14:42:45 -0400 Received: from mail-yb1-xb2f.google.com (mail-yb1-xb2f.google.com [IPv6:2607:f8b0:4864:20::b2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE707C061574; Wed, 26 May 2021 11:41:12 -0700 (PDT) Received: by mail-yb1-xb2f.google.com with SMTP id o18so3442744ybc.8; Wed, 26 May 2021 11:41:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XFPiHuMmgB1diVIK7dUPVf8VcVw6JsgY/PRpvldEVQ0=; b=qaSvn6PI+8BoBElLj/aK5GPJlL6f774Y24z0S6KncRf915wNgynqgtLORZyoSDVquM SpOjVNqBDwkEZ2pxfIRMa7bMNtMXBCAhSb58WtU1nsfrAT3XIxRjnmVpPjrSzcNSPb7g z5BVFBGZ2KuVuliw9g4hAoOnFHPQ3REKaiRClFkO6tPNNAk89cyfePVQpCAFoUniS/kY qBkTpVtuPjfcLaBWOn0SfYMKBxxlE457FedrsxXevhi0w3n+k4iSGSjSZXPt0npjSAdK agdh4otT1bi2+sYrYgK2WbafJ0hGlfOEO7Mnh3y7O0fxWY9g3RUbW6jIIOMzZysLqpVn a+iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XFPiHuMmgB1diVIK7dUPVf8VcVw6JsgY/PRpvldEVQ0=; b=F7NJCHRJhu4Wvb346pIKdi+yJb8nf1Ox3W+ezfj+l/vAhO7HAjnAOcXHlIvH/LEpHj rif6CHemliJQMCcnoSPaHHNO6NMr9nMLamJa8YjwkHnew+rPlzE670uHQGa8AZF/Ohui 2ljW0wcKb3XgqGMgvuBdn0jjkze+mTWD92Xxyo5RuGVuPtHkEOXZ74RB/SCkV0a7kXsZ TDuQVsAtadiQVkEcifzgyKWDzVZ2EcrH0RnWThhWxdyCXSmQeP8va0BeUdJzvQJegGit OHzW0NV3fzGYqi0vTqvsK6PR3tWZG9JYuPhCCvyPlKWWYaGLbS6O+FaeYKX9mNS4bsWl GiMg== X-Gm-Message-State: AOAM533711Pe8H1r2ZuF8g8NHmKZEMGQZEAwc9JPcWcqNUlxCMIiJct0 xSApm5hy3lVKC1AiO3+nJR+4p+gVJA6AewZBaAk= X-Received: by 2002:a25:3c87:: with SMTP id j129mr53760696yba.141.1622054471905; Wed, 26 May 2021 11:41:11 -0700 (PDT) MIME-Version: 1.0 References: <20210526162342.GA20@8bbba9ba63a4> In-Reply-To: <20210526162342.GA20@8bbba9ba63a4> From: Peter Geis Date: Wed, 26 May 2021 14:41:00 -0400 Message-ID: Subject: Re: [PATCH] regulator: fan53555: add back tcs4526 To: Rudi Heitbaum Cc: devicetree@vger.kernel.org, Linux Kernel Mailing List , "open list:ARM/Rockchip SoC..." , Mark Brown , Ezequiel Garcia , chenjh@rock-chips.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 26, 2021 at 12:23 PM Rudi Heitbaum wrote: > > > For rk3399pro boards the tcs4526 regulator supports the vdd_gpu > regulator. The tcs4526 regulator has a chip id of <0>. > Add the compatibile tcs,tcs4526 > > without this patch, the dmesg output is: > fan53555-regulator 0-0010: Chip ID 0 not supported! > fan53555-regulator 0-0010: Failed to setup device! > fan53555-regulator: probe of 0-0010 failed with error -22 > with this patch, the dmesg output is: > vdd_gpu: supplied by vcc5v0_sys > > The regulators are described as: > - Dedicated power management IC TCS4525 > - Lithium battery protection chip TCS4526 > > This has been tested with a Radxa Rock Pi N10. > > Fixes: f9028dcdf589 ("regulator: fan53555: only bind tcs4525 to correct chip id") > Signed-off-by: Rudi Heitbaum Considering the TCS4525 wasn't supported prior to its recent addition, and the TCS4526 wasn't supported by the driver at all, this isn't a fix but a feature addition. Binding only to the correct device ID exists for this reason, to prevent unsafe voltage setting. I also don't see the TCS4525/TCS4526 regulators in the current linux-next device tree for the N10. > --- > drivers/regulator/fan53555.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c > index 2695be617373..ddab9359ea20 100644 > --- a/drivers/regulator/fan53555.c > +++ b/drivers/regulator/fan53555.c > @@ -90,6 +90,7 @@ enum { > }; > > enum { > + TCS4525_CHIP_ID_00 = 0, > TCS4525_CHIP_ID_12 = 12, This isn't a TCS4525, but a TCS4526. > }; > > @@ -373,6 +374,7 @@ static int fan53555_voltages_setup_silergy(struct fan53555_device_info *di) > static int fan53526_voltages_setup_tcs(struct fan53555_device_info *di) > { > switch (di->chip_id) { > + case TCS4525_CHIP_ID_00: > case TCS4525_CHIP_ID_12: > di->slew_reg = TCS4525_TIME; > di->slew_mask = TCS_SLEW_MASK; > @@ -564,6 +566,9 @@ static const struct of_device_id __maybe_unused fan53555_dt_ids[] = { > }, { > .compatible = "tcs,tcs4525", > .data = (void *)FAN53526_VENDOR_TCS > + }, { > + .compatible = "tcs,tcs4526", > + .data = (void *)FAN53526_VENDOR_TCS Since you aren't adding any functional code, is there a particular reason you can't just add the chip id and simply use the tcs4525 compatible? This will prevent you from needing to modify the dt-bindings as well. > }, > { } > }; > @@ -672,6 +677,9 @@ static const struct i2c_device_id fan53555_id[] = { > }, { > .name = "tcs4525", > .driver_data = FAN53526_VENDOR_TCS > + }, { > + .name = "tcs4526", > + .driver_data = FAN53526_VENDOR_TCS > }, > { }, > }; > -- > 2.29.2 >