Kaushal Kumar | f3b1a19 | 2012-07-03 19:48:41 +0530 | [diff] [blame] | 1 | /* Copyright (c) 2012, Code Aurora Forum. All rights reserved. |
| 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | */ |
| 12 | |
| 13 | #include "msm_smem_iface.h" |
| 14 | |
| 15 | /** |
| 16 | * mem_get_cpr_info() - Copy Core Power Reduction (CPR) driver specific |
| 17 | * data from Shared memory (SMEM). |
| 18 | * @cpr_info - Pointer to CPR data. Memory to be allocated and freed by |
| 19 | * calling function. |
| 20 | * |
| 21 | * Copy CPR specific data from SMEM to cpr_info. |
| 22 | */ |
| 23 | |
| 24 | void msm_smem_get_cpr_info(struct cpr_info_type *cpr_info) |
| 25 | { |
| 26 | struct boot_info_for_apps *boot_info; |
| 27 | struct cpr_info_type *temp_cpr_info; |
| 28 | uint32_t smem_boot_info_size; |
| 29 | |
| 30 | boot_info = smem_get_entry(SMEM_BOOT_INFO_FOR_APPS, |
| 31 | &smem_boot_info_size); |
| 32 | BUG_ON(!boot_info); |
| 33 | if (smem_boot_info_size < sizeof(struct boot_info_for_apps)) { |
| 34 | pr_err("%s: Shared boot info data structure too small!\n", |
| 35 | __func__); |
| 36 | BUG(); |
| 37 | } else { |
| 38 | pr_debug("%s: Shared boot info available.\n", __func__); |
| 39 | } |
| 40 | temp_cpr_info = (struct cpr_info_type *) &(boot_info->cpr_info); |
| 41 | cpr_info->ring_osc = temp_cpr_info->ring_osc; |
| 42 | cpr_info->turbo_quot = temp_cpr_info->turbo_quot; |
| 43 | cpr_info->pvs_fuse = temp_cpr_info->pvs_fuse; |
| 44 | } |