Linux-PM Archive on
 help / color / Atom feed
From: Philip Molloy <>
To: "" <>
Cc: Kevin Hilman <>
Subject: Power domain configuration for a i2c module
Date: Thu, 15 Aug 2019 15:57:45 +0000
Message-ID: <> (raw)
In-Reply-To: <>


I've setup a power domain, but I'm having trouble understanding how the domain's power management callbacks are called when a i2c driver is probed.

The domain is intended to cover two external modules. The power to both modules is controlled by a single GPIO. I intend to add several drivers to the domain including drivers for several i2c devices and a MMIO driver to access data streamed from the modules. I've started with one provider and two consumers.

The provider calls pm_genpd_init() and of_genpd_add_provider_simple(). It also implements power_on() and power_of().

provider@0 {
    power-gpio = <&gpio XX GPIO_ACTIVE_HIGH>;
    ready-gpio = <&gpio XX GPIO_ACTIVE_HIGH>;
    #power-domain-cells = <0>;

The consumers are two physical I2C switches:

i2c-mux-gpio {
    compatible = "i2c-mux-gpio";

    module@1 {

        tca9543@70 {
            compatible = "nxp,pca943";
            power-domains = <&provider 0>;
            power-domain-names = "provider";

    module@2 {
        // Same as above

When I modprobe i2c-mux-mpca954x it is successfully added to the domain, but probe fails when calling i2c_smbus_write_byte() to verify the mux is present. That is because the modules are not powered on, because the power domain callbacks were not called.

I feel like there are a number of ways this could work. My assumption would be that the i2c driver subsystem would make sure the device is powered on before probe is called. i2c_device_probe() does call dev_pm_domain_attach() before calling driver->probe(), but I don't see where it would power on the device. i2c-mux-pca954x implements a resume callback so I assume it doesn't require any changes.

Any clarity would be greatly appreciated.


      reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-20 22:18 Philip Molloy
2019-08-15 15:57 ` Philip Molloy [this message]

Reply instructions:

You may reply publically 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:

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

  git send-email \
    --in-reply-to='' \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-PM Archive on

Archives are clonable:
	git clone --mirror linux-pm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-pm linux-pm/ \
	public-inbox-index linux-pm

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox