gpio: rcar: Fix runtime PM imbalance on error
[linux/fpc-iii.git] / drivers / soc / tegra / fuse / fuse.h
blob94a059e577a1fbd65f69abbc03c6088156e21dd0
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * Copyright (C) 2010 Google, Inc.
4 * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved.
6 * Author:
7 * Colin Cross <ccross@android.com>
8 */
10 #ifndef __DRIVERS_MISC_TEGRA_FUSE_H
11 #define __DRIVERS_MISC_TEGRA_FUSE_H
13 #include <linux/dmaengine.h>
14 #include <linux/types.h>
16 struct nvmem_cell_lookup;
17 struct nvmem_device;
18 struct tegra_fuse;
20 struct tegra_fuse_info {
21 u32 (*read)(struct tegra_fuse *fuse, unsigned int offset);
22 unsigned int size;
23 unsigned int spare;
26 struct tegra_fuse_soc {
27 void (*init)(struct tegra_fuse *fuse);
28 void (*speedo_init)(struct tegra_sku_info *info);
29 int (*probe)(struct tegra_fuse *fuse);
31 const struct tegra_fuse_info *info;
33 const struct nvmem_cell_lookup *lookups;
34 unsigned int num_lookups;
37 struct tegra_fuse {
38 struct device *dev;
39 void __iomem *base;
40 phys_addr_t phys;
41 struct clk *clk;
43 u32 (*read_early)(struct tegra_fuse *fuse, unsigned int offset);
44 u32 (*read)(struct tegra_fuse *fuse, unsigned int offset);
45 const struct tegra_fuse_soc *soc;
47 /* APBDMA on Tegra20 */
48 struct {
49 struct mutex lock;
50 struct completion wait;
51 struct dma_chan *chan;
52 struct dma_slave_config config;
53 dma_addr_t phys;
54 u32 *virt;
55 } apbdma;
57 struct nvmem_device *nvmem;
58 struct nvmem_cell_lookup *lookups;
61 void tegra_init_revision(void);
62 void tegra_init_apbmisc(void);
64 bool __init tegra_fuse_read_spare(unsigned int spare);
65 u32 __init tegra_fuse_read_early(unsigned int offset);
67 #ifdef CONFIG_ARCH_TEGRA_2x_SOC
68 void tegra20_init_speedo_data(struct tegra_sku_info *sku_info);
69 #endif
71 #ifdef CONFIG_ARCH_TEGRA_3x_SOC
72 void tegra30_init_speedo_data(struct tegra_sku_info *sku_info);
73 #endif
75 #ifdef CONFIG_ARCH_TEGRA_114_SOC
76 void tegra114_init_speedo_data(struct tegra_sku_info *sku_info);
77 #endif
79 #if defined(CONFIG_ARCH_TEGRA_124_SOC) || defined(CONFIG_ARCH_TEGRA_132_SOC)
80 void tegra124_init_speedo_data(struct tegra_sku_info *sku_info);
81 #endif
83 #ifdef CONFIG_ARCH_TEGRA_210_SOC
84 void tegra210_init_speedo_data(struct tegra_sku_info *sku_info);
85 #endif
87 #ifdef CONFIG_ARCH_TEGRA_2x_SOC
88 extern const struct tegra_fuse_soc tegra20_fuse_soc;
89 #endif
91 #ifdef CONFIG_ARCH_TEGRA_3x_SOC
92 extern const struct tegra_fuse_soc tegra30_fuse_soc;
93 #endif
95 #ifdef CONFIG_ARCH_TEGRA_114_SOC
96 extern const struct tegra_fuse_soc tegra114_fuse_soc;
97 #endif
99 #if defined(CONFIG_ARCH_TEGRA_124_SOC) || defined(CONFIG_ARCH_TEGRA_132_SOC)
100 extern const struct tegra_fuse_soc tegra124_fuse_soc;
101 #endif
103 #ifdef CONFIG_ARCH_TEGRA_210_SOC
104 extern const struct tegra_fuse_soc tegra210_fuse_soc;
105 #endif
107 #ifdef CONFIG_ARCH_TEGRA_186_SOC
108 extern const struct tegra_fuse_soc tegra186_fuse_soc;
109 #endif
111 #ifdef CONFIG_ARCH_TEGRA_194_SOC
112 extern const struct tegra_fuse_soc tegra194_fuse_soc;
113 #endif
115 #endif