public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Przemyslaw Marczak <p.marczak@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/5] power: regulator: Add ctrl_reg and volt_reg fields for pmic
Date: Wed, 14 Sep 2016 10:03:07 +0200	[thread overview]
Message-ID: <57D9043B.8020706@samsung.com> (raw)
In-Reply-To: <1473827299-29944-2-git-send-email-j-keerthy@ti.com>

Hello Keerthy,

On 09/14/2016 06:28 AM, Keerthy wrote:
> The ctrl reg contains bit fields to enable and disable regulators,
> and volt_reg has the bit fields to configure the voltage values.
> The registers are frequently accessed hence make them part
> of dm_regulator_uclass_platdata structure.
>
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> ---
>   include/power/regulator.h | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/include/power/regulator.h b/include/power/regulator.h
> index 9bcd728..57b14a3 100644
> --- a/include/power/regulator.h
> +++ b/include/power/regulator.h
> @@ -171,6 +171,8 @@ struct dm_regulator_uclass_platdata {
>   	bool boot_on;
>   	const char *name;
>   	int flags;
> +	u8 ctrl_reg;
> +	u8 volt_reg;
>   };
>   
>   /* Regulator device operations */

This structure above is used for some common "high-level" data, which 
can be used by regulator uclass driver.

Even if most of PMICs has some ctrl/volt/etc regs, the regulator uclass 
driver doesn't know, how to use it, so from this point of view it is 
useless.

But, you can keep device/driver data in a proper fields. Please look at 
those files:

drivers/power/regulator/fixed.c:119
drivers/power/regulator/pfuze100.c:567

To store some device internal data, you can use:
.platdata_auto_alloc_size -> with access by dev_get_platdata()
.priv_auto_alloc_size -> with access by dev_get_priv()

Best regards,
-- 
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marczak at samsung.com

  reply	other threads:[~2016-09-14  8:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-14  4:28 [U-Boot] [PATCH 0/5] power: pmic: Add support for Palmas family of PMICs Keerthy
2016-09-14  4:28 ` [U-Boot] [PATCH 1/5] power: regulator: Add ctrl_reg and volt_reg fields for pmic Keerthy
2016-09-14  8:03   ` Przemyslaw Marczak [this message]
2016-09-14  8:24     ` Keerthy
2016-09-14 11:56       ` Przemyslaw Marczak
2016-09-15  8:17         ` Keerthy
2016-09-14  4:28 ` [U-Boot] [PATCH 2/5] power: pmic: Palmas: Add the base pmic support Keerthy
2016-09-19  0:58   ` Simon Glass
2016-09-14  4:28 ` [U-Boot] [PATCH 3/5] power: regulator: palmas: Add regulator support Keerthy
2016-09-19  0:58   ` Simon Glass
2016-09-19  3:31     ` Keerthy
2016-09-14  4:28 ` [U-Boot] [PATCH 4/5] configs: am57xx_evm_defconfig: Enable PALMAS options Keerthy
2016-09-14  4:28 ` [U-Boot] [PATCH 5/5] configs: dra7xx_evm_defconfig: " Keerthy

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=57D9043B.8020706@samsung.com \
    --to=p.marczak@samsung.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