[linux-sunxi] [PATCH v4 08/13] power: supply: axp20x_battery: add support for AXP813

2018-02-19 Thread Quentin Schulz
The X-Powers AXP813 PMIC has got some slight differences from AXP20X/AXP22X PMICs: - the maximum voltage supplied by the PMIC is 4.35 instead of 4.36/4.24 for AXP20X/AXP22X, - the constant charge current formula is different, It also has a bit to tell whether the battery percentage returned by

[linux-sunxi] [PATCH v4 13/13] iio: adc: axp20x_adc: remove !! in favor of ternary condition

2018-02-19 Thread Quentin Schulz
!!'s behaviour isn't that obvious and sparse complained about it, so let's replace it with a ternary condition. Signed-off-by: Quentin Schulz --- drivers/iio/adc/axp20x_adc.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git

[linux-sunxi] [PATCH v4 09/13] mfd: axp20x: add battery power supply cell for AXP813

2018-02-19 Thread Quentin Schulz
As axp20x-battery-power-supply now supports AXP813, add a cell for it. Signed-off-by: Quentin Schulz Acked-for-MFD-by: Lee Jones Reviewed-by: Chen-Yu Tsai --- drivers/mfd/axp20x.c | 3 +++ 1 file changed, 3 insertions(+) diff

[linux-sunxi] [PATCH v4 00/13] add support for AXP813 ADC and battery power supply

2018-02-19 Thread Quentin Schulz
The AXP813 PMIC is relatively close to the already supported AXP20X and AXP22X. It provides three different power outputs: battery, AC and USB, and measures a few different things: temperature, power supply status, current current and voltage supplied, maximum current limit, battery capacity, min

[linux-sunxi] [PATCH v4 03/13] mfd: axp20x: make AXP209/22x cells probe their ADC via DT

2018-02-19 Thread Quentin Schulz
This makes AXP209 and AXP22x ADCs probe first via DT and then by fallback via platform. Signed-off-by: Quentin Schulz Acked-for-MFD-by: Lee Jones Acked-by: Chen-Yu Tsai --- drivers/mfd/axp20x.c | 5 - 1 file changed, 4

[linux-sunxi] [PATCH v4 06/13] power: supply: axp20x_battery: use data struct for variant specific code

2018-02-19 Thread Quentin Schulz
We used to use IDs to select a function or a feature depending on the variant. It's easier to maintain the code by adding data structure storing the few differences between variants so that we don't add a pile of if conditions. Let's use this data structure and update the code to use it.

[linux-sunxi] [PATCH v4 12/13] ARM: dtsi: axp81x: remove IP name from DT node name

2018-02-19 Thread Quentin Schulz
The DT node should be named after its functionality and not after the IP it's defining. Signed-off-by: Quentin Schulz Acked-by: Chen-Yu Tsai --- arch/arm/boot/dts/axp81x.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[linux-sunxi] [PATCH v4 01/13] ARM: dtsi: axp209: add node for ADC

2018-02-19 Thread Quentin Schulz
This adds a DT node for the ADC of the PMIC so that there can be consumers of its IIO channels declaring their consumptions via DT. Signed-off-by: Quentin Schulz Acked-by: Chen-Yu Tsai --- arch/arm/boot/dts/axp209.dtsi | 5 + 1 file changed, 5

[linux-sunxi] [PATCH v4 10/13] ARM: dtsi: axp81x: add battery power supply subnode

2018-02-19 Thread Quentin Schulz
The X-Powers AXP81X PMIC exposes battery supply various data such as the battery status (charging, discharging, full, dead), current max limit, current current, battery capacity (in percentage), voltage max and min limits, current voltage, and battery capacity (in Ah). This adds the battery power

[linux-sunxi] [PATCH v4 04/13] ARM: dtsi: axp81x: add node for ADC

2018-02-19 Thread Quentin Schulz
This adds a DT node for the ADC of the PMIC so that there can be consumers of its IIO channels declaring their consumptions via DT. Signed-off-by: Quentin Schulz Acked-by: Chen-Yu Tsai --- arch/arm/boot/dts/axp81x.dtsi | 5 + 1 file changed, 5

[linux-sunxi] [PATCH v4 11/13] ARM: dtsi: sun8i: a711: enable battery power supply subnode

2018-02-19 Thread Quentin Schulz
The TBS A711 has an AXP813 PMIC and a soldered battery, thus, we enable the battery power supply subnode in its Device Tree. Signed-off-by: Quentin Schulz Acked-by: Chen-Yu Tsai --- arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 4 1 file changed, 4

[linux-sunxi] [PATCH v4 02/13] ARM: dtsi: axp22x: add node for ADC

2018-02-19 Thread Quentin Schulz
This adds a DT node for the ADC of the PMIC so that there can be consumers of its IIO channels declaring their consumptions via DT. Signed-off-by: Quentin Schulz Acked-by: Chen-Yu Tsai --- arch/arm/boot/dts/axp22x.dtsi | 5 + 1 file changed, 5

[linux-sunxi] [PATCH v4 07/13] dt-bindings: power: supply: axp20x: add AXP813 battery DT binding

2018-02-19 Thread Quentin Schulz
The AXP813 can have a battery as power supply, so let's add it to the list of compatibles. Signed-off-by: Quentin Schulz Reviewed-by: Rob Herring Acked-by: Chen-Yu Tsai ---

[linux-sunxi] [PATCH v4 05/13] mfd: axp20x: probe axp20x_adc driver for AXP813

2018-02-19 Thread Quentin Schulz
This makes the axp20x_adc driver probe with platform device id "axp813-adc". Signed-off-by: Quentin Schulz Acked-for-MFD-by: Lee Jones Acked-by: Chen-Yu Tsai --- drivers/mfd/axp20x.c | 5 - 1 file changed, 4 insertions(+), 1

[linux-sunxi] Re: [PATCH v5 05/12] drm/bridge/synopsys: dw-hdmi: don't clobber drvdata

2018-02-19 Thread Philipp Zabel
On Wed, 2018-02-14 at 21:08 +0100, Jernej Skrabec wrote: > dw_hdmi shouldn't set drvdata since some drivers might need to store > it's own data there. Rework dw_hdmi in a way to return struct dw_hdmi > instead to store it in drvdata. This way drivers are responsible to > store and pass structure