From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D34B418027 for ; Mon, 8 Dec 2025 08:20:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765182054; cv=none; b=DNEXhTJPBLGePXWuhsn7anFuxFJ5zXCD8EvAs/qzxHrvbyz+4tBYsk9/NnFhnM2MxJFT+7gpgGTXV2rUPHnWKnYH3DEJNH8nHzM0d0BngkU/0YAHivDv5yMbR0LaFvjsOUq7tqN3cozHTvVNgRq1Kqj+XprLaMcRiXCQd0H7Hso= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765182054; c=relaxed/simple; bh=ZTBAanapmYWGJBRZyfp44WbaZdm4lmNCC8RZD8i47iw=; h=Message-ID:Date:MIME-Version:Subject:From:To:References: In-Reply-To:Content-Type; b=RQ1u92cGxt2avE2LDJ+pyGlo8dj0djvcEhBrceZLAKJkoOcJcTbQay25F5lFrlNmJK8AITtExImLUAgEAZ70hpDBGoImJz3DDkKZRcAiBjg5yUrjDkOtpp1MxcVAsRS2OT0Q5MUaaSM7z05QgqOgbyWh+ZVyE/6pBCMr2EVBbFY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=eqAooHma; arc=none smtp.client-ip=209.85.167.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eqAooHma" Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-5958187fa55so3297116e87.3 for ; Mon, 08 Dec 2025 00:20:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765182051; x=1765786851; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :to:from:subject:user-agent:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=24P9RkaUTzrejpHjnKGGORqQ132L/mjxm9V9vho/MAw=; b=eqAooHmahqhLxzF9eR6qqDNF3YoFmd0i4Mrsq17mxkIHY0DRDVEO22Di6pZWFA2sza XeGapG9nok+1b+Tep6AeKXlZck1jydI/fY3pfdpkEeTBNkocPWINFWnpMC83Fsk1kiu5 Fk0VVhAtfMJsMVmisTv38+jkDiiVvC+hhM9pK+x0GfDU1nBU0U+tHk2oDGmlFHOFK/wp wUL57qB64mCdRnK0zs77Cnq4YT5c6UBVbJ2iuUcty9k5VJu2FM7kzIZj66MU/+QpZOna hJcu6m5D+NwCyEoOMuI4w2fZmY8DfSrTcwF/WrxkClr3xwz9RfCPNjMDjZEWcVwXn4qy LJYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765182051; x=1765786851; h=content-transfer-encoding:in-reply-to:content-language:references :to:from:subject:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=24P9RkaUTzrejpHjnKGGORqQ132L/mjxm9V9vho/MAw=; b=mnkBntI2qhzrVq2KyBphlw29Jhtky7jiU6TDyUpcMz1iuV4/ozsv5THNwULDSWhftA c2tOfjpHEsTgBbwH+qTQJPHkutT8RTo1OLf2gknoes4l/SmRc4q4G/qLFdeiVQMizzNw h7hF5Z6UrwQT1VPshQpsoC8jSS5l8iaLZiOH0MYiL/mIQXj/NqlIPoALF30c35oL5Mif pHmW3qqIL8qAOofkqnx5rOdilhBMKcYSB/64UiPm4mfYHZPlezikMxoQY1BC+8AZcZex pW0H+eE3ZKJ4e8GKnyovFCcTufZ6fNTrbXOMfszPxXZzT5BYEsLugFmiErS+Uyp1Ugo9 QhEA== X-Forwarded-Encrypted: i=1; AJvYcCX4slYwIfEDmuI3+ejgRGFsHrIn0j+44yOCqg8mVJwZAd9aPQBMIXEiMlflE4PkfOc51zwqR3fT0xu+a0M=@vger.kernel.org X-Gm-Message-State: AOJu0YymTvwb/I+ilpmHKVCK/cpHo40VOr0bD5VFLrNIHwK/TDxloWeY 9iWqOjhAT/MbWRTo8qyIyhAIy/FCFpKBPTGkX247chIhppLnYHPEO6Lr X-Gm-Gg: ASbGnctq+I9u4bqlWTB6kb0eaa/PJDXqsQ6+BjqgxAprFyOcLFmRaBvh7eQ5kkHqRjO /ds9ipjvHeP2bXZ+HiVGhaQ9V//sdNetliAEfF1SRWmR/Wkx9wEQr10NL5K/dFMEpt3YSAmR6ZT pecVxaHtWxB7yTz5ueeD5GNoYPcvWkKCipotL2EABwK5AA3Zez3Bp6KAJAfDxdllWItRlzxdQjP haXWH8m5080vMSmdUxAnOix82TtkgT1kgqYmqNfek7FC7PLhDExVjs3kkL/bb5TkZhhHXlvFmaB DXagZdNDcjl9dsmCCH4yByadEedoa5ytbx97ELiXOefta/kUkb4LV0UHv/J7PSCfm63mBnCH2oM jItrhFJ6vQHXINKcnOYtUTRIcixID/tjC5mPeLu6gnq+SehZH3bcFNwoMGZvaNhd+mg2s8kAwuR 6zziLjLU6K7HVoVU6fHPfZiUDo/F/Gn0/M5um8a2DofGrz0XgqHfKhV/UOkb9Zlg7/Dbew X-Google-Smtp-Source: AGHT+IFWJapjHSs0Q1We1gxbKQ4Myp4SqGv0qdErZeEryPVUTwszCAsMf/B+uaLskgn+IVWMzs51Qg== X-Received: by 2002:a05:6512:3d94:b0:594:2e37:8091 with SMTP id 2adb3069b0e04-598853be3edmr1895354e87.48.1765182050049; Mon, 08 Dec 2025 00:20:50 -0800 (PST) Received: from ?IPV6:2a10:a5c0:800d:dd00:8fdf:935a:2c85:d703? ([2a10:a5c0:800d:dd00:8fdf:935a:2c85:d703]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-597d7c1e3e4sm3867014e87.47.2025.12.08.00.20.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Dec 2025 00:20:49 -0800 (PST) Message-ID: <143515f8-34f2-4f9f-a829-1388b222ce2d@gmail.com> Date: Mon, 8 Dec 2025 10:20:48 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mfd: bd71828: Add some missing charger related registers From: Matti Vaittinen To: Andreas Kemnade , lee@kernel.org, linux-kernel@vger.kernel.org References: <20251207085024.7375-1-andreas@kemnade.info> <20389a09-1c69-40fa-a937-289a104d57fa@gmail.com> Content-Language: en-US, en-AU, en-GB, en-BW In-Reply-To: <20389a09-1c69-40fa-a937-289a104d57fa@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi again, It was faster than one could guess :) I got the response from the HQ. In a nutshell: "BD72720 ILIM_VBUS_STAT and IBUS_INLIM provide the same functionality as BD71828 ILIM_DCIN_STAT and ILIM_DCIN, but note that the offset and resolution differ." OTP settings for the time-interval aren't available for BD71828 (and variants). Furthermore, they can't be read/set at runtime on BD72720 which makes them more or less 'invisible' for the SW. The 'ILIM_VBUS' bit in 'CHG_VBUS_STAT' register (for BD72720) corresponds to the 'DCIN_ILIM_MOD' bit in 'DCIN_STAT' for BD71828. Finally: "The Anti-Collapse function present in BD71828 is implemented in analog circuitry on BD72720, so ILIM_VBUS_STAT does not fluctuate due to Anti-Collapse. On BD71828, ILIM_DCIN_STAT changes during Anti-Collapse." Yours, -- Matti On 08/12/2025 09:47, Matti Vaittinen wrote: > On 07/12/2025 10:50, Andreas Kemnade wrote: >> As there are some registers missing which are required for future charger >> extensions, add them. >> >> Signed-off-by: Andreas Kemnade > > Reviewed-by: Matti Vaittinen > > Thanks for working with this driver! Much appreciated :) > >> --- >> I have something in preparation for the power supply driver, but I am >> sending this now if this might go in earlier e.g. via  BD72720 >> immutable branch to avoid more immutable branches. >> @Matti: Can you check the situation with the other chips supported >> by that driver. Is that register there, too? > > Sure. > > Just purely based on the data-sheets: > > - BD71815: I didn't find one. > - BD71879: (As you know) - basically the same as BD71828, so they can >   both use the BD71828_REG_ILIM_STAT and BD71828_REG_DCIN_SET. > - BD72720: >   1: I see 'CHG_ILIM_STAT' with ILIM_VBUS_STAT[6:0], which says: >     "Actual value of VBUS current-limitation. The VBUS current limit >     is increased or decreased automatically. The actual limit can be >     read from ILIM_VBUS_STAT register." >     This may, or may not be related to the stuff you are working >     with. I think I have this register included in the >     include/linux/mfd/rohm-bd72720.h. On top of that, the BD72720 >     has OTP options to configure (time) "Interval for VBUS Current >     Limitation / Relaxation". >   2: I see a read-only 'CHG_VBUS_STAT' with 'ILIM_VBUS' bit and: >     "0 = Normal operation >     1 = Automatic limit control" >   3: I see enable/disable control for: >     "VBUS input current limit in Battery Assist" >   4: There is also: CHG_VBUS_SET with IBUS_INLIM[6:0], which says: >     "VBUS current limit setting for Charge. VBUS current limit is >     automatically changed to supply enough current to the Battery >     Charger. Present current limit is available to read from >     ILIM_VBUS_STAT register." This may be something similar to the >     DCIN_SET. > > I asked for some clarification from the HQ folks - but they may be quite > busy, and my request(s) may not be at the top of the priority list. So, > let's see... > > Are you planning to expose the current limit values to user-space? Allow > setting the control to AUTO/fixed value? I suppose this is what enabled > you to do some low-power charging, right? > > Yours, >     -- Matti > > > --- > Matti Vaittinen > Linux kernel developer at ROHM Semiconductors > Oulu Finland > > ~~ When things go utterly wrong vim users can always type :help! ~~ -- --- Matti Vaittinen Linux kernel developer at ROHM Semiconductors Oulu Finland ~~ When things go utterly wrong vim users can always type :help! ~~