All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peng Fan (OSS) <peng.fan@oss.nxp.com>
To: u-boot@lists.denx.de
Subject: [PATCH 14/26] power: pca9450: add a new parameter for power_pca9450_init
Date: Fri, 19 Mar 2021 15:57:06 +0800	[thread overview]
Message-ID: <20210319075718.14181-15-peng.fan@oss.nxp.com> (raw)
In-Reply-To: <20210319075718.14181-1-peng.fan@oss.nxp.com>

From: Peng Fan <peng.fan@nxp.com>

Currently PCA9450 might have address 0x25 or 0x35, so let user
choose the address.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 board/freescale/imx8mp_evk/spl.c  | 2 +-
 board/phytec/phycore_imx8mp/spl.c | 2 +-
 drivers/power/pmic/pmic_pca9450.c | 4 ++--
 include/power/pca9450.h           | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/board/freescale/imx8mp_evk/spl.c b/board/freescale/imx8mp_evk/spl.c
index 6ccf5ac8fa..a7564e9b1a 100644
--- a/board/freescale/imx8mp_evk/spl.c
+++ b/board/freescale/imx8mp_evk/spl.c
@@ -70,7 +70,7 @@ int power_init_board(void)
 	struct pmic *p;
 	int ret;
 
-	ret = power_pca9450_init(I2C_PMIC);
+	ret = power_pca9450_init(I2C_PMIC, 0x25);
 	if (ret)
 		printf("power init failed");
 	p = pmic_get("PCA9450");
diff --git a/board/phytec/phycore_imx8mp/spl.c b/board/phytec/phycore_imx8mp/spl.c
index eefdd7fdda..f9fa8d1e12 100644
--- a/board/phytec/phycore_imx8mp/spl.c
+++ b/board/phytec/phycore_imx8mp/spl.c
@@ -53,7 +53,7 @@ int power_init_board(void)
 	struct pmic *p;
 	int ret;
 
-	ret = power_pca9450_init(0);
+	ret = power_pca9450_init(0, 0x25);
 	if (ret)
 		printf("power init failed");
 	p = pmic_get("PCA9450");
diff --git a/drivers/power/pmic/pmic_pca9450.c b/drivers/power/pmic/pmic_pca9450.c
index d4f27428bd..8c4d0a9230 100644
--- a/drivers/power/pmic/pmic_pca9450.c
+++ b/drivers/power/pmic/pmic_pca9450.c
@@ -11,7 +11,7 @@
 
 static const char pca9450_name[] = "PCA9450";
 
-int power_pca9450_init(unsigned char bus)
+int power_pca9450_init(unsigned char bus, unsigned char addr)
 {
 	struct pmic *p = pmic_alloc();
 
@@ -23,7 +23,7 @@ int power_pca9450_init(unsigned char bus)
 	p->name = pca9450_name;
 	p->interface = PMIC_I2C;
 	p->number_of_regs = PCA9450_REG_NUM;
-	p->hw.i2c.addr = 0x25;
+	p->hw.i2c.addr = addr;
 	p->hw.i2c.tx_num = 1;
 	p->bus = bus;
 
diff --git a/include/power/pca9450.h b/include/power/pca9450.h
index 5a9a697d62..27703bb1f9 100644
--- a/include/power/pca9450.h
+++ b/include/power/pca9450.h
@@ -54,6 +54,6 @@ enum {
 	PCA9450_REG_NUM,
 };
 
-int power_pca9450_init(unsigned char bus);
+int power_pca9450_init(unsigned char bus, unsigned char addr);
 
 #endif
-- 
2.30.0

  parent reply	other threads:[~2021-03-19  7:57 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-19  7:56 [PATCH 00/26] imx: update for i.MX8M Peng Fan
2021-03-19  7:56 ` [PATCH 01/26] tools: imx image: fix write warning Peng Fan
2021-03-19  7:56 ` [PATCH 02/26] imx8mm_evk: Update to latest LPDDR4 script Peng Fan
2021-03-24 21:19   ` Tim Harvey
2021-03-25  1:15     ` Peng Fan
2021-03-19  7:56 ` [PATCH 03/26] imx8mm_evk: Switch to new imx8mm evk board Peng Fan
2021-05-12 21:47   ` ZHIZHIKIN Andrey
2021-05-14 12:30     ` Fabio Estevam
2021-05-14 15:29       ` Ricardo Salveti
2021-05-14 15:59         ` Fabio Estevam
2021-05-16 14:31         ` ZHIZHIKIN Andrey
2021-05-18 13:14           ` Vanessa Maegima
2021-05-18 19:51             ` ZHIZHIKIN Andrey
2021-05-16 14:21       ` ZHIZHIKIN Andrey
2021-05-17  0:34     ` Peng Fan
2021-03-19  7:56 ` [PATCH 04/26] imx8mm/p: remove boot.cmd Peng Fan
2021-03-19  7:56 ` [PATCH 05/26] imx8mm_evk: add/cleanup variable for distro Peng Fan
2021-03-19  7:56 ` [PATCH 06/26] imx8mp_evk: " Peng Fan
2021-03-19  7:56 ` [PATCH 07/26] imx8mp: ddr: Add inline ECC feature support Peng Fan
2021-03-19  7:57 ` [PATCH 08/26] imx8mp_evk: Update LPDDR4 timing for new FW 202006 Peng Fan
2021-03-19  7:57 ` [PATCH 09/26] imx8mp_evk: Update LPDDR4 refresh time Peng Fan
2021-03-19  7:57 ` [PATCH 10/26] imx8mp: refine power on imx8mp board Peng Fan
2021-03-19  7:57 ` [PATCH 11/26] imx8mp_evk: spl: clean up including headers Peng Fan
2021-03-19  7:57 ` [PATCH 12/26] imx8mp_evk: Increase VDD_ARM to 0.95v Overdrive voltage Peng Fan
2021-03-19  7:57 ` [PATCH 13/26] imx8mn: Update the DDR4 timing script on imx8mn ddr4 evk Peng Fan
2021-03-19  7:57 ` Peng Fan [this message]
2021-03-21 22:41   ` [PATCH 14/26] power: pca9450: add a new parameter for power_pca9450_init Jaehoon Chung
2021-03-19  7:57 ` [PATCH 15/26] imx8mn_evk: drop duplicated code Peng Fan
2021-03-19  7:57 ` [PATCH 16/26] imx8mn: Add LPDDR4 EVK board support Peng Fan
2021-03-19  7:57 ` [PATCH 17/26] imx8mn: Add low drive mode support for DDR4/LPDDR4 EVK Peng Fan
2021-03-19  7:57 ` [PATCH 18/26] imx: logos: use NXP logo Peng Fan
2021-03-19  7:57 ` [PATCH 19/26] imx8mn: Add support for 11x11 UltraLite part number Peng Fan
2021-03-19  7:57 ` [PATCH 20/26] imx8m: Update thermal and PMU kernel nodes for dual/single cores Peng Fan
2021-03-19  7:57 ` [PATCH 21/26] imx8m: soc: update fuse path Peng Fan
2021-03-19  7:57 ` [PATCH 22/26] imx8m: ddr: Disable CA VREF Training for LPDDR4 Peng Fan
2021-03-24 21:25   ` Tim Harvey
2021-03-25  8:14     ` Stefano Babic
2021-03-25  8:35       ` Peng Fan
2021-03-19  7:57 ` [PATCH 23/26] arch: mach-imx: imx8m: fix unique_id read error for imx8mp Peng Fan
2021-03-19  7:57 ` [PATCH 24/26] iMX8MQ: Recognize the B2 revision Peng Fan
2021-03-19  7:57 ` [PATCH 25/26] misc: ocotp: Update OCOTP driver for iMX8MQ B2 Peng Fan
2021-03-19  7:57 ` [PATCH 26/26] imx8mq_evk: Applying default LPDDR4 script for B2 Peng Fan

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=20210319075718.14181-15-peng.fan@oss.nxp.com \
    --to=peng.fan@oss.nxp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.