From 0f2eb5430d19cc49661d69571dde042650766691 Mon Sep 17 00:00:00 2001 From: Thomas Fleury Date: Wed, 22 Mar 2017 19:58:09 +0530 Subject: gpu: nvgpu: add INA3221 I2C info in platform data Add I2C device index and address for INA3221 in platform data. Jira EVLR-1048 Change-Id: I3791f24bd6d8ab99483ea0103313b2b671dfb445 Signed-off-by: Thomas Fleury Reviewed-on: http://git-master/r/1327047 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/pmgr/pmgrpmu.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'drivers/gpu/nvgpu/pmgr/pmgrpmu.c') diff --git a/drivers/gpu/nvgpu/pmgr/pmgrpmu.c b/drivers/gpu/nvgpu/pmgr/pmgrpmu.c index 9873bd17..9201de2b 100644 --- a/drivers/gpu/nvgpu/pmgr/pmgrpmu.c +++ b/drivers/gpu/nvgpu/pmgr/pmgrpmu.c @@ -138,18 +138,20 @@ exit: static u32 pmgr_send_i2c_device_topology_to_pmu(struct gk20a *g) { struct nv_pmu_pmgr_i2c_device_desc_table i2c_desc_table; + struct gk20a_platform *platform = gk20a_get_platform(g->dev); + u32 idx = platform->ina3221_dcb_index; u32 status = 0; /* INA3221 I2C device info */ - i2c_desc_table.dev_mask = 0x01; + i2c_desc_table.dev_mask = (1UL << idx); /* INA3221 */ - i2c_desc_table.devices[0].super.type = 0x4E; + i2c_desc_table.devices[idx].super.type = 0x4E; - i2c_desc_table.devices[0].dcb_index = 0; - i2c_desc_table.devices[0].i2c_address = 0x84; - i2c_desc_table.devices[0].i2c_flags = 0xC2F; - i2c_desc_table.devices[0].i2c_port = 0x2; + i2c_desc_table.devices[idx].dcb_index = idx; + i2c_desc_table.devices[idx].i2c_address = platform->ina3221_i2c_address; + i2c_desc_table.devices[idx].i2c_flags = 0xC2F; + i2c_desc_table.devices[idx].i2c_port = 0x2; /* Pass the table down the PMU as an object */ status = pmgr_pmu_set_object( -- cgit v1.2.2