linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/9] power: sequencing: implement the subsystem and add first users
@ 2024-02-01 15:55 Bartosz Golaszewski
  2024-02-01 15:55 ` [RFC 1/9] of: provide a cleanup helper for OF nodes Bartosz Golaszewski
                   ` (10 more replies)
  0 siblings, 11 replies; 41+ messages in thread
From: Bartosz Golaszewski @ 2024-02-01 15:55 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Marcel Holtmann, Luiz Augusto von Dentz,
	Bjorn Helgaas, Neil Armstrong, Alex Elder, Srini Kandagatla,
	Greg Kroah-Hartman, Arnd Bergmann, Abel Vesa,
	Manivannan Sadhasivam, Lukas Wunner
  Cc: linux-arm-msm, devicetree, linux-kernel, linux-bluetooth,
	linux-pci, Bartosz Golaszewski

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

I'd like to preface the cover letter by saying right away that this
series is not complete. It's an RFC that presents my approach and is sent
to the list for discussion. There are no DT bindings nor docs in
Documentation/ yet. Please review it as an RFC and not an upstreambound
series. If the approach is accepted as correct, I'll add missing bits.

The RFC[1] presenting my proposed device-tree representation of the
QCA6391 package present on the RB5 board - while not really officially
accepted - was not outright rejected which is a good sign.

This series incorporates it and builds a proposed power sequencing
subsystem together with the first dedicated driver around it. Then it
adds first two users: the Bluetooth and WLAN modules of the QCA6391.

The Bluetooth part is pretty straightforward. The WLAN however is a PCIe
device and as such needs to be powered-up *before* it's detected on the
PCI bus. To that end, we modify the PCI core to instantiate platform
devices for existing DT child nodes of the PCIe ports. For those nodes
for which a power-sequencing driver exists, we bind it and let it probe.
The driver then triggers a rescan of the PCI bus with the aim of
detecting the now powered-on device. The device will consume the same DT
node as the platform, power-sequencing device. We use device links to
make the latter become the parent of the former.

The main advantage of the above approach (both for PCI as well as
generic power sequencers) is that we don't introduce significant changes
in DT bindings and don't introduce new properties. We merely define new
resources.

[1] https://lore.kernel.org/all/CAMRc=MckG32DQv7b1AQL-mbnYdx4fsdYWtLwCyXc5Ma7EeSAKw@mail.gmail.com/T/#md5dc62007d12f6833d4e51658b14e0493954ba68

Bartosz Golaszewski (9):
  of: provide a cleanup helper for OF nodes
  arm64: dts: qcom: qrb5165-rb5: model the PMU of the QCA6391
  power: sequencing: new subsystem
  power: pwrseq: add a driver for the QCA6390 PMU module
  Bluetooth: qca: use the power sequencer for QCA6390
  PCI: create platform devices for child OF nodes of the port node
  PCI: hold the rescan mutex when scanning for the first time
  PCI/pwrctl: add PCI power control core code
  PCI/pwrctl: add a PCI power control driver for power sequenced devices

 arch/arm64/boot/dts/qcom/qrb5165-rb5.dts  | 128 +++++-
 arch/arm64/boot/dts/qcom/sm8250.dtsi      |  10 +
 drivers/bluetooth/hci_qca.c               |  30 ++
 drivers/pci/Kconfig                       |   1 +
 drivers/pci/Makefile                      |   1 +
 drivers/pci/bus.c                         |   9 +-
 drivers/pci/probe.c                       |   2 +
 drivers/pci/pwrctl/Kconfig                |  17 +
 drivers/pci/pwrctl/Makefile               |   4 +
 drivers/pci/pwrctl/core.c                 |  82 ++++
 drivers/pci/pwrctl/pci-pwrctl-pwrseq.c    |  83 ++++
 drivers/pci/remove.c                      |   2 +
 drivers/power/Kconfig                     |   1 +
 drivers/power/Makefile                    |   1 +
 drivers/power/sequencing/Kconfig          |  28 ++
 drivers/power/sequencing/Makefile         |   6 +
 drivers/power/sequencing/core.c           | 482 ++++++++++++++++++++++
 drivers/power/sequencing/pwrseq-qca6390.c | 232 +++++++++++
 include/linux/of.h                        |   4 +
 include/linux/pci-pwrctl.h                |  24 ++
 include/linux/pwrseq/consumer.h           |  53 +++
 include/linux/pwrseq/provider.h           |  41 ++
 22 files changed, 1229 insertions(+), 12 deletions(-)
 create mode 100644 drivers/pci/pwrctl/Kconfig
 create mode 100644 drivers/pci/pwrctl/Makefile
 create mode 100644 drivers/pci/pwrctl/core.c
 create mode 100644 drivers/pci/pwrctl/pci-pwrctl-pwrseq.c
 create mode 100644 drivers/power/sequencing/Kconfig
 create mode 100644 drivers/power/sequencing/Makefile
 create mode 100644 drivers/power/sequencing/core.c
 create mode 100644 drivers/power/sequencing/pwrseq-qca6390.c
 create mode 100644 include/linux/pci-pwrctl.h
 create mode 100644 include/linux/pwrseq/consumer.h
 create mode 100644 include/linux/pwrseq/provider.h

-- 
2.40.1


^ permalink raw reply	[flat|nested] 41+ messages in thread

end of thread, other threads:[~2024-02-14 15:46 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-01 15:55 [RFC 0/9] power: sequencing: implement the subsystem and add first users Bartosz Golaszewski
2024-02-01 15:55 ` [RFC 1/9] of: provide a cleanup helper for OF nodes Bartosz Golaszewski
2024-02-01 22:18   ` Rob Herring
2024-02-04 19:18     ` Bartosz Golaszewski
2024-02-01 15:55 ` [RFC 2/9] arm64: dts: qcom: qrb5165-rb5: model the PMU of the QCA6391 Bartosz Golaszewski
2024-02-02  4:34   ` Bjorn Andersson
2024-02-02  4:59     ` Dmitry Baryshkov
2024-02-02 16:09       ` Bjorn Andersson
2024-02-02 13:23     ` Bartosz Golaszewski
2024-02-02 16:41       ` Bjorn Andersson
2024-02-02 16:47   ` Bjorn Andersson
2024-02-05  7:51   ` Krzysztof Kozlowski
2024-02-01 15:55 ` [RFC 3/9] power: sequencing: new subsystem Bartosz Golaszewski
2024-02-01 22:25   ` Rob Herring
2024-02-01 15:55 ` [RFC 4/9] power: pwrseq: add a driver for the QCA6390 PMU module Bartosz Golaszewski
2024-02-02  4:54   ` Bjorn Andersson
2024-02-02  7:48     ` Dmitry Baryshkov
2024-02-02  9:01       ` Bartosz Golaszewski
2024-02-01 15:55 ` [RFC 5/9] Bluetooth: qca: use the power sequencer for QCA6390 Bartosz Golaszewski
2024-02-01 15:55 ` [RFC 6/9] PCI: create platform devices for child OF nodes of the port node Bartosz Golaszewski
2024-02-02  2:59   ` Bjorn Andersson
2024-02-02  9:03     ` Bartosz Golaszewski
2024-02-01 15:55 ` [RFC 7/9] PCI: hold the rescan mutex when scanning for the first time Bartosz Golaszewski
2024-02-01 15:55 ` [RFC 8/9] PCI/pwrctl: add PCI power control core code Bartosz Golaszewski
2024-02-02  3:53   ` Bjorn Andersson
2024-02-02  9:11     ` Bartosz Golaszewski
2024-02-02 16:52       ` Bjorn Andersson
2024-02-07 16:26         ` Bartosz Golaszewski
2024-02-09  9:04           ` Lukas Wunner
2024-02-09  9:38             ` Manivannan Sadhasivam
2024-02-08 11:32         ` Manivannan Sadhasivam
2024-02-09 23:43           ` Bjorn Andersson
2024-02-14 14:28             ` Manivannan Sadhasivam
2024-02-14 15:46     ` Bartosz Golaszewski
2024-02-01 15:55 ` [RFC 9/9] PCI/pwrctl: add a PCI power control driver for power sequenced devices Bartosz Golaszewski
2024-02-02  4:03   ` Bjorn Andersson
2024-02-02 13:05     ` Bartosz Golaszewski
2024-02-09 23:37       ` Bjorn Andersson
2024-02-02  0:40 ` [RFC 0/9] power: sequencing: implement the subsystem and add first users Bjorn Andersson
2024-02-02  8:53   ` Bartosz Golaszewski
2024-02-02  4:10 ` Bjorn Andersson

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).