All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCHv3 1/2] power: as3722: Allow using on any i2c bus with any address
@ 2016-03-04  7:32 Julian Scheel
  2016-03-04  7:32 ` [U-Boot] [PATCHv3 2/2] Add support the Avionic Design Meerkat COM and Kein Baseboard Julian Scheel
  0 siblings, 1 reply; 4+ messages in thread
From: Julian Scheel @ 2016-03-04  7:32 UTC (permalink / raw)
  To: u-boot

From: Alban Bedel <alban.bedel@avionic-design.de>

The init simply hardcoded the i2c bus and address to those used on
jetson. Extend the init function to take the bus number and device
address as parameter. As only jetson is using this code for now just
fix this single use of the function.

Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de>
Reviewed-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Julian Scheel <julian@jusst.de>
---
Changes in v2:
 - add signed off by me
---
 arch/arm/mach-tegra/board2.c         | 2 +-
 board/nvidia/jetson-tk1/jetson-tk1.c | 2 +-
 drivers/power/as3722.c               | 4 +---
 include/power/as3722.h               | 2 +-
 4 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-tegra/board2.c b/arch/arm/mach-tegra/board2.c
index ac274e1..55c50df 100644
--- a/arch/arm/mach-tegra/board2.c
+++ b/arch/arm/mach-tegra/board2.c
@@ -148,7 +148,7 @@ int board_init(void)
 #  endif
 # endif /* CONFIG_TEGRA_PMU */
 #ifdef CONFIG_AS3722_POWER
-	err = as3722_init(NULL);
+	err = as3722_init(NULL, 0, 0x40);
 	if (err && err != -ENODEV)
 		return err;
 #endif
diff --git a/board/nvidia/jetson-tk1/jetson-tk1.c b/board/nvidia/jetson-tk1/jetson-tk1.c
index 14f0ce5..7f16a4a 100644
--- a/board/nvidia/jetson-tk1/jetson-tk1.c
+++ b/board/nvidia/jetson-tk1/jetson-tk1.c
@@ -39,7 +39,7 @@ int tegra_pcie_board_init(void)
 	struct udevice *pmic;
 	int err;
 
-	err = as3722_init(&pmic);
+	err = as3722_init(&pmic, 0, 0x40);
 	if (err) {
 		error("failed to initialize AS3722 PMIC: %d\n", err);
 		return err;
diff --git a/drivers/power/as3722.c b/drivers/power/as3722.c
index c09e1de..321d65d 100644
--- a/drivers/power/as3722.c
+++ b/drivers/power/as3722.c
@@ -243,12 +243,10 @@ int as3722_get(struct udevice **devp)
 	return i2c_get_chip_for_busnum(bus, address, 1, devp);
 }
 
-int as3722_init(struct udevice **devp)
+int as3722_init(struct udevice **devp, unsigned int bus, unsigned int address)
 {
 	struct udevice *pmic;
 	u8 id, revision;
-	const unsigned int bus = 0;
-	const unsigned int address = 0x40;
 	int err;
 
 	err = i2c_get_chip_for_busnum(bus, address, 1, &pmic);
diff --git a/include/power/as3722.h b/include/power/as3722.h
index 0f22482..c37b43a 100644
--- a/include/power/as3722.h
+++ b/include/power/as3722.h
@@ -14,7 +14,7 @@
 
 struct udevice;
 
-int as3722_init(struct udevice **devp);
+int as3722_init(struct udevice **devp, unsigned int bus, unsigned int address);
 int as3722_sd_enable(struct udevice *pmic, unsigned int sd);
 int as3722_sd_set_voltage(struct udevice *pmic, unsigned int sd, u8 value);
 int as3722_ldo_enable(struct udevice *pmic, unsigned int ldo);
-- 
2.7.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-03-29 16:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-04  7:32 [U-Boot] [PATCHv3 1/2] power: as3722: Allow using on any i2c bus with any address Julian Scheel
2016-03-04  7:32 ` [U-Boot] [PATCHv3 2/2] Add support the Avionic Design Meerkat COM and Kein Baseboard Julian Scheel
2016-03-23 10:23   ` Julian Scheel
2016-03-29 16:59     ` Tom Warren

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.