summaryrefslogtreecommitdiff
path: root/drivers/media/video/tegra/max77665-flash.c
diff options
context:
space:
mode:
authorSivaram Nair <sivaramn@nvidia.com>2013-01-30 11:16:26 +0200
committerRiham Haidar <rhaidar@nvidia.com>2013-02-07 16:48:55 -0800
commit6cfa7b050f9a92558639fe7589910dea1e2363b9 (patch)
tree013017a4c4af5b2b702e9dad51b57d31f0c94f88 /drivers/media/video/tegra/max77665-flash.c
parente7d2b85b5c5da95c06d185ea1a4f05fa5f81ee2a (diff)
media: tegra: imx091: use mW E-states
The camera driver's E-states are changes to use mW values instead of mA. Change-Id: Ib5929cf45404fdf0c5fb332027fa909f5a6efc48 Signed-off-by: Sivaram Nair <sivaramn@nvidia.com> (cherry picked from commit 2868d8c74df6c8380beebf6c9d7297fdfa84c45d) Reviewed-on: http://git-master/r/196359 Reviewed-by: Riham Haidar <rhaidar@nvidia.com> Tested-by: Riham Haidar <rhaidar@nvidia.com>
Diffstat (limited to 'drivers/media/video/tegra/max77665-flash.c')
-rw-r--r--drivers/media/video/tegra/max77665-flash.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/media/video/tegra/max77665-flash.c b/drivers/media/video/tegra/max77665-flash.c
index bb608963d9b5..457099031bc2 100644
--- a/drivers/media/video/tegra/max77665-flash.c
+++ b/drivers/media/video/tegra/max77665-flash.c
@@ -415,6 +415,7 @@ static int max77665_f_edp_req(struct max77665_f_info *info,
unsigned *estates;
unsigned total_curr = 0;
unsigned curr_mA;
+ unsigned int curr_mW;
unsigned approved;
unsigned new_state;
int ret = 0;
@@ -430,12 +431,13 @@ static int max77665_f_edp_req(struct max77665_f_info *info,
if (mask & 2)
total_curr += *curr2;
curr_mA = GET_CURRENT_BY_INDEX(total_curr);
+ curr_mW = curr_mA * 38 / 10;
for (new_state = info->edpc->num_states - 1; new_state > 0; new_state--)
- if (estates[new_state] >= curr_mA)
+ if (estates[new_state] >= curr_mW)
break;
- dev_dbg(info->dev, "edp req: %d curr = %d mA\n", new_state, curr_mA);
+ dev_dbg(info->dev, "edp req: %d curr = %d mW\n", new_state, curr_mW);
ret = edp_update_client_request(info->edpc, new_state, &approved);
if (ret) {
dev_err(info->dev, "E state transition failed\n");
@@ -443,7 +445,8 @@ static int max77665_f_edp_req(struct max77665_f_info *info,
}
if (approved > new_state) { /* edp manager returned less current */
- curr_mA = GET_INDEX_BY_CURRENT(estates[approved]);
+ curr_mA = estates[approved] * 10 / 38;
+ curr_mA = GET_INDEX_BY_CURRENT(curr_mA);
if (mask & 1)
*curr1 = curr_mA * (*curr1) / total_curr;
*curr2 = curr_mA - (*curr1);