From: Lokesh Vutla <lokeshvutla@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 14/25] power domain: Add support for multiple powerdomains per device
Date: Wed, 22 Aug 2018 14:51:35 +0530 [thread overview]
Message-ID: <43bceb75-6d63-f62b-ffe7-9f1b30f0c141@ti.com> (raw)
In-Reply-To: <20180821143203.29142-15-lokeshvutla@ti.com>
On Tuesday 21 August 2018 08:01 PM, Lokesh Vutla wrote:
> There are cases where there are more than one power domain
> attached to the device inorder to get the device functional.
> So add support for enabling power domain based on the index.
>
> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
> ---
> drivers/power/domain/power-domain-uclass.c | 11 +++++++++--
> include/power-domain.h | 19 +++++++++++++++++++
> 2 files changed, 28 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/power/domain/power-domain-uclass.c b/drivers/power/domain/power-domain-uclass.c
> index 9e9ec4f419..2ea0ff24c7 100644
> --- a/drivers/power/domain/power-domain-uclass.c
> +++ b/drivers/power/domain/power-domain-uclass.c
> @@ -28,7 +28,8 @@ static int power_domain_of_xlate_default(struct power_domain *power_domain,
> return 0;
> }
>
> -int power_domain_get(struct udevice *dev, struct power_domain *power_domain)
> +int power_domain_get_by_index(struct udevice *dev,
> + struct power_domain *power_domain, int index)
> {
> struct ofnode_phandle_args args;
> int ret;
> @@ -38,7 +39,8 @@ int power_domain_get(struct udevice *dev, struct power_domain *power_domain)
> debug("%s(dev=%p, power_domain=%p)\n", __func__, dev, power_domain);
>
> ret = dev_read_phandle_with_args(dev, "power-domains",
> - "#power-domain-cells", 0, 0, &args);
> + "#power-domain-cells", 0, index,
> + &args);
> if (ret) {
> debug("%s: dev_read_phandle_with_args failed: %d\n",
> __func__, ret);
> @@ -73,6 +75,11 @@ int power_domain_get(struct udevice *dev, struct power_domain *power_domain)
> return 0;
> }
>
> +int power_domain_get(struct udevice *dev, struct power_domain *power_domain)
> +{
> + return power_domain_get_by_index(dev, power_domain, 0);
> +}
> +
> int power_domain_free(struct power_domain *power_domain)
> {
> struct power_domain_ops *ops = power_domain_dev_ops(power_domain->dev);
> diff --git a/include/power-domain.h b/include/power-domain.h
> index a558fbbdb2..0c6d77e813 100644
> --- a/include/power-domain.h
> +++ b/include/power-domain.h
> @@ -97,6 +97,25 @@ int power_domain_get(struct udevice *dev, struct power_domain *power_domain)
> }
> #endif
>
> +/**
> + * power_domain_get_by_index - Get the indexed power domain for a device.
> + *
> + * @dev: The client device.
> + * @power_domain: A pointer to a power domain struct to initialize.
> + * @index: Power domain index to be powered on.
> + *
> + * @return 0 if OK, or a negative error code.
> + */
> +#if CONFIG_IS_ENABLED(POWER_DOMAIN)
> +int power_domain_get_by_index(struct udevice *dev,
> + struct power_domain *power_domain, int index);
> +#else
> +int power_domain_get_by_index(struct udevice *dev,
> + struct power_domain *power_domain, int index)
Looks like I missed open braces "{" here. Will wait for some more time
and post a v2.
Thanks and regards,
Lokesh
> + return -ENOSYS;
> +}
> +#endif
> +
> /**
> * power_domain_free - Free a previously requested power domain.
> *
>
next prev parent reply other threads:[~2018-08-22 9:21 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-21 14:31 [U-Boot] [PATCH 00/25] [2/3] Initial support Texas Instrument's AM654 Platform Lokesh Vutla
2018-08-21 14:31 ` [U-Boot] [PATCH 01/25] firmware: Add basic support for TI System Control Interface (TI SCI) protocol Lokesh Vutla
2018-08-24 14:11 ` Tom Rini
2018-08-24 15:00 ` Lokesh Vutla
2018-08-21 14:31 ` [U-Boot] [PATCH 02/25] firmware: ti_sci: Add support for board configuration Lokesh Vutla
2018-08-24 14:11 ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 03/25] firmware: ti_sci: Add support for device control Lokesh Vutla
2018-08-24 14:11 ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 04/25] firmware: ti_sci: Add support for clock control Lokesh Vutla
2018-08-24 14:11 ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 05/25] firmware: ti_sci: Add support for reboot core service Lokesh Vutla
2018-08-24 14:11 ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 06/25] firmware: ti_sci: Add support for processor control services Lokesh Vutla
2018-08-24 14:11 ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 07/25] dm: firmware: Automatically bind child devices Lokesh Vutla
2018-08-24 14:11 ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 08/25] dm: reset: Update uclass to allow querying reset status Lokesh Vutla
2018-08-24 14:11 ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 09/25] reset: Extend reset control with an optional data field Lokesh Vutla
2018-08-24 14:11 ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 10/25] reset: Introduce TI System Control Interface (TI SCI) reset driver Lokesh Vutla
2018-08-24 14:12 ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 11/25] clk: Allow clock defaults to be set also during re-reloc state Lokesh Vutla
2018-08-24 14:12 ` Tom Rini
2018-08-24 14:42 ` Dr. Philipp Tomsich
2018-08-24 15:54 ` Andreas Dannenberg
2018-08-24 16:00 ` Dr. Philipp Tomsich
2018-08-24 16:28 ` Andreas Dannenberg
2018-08-27 3:26 ` Kever Yang
2018-08-27 16:06 ` Andreas Dannenberg
2018-08-28 9:12 ` Lokesh Vutla
2018-08-27 6:02 ` Lokesh Vutla
2018-08-21 14:31 ` [U-Boot] [PATCH 12/25] clk: Extend clock control with an optional data field Lokesh Vutla
2018-08-24 14:12 ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 13/25] clk: Introduce TI System Control Interface (TI SCI) clock driver Lokesh Vutla
2018-08-24 14:12 ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 14/25] power domain: Add support for multiple powerdomains per device Lokesh Vutla
2018-08-22 9:21 ` Lokesh Vutla [this message]
2018-08-24 14:12 ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 15/25] power domain: Introduce TI System Control Interface (TI SCI) power domain driver Lokesh Vutla
2018-08-24 14:12 ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 16/25] sysreset: Add TI System Control Interface (TI SCI) sysreset driver Lokesh Vutla
2018-08-24 14:12 ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 17/25] mailbox: Allow attaching private data for mbox_chan Lokesh Vutla
2018-08-24 14:12 ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 18/25] mailbox: Introduce K3 Secure Proxy Driver Lokesh Vutla
2018-08-24 14:12 ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 19/25] spl: Allow mailbox drivers to be used within SPL Lokesh Vutla
2018-08-24 14:12 ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 20/25] remoteproc: Allow for individual remoteproc initialization Lokesh Vutla
2018-08-24 14:12 ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 21/25] remoteproc: Introduce K3 system controller Lokesh Vutla
2018-08-24 14:12 ` Tom Rini
2018-08-24 15:02 ` Lokesh Vutla
2018-08-21 14:32 ` [U-Boot] [PATCH 22/25] remoteproc: Introduce K3 remoteproc driver Lokesh Vutla
2018-08-24 14:12 ` Tom Rini
2018-08-21 14:32 ` [U-Boot] [PATCH 23/25] spl: Allow remoteproc drivers to be used within SPL Lokesh Vutla
2018-08-24 14:12 ` Tom Rini
2018-08-21 14:32 ` [U-Boot] [PATCH 24/25] mmc: k3_arasan: Add sdhci driver support for K3 family SoCs Lokesh Vutla
2018-08-24 14:12 ` Tom Rini
2018-08-21 14:32 ` [U-Boot] [PATCH 25/25] gpio: do not include <asm/arch/gpio.h> for ARCH_K3 Lokesh Vutla
2018-08-24 14:13 ` Tom Rini
Reply instructions:
You may reply publicly 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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43bceb75-6d63-f62b-ffe7-9f1b30f0c141@ti.com \
--to=lokeshvutla@ti.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).