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 E9C0FC6FA99 for ; Sun, 5 Mar 2023 10:56:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229624AbjCEK4E (ORCPT ); Sun, 5 Mar 2023 05:56:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229539AbjCEK4C (ORCPT ); Sun, 5 Mar 2023 05:56:02 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C6E713D68; Sun, 5 Mar 2023 02:56:01 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 8464FCE0025; Sun, 5 Mar 2023 10:55:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41984C433D2; Sun, 5 Mar 2023 10:55:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678013757; bh=ghe9m3Sb2ZozwkfUR3J/OZxMt72CJ2dDXwhL30J9Tgo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LOZT9OJBJihI6tMu2QfcwPJPPtN6tTDGw3Q54Ffxpw2/uV+mb3v7Hno20+REVOYZ+ h9Mzi1KgMLER8Si5Z63Nh2pkrOKm6XP/69GhEb7C2ACURXP8bwIBL2guem7Ez19Efo wSBY/nGx7Lk6cs88HdidRV7a9b+vDOejoLKMtJQMTQ8e8/9jOohHnOgF05SMNPqvEB /pjVU6yiAkySo7wTZsh3dJMEN1/MLNkLuMWSO/rVS2G9STsPH6ogIikHsQzx7fk0pP bB0KWKNKQFtwKwuLw9JSW39dSi78dHHqFka0qdNZ9syXSkajAT/sbJ1ACryr4ikovx 60F5s0lLB/bUA== Date: Sun, 5 Mar 2023 10:55:51 +0000 From: Lee Jones To: Jakob Hauser Cc: Sebastian Reichel , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Beomho Seo , Chanwoo Choi , Stephan Gerhold , Raymond Hackley , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht Subject: Re: [PATCH 05/10] mfd: rt5033: Apply preparatory changes before adding rt5033-charger driver Message-ID: <20230305105551.GJ2574592@google.com> References: <4edfef7fdf129185355d4dd2d3928d63c04bac73.1677620677.git.jahau@rocketmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4edfef7fdf129185355d4dd2d3928d63c04bac73.1677620677.git.jahau@rocketmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 28 Feb 2023, Jakob Hauser wrote: > Order the register blocks to have the masks in descending manner. > > Add new defines for constant voltage shift (RT5033_CHGCTRL2_CV_SHIFT), > MIVR mask (RT5033_CHGCTRL4_MIVR_MASK), pre-charge current shift > (RT5033_CHGCTRL4_IPREC_SHIFT), internal timer disable > (RT5033_INT_TIMER_DISABLE), termination disable (RT5033_TE_DISABLE), > CFO disable (RT5033_CFO_DISABLE), UUG disable (RT5033_CHARGER_UUG_DISABLE). > > The fast charge timer type needs to be written on mask 0x38 > (RT5033_CHGCTRL3_TIMER_MASK). To avoid a bit shift on application, change the > values of the timer types to fit the mask. Added the timout duration as a > comment. And the timer between TIMER8 and TIMER12 is most likely TIMER10, see > e.g. RT5036 [1] page 28 bottom. > > Add value options for MIVR (Minimum Input Voltage Regulation). > > Move RT5033_TE_ENABLE_MASK to the block "RT5033 CHGCTRL1 register", in order > to have the masks of the register collected there. To fit the naming scheme, > rename it to RT5033_CHGCTRL1_TE_EN_MASK. > > Move RT5033_CHG_MAX_CURRENT to the block "RT5033 charger fast-charge current". > > Add new defines RT5033_CV_MAX_VOLTAGE and RT5033_CHG_MAX_PRE_CURRENT to the > blocks "RT5033 charger constant charge voltage" and "RT5033 charger pre-charge > current limits". > > In include/linux/mfd/rt5033.h, turn power_supply "psy" into a pointer in order > to use it in devm_power_supply_register(). Are there no present users to account for? > [1] https://media.digikey.com/pdf/Data%20Sheets/Richtek%20PDF/RT5036%20%20Preliminary.pdf > > Signed-off-by: Jakob Hauser > --- > include/linux/mfd/rt5033-private.h | 53 ++++++++++++++++++++---------- > include/linux/mfd/rt5033.h | 2 +- > 2 files changed, 36 insertions(+),` 19 deletions(-) -- Lee Jones [李琼斯]