diff options
author | Thomas Fleury <tfleury@nvidia.com> | 2017-03-22 10:28:09 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-03-27 07:45:30 -0400 |
commit | 0f2eb5430d19cc49661d69571dde042650766691 (patch) | |
tree | 76263ebafdf1b375e2c1bcc6a62667d55fdd8e25 /drivers/gpu/nvgpu/pmgr/pmgrpmu.c | |
parent | 4f5996e23d7ea3d576c33f9b0ec5c7b590d6adca (diff) |
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 <tfleury@nvidia.com>
Reviewed-on: http://git-master/r/1327047
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/pmgr/pmgrpmu.c')
-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( |