summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2016-04-26 08:15:35 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-07-04 13:02:19 -0400
commit79849ef2b34d0404c74ed381daf059c88238e376 (patch)
treee2664a7894f0d926bb3d3b7bf4a08bb0cf8bd74e /include
parent08bf8c9524efc0f26df2a00306226cba923b74ee (diff)
platform: tegra: Add support for mask with 1s
Currently, the value of prod setting are applied if mask bit is 0 for given value. This is non-traditional style of defining mask. Add support a traditional way of defining mask like if mask bits are 1s then only apply the value of those bits. reg = (reg & ~mask) | (reg & mask); This mechanism is selected via DT property to have backward compatibility. The DT property is "mask-one-style" which can be added under prod-setting node. bug 1758682 Change-Id: I0c40f55097c3f5eedfa526c07603c8d9817b3b53 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/1132745 (cherry picked from commit a070f4d9ad83455254bb88de1a12c23eaaf28f11) Reviewed-on: http://git-master/r/1139578 Reviewed-on: https://git-master.nvidia.com/r/1768528 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')
-rw-r--r--include/linux/tegra_prod.h22
1 files changed, 4 insertions, 18 deletions
diff --git a/include/linux/tegra_prod.h b/include/linux/tegra_prod.h
index 76678112b..9b9d290b3 100644
--- a/include/linux/tegra_prod.h
+++ b/include/linux/tegra_prod.h
@@ -19,33 +19,19 @@
19 19
20#define PROD_TUPLE_NUM (sizeof(struct prod_tuple)/sizeof(u32)) 20#define PROD_TUPLE_NUM (sizeof(struct prod_tuple)/sizeof(u32))
21 21
22struct prod_tuple {
23 u32 index; /* Address base index */
24 u32 addr; /* offset address*/
25 u32 mask; /* mask */
26 u32 val; /* value */
27};
28
29struct tegra_prod {
30 const char *name;
31 struct prod_tuple *prod_tuple;
32 int count; /* number of prod_tuple*/
33 bool boot_init;
34};
35
36/* tegra_prod_list: Tegra Prod list for the given submodule 22/* tegra_prod_list: Tegra Prod list for the given submodule
37 * @n_prod_cells: Number of prod setting cells. 23 * @n_prod_cells: Number of prod setting cells.
24 * @mask_ones: Mask value type. if it is true than value applied for those
25 * bits whose mask bits are 1s. If it false then value applies
26 * to those bits whose mask bits are 0.
38 */ 27 */
39struct tegra_prod_list { 28struct tegra_prod_list {
40 struct tegra_prod *tegra_prod; 29 struct tegra_prod *tegra_prod;
41 int num; /* number of tegra_prod*/ 30 int num; /* number of tegra_prod*/
42 int n_prod_cells; 31 int n_prod_cells;
32 bool mask_ones;
43}; 33};
44 34
45int tegra_prod_set_tuple(void __iomem **base, struct prod_tuple *prod_tuple);
46
47int tegra_prod_set(void __iomem **base, struct tegra_prod *tegra_prod);
48
49int tegra_prod_set_list(void __iomem **base, 35int tegra_prod_set_list(void __iomem **base,
50 struct tegra_prod_list *tegra_prod_list); 36 struct tegra_prod_list *tegra_prod_list);
51 37