[linux-sunxi] [PATCH v7 0/6] Allwinner sun6i message box support

2020-02-22 Thread Samuel Holland
cal instead of hacks in the driver - 8 unidirectional channels instead of 4 bidirectional pairs - Use per-SoC compatible strings and an A31 fallback compatible - Dropped the mailbox framework patch - Include DT patches for SoCs that document the message box Samuel Holland (6): dt-bindings: ma

[linux-sunxi] [PATCH v7 4/6] ARM: dts: sunxi: h3/h5: Add msgbox node

2020-02-22 Thread Samuel Holland
The H3 and H5 SoCs contain a message box that can be used to send messages and interrupts back and forth between the ARM application CPUs and the ARISC coprocessor. Add a device tree node for it. Signed-off-by: Samuel Holland --- arch/arm/boot/dts/sunxi-h3-h5.dtsi | 10 ++ 1 file

Re: [linux-sunxi] [PATCH] arm64: dts: sun50i-h5-orange-pi-pc2: Add CPUX voltage regulator

2020-02-22 Thread Samuel Holland
ary here. > + regulator-min-microvolt = <100>; > + regulator-max-microvolt = <1400000>; > + regulator-ramp-delay = <200>; > + regulator-boot-on; > + regulator-always-on; > + }; > +}; > + > { > pinctrl-names = "

[linux-sunxi] [PATCH] mailbox: sun6i-msgbox: Remove unneeded FIFO status check

2020-02-14 Thread Samuel Holland
A transmit FIFO can never be full, because the mailbox framework waits until mbox->ops->last_tx_done() succeeds before sending the next message. sun6i_msgbox_last_tx_done() ensures that the FIFO is empty. Since the extra check here is unnecessary, remove it. Signed-off-by: Samuel H

[linux-sunxi] Re: [PATCH v6 2/6] mailbox: sun6i-msgbox: Add a new mailbox driver

2020-02-14 Thread Samuel Holland
On 2/12/20 8:18 PM, Samuel Holland wrote: > Jassi, > > On 2/12/20 8:02 PM, Jassi Brar wrote: >> On Sun, Jan 12, 2020 at 11:18 PM Samuel Holland wrote: >>> >>> +static int sun6i_msgbox_send_data(struct mbox_chan *chan, void *data) >>> +{ >>>

[linux-sunxi] Re: [PATCH v6 2/6] mailbox: sun6i-msgbox: Add a new mailbox driver

2020-02-12 Thread Samuel Holland
Jassi, On 2/12/20 8:02 PM, Jassi Brar wrote: > On Sun, Jan 12, 2020 at 11:18 PM Samuel Holland wrote: >> >> +static int sun6i_msgbox_send_data(struct mbox_chan *chan, void *data) >> +{ >> + struct sun6i_msgbox *mbox = to_sun6i_msgbox(chan); >> +

[linux-sunxi] Re: [PATCH 1/2] pinctrl: sunxi: Forward calls to irq_set_irq_wake

2020-02-12 Thread Samuel Holland
All, On 1/17/20 3:33 PM, Samuel Holland wrote: > The pinctrl irqchip may be connected to an irqchip that implements the > .irq_set_wake callback, such as the R_INTC on A31 and newer sunxi SoCs. > In order for GPIOs to be able to trigger wakeup, the IRQ from the > pinctrl to the upper

[linux-sunxi] Re: [PATCH v6 0/6] Allwinner sun6i message box support

2020-02-12 Thread Samuel Holland
Jassi, On 1/12/20 11:18 PM, Samuel Holland wrote: > This series adds support for the "hardware message box" in sun8i, sun9i, > and sun50i SoCs, used for communication with the ARISC management > processor (the platform's equivalent of the ARM SCP). The end goal is to > u

[linux-sunxi] Re: [PATCH 3/9] arm64: dts: allwinner: pinebook: Remove unused AXP803 regulators

2020-01-21 Thread Samuel Holland
On 1/21/20 3:05 AM, Maxime Ripard wrote: > On Sun, Jan 19, 2020 at 10:30:58AM -0600, Samuel Holland wrote: >> The Pinebook does not use the CSI bus on the A64. In fact it does not >> use GPIO port E for anything at all. Thus the following regulators are >> not used and do

[linux-sunxi] [PATCH 3/9] arm64: dts: allwinner: pinebook: Remove unused AXP803 regulators

2020-01-19 Thread Samuel Holland
The Pinebook does not use the CSI bus on the A64. In fact it does not use GPIO port E for anything at all. Thus the following regulators are not used and do not need voltages set: - ALDO1: Connected to VCC-PE only - DLDO3: Not connected - ELDO3: Not connected Signed-off-by: Samuel Holland

[linux-sunxi] [PATCH 5/9] arm64: dts: allwinner: pinebook: Make simplefb more consistent

2020-01-19 Thread Samuel Holland
Boards generally reference the simplefb nodes from the SoC dtsi by label, not by full path. simplefb_hdmi is already like this in the Pinebook DTS. Update simplefb_lcd to match. Signed-off-by: Samuel Holland --- .../arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts | 12 ++-- 1 file

[linux-sunxi] [PATCH 4/9] arm64: dts: allwinner: pinebook: Sort device tree nodes

2020-01-19 Thread Samuel Holland
The r_i2c node should come before r_rsb, and in any case should not separate the axp803 node from its subnodes. Signed-off-by: Samuel Holland --- .../boot/dts/allwinner/sun50i-a64-pinebook.dts | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/arm64/boot

[linux-sunxi] [PATCH 1/9] arm64: dts: allwinner: Enable button wakeup on Orange Pi PC2

2020-01-19 Thread Samuel Holland
The Orange Pi PC2 features a GPIO button. As the button is connected to Port L (pin PL3), it can be used as a wakeup source. Enable this. Signed-off-by: Samuel Holland --- arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64

[linux-sunxi] [PATCH 2/9] arm64: dts: allwinner: pinebook: Remove unused vcc3v3 regulator

2020-01-19 Thread Samuel Holland
This fixed regulator has no consumers, GPIOs, or other connections. Remove it. Signed-off-by: Samuel Holland --- arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts | 7 --- 1 file changed, 7 deletions(-) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts b/arch/arm64

[linux-sunxi] [PATCH 8/9] arm64: dts: allwinner: pinebook: Fix backlight regulator

2020-01-19 Thread Samuel Holland
h are both >3.3V, the output could not be 3.3V anyway. Signed-off-by: Samuel Holland --- .../dts/allwinner/sun50i-a64-pinebook.dts | 20 +-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts b/arch/arm64/boot/

[linux-sunxi] [PATCH 6/9] arm64: dts: allwinner: pinebook: Document MMC0 CD pin name

2020-01-19 Thread Samuel Holland
Normally GPIO pin references are followed by a comment giving the pin name for searchability. Add the comment here where it was missing. Signed-off-by: Samuel Holland --- arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[linux-sunxi] [PATCH 9/9] arm64: dts: allwinner: pinebook: Fix 5v0 boost regulator

2020-01-19 Thread Samuel Holland
Now that AXP803 GPIO support is available, we can properly model the hardware. Replace the use of GPIO0-LDO with a fixed regulator controlled by GPIO0. This boost regulator is used to power the (internal and external) USB ports, as well as the speakers. Signed-off-by: Samuel Holland --- .../dts

[linux-sunxi] [PATCH 7/9] arm64: dts: allwinner: pinebook: Add GPIO port regulators

2020-01-19 Thread Samuel Holland
Allwinner A64 SoC has separate supplies for PC, PD, PE, PG and PL. VCC-PC and VCC-PG are supplied by ELDO1 at 1.8v. VCC-PD is supplied by DCDC1 (VCC-IO) at 3.3v. VCC-PE is supplied by ALDO1, and is unused. VCC-PL creates a circular dependency, so it is omitted for now. Signed-off-by: Samuel

[linux-sunxi] [PATCH 1/2] pinctrl: sunxi: Forward calls to irq_set_irq_wake

2020-01-17 Thread Samuel Holland
already manages the "wake_depth" of each IRQ, no additional accounting is needed in the pinctrl driver. Signed-off-by: Samuel Holland --- drivers/pinctrl/sunxi/pinctrl-sunxi.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/sun

[linux-sunxi] [PATCH 2/2] pinctrl: sunxi: Mask non-wakeup IRQs on suspend

2020-01-17 Thread Samuel Holland
The pin controller hardware does not distinguish IRQs intended for wakeup from other IRQs, so we must mask non-wakeup IRQs in software to prevent inadvertent wakeups. This is accomplished at the irqchip level via the IRQCHIP_MASK_ON_SUSPEND flag. Signed-off-by: Samuel Holland --- drivers

[linux-sunxi] [PATCH v2 1/2] Input: axp20x-pek - Respect userspace wakeup configuration

2020-01-14 Thread Samuel Holland
interrupt handler. The device core ignores such interrupts, so to actually disable wakeup, we must explicitly disable all non-wakeup interrupts during suspend. Signed-off-by: Samuel Holland --- drivers/input/misc/axp20x-pek.c | 37 - 1 file changed, 36 insertions

[linux-sunxi] [PATCH v2 0/2] Input: axp20x-pek wakeup enablement

2020-01-14 Thread Samuel Holland
ifdef CONFIG_PM_SLEEP" [patch 2] - Add Reviewed-by [patch 3] Samuel Holland (2): Input: axp20x-pek - Respect userspace wakeup configuration Input: axp20x-pek - Enable wakeup for all AXP variants drivers/input/misc/axp20x-pek.c | 38 +++-- 1 file changed, 36

[linux-sunxi] [PATCH v2 2/2] Input: axp20x-pek - Enable wakeup for all AXP variants

2020-01-14 Thread Samuel Holland
There are many devices, including several mobile battery-powered devices, using other AXP variants as their PMIC. Allow them to use the power key as a wakeup source. Reviewed-by: Hans de Goede Signed-off-by: Samuel Holland --- drivers/input/misc/axp20x-pek.c | 3 +-- 1 file changed, 1

[linux-sunxi] Re: [PATCH 3/3] Input: axp20x-pek - Enable wakeup for all AXP variants

2020-01-14 Thread Samuel Holland
Hi, On 1/14/20 3:07 AM, Hans de Goede wrote: > Hi, > > On 13-01-2020 22:26, Dmitry Torokhov wrote: >> Hi Samuel, >> >> On Sun, Jan 12, 2020 at 09:20:32PM -0600, Samuel Holland wrote: >>> There are many devices, including several mobile battery-powered &

Re: [linux-sunxi] Re: [PATCH 1/3] Input: axp20x-pek - Remove unique wakeup event handling

2020-01-14 Thread Samuel Holland
Hans, Thank you for the detailed explanation! This is exactly the background I needed, and it clears up my confusion. On 1/13/20 4:58 AM, Hans de Goede wrote: > On 13-01-2020 11:41, Hans de Goede wrote: >> Hi, >> >> On 13-01-2020 04:20, Samuel Holland wrote: >>>

[linux-sunxi] [PATCH v4 3/4] power: supply: axp20x_usb_power: Add wakeup control

2020-01-14 Thread Samuel Holland
on the PMIC are all disabled. Reviewed-by: Chen-Yu Tsai Signed-off-by: Samuel Holland --- drivers/power/supply/axp20x_usb_power.c | 83 - 1 file changed, 67 insertions(+), 16 deletions(-) diff --git a/drivers/power/supply/axp20x_usb_power.c b/drivers/power/supply

[linux-sunxi] [PATCH v4 1/4] power: supply: axp20x_usb_power: Use a match structure

2020-01-14 Thread Samuel Holland
(). Other parts of the driver still do ID matching; they are left unchanged for now. Reviewed-by: Chen-Yu Tsai Signed-off-by: Samuel Holland --- drivers/power/supply/axp20x_usb_power.c | 86 - 1 file changed, 57 insertions(+), 29 deletions(-) diff --git a/drivers/power/supply

[linux-sunxi] [PATCH v4 2/4] power: supply: axp20x_usb_power: Allow offlining

2020-01-14 Thread Samuel Holland
VBUS input is disabled via the PATH_SEL bit, the VBUS_USED bit in PWR_INPUT_STATUS is cleared, so there is no change needed when getting the property. Reviewed-by: Chen-Yu Tsai Signed-off-by: Samuel Holland --- drivers/power/supply/axp20x_usb_power.c | 30 + 1 file

[linux-sunxi] [PATCH v4 0/4] X-Powers Power Supply Improvements

2020-01-14 Thread Samuel Holland
to regmap_update_bits (3, 7) - Use #ifdef instead of #if to avoid -Wundef warnings (4, 8) - Poll once after an IRQ, instead of setting power->online in the IRQ (9) - Poll once on resume, in case the state changed during suspend (9) Samuel Holland (4): power: supply: axp20x_usb_power: Use a match struct

[linux-sunxi] [PATCH v4 4/4] power: supply: axp20x_usb_power: Only poll while offline

2020-01-14 Thread Samuel Holland
olling will cease until the next VBUS_REMOVAL IRQ. Reviewed-by: Chen-Yu Tsai Signed-off-by: Samuel Holland --- drivers/power/supply/axp20x_usb_power.c | 30 + 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/drivers/power/supply/axp20x_usb_power.c b/drivers

Re: [linux-sunxi] Re: [PATCH 9/9] arm64: dts: allwinner: Move wakeup-capable IRQs to r_intc

2020-01-13 Thread Samuel Holland
Hello, On 1/13/20 11:30 AM, pune wrote: > I am using Banana bi bsp for android which in turn using lichee kernel 3.10 Unfortunately, this is the reason you are not getting much help. The BSP kernel works very differently from mainline Linux, especially with regard to power management. Allwinner

[linux-sunxi] [PATCH v6 3/6] ARM: dts: sunxi: a83t: Add msgbox node

2020-01-12 Thread Samuel Holland
The A83T SoC contains a message box that can be used to send messages and interrupts back and forth between the ARM application CPUs and the ARISC coprocessor. Add a device tree node for it. Tested-by: Ondrej Jirman Signed-off-by: Samuel Holland --- arch/arm/boot/dts/sun8i-a83t.dtsi | 10

[linux-sunxi] [PATCH v6 0/6] Allwinner sun6i message box support

2020-01-12 Thread Samuel Holland
s for SoCs that document the message box Samuel Holland (6): dt-bindings: mailbox: Add a sun6i message box binding mailbox: sun6i-msgbox: Add a new mailbox driver ARM: dts: sunxi: a83t: Add msgbox node ARM: dts: sunxi: h3/h5: Add msgbox node arm64: dts: allwinner: a64: Add msgbox node arm64: dts:

[linux-sunxi] [PATCH v6 6/6] arm64: dts: allwinner: h6: Add msgbox node

2020-01-12 Thread Samuel Holland
The H6 SoC contains a message box that can be used to send messages and interrupts back and forth between the ARM application CPUs and the ARISC coprocessor. Add a device tree node for it. Signed-off-by: Samuel Holland --- arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 10 ++ 1 file

[linux-sunxi] [PATCH v6 4/6] ARM: dts: sunxi: h3/h5: Add msgbox node

2020-01-12 Thread Samuel Holland
The H3 and H5 SoCs contain a message box that can be used to send messages and interrupts back and forth between the ARM application CPUs and the ARISC coprocessor. Add a device tree node for it. Signed-off-by: Samuel Holland --- arch/arm/boot/dts/sunxi-h3-h5.dtsi | 10 ++ 1 file

[linux-sunxi] [PATCH v6 2/6] mailbox: sun6i-msgbox: Add a new mailbox driver

2020-01-12 Thread Samuel Holland
. Signed-off-by: Samuel Holland --- drivers/mailbox/Kconfig| 9 + drivers/mailbox/Makefile | 2 + drivers/mailbox/sun6i-msgbox.c | 332 + 3 files changed, 343 insertions(+) create mode 100644 drivers/mailbox/sun6i-msgbox.c diff --git a/drivers

[linux-sunxi] [PATCH v6 5/6] arm64: dts: allwinner: a64: Add msgbox node

2020-01-12 Thread Samuel Holland
The A64 SoC contains a message box that can be used to send messages and interrupts back and forth between the ARM application CPUs and the ARISC coprocessor. Add a device tree node for it. Signed-off-by: Samuel Holland --- arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 10 ++ 1 file

[linux-sunxi] [PATCH v6 1/6] dt-bindings: mailbox: Add a sun6i message box binding

2020-01-12 Thread Samuel Holland
This mailbox hardware is present in Allwinner sun6i, sun8i, sun9i, and sun50i SoCs. Add a device tree binding for it. Signed-off-by: Samuel Holland --- .../mailbox/allwinner,sun6i-a31-msgbox.yaml | 80 +++ 1 file changed, 80 insertions(+) create mode 100644 Documentation

[linux-sunxi] [PATCH 8/9] arm64: dts: allwinner: h6: Fix indentation of IR node

2020-01-12 Thread Samuel Holland
This node was indented by two tabs when added instead of one. Remove the extra tab. Signed-off-by: Samuel Holland --- arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 22 ++-- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6

[linux-sunxi] [PATCH 9/9] arm64: dts: allwinner: Move wakeup-capable IRQs to r_intc

2020-01-12 Thread Samuel Holland
All IRQs that can be used to wake up the system must be routed through r_intc, so they are visible to firmware while the system is suspended. r_intc IRQ numbers are offset by 96 from the GIC IRQ numbers. Signed-off-by: Samuel Holland --- arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 13

[linux-sunxi] [PATCH 1/9] irqchip/sun6i-r: Switch to a stacked irqchip driver

2020-01-12 Thread Samuel Holland
. The "interrupt" property of the R_INTC node is used to determine 1) the offset between GIC and R_INTC hwirq numbers and 2) the type of trigger between the R_INTC "IRQ 0 pending" output and the GIC NMI input. This commit mostly reverts commit 173bda53b340 ("irqchip/sunxi-n

[linux-sunxi] [PATCH 4/9] ARM: dts: sunxi: h3/h5: Add r_intc node

2020-01-12 Thread Samuel Holland
The H3 and H5 SoCs have an additional interrupt controller in the RTC power domain that can be used to enable wakeup for certain IRQs. Add a node for it. Signed-off-by: Samuel Holland --- arch/arm/boot/dts/sunxi-h3-h5.dtsi | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/arm

[linux-sunxi] [PATCH 5/9] ARM: dts: sunxi: h3/h5: Move wakeup-capable IRQs to r_intc

2020-01-12 Thread Samuel Holland
All IRQs that can be used to wake up the system must be routed through r_intc, so they are visible to firmware while the system is suspended. r_intc IRQ numbers are offset by 32 from the GIC IRQ numbers. Signed-off-by: Samuel Holland --- arch/arm/boot/dts/sunxi-h3-h5.dtsi | 11 +++ 1

[linux-sunxi] [PATCH 2/9] irqchip/sun6i-r: Add wakeup support

2020-01-12 Thread Samuel Holland
for an interrupt to arrive. Signed-off-by: Samuel Holland --- drivers/irqchip/irq-sun6i-r.c | 53 +++ 1 file changed, 53 insertions(+) diff --git a/drivers/irqchip/irq-sun6i-r.c b/drivers/irqchip/irq-sun6i-r.c index 37b6e9c60bf8..f4a4e335061b 100644 --- a/drivers/irqchip

[linux-sunxi] [PATCH 3/9] dt-bindings: irq: Add a compatible for the H3 R_INTC

2020-01-12 Thread Samuel Holland
difference. Signed-off-by: Samuel Holland --- .../interrupt-controller/allwinner,sun7i-a20-sc-nmi.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/interrupt-controller/allwinner,sun7i-a20-sc-nmi.yaml b/Documentation/devicetree/bindings/interrupt

[linux-sunxi] [PATCH 0/9] sunxi: Support IRQ wakeup from deep sleep

2020-01-12 Thread Samuel Holland
atches update the DT+bindings to use R_INTC where beneficial With appropriate firmware, this series allows waking from RTC and NMI (power button, plugging in USB, etc.). Wake from Port L GPIO interrupts (gpio-keys, wifi, etc.) requires some patches to the pinctrl driver. Samuel Holland (9): i

[linux-sunxi] [PATCH 6/9] ARM: dts: sunxi: a83t: Move wakeup-capable IRQs to r_intc

2020-01-12 Thread Samuel Holland
All IRQs that can be used to wake up the system must be routed through r_intc, so they are visible to firmware while the system is suspended. r_intc IRQ numbers are offset by 32 from the GIC IRQ numbers. Signed-off-by: Samuel Holland --- arch/arm/boot/dts/sun8i-a83t.dtsi | 9 ++--- 1 file

[linux-sunxi] [PATCH 7/9] arm64: dts: allwinner: a64: Move wakeup-capable IRQs to r_intc

2020-01-12 Thread Samuel Holland
All IRQs that can be used to wake up the system must be routed through r_intc, so they are visible to firmware while the system is suspended. r_intc IRQ numbers are offset by 32 from the GIC IRQ numbers. Signed-off-by: Samuel Holland --- arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 11

[linux-sunxi] [PATCH v3 7/8] power: supply: axp20x_usb_power: Add wakeup control

2020-01-12 Thread Samuel Holland
on the PMIC are all disabled. Reviewed-by: Chen-Yu Tsai Signed-off-by: Samuel Holland --- drivers/power/supply/axp20x_usb_power.c | 83 - 1 file changed, 67 insertions(+), 16 deletions(-) diff --git a/drivers/power/supply/axp20x_usb_power.c b/drivers/power/supply

[linux-sunxi] [PATCH v3 4/8] power: supply: axp20x_usb_power: Remove unused device_node

2020-01-12 Thread Samuel Holland
This member of struct axp20x_usb_power is not used anywhere. Remove it. Reviewed-by: Chen-Yu Tsai Signed-off-by: Samuel Holland --- drivers/power/supply/axp20x_usb_power.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/power/supply/axp20x_usb_power.c b/drivers/power/supply

[linux-sunxi] [PATCH v3 8/8] power: supply: axp20x_usb_power: Only poll while offline

2020-01-12 Thread Samuel Holland
olling will cease until the next VBUS_REMOVAL IRQ. Reviewed-by: Chen-Yu Tsai Signed-off-by: Samuel Holland --- drivers/power/supply/axp20x_usb_power.c | 30 + 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/drivers/power/supply/axp20x_usb_power.c b/drivers

[linux-sunxi] [PATCH v3 6/8] power: supply: axp20x_usb_power: Allow offlining

2020-01-12 Thread Samuel Holland
VBUS input is disabled via the PATH_SEL bit, the VBUS_USED bit in PWR_INPUT_STATUS is cleared, so there is no change needed when getting the property. Signed-off-by: Samuel Holland --- drivers/power/supply/axp20x_usb_power.c | 30 + 1 file changed, 30 insertions(+) diff

[linux-sunxi] [PATCH v3 5/8] power: supply: axp20x_usb_power: Use a match structure

2020-01-12 Thread Samuel Holland
(). Other parts of the driver still do ID matching; they are left unchanged for now. Signed-off-by: Samuel Holland --- drivers/power/supply/axp20x_usb_power.c | 86 - 1 file changed, 57 insertions(+), 29 deletions(-) diff --git a/drivers/power/supply/axp20x_usb_power.c b

[linux-sunxi] [PATCH v3 2/8] power: supply: axp20x_ac_power: Allow offlining

2020-01-12 Thread Samuel Holland
AXP803/AXP813 have a flag that enables/disables the AC power supply input. Allow control of this flag via the ONLINE property on those variants. Reviewed-by: Chen-Yu Tsai Signed-off-by: Samuel Holland --- drivers/power/supply/axp20x_ac_power.c | 9 - 1 file changed, 8 insertions(+), 1

[linux-sunxi] [PATCH v3 1/8] power: supply: axp20x_ac_power: Fix reporting online status

2020-01-12 Thread Samuel Holland
this flag into account when getting the ONLINE property of the AC input, on PMICs where this flag is present. Fixes: 7693b5643fd2 ("power: supply: add AC power supply driver for AXP813") Cc: sta...@vger.kernel.org Signed-off-by: Samuel Holland --- drivers/power/supply/axp20x_ac_po

[linux-sunxi] [PATCH v3 0/8] X-Powers Power Supply Improvements

2020-01-12 Thread Samuel Holland
ate changed during suspend (9) Samuel Holland (8): power: supply: axp20x_ac_power: Fix reporting online status power: supply: axp20x_ac_power: Allow offlining power: supply: axp20x_ac_power: Add wakeup control power: supply: axp20x_usb_power: Remove unused device_node power: sup

[linux-sunxi] [PATCH v3 3/8] power: supply: axp20x_ac_power: Add wakeup control

2020-01-12 Thread Samuel Holland
on the PMIC are all disabled. Reviewed-by: Chen-Yu Tsai Signed-off-by: Samuel Holland --- drivers/power/supply/axp20x_ac_power.c | 91 +- 1 file changed, 74 insertions(+), 17 deletions(-) diff --git a/drivers/power/supply/axp20x_ac_power.c b/drivers/power/supply

[linux-sunxi] [PATCH 2/3] Input: axp20x-pek - Respect userspace wakeup configuration

2020-01-12 Thread Samuel Holland
interrupt handler. The device core ignores such interrupts, so to actually disable wakeup, we must explicitly disable all non-wakeup interrupts during suspend. Signed-off-by: Samuel Holland --- drivers/input/misc/axp20x-pek.c | 42 - 1 file changed, 41 insertions

[linux-sunxi] [PATCH 1/3] Input: axp20x-pek - Remove unique wakeup event handling

2020-01-12 Thread Samuel Holland
then it would race with the power key IRQ handler. So the best solution seems to be simply removing the hook. Signed-off-by: Samuel Holland --- drivers/input/misc/axp20x-pek.c | 25 - 1 file changed, 25 deletions(-) diff --git a/drivers/input/misc/axp20x-pek.c b/drivers

[linux-sunxi] [PATCH 3/3] Input: axp20x-pek - Enable wakeup for all AXP variants

2020-01-12 Thread Samuel Holland
There are many devices, including several mobile battery-powered devices, using other AXP variants as their PMIC. Enable them to use the power key as a wakeup source. Signed-off-by: Samuel Holland --- drivers/input/misc/axp20x-pek.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff

Re: [linux-sunxi] [PATCH v2 6/9] power: supply: axp20x_usb_power: Use a match structure

2020-01-05 Thread Samuel Holland
On 1/5/20 4:34 AM, Chen-Yu Tsai wrote: > On Sun, Jan 5, 2020 at 9:24 AM Samuel Holland wrote: >> >> Instead of ad-hoc variant ID checks throughout the code, let's start >> moving the variant-specific details to a match structure. This allows >> for future flexibi

Re: [linux-sunxi] [PATCH v2 7/9] power: supply: axp20x_usb_power: Allow offlining

2020-01-05 Thread Samuel Holland
On 1/5/20 4:40 AM, Chen-Yu Tsai wrote: > On Sun, Jan 5, 2020 at 9:24 AM Samuel Holland wrote: >> >> AXP803/AXP813 have a flag that enables/disables the USB power supply >> input. Allow control of this flag via the ONLINE property on those >> variants. >> >>

Re: [linux-sunxi] [PATCH v2 2/9] power: supply: axp20x_ac_power: Fix reporting online status

2020-01-05 Thread Samuel Holland
Hi Julian, On 1/5/20 7:00 AM, Julian Calaby wrote: > On Sun, Jan 5, 2020 at 12:24 PM Samuel Holland wrote: >> >> AXP803/AXP813 have a flag that enables/disables the AC power supply >> input. This flag does not affect the status bits in PWR_INPUT_STATUS. >> Its effect

[linux-sunxi] [PATCH] arm64: dts: allwinner: a64: pinebook: Fix lid wakeup

2020-01-04 Thread Samuel Holland
By default, gpio-keys configures the pin to trigger wakeup IRQs on either edge. The lid switch should only trigger wakeup when opening the lid, not when closing it. Signed-off-by: Samuel Holland --- arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts | 2 ++ 1 file changed, 2 insertions

[linux-sunxi] [PATCH v2 7/9] power: supply: axp20x_usb_power: Allow offlining

2020-01-04 Thread Samuel Holland
VBUS input is disabled via the PATH_SEL bit, the VBUS_USED bit in PWR_INPUT_STATUS is cleared, so there is no change needed when getting the property. Signed-off-by: Samuel Holland --- drivers/power/supply/axp20x_usb_power.c | 27 + 1 file changed, 27 insertions(+) diff

[linux-sunxi] [PATCH v2 2/9] power: supply: axp20x_ac_power: Fix reporting online status

2020-01-04 Thread Samuel Holland
this flag into account when getting the ONLINE property of the AC input, on PMICs where this flag is present. Fixes: 7693b5643fd2 ("power: supply: add AC power supply driver for AXP813") Cc: sta...@vger.kernel.org Signed-off-by: Samuel Holland --- drivers/power/supply/axp20x_ac_po

[linux-sunxi] [PATCH v2 9/9] power: supply: axp20x_usb_power: Only poll while offline

2020-01-04 Thread Samuel Holland
olling will cease until the next VBUS_REMOVAL IRQ. Signed-off-by: Samuel Holland --- drivers/power/supply/axp20x_usb_power.c | 30 + 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/drivers/power/supply/axp20x_usb_power.c b/drivers/power/supply/axp20x_usb_p

[linux-sunxi] [PATCH v2 4/9] power: supply: axp20x_ac_power: Add wakeup control

2020-01-04 Thread Samuel Holland
on the PMIC are all disabled. Signed-off-by: Samuel Holland --- drivers/power/supply/axp20x_ac_power.c | 91 +- 1 file changed, 74 insertions(+), 17 deletions(-) diff --git a/drivers/power/supply/axp20x_ac_power.c b/drivers/power/supply/axp20x_ac_power.c index bc2663cd47fa

[linux-sunxi] [PATCH v2 6/9] power: supply: axp20x_usb_power: Use a match structure

2020-01-04 Thread Samuel Holland
Instead of ad-hoc variant ID checks throughout the code, let's start moving the variant-specific details to a match structure. This allows for future flexibility, and it better matches the other axp20x power supply drivers. Signed-off-by: Samuel Holland --- drivers/power/supply

[linux-sunxi] [PATCH v2 8/9] power: supply: axp20x_usb_power: Add wakeup control

2020-01-04 Thread Samuel Holland
on the PMIC are all disabled. Signed-off-by: Samuel Holland --- drivers/power/supply/axp20x_usb_power.c | 80 - 1 file changed, 65 insertions(+), 15 deletions(-) diff --git a/drivers/power/supply/axp20x_usb_power.c b/drivers/power/supply/axp20x_usb_power.c index

[linux-sunxi] [PATCH v2 5/9] power: supply: axp20x_usb_power: Remove unused device_node

2020-01-04 Thread Samuel Holland
This member of struct axp20x_usb_power is not used anywhere. Remove it. Signed-off-by: Samuel Holland --- drivers/power/supply/axp20x_usb_power.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/power/supply/axp20x_usb_power.c b/drivers/power/supply/axp20x_usb_power.c index

[linux-sunxi] [PATCH v2 0/9] X-Powers Power Supply Improvements

2020-01-04 Thread Samuel Holland
- Shift value properly in calls to regmap_update_bits (3, 7) - Use #ifdef instead of #if to avoid -Wundef warnings (4, 8) - Poll once after an IRQ, instead of setting power->online in the IRQ (9) - Poll once on resume, in case the state changed during suspend (9) Samuel Holland (9): mfd: axp

[linux-sunxi] [PATCH v2 1/9] mfd: axp20x: Mark AXP20X_VBUS_IPSOUT_MGMT as volatile

2020-01-04 Thread Samuel Holland
will think the bit is already set and not write the register. Fixes: cd53216625a0 ("mfd: axp20x: Fix axp288 volatile ranges") Cc: sta...@vger.kernel.org Signed-off-by: Samuel Holland --- drivers/mfd/axp20x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mf

[linux-sunxi] [PATCH v2 3/9] power: supply: axp20x_ac_power: Allow offlining

2020-01-04 Thread Samuel Holland
AXP803/AXP813 have a flag that enables/disables the AC power supply input. Allow control of this flag via the ONLINE property on those variants. Signed-off-by: Samuel Holland --- drivers/power/supply/axp20x_ac_power.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git

[linux-sunxi] Re: [PATCH 1/7] power: supply: axp20x_ac_power: Allow offlining

2020-01-01 Thread Samuel Holland
On 1/2/20 12:36 AM, Samuel Holland wrote: > AXP803/AXP813 have a flag that enables/disables the AC power supply > input. Allow control of this flag via the ONLINE property on those > variants. > > Signed-off-by: Samuel Holland > --- > drivers/power/supply/axp20x_ac_power.c

[linux-sunxi] [PATCH 3/7] power: supply: axp20x_usb_power: Remove unused device_node

2020-01-01 Thread Samuel Holland
This member of struct axp20x_usb_power is not used anywhere. Remove it. Signed-off-by: Samuel Holland --- drivers/power/supply/axp20x_usb_power.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/power/supply/axp20x_usb_power.c b/drivers/power/supply/axp20x_usb_power.c index

[linux-sunxi] [PATCH 2/7] power: supply: axp20x_ac_power: Add wakeup control

2020-01-01 Thread Samuel Holland
on the PMIC are all disabled. Signed-off-by: Samuel Holland --- drivers/power/supply/axp20x_ac_power.c | 103 +++-- 1 file changed, 80 insertions(+), 23 deletions(-) diff --git a/drivers/power/supply/axp20x_ac_power.c b/drivers/power/supply/axp20x_ac_power.c index 4410e7b89383

[linux-sunxi] [PATCH 1/7] power: supply: axp20x_ac_power: Allow offlining

2020-01-01 Thread Samuel Holland
AXP803/AXP813 have a flag that enables/disables the AC power supply input. Allow control of this flag via the ONLINE property on those variants. Signed-off-by: Samuel Holland --- drivers/power/supply/axp20x_ac_power.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git

[linux-sunxi] [PATCH 7/7] power: supply: axp20x_usb_power: Only poll while offline

2020-01-01 Thread Samuel Holland
ent transition necessarily implies an online->offline transition. This will cause an IRQ, and so there is no need to poll. Signed-off-by: Samuel Holland --- drivers/power/supply/axp20x_usb_power.c | 35 ++--- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/drivers

[linux-sunxi] [PATCH 5/7] power: supply: axp20x_usb_power: Allow offlining

2020-01-01 Thread Samuel Holland
-by: Samuel Holland --- drivers/power/supply/axp20x_usb_power.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/drivers/power/supply/axp20x_usb_power.c b/drivers/power/supply/axp20x_usb_power.c index 2d7272e19a87..f49c8ff4a3f0 100644 --- a/drivers/power/supply

[linux-sunxi] [PATCH 4/7] power: supply: axp20x_usb_power: Use a match structure

2020-01-01 Thread Samuel Holland
Instead of ad-hoc variant ID checks throughout the code, let's start moving the variant-specific details to a match structure. This allows for future flexibility, and it better matches the other axp20x power supply drivers. Signed-off-by: Samuel Holland --- drivers/power/supply

[linux-sunxi] [PATCH 6/7] power: supply: axp20x_usb_power: Add wakeup control

2020-01-01 Thread Samuel Holland
on the PMIC are all disabled. Signed-off-by: Samuel Holland --- drivers/power/supply/axp20x_usb_power.c | 80 - 1 file changed, 65 insertions(+), 15 deletions(-) diff --git a/drivers/power/supply/axp20x_usb_power.c b/drivers/power/supply/axp20x_usb_power.c index

[linux-sunxi] [PATCH 1/3] clk: sunxi-ng: sun8i-r: Fix divider on APB0 clock

2019-12-28 Thread Samuel Holland
the definitions. Signed-off-by: Samuel Holland --- drivers/clk/sunxi-ng/ccu-sun8i-r.c | 21 +++-- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-r.c b/drivers/clk/sunxi-ng/ccu-sun8i-r.c index 4646fdc61053..4c8c491b87c2 100644 --- a/drivers/clk

[linux-sunxi] [PATCH 2/3] clk: sunxi-ng: h6-r: Simplify R_APB1 clock definition

2019-12-28 Thread Samuel Holland
Like the APB0 clock on previous chips, this is a simple single-parent clock with an M divider. Use the equivalent helper macro instead of writing out the whole clock description manually. Signed-off-by: Samuel Holland --- drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c | 12 +--- 1 file changed

[linux-sunxi] [PATCH 3/3] clk: sunxi-ng: h6-r: Fix AR100/R_APB2 parent order

2019-12-28 Thread Samuel Holland
| 11422 (unstable) | iosc/osc16M | | 3 | 5 | 85338 (stable) | pll-periph0 | | 3 | 17 | 27167 (stable) | pll-periph0 | The relative performance numbers all match up (with pll-periph0 running at its default 600MHz). Signed-off-by: Samuel Holland

[linux-sunxi] [PATCH 0/3] A64/H3/H6 R_CCU clock fixes

2019-12-28 Thread Samuel Holland
the I2C/RSB frequency. Patch 2 should have no functional change. Patch 3 was verified by benchmarking. Details are in the commit message. [1]: https://github.com/Allwinner-Homlet/H6-BSP4.9-linux [2]: https://github.com/crust-firmware/crust Samuel Holland (3): clk: sunxi-ng: sun8i-r: Fix

[linux-sunxi] Re: [PATCH v5 2/8] dt-bindings: mailbox: Add a sun6i message box binding

2019-12-16 Thread Samuel Holland
Hi, On 12/16/19 8:04 AM, Maxime Ripard wrote: > Hi, > > On Sat, Dec 14, 2019 at 10:24:49PM -0600, Samuel Holland wrote: >> This mailbox hardware is present in Allwinner sun6i, sun8i, sun9i, and >> sun50i SoCs. Add a device tree binding for it. As it has only been >>

[linux-sunxi] [PATCH v5 5/8] ARM: dts: sunxi: h3/h5: Add msgbox node

2019-12-14 Thread Samuel Holland
The H3 and H5 SoCs contain a message box that can be used to send messages and interrupts back and forth between the ARM application CPUs and the ARISC coprocessor. Add a device tree node for it. Signed-off-by: Samuel Holland --- arch/arm/boot/dts/sunxi-h3-h5.dtsi | 10 ++ 1 file

[linux-sunxi] [PATCH v5 0/8] Allwinner sun6i message box support

2019-12-14 Thread Samuel Holland
le strings and an A31 fallback compatible - Dropped the mailbox framework patch - Include DT patches for SoCs that document the message box Samuel Holland (8): clk: sunxi-ng: Mark msgbox clocks as critical dt-bindings: mailbox: Add a sun6i message box binding mailbox: sun6i-msgbox: Add a n

[linux-sunxi] [PATCH v5 4/8] ARM: dts: sunxi: a83t: Add msgbox node

2019-12-14 Thread Samuel Holland
The A83T SoC contains a message box that can be used to send messages and interrupts back and forth between the ARM application CPUs and the ARISC coprocessor. Add a device tree node for it. Tested-by: Ondrej Jirman Signed-off-by: Samuel Holland --- arch/arm/boot/dts/sun8i-a83t.dtsi | 10

[linux-sunxi] [PATCH v5 1/8] clk: sunxi-ng: Mark msgbox clocks as critical

2019-12-14 Thread Samuel Holland
SoCs. Signed-off-by: Samuel Holland --- drivers/clk/sunxi-ng/ccu-sun50i-a64.c | 3 ++- drivers/clk/sunxi-ng/ccu-sun50i-h6.c | 3 ++- drivers/clk/sunxi-ng/ccu-sun8i-a23.c | 3 ++- drivers/clk/sunxi-ng/ccu-sun8i-a33.c | 3 ++- drivers/clk/sunxi-ng/ccu-sun8i-a83t.c | 3 ++- drivers/clk/sunxi-ng

[linux-sunxi] [PATCH v5 8/8] firmware: arm_scpi: Support unidirectional mailbox channels

2019-12-14 Thread Samuel Holland
SCPI channel. Note that since the mailbox framework only supports a single phandle with each name (mbox_request_channel_byname always returns the first one), this new mode only supports a single SCPI channel. Signed-off-by: Samuel Holland --- drivers/firmware/arm_scpi.c | 58

[linux-sunxi] [PATCH v5 6/8] arm64: dts: allwinner: a64: Add msgbox node

2019-12-14 Thread Samuel Holland
The A64 SoC contains a message box that can be used to send messages and interrupts back and forth between the ARM application CPUs and the ARISC coprocessor. Add a device tree node for it. Signed-off-by: Samuel Holland --- arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 10 ++ 1 file

[linux-sunxi] [PATCH v5 2/8] dt-bindings: mailbox: Add a sun6i message box binding

2019-12-14 Thread Samuel Holland
This mailbox hardware is present in Allwinner sun6i, sun8i, sun9i, and sun50i SoCs. Add a device tree binding for it. As it has only been tested on the A83T, A64, H3/H5, and H6 SoCs, only those compatibles are included. Signed-off-by: Samuel Holland --- .../mailbox/allwinner,sun6i-a31

[linux-sunxi] [PATCH v5 7/8] arm64: dts: allwinner: h6: Add msgbox node

2019-12-14 Thread Samuel Holland
The H6 SoC contains a message box that can be used to send messages and interrupts back and forth between the ARM application CPUs and the ARISC coprocessor. Add a device tree node for it. Signed-off-by: Samuel Holland --- arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 10 ++ 1 file

[linux-sunxi] [PATCH v5 3/8] mailbox: sun6i-msgbox: Add a new mailbox driver

2019-12-14 Thread Samuel Holland
. Signed-off-by: Samuel Holland --- drivers/mailbox/Kconfig| 9 + drivers/mailbox/Makefile | 2 + drivers/mailbox/sun6i-msgbox.c | 332 + 3 files changed, 343 insertions(+) create mode 100644 drivers/mailbox/sun6i-msgbox.c diff --git a/drivers

Re: [linux-sunxi] [PATCH] bus: sunxi-rsb: Make interrupt handling more robust

2019-10-07 Thread Samuel Holland
On 10/7/19 10:19 AM, Chen-Yu Tsai wrote: > On Sun, Aug 25, 2019 at 1:50 AM Samuel Holland wrote: >> >> The RSB controller has two registers for controlling interrupt inputs: >> RSB_INTE, which has bits for each possible interrupt, and the global >> inter

[linux-sunxi] Re: [PATCH] bus: sunxi-rsb: Make interrupt handling more robust

2019-10-07 Thread Samuel Holland
Hello, On 8/24/19 12:50 PM, Samuel Holland wrote: > The RSB controller has two registers for controlling interrupt inputs: > RSB_INTE, which has bits for each possible interrupt, and the global > interrupt enable bit in RSB_CTRL. > > Currently, we enable the bits in RSB_INTE befor

[linux-sunxi] Re: [PATCH v4 00/10] Allwinner sunxi message box support

2019-09-08 Thread Samuel Holland
On 9/8/19 10:22 PM, Ondřej Jirman wrote: > Hello Samuel, > > On Mon, Aug 19, 2019 at 10:23:01PM -0500, Samuel Holland wrote: >> This series adds support for the "hardware message box" in sun8i, sun9i, >> and sun50i SoCs, used for communication with th

[linux-sunxi] [PATCH] bus: sunxi-rsb: Make interrupt handling more robust

2019-08-24 Thread Samuel Holland
. This causes false completion of a transfer, and the next transfer starts prematurely, causing a LOAD_BSY condition. The end result is that some transfers at resume fail with -EBUSY. With this patch, all transfers reliably succeed during/after resume. Signed-off-by: Samuel Holland --- drivers/bus/sunxi

<    1   2   3   4   >