Message ID | 20160905132952.27280-3-julian@jusst.de |
---|---|
State | Changes Requested |
Delegated to: | Tom Warren |
Headers | show |
On 09/05/2016 07:29 AM, Julian Scheel wrote: > 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. Conceptually this patch seems fine, but it'll need fixing due to dropping/modifying patch 1 in the series.
diff --git a/board/nvidia/jetson-tk1/jetson-tk1.c b/board/nvidia/jetson-tk1/jetson-tk1.c index a66b710..129c08b 100644 --- a/board/nvidia/jetson-tk1/jetson-tk1.c +++ b/board/nvidia/jetson-tk1/jetson-tk1.c @@ -42,7 +42,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);