diff options
| author | Laxman Dewangan <ldewangan@nvidia.com> | 2016-06-29 09:13:16 -0400 |
|---|---|---|
| committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-07-04 13:02:41 -0400 |
| commit | bdbd7fccbb83efdc7d32ae69161525adb408a729 (patch) | |
| tree | 41eeaa151a19be4145e483503a215d9803a55a36 /include/linux | |
| parent | 1ff7bc604c3d209b692a0a282109f77f1f6b8f98 (diff) | |
platform: tegra_prod: Add APIs to managed allocation of prod_list
Add manager APIs to get the prod list by passing the device structure.
Also add APIs to get prod list from device node if device structure
is not available to client like SOR/DP etc.
Change-Id: I2036dd4c557db0cd70b1cd87d0ca34d034946871
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/1173751
Reviewed-on: https://git-master.nvidia.com/r/1768534
Tested-by: Nicolin Chen <nicolinc@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/tegra_prod.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/include/linux/tegra_prod.h b/include/linux/tegra_prod.h index 35a325a07..bcb4463b1 100644 --- a/include/linux/tegra_prod.h +++ b/include/linux/tegra_prod.h | |||
| @@ -19,6 +19,8 @@ | |||
| 19 | 19 | ||
| 20 | struct tegra_prod_list; | 20 | struct tegra_prod_list; |
| 21 | 21 | ||
| 22 | #define tegra_prod tegra_prod_list | ||
| 23 | |||
| 22 | int tegra_prod_set_list(void __iomem **base, | 24 | int tegra_prod_set_list(void __iomem **base, |
| 23 | struct tegra_prod_list *tegra_prod_list); | 25 | struct tegra_prod_list *tegra_prod_list); |
| 24 | 26 | ||
| @@ -33,4 +35,41 @@ struct tegra_prod_list *tegra_prod_init(const struct device_node *np); | |||
| 33 | struct tegra_prod_list *tegra_prod_get(struct device *dev, const char *name); | 35 | struct tegra_prod_list *tegra_prod_get(struct device *dev, const char *name); |
| 34 | 36 | ||
| 35 | int tegra_prod_release(struct tegra_prod_list **tegra_prod_list); | 37 | int tegra_prod_release(struct tegra_prod_list **tegra_prod_list); |
| 38 | |||
| 39 | /** | ||
| 40 | * devm_tegra_prod_get(): Get the prod handle from the device. | ||
| 41 | * @dev: Device handle on which prod setting nodes are available. | ||
| 42 | * | ||
| 43 | * Parse the prod-setting node of the dev->of_node and keep all prod | ||
| 44 | * setting data in prod handle. | ||
| 45 | * This handle is used for setting prod configurations. | ||
| 46 | * | ||
| 47 | * Returns valid prod_list handle on success or pointer to the error | ||
| 48 | * when it failed. | ||
| 49 | */ | ||
| 50 | struct tegra_prod *devm_tegra_prod_get(struct device *dev); | ||
| 51 | |||
| 52 | /** | ||
| 53 | * tegra_prod_get_from_node(): Get the prod handle from the node. | ||
| 54 | * @np: Node pointer on which prod setting nodes are available. | ||
| 55 | * | ||
| 56 | * Parse the prod-setting node of the node pointer "np" and keep all prod | ||
| 57 | * setting data in prod handle. | ||
| 58 | * This handle is used for setting prod configurations. | ||
| 59 | * | ||
| 60 | * Returns valid prod_list handle on success or pointer to the error | ||
| 61 | * when it failed. | ||
| 62 | */ | ||
| 63 | struct tegra_prod *tegra_prod_get_from_node(struct device_node *np); | ||
| 64 | |||
| 65 | /** | ||
| 66 | * tegra_prod_put(): Put the allocated prod handle. | ||
| 67 | * @tegra_prod: Tegra prod handle which was allocated by function | ||
| 68 | * devm_tegra_prod_get() or tegra_prod_get_from_node(). | ||
| 69 | * | ||
| 70 | * Release the prod handle. | ||
| 71 | * | ||
| 72 | * Returns 0 on success or error number in negative when it failed. | ||
| 73 | */ | ||
| 74 | int tegra_prod_put(struct tegra_prod *tegra_prod); | ||
| 36 | #endif | 75 | #endif |
