summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSonghee Baek <sbaek@nvidia.com>2016-08-24 19:39:07 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2016-09-16 12:20:06 -0400
commit0f52491c3cbaa91bc7f73ae3a58a21d264756b5d (patch)
tree78c8e25c02744b3069740ea9d94069900719ebe7
parente0d1b8cb9487cedb6ffce4ecabe03bfcc4b59eda (diff)
driver: misc: remove csi_mipi_cal drv
Bug 1686313 Change-Id: Icdfd774ba7e539adb261df20c194e6b4083477cd Signed-off-by: Songhee Baek <sbaek@nvidia.com> Reviewed-on: http://git-master/r/1207362 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
-rw-r--r--drivers/Makefile.t18x1
-rw-r--r--drivers/misc/csi_mipi_cal/Kconfig.t18x5
-rw-r--r--drivers/misc/csi_mipi_cal/Makefile.t18x8
-rw-r--r--drivers/misc/csi_mipi_cal/csi_mipi_cal.c258
4 files changed, 0 insertions, 272 deletions
diff --git a/drivers/Makefile.t18x b/drivers/Makefile.t18x
index 47902aef8..f82269607 100644
--- a/drivers/Makefile.t18x
+++ b/drivers/Makefile.t18x
@@ -30,6 +30,5 @@ obj-y += net/
30obj-$(CONFIG_CPU_IDLE) += cpuidle/ 30obj-$(CONFIG_CPU_IDLE) += cpuidle/
31obj-y += padctrl/ 31obj-y += padctrl/
32obj-y += tachometer/ 32obj-y += tachometer/
33obj-$(CONFIG_T186_CSI_MIPI_CAL) += misc/csi_mipi_cal/
34obj-$(CONFIG_TEGRA186_AHC) += misc/tegra186-ahc/ 33obj-$(CONFIG_TEGRA186_AHC) += misc/tegra186-ahc/
35obj-y += tty/ 34obj-y += tty/
diff --git a/drivers/misc/csi_mipi_cal/Kconfig.t18x b/drivers/misc/csi_mipi_cal/Kconfig.t18x
deleted file mode 100644
index e6e5740a2..000000000
--- a/drivers/misc/csi_mipi_cal/Kconfig.t18x
+++ /dev/null
@@ -1,5 +0,0 @@
1config T186_CSI_MIPI_CAL
2 bool "Tegra186 CSI MIPI Calibration driver"
3 select REGMAP_MMIO
4 help
5 Say Y or M if you want to add support for T186 CSI MIPI Calibration
diff --git a/drivers/misc/csi_mipi_cal/Makefile.t18x b/drivers/misc/csi_mipi_cal/Makefile.t18x
deleted file mode 100644
index 8ab737408..000000000
--- a/drivers/misc/csi_mipi_cal/Makefile.t18x
+++ /dev/null
@@ -1,8 +0,0 @@
1#
2# Makefile for padctrl support.
3#
4subdir-ccflags-y = -Werror
5ccflags-y += -I../display/drivers/video/tegra/dc
6ccflags-y += -Idrivers/video/tegra/dc
7
8obj-$(CONFIG_T186_CSI_MIPI_CAL) += csi_mipi_cal.o
diff --git a/drivers/misc/csi_mipi_cal/csi_mipi_cal.c b/drivers/misc/csi_mipi_cal/csi_mipi_cal.c
deleted file mode 100644
index 3b44c4077..000000000
--- a/drivers/misc/csi_mipi_cal/csi_mipi_cal.c
+++ /dev/null
@@ -1,258 +0,0 @@
1/*
2 * csi_mipi_cal.c - csi mipi calibration driver
3 *
4 * Copyright (c) 2015-2016 NVIDIA CORPORATION. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18#include <linux/delay.h>
19#include <linux/clk.h>
20#include <linux/device.h>
21#include <linux/io.h>
22#include <linux/module.h>
23#include <linux/of.h>
24#include <linux/platform_device.h>
25#include <linux/regmap.h>
26#include <linux/slab.h>
27#include <linux/of_device.h>
28#include <linux/tegra-soc.h>
29#include <linux/reset.h>
30#include <dt-bindings/soc/tegra186-powergate.h>
31#include <linux/tegra-powergate.h>
32#include "dc_priv.h"
33
34#define DRV_NAME "tegra186_csi_mipical"
35
36#define MIPI_CAL_MIPI_BIAS_PAD_CFG0_0 0x5c
37#define MIPI_CAL_MIPI_BIAS_PAD_CFG1_0 0x60
38#define MIPI_CAL_MIPI_BIAS_PAD_CFG2_0 0x64
39#define MIPI_CAL_DSID_MIPI_CAL_CONFIG_2_0 0x78
40
41struct tegra186_csi_mipical {
42 struct clk *clk_mipical;
43 struct clk *clk_uart_fs_mipical;
44 struct regmap *regmap;
45};
46
47static const struct regmap_config tegra186_csi_mipical_regmap_config = {
48 .reg_bits = 32,
49 .reg_stride = 4,
50 .val_bits = 32,
51 .max_register = MIPI_CAL_DSID_MIPI_CAL_CONFIG_2_0,
52 .cache_type = REGCACHE_NONE,
53};
54
55static const struct of_device_id tegra186_csi_mipical_of_match[] = {
56 { .compatible = "nvidia, tegra186_csi_mipical", .data = NULL },
57 {},
58};
59
60static int tegra186_csi_mipical_platform_probe(struct platform_device *pdev)
61{
62 const struct of_device_id *match;
63 struct device_node *np = pdev->dev.of_node;
64 struct tegra186_csi_mipical *csi_mipical;
65 struct resource *mem, *memregion;
66 void __iomem *regs;
67 struct reset_control *rst = NULL;
68 int ret = 0;
69#if defined(CONFIG_TEGRA_NVDISPLAY) && defined(CONFIG_TEGRA_POWERGATE)
70 bool powergate = false;
71#endif
72
73 match = of_match_device(tegra186_csi_mipical_of_match, &pdev->dev);
74 if (!match) {
75 dev_err(&pdev->dev, "Error: No device match found\n");
76 ret = -ENODEV;
77 goto err;
78 }
79
80 csi_mipical = devm_kzalloc(&pdev->dev,
81 sizeof(struct tegra186_csi_mipical), GFP_KERNEL);
82 if (!csi_mipical) {
83 dev_err(&pdev->dev, "Can't allocate csi mipical\n");
84 ret = -ENOMEM;
85 goto err;
86 }
87 dev_set_drvdata(&pdev->dev, csi_mipical);
88
89 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
90 if (!mem) {
91 dev_err(&pdev->dev, "No memory resource\n");
92 ret = -ENODEV;
93 goto err;
94 }
95
96 /* Don't return in the error condition since the same memory area can be
97 requested by nvdisplay's mipi_cal driver before
98 csi_mipical driver probe function called.
99 TDB : This csi_mipical driver is temporal driver
100 before the common mipi driver
101 developed(Tracking : Bug 1686313) */
102 memregion = devm_request_mem_region(&pdev->dev, mem->start,
103 resource_size(mem), pdev->name);
104 if (!memregion)
105 dev_info(&pdev->dev, "Memory region already claimed\n");
106
107 regs = devm_ioremap(&pdev->dev, mem->start, resource_size(mem));
108 if (!regs) {
109 dev_err(&pdev->dev, "ioremap failed\n");
110 ret = -ENOMEM;
111 goto err;
112 }
113
114 csi_mipical->regmap = devm_regmap_init_mmio(&pdev->dev, regs,
115 &tegra186_csi_mipical_regmap_config);
116 if (IS_ERR(csi_mipical->regmap)) {
117 dev_err(&pdev->dev, "regmap init failed\n");
118 ret = PTR_ERR(csi_mipical->regmap);
119 goto err;
120 }
121
122 regcache_cache_only(csi_mipical->regmap, false);
123
124 if (!(tegra_platform_is_unit_fpga() || tegra_platform_is_fpga())) {
125 csi_mipical->clk_mipical = of_clk_get_by_name(np, "mipi_cal");
126 if (IS_ERR(csi_mipical->clk_mipical)) {
127 dev_err(&pdev->dev, "Can't retrieve mipi_cal clock\n");
128 ret = PTR_ERR(csi_mipical->clk_mipical);
129 goto err;
130 }
131
132 csi_mipical->clk_uart_fs_mipical =
133 of_clk_get_by_name(np, "uart_fs_mipi_cal");
134 if (IS_ERR(csi_mipical->clk_uart_fs_mipical)) {
135 dev_err(&pdev->dev, "Can't retrieve uart_fs_mipi_cal clock\n");
136 ret = PTR_ERR(csi_mipical->clk_uart_fs_mipical);
137 goto err_uart_fs_mipi_cal;
138 }
139
140 ret = clk_prepare_enable(csi_mipical->clk_mipical);
141 if (ret) {
142 dev_err(&pdev->dev, "fail to enable mipical clock\n");
143 goto err_clk_enable_mipical;
144 }
145
146 ret = clk_prepare_enable(csi_mipical->clk_uart_fs_mipical);
147 if (ret) {
148 dev_err(&pdev->dev, "fail to enable uart_fs_mipi_cal clock\n");
149 goto err_clk_enable_uart_fs_mipi_cal;
150 }
151
152 rst = of_reset_control_get(np, "mipi_cal");
153 if (IS_ERR_OR_NULL(rst)) {
154 dev_err(&pdev->dev,
155 "mipi_cal: reset get control failed\n");
156 ret = PTR_ERR(rst);
157 goto err_mipi_cal_rst;
158 }
159
160 ret = reset_control_deassert(rst);
161 if (ret) {
162 dev_err(&pdev->dev,
163 "mipi_cal: fail to deassert reset\n");
164 ret = PTR_ERR(rst);