From 08bf8c9524efc0f26df2a00306226cba923b74ee Mon Sep 17 00:00:00 2001 From: Ishan Mittal Date: Fri, 1 Apr 2016 17:48:23 +0530 Subject: platform: tegra: Import tegra_prod and wdt-recovery drivers This changes imports tegra_prod and wdt-recovery drivers from k4.4. It squashes below three original commits to make the change neat as the original commits contained many other drivers as well: commit c5c90b82ec25 ("drivers: platform: tegra: Add miscellaneous platform specific drivers") commit 000acb1cd376 ("platform: tegra: add missing headers and build fixes") commit 0b95640a2a30 ("include/linux: add missing tegra headers") commit c413070a1e21 ("platform: tegra: Get rid of mach/irq.h include") Bug 200416207 Change-Id: Ic174f1123854cbac816dfe0a95c52f6395bf095d Signed-off-by: Nicolin Chen Reviewed-on: https://git-master.nvidia.com/r/1768527 GVS: Gerrit_Virtual_Submit Reviewed-by: Sachin Nikam Reviewed-by: mobile promotions Tested-by: mobile promotions --- include/linux/tegra_prod.h | 63 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 include/linux/tegra_prod.h (limited to 'include') diff --git a/include/linux/tegra_prod.h b/include/linux/tegra_prod.h new file mode 100644 index 000000000..76678112b --- /dev/null +++ b/include/linux/tegra_prod.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef _TEGRA_PRODS_H +#define _TEGRA_PRODS_H + +#define PROD_TUPLE_NUM (sizeof(struct prod_tuple)/sizeof(u32)) + +struct prod_tuple { + u32 index; /* Address base index */ + u32 addr; /* offset address*/ + u32 mask; /* mask */ + u32 val; /* value */ +}; + +struct tegra_prod { + const char *name; + struct prod_tuple *prod_tuple; + int count; /* number of prod_tuple*/ + bool boot_init; +}; + +/* tegra_prod_list: Tegra Prod list for the given submodule + * @n_prod_cells: Number of prod setting cells. + */ +struct tegra_prod_list { + struct tegra_prod *tegra_prod; + int num; /* number of tegra_prod*/ + int n_prod_cells; +}; + +int tegra_prod_set_tuple(void __iomem **base, struct prod_tuple *prod_tuple); + +int tegra_prod_set(void __iomem **base, struct tegra_prod *tegra_prod); + +int tegra_prod_set_list(void __iomem **base, + struct tegra_prod_list *tegra_prod_list); + +int tegra_prod_set_boot_init(void __iomem **base, + struct tegra_prod_list *tegra_prod_list); + +int tegra_prod_set_by_name(void __iomem **base, const char *name, + struct tegra_prod_list *tegra_prod_list); + +struct tegra_prod_list *tegra_prod_init(const struct device_node *np); + +struct tegra_prod_list *tegra_prod_get(struct device *dev, const char *name); + +int tegra_prod_release(struct tegra_prod_list **tegra_prod_list); +#endif -- cgit v1.2.2