Hi, On Fri, Sep 21, 2018 at 04:08:28AM +0800, Baolin Wang wrote: > Hi Sebastian, > > On 21 September 2018 at 00:58, Sebastian Reichel > wrote: > > [Dropped a couple of people from CC, added Baolin] > > > > Hi Craig, Baolin and Rob, > > > > On Thu, Sep 20, 2018 at 03:32:29PM +0100, Craig wrote: > >> On 16 September 2018 13:10:45 BST, Sebastian Reichel wrote: > >> >Sorry for my long delay in reviewing this. I like the binding, > >> >but the "qcom," specific properties should become common properties > >> >in > >> > > >> >Documentation/devicetree/bindings/power/supply/battery.txt > >> >and referenced via monitored-battery. > > > >> Thanks for the review, what bindings for ocv would you prefer? The > >> spreadtrum ones or mine? > > > > Most importantly I want to see only one generic binding supporting > > both use cases. As far as I can see there are two major differences: > > > > 1. Qcom uses legend properties and SC27XX embedds this into data > > 2. Qcom supports temperature based mapping > > > > The second point is easy: Not having temperature information can > > be a subset of the data with temperature info. The main thing to > > discuss are the legend properties. I suppose we have these > > proposals: > > > > Proposal A (from Qcom BMS binding): > > > > ocv-capacity-legend = /bits/ 8 <100 95 90 85 80 75 70 65 60 55 50 45 ...>; > > ocv-temp-legend-celsius = /bits/ 8 <(-10) 0 25 50 65>; > > ocv-lut-microvolt = <43050000 43050000 43030000 42990000 > > > > Proposal B (from SC27XX binding): > > > > ocv-cap-table = <4185 100>, <4113 95>, <4066 90>, <4022 85> ...; > > > > I prefer the second binding (with mV -> uV), but I think it becomes > > messy when temperature is added. What do you think about the > > following proposal (derived from pinctrl style): > > > > Proposal C: > > > > ocv-capacity-table-temperatures = <(-10) 0 10>; > > ocv-capacity-table-0 = <4185000 100>, <4113000 95>, <4066000 90>, ...; > > ocv-capacity-table-1 = <4200000 100>, <4185000 95>, <4113000 90>, ...; > > ocv-capacity-table-2 = <4250000 100>, <4200000 95>, <4185000 90>, ...; > > For SC27XX, we have no temperatures consideration, but I think > Proposal C can be compatible with our case. Yes. I think for SC27XX proposal C could be used like this: ocv-capacity-table-temperatures = <20>; /* room temperature */ ocv-capacity-table-0 = <4185000 100>, <4113000 95>, <4066000 90>, ...; With only one curve defined it would be used for all temperatures. -- Sebastian