public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Minkyu Kang <mk7.kang@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V3 1/6] exynos: Use common pmic_reg_update() definition
Date: Thu, 05 Dec 2013 14:50:15 +0900	[thread overview]
Message-ID: <52A01417.8000001@samsung.com> (raw)
In-Reply-To: <1384250684-16124-2-git-send-email-l.krishna@samsung.com>

Dear Leela Krishna Amudala,

On 12/11/13 19:04, Leela Krishna Amudala wrote:
> This function is used by different Exynos platforms, put it in the
> common file.
> 
> Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
> Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com>
> Reviewed-by: Doug Anderson <dianders@google.com>
> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
> Acked-by: Simon Glass <sjg@chromium.org>
> ---
>  board/samsung/common/board.c |   19 -------------------
>  drivers/power/power_core.c   |   19 +++++++++++++++++++
>  include/power/pmic.h         |    1 +
>  3 files changed, 20 insertions(+), 19 deletions(-)
> 
> diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
> index 2512a59..1959c4e 100644
> --- a/board/samsung/common/board.c
> +++ b/board/samsung/common/board.c
> @@ -156,25 +156,6 @@ static int board_init_cros_ec_devices(const void *blob)
>  
>  #if defined(CONFIG_POWER)
>  #ifdef CONFIG_POWER_MAX77686
> -static int pmic_reg_update(struct pmic *p, int reg, uint regval)
> -{
> -	u32 val;
> -	int ret = 0;
> -
> -	ret = pmic_reg_read(p, reg, &val);
> -	if (ret) {
> -		debug("%s: PMIC %d register read failed\n", __func__, reg);
> -		return -1;
> -	}
> -	val |= regval;
> -	ret = pmic_reg_write(p, reg, val);
> -	if (ret) {
> -		debug("%s: PMIC %d register write failed\n", __func__, reg);
> -		return -1;
> -	}
> -	return 0;
> -}
> -
>  static int max77686_init(void)
>  {
>  	struct pmic *p;
> diff --git a/drivers/power/power_core.c b/drivers/power/power_core.c
> index 29ccc83..e715435 100644
> --- a/drivers/power/power_core.c
> +++ b/drivers/power/power_core.c
> @@ -208,6 +208,25 @@ int do_pmic(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
>  	return CMD_RET_SUCCESS;
>  }
>  
> +int pmic_reg_update(struct pmic *p, int reg, uint regval)
> +{
> +	u32 val;
> +	int ret = 0;

= 0 is unnecessary.

> +
> +	ret = pmic_reg_read(p, reg, &val);
> +	if (ret) {
> +		debug("%s: PMIC %d register read failed\n", __func__, reg);
> +		return -1;
> +	}

please add blank line.

> +	val |= regval;
> +	ret = pmic_reg_write(p, reg, val);
> +	if (ret) {
> +		debug("%s: PMIC %d register write failed\n", __func__, reg);
> +		return -1;
> +	}
> +	return 0;
> +}
> +
>  U_BOOT_CMD(
>  	pmic,	CONFIG_SYS_MAXARGS, 1, do_pmic,
>  	"PMIC",
> diff --git a/include/power/pmic.h b/include/power/pmic.h
> index 0e7aa31..d17dbdc 100644
> --- a/include/power/pmic.h
> +++ b/include/power/pmic.h
> @@ -83,6 +83,7 @@ int pmic_probe(struct pmic *p);
>  int pmic_reg_read(struct pmic *p, u32 reg, u32 *val);
>  int pmic_reg_write(struct pmic *p, u32 reg, u32 val);
>  int pmic_set_output(struct pmic *p, u32 reg, int ldo, int on);
> +int pmic_reg_update(struct pmic *p, int reg, uint regval);

uint regval -> u32 val, for keep naming convention with other functions.

>  
>  #define pmic_i2c_addr (p->hw.i2c.addr)
>  #define pmic_i2c_tx_num (p->hw.i2c.tx_num)
> 

Thanks,
Minkyu Kang.

  reply	other threads:[~2013-12-05  5:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-12 10:04 [U-Boot] [PATCH V3 0/6] SMDK5420: Add S2MPS11 pmic support to SMDK5420 Leela Krishna Amudala
2013-11-12 10:04 ` [U-Boot] [PATCH V3 1/6] exynos: Use common pmic_reg_update() definition Leela Krishna Amudala
2013-12-05  5:50   ` Minkyu Kang [this message]
2014-01-02 23:36     ` Leela Krishna Amudala
2013-11-12 10:04 ` [U-Boot] [PATCH V3 2/6] power: Explicitly select pmic device's bus Leela Krishna Amudala
2013-12-05  5:50   ` Minkyu Kang
2014-01-02 23:37     ` Leela Krishna Amudala
2014-01-03  1:11       ` Minkyu Kang
2013-11-12 10:04 ` [U-Boot] [PATCH V3 3/6] FDT: Exynos5420: Add compatible srings for PMIC Leela Krishna Amudala
2013-11-12 10:04 ` [U-Boot] [PATCH V3 4/6] SMDK5420: S2MPS11: Adds the register settings for S2MPS11 Leela Krishna Amudala
2013-11-12 10:04 ` [U-Boot] [PATCH V3 5/6] exynos: Add a common DT based PMIC driver initialization Leela Krishna Amudala
2013-11-12 10:04 ` [U-Boot] [PATCH V3 6/6] config: SMDK5420: Enable S2MPS11 pmic Leela Krishna Amudala

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=52A01417.8000001@samsung.com \
    --to=mk7.kang@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