diff options
Diffstat (limited to 'drivers/gpu/nvgpu/pmgr')
-rw-r--r-- | drivers/gpu/nvgpu/pmgr/pmgrpmu.c | 14 |
1 files changed, 8 insertions, 6 deletions
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: | |||
138 | static u32 pmgr_send_i2c_device_topology_to_pmu(struct gk20a *g) | 138 | static u32 pmgr_send_i2c_device_topology_to_pmu(struct gk20a *g) |
139 | { | 139 | { |
140 | struct nv_pmu_pmgr_i2c_device_desc_table i2c_desc_table; | 140 | struct nv_pmu_pmgr_i2c_device_desc_table i2c_desc_table; |
141 | struct gk20a_platform *platform = gk20a_get_platform(g->dev); | ||
142 | u32 idx = platform->ina3221_dcb_index; | ||
141 | u32 status = 0; | 143 | u32 status = 0; |
142 | 144 | ||
143 | /* INA3221 I2C device info */ | 145 | /* INA3221 I2C device info */ |
144 | i2c_desc_table.dev_mask = 0x01; | 146 | i2c_desc_table.dev_mask = (1UL << idx); |
145 | 147 | ||
146 | /* INA3221 */ | 148 | /* INA3221 */ |
147 | i2c_desc_table.devices[0].super.type = 0x4E; | 149 | i2c_desc_table.devices[idx].super.type = 0x4E; |
148 | 150 | ||
149 | i2c_desc_table.devices[0].dcb_index = 0; | 151 | i2c_desc_table.devices[idx].dcb_index = idx; |
150 | i2c_desc_table.devices[0].i2c_address = 0x84; | 152 | i2c_desc_table.devices[idx].i2c_address = platform->ina3221_i2c_address; |
151 | i2c_desc_table.devices[0].i2c_flags = 0xC2F; | 153 | i2c_desc_table.devices[idx].i2c_flags = 0xC2F; |
152 | i2c_desc_table.devices[0].i2c_port = 0x2; | 154 | i2c_desc_table.devices[idx].i2c_port = 0x2; |
153 | 155 | ||
154 | /* Pass the table down the PMU as an object */ | 156 | /* Pass the table down the PMU as an object */ |
155 | status = pmgr_pmu_set_object( | 157 | status = pmgr_pmu_set_object( |