devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yassine Oudjana <yassine.oudjana@gmail.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Sebastian Reichel <sre@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Andy Gross <agross@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Caleb Connolly <caleb.connolly@linaro.org>,
	Yassine Oudjana <y.oudjana@protonmail.com>,
	Alejandro Tafalla <atafalla@dnyon.com>,
	Konrad Dybcio <konrad.dybcio@somainline.org>,
	linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	devicetree@vger.kernel.org, phone-devel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/8] power: supply: Add driver for Qualcomm SMBCHG
Date: Mon, 08 Aug 2022 10:39:47 +0100	[thread overview]
Message-ID: <BUIAGR.NIMOFVJH9GVZ1@gmail.com> (raw)
In-Reply-To: <a233730b-6ac3-2cb9-cc5c-21ca6289fadc@linaro.org>


On Mon, Aug 8 2022 at 11:41:26 +03:00:00, Krzysztof Kozlowski 
<krzysztof.kozlowski@linaro.org> wrote:
> On 08/08/2022 10:34, Yassine Oudjana wrote:
>>  From: Yassine Oudjana <y.oudjana@protonmail.com>
>> 
>>  This series adds a driver for the switch-mode battery charger found 
>> on PMICs
>>  such as PMI8994, and referred to in the vendor kernel[1] as 
>> smbcharger or
>>  SMBCHG. More details on this block can be found in the last patch 
>> message.
>> 
>>  This driver currently supports the charger blocks of PMI8994 and 
>> PMI8996.
>>  PMI8950 was also to be supported, but it was dropped due to some 
>> last minute
>>  issues, to be brought back at a later time once ready.
>> 
>>  The OTG regulator remains unused on devices where the charger is 
>> enabled in
>>  this series due to lack of a consumer. Applying a patch[2] adding 
>> vbus-supply
>>  to DWC3 allows it to enable the OTG regulator making USB host 
>> without
>>  external power possible.
>> 
>>  [1] 
>> https://github.com/android-linux-stable/msm-3.18/blob/kernel.lnx.3.18.r34-rel/drivers/power/qpnp-smbcharger.c
>>  [2] 
>> https://lore.kernel.org/linux-usb/20200805061744.20404-1-mike.looijmans@topic.nl/
> 
> How is it different from PMI8998? I expect not that much, so this 
> should
> be based on existing work:
> https://lore.kernel.org/linux-arm-msm/20220706194125.1861256-1-caleb.connolly@linaro.org/
> 
> Unless they are different, but then please create common parts and
> explain the differences.
> 
> Best regards,
> Krzysztof

This driver has been in slow developement for a long time before that 
one existed, which was why no initial attempt at a common driver was 
made. With that said however, I've been watching its development even 
before it was sent for review, and It seems that the hardware is 
actually quite different. For example, the original charger entirely 
lacks the type-c functionality that exists on the second gen one. There 
are a couple of similar registers like CMD_APSD (same address and 
function) CHGR_CFG2 (same/similar function, different address), but 
other than that there don't seem to be any major similarities. While I 
guess it would technically be possible to force them into one driver 
with multiple register tables and separate functions for most tasks, I 
think it would just unnecessarily complicate things. One thing that is 
common however is the secure register unlock sequence, which I have 
separated in patch 6 to allow for its use in other drivers (the fuel 
gauge block has secure registers too so it will also be used in an 
upcoming fuel gauge driver).



  reply	other threads:[~2022-08-08  9:40 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-08  7:34 [PATCH 0/8] power: supply: Add driver for Qualcomm SMBCHG Yassine Oudjana
2022-08-08  7:34 ` [PATCH 1/8] dt-bindings: power: supply: Add DT schema " Yassine Oudjana
2022-08-08  8:42   ` Krzysztof Kozlowski
2022-11-20 15:46     ` Yassine Oudjana
2022-11-21  8:26       ` Krzysztof Kozlowski
2022-11-21 10:36         ` Yassine Oudjana
2022-11-21 17:07           ` Krzysztof Kozlowski
2022-11-22 13:30             ` Dmitry Baryshkov
2022-11-28 11:39               ` Krzysztof Kozlowski
2022-11-28 11:52                 ` Dmitry Baryshkov
2022-11-30 16:24   ` Krzysztof Kozlowski
2024-09-30 10:13     ` Yassine Oudjana
2022-08-08  7:34 ` [PATCH 2/8] arm64: dts: qcom: pmi8994: Add SMBCHG Yassine Oudjana
2022-08-08  7:34 ` [PATCH 3/8] arm64: dts: qcom: pmi8996: " Yassine Oudjana
2022-08-08  7:34 ` [PATCH 5/8] arm64: dts: qcom: msm8996-xiaomi-*: Enable SMBCHG Yassine Oudjana
2022-08-08  7:34 ` [PATCH 6/8] soc: qcom: Add PMIC secure register write helpers Yassine Oudjana
2022-08-08  7:34 ` [PATCH 7/8] util_macros.h: Add macro to find closest smaller value in array Yassine Oudjana
2022-08-08  7:34 ` [PATCH 8/8] power: supply: Add driver for Qualcomm SMBCHG Yassine Oudjana
2022-08-08  8:55   ` Krzysztof Kozlowski
2022-08-08 10:05     ` Yassine Oudjana
2022-08-08 13:42       ` Krzysztof Kozlowski
2022-08-08  8:41 ` [PATCH 0/8] " Krzysztof Kozlowski
2022-08-08  9:39   ` Yassine Oudjana [this message]
2022-08-08 13:24     ` Caleb Connolly

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BUIAGR.NIMOFVJH9GVZ1@gmail.com \
    --to=yassine.oudjana@gmail.com \
    --cc=agross@kernel.org \
    --cc=atafalla@dnyon.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=caleb.connolly@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=konrad.dybcio@somainline.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=phone-devel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sre@kernel.org \
    --cc=y.oudjana@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).