aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-01-23 21:36:55 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-23 21:36:55 -0500
commitf2c73464d7b399cf4e0c601c1c7d7b079080fa52 (patch)
tree902decd0c280757075bce5068fee679e0ccc261e /drivers/gpu
parent93abdb7785503c269e73e811f3c7fd23a9243b14 (diff)
parent273c2279ca502267fac40bcaecb35942380c429c (diff)
Merge tag 'cleanup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC cleanups from Olof Johansson: "This is the branch where we usually queue up cleanup efforts, moving drivers out of the architecture directory, header file restructuring, etc. Sometimes they tangle with new development so it's hard to keep it strictly to cleanups. Some of the things included in this branch are: * Atmel SAMA5 conversion to common clock * Reset framework conversion for tegra platforms - Some of this depends on tegra clock driver reworks that are shared with Mike Turquette's clk tree. * Tegra DMA refactoring, which are shared branches with the DMA tree. * Removal of some header files on exynos to prepare for multiplatform" * tag 'cleanup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (169 commits) ARM: mvebu: move Armada 370/XP specific definitions to armada-370-xp.h ARM: mvebu: remove prototypes of non-existing functions from common.h ARM: mvebu: move ARMADA_XP_MAX_CPUS to armada-370-xp.h serial: sh-sci: Rework baud rate calculation serial: sh-sci: Compute overrun_bit without using baud rate algo serial: sh-sci: Remove unused GPIO request code serial: sh-sci: Move overrun_bit and error_mask fields out of pdata serial: sh-sci: Support resources passed through platform resources serial: sh-sci: Don't check IRQ in verify port operation serial: sh-sci: Set the UPF_FIXED_PORT flag serial: sh-sci: Remove duplicate interrupt check in verify port op serial: sh-sci: Simplify baud rate calculation algorithms serial: sh-sci: Remove baud rate calculation algorithm 5 serial: sh-sci: Sort headers alphabetically ARM: EXYNOS: Kill exynos_pm_late_initcall() ARM: EXYNOS: Consolidate selection of PM_GENERIC_DOMAINS for Exynos4 ARM: at91: switch Calao QIL-A9260 board to DT clk: at91: fix pmc_clk_ids data type attriubte PM / devfreq: use inclusion <mach/map.h> instead of <plat/map-s5p.h> ARM: EXYNOS: remove <mach/regs-clock.h> for exynos ...
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/tegra/Kconfig1
-rw-r--r--drivers/gpu/drm/tegra/dc.c10
-rw-r--r--drivers/gpu/drm/tegra/drm.h3
-rw-r--r--drivers/gpu/drm/tegra/gr3d.c22
-rw-r--r--drivers/gpu/drm/tegra/hdmi.c15
5 files changed, 43 insertions, 8 deletions
diff --git a/drivers/gpu/drm/tegra/Kconfig b/drivers/gpu/drm/tegra/Kconfig
index 8961ba6a34b8..8db9b3bce001 100644
--- a/drivers/gpu/drm/tegra/Kconfig
+++ b/drivers/gpu/drm/tegra/Kconfig
@@ -2,6 +2,7 @@ config DRM_TEGRA
2 bool "NVIDIA Tegra DRM" 2 bool "NVIDIA Tegra DRM"
3 depends on ARCH_TEGRA || ARCH_MULTIPLATFORM 3 depends on ARCH_TEGRA || ARCH_MULTIPLATFORM
4 depends on DRM 4 depends on DRM
5 depends on RESET_CONTROLLER
5 select TEGRA_HOST1X 6 select TEGRA_HOST1X
6 select DRM_KMS_HELPER 7 select DRM_KMS_HELPER
7 select DRM_KMS_FB_HELPER 8 select DRM_KMS_FB_HELPER
diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index ae1cb31ead7e..cd7f1e499616 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -8,8 +8,8 @@
8 */ 8 */
9 9
10#include <linux/clk.h> 10#include <linux/clk.h>
11#include <linux/clk/tegra.h>
12#include <linux/debugfs.h> 11#include <linux/debugfs.h>
12#include <linux/reset.h>
13 13
14#include "dc.h" 14#include "dc.h"
15#include "drm.h" 15#include "drm.h"
@@ -712,7 +712,7 @@ static void tegra_crtc_prepare(struct drm_crtc *crtc)
712 unsigned long value; 712 unsigned long value;
713 713
714 /* hardware initialization */ 714 /* hardware initialization */
715 tegra_periph_reset_deassert(dc->clk); 715 reset_control_deassert(dc->rst);
716 usleep_range(10000, 20000); 716 usleep_range(10000, 20000);
717 717
718 if (dc->pipe) 718 if (dc->pipe)
@@ -1187,6 +1187,12 @@ static int tegra_dc_probe(struct platform_device *pdev)
1187 return PTR_ERR(dc->clk); 1187 return PTR_ERR(dc->clk);
1188 } 1188 }
1189 1189
1190 dc->rst = devm_reset_control_get(&pdev->dev, "dc");
1191 if (IS_ERR(dc->rst)) {
1192 dev_err(&pdev->dev, "failed to get reset\n");
1193 return PTR_ERR(dc->rst);
1194 }
1195
1190 err = clk_prepare_enable(dc->clk); 1196 err = clk_prepare_enable(dc->clk);
1191 if (err < 0) 1197 if (err < 0)
1192 return err; 1198 return err;
diff --git a/drivers/gpu/drm/tegra/drm.h b/drivers/gpu/drm/tegra/drm.h
index 7da0b923131f..266aae08a3bd 100644
--- a/drivers/gpu/drm/tegra/drm.h
+++ b/drivers/gpu/drm/tegra/drm.h
@@ -19,6 +19,8 @@
19#include <drm/drm_fb_helper.h> 19#include <drm/drm_fb_helper.h>
20#include <drm/drm_fixed.h> 20#include <drm/drm_fixed.h>
21 21
22struct reset_control;
23
22struct tegra_fb { 24struct tegra_fb {
23 struct drm_framebuffer base; 25 struct drm_framebuffer base;
24 struct tegra_bo **planes; 26 struct tegra_bo **planes;
@@ -93,6 +95,7 @@ struct tegra_dc {
93 int pipe; 95 int pipe;
94 96
95 struct clk *clk; 97 struct clk *clk;
98 struct reset_control *rst;
96 void __iomem *regs; 99 void __iomem *regs;
97 int irq; 100 int irq;
98 101
diff --git a/drivers/gpu/drm/tegra/gr3d.c b/drivers/gpu/drm/tegra/gr3d.c
index 4cec8f526af7..0cbb24b1ae04 100644
--- a/drivers/gpu/drm/tegra/gr3d.c
+++ b/drivers/gpu/drm/tegra/gr3d.c
@@ -11,6 +11,7 @@
11#include <linux/host1x.h> 11#include <linux/host1x.h>
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/reset.h>
14#include <linux/tegra-powergate.h> 15#include <linux/tegra-powergate.h>
15 16
16#include "drm.h" 17#include "drm.h"
@@ -22,6 +23,8 @@ struct gr3d {
22 struct host1x_channel *channel; 23 struct host1x_channel *channel;
23 struct clk *clk_secondary; 24 struct clk *clk_secondary;
24 struct clk *clk; 25 struct clk *clk;
26 struct reset_control *rst_secondary;
27 struct reset_control *rst;
25 28
26 DECLARE_BITMAP(addr_regs, GR3D_NUM_REGS); 29 DECLARE_BITMAP(addr_regs, GR3D_NUM_REGS);
27}; 30};
@@ -255,15 +258,29 @@ static int gr3d_probe(struct platform_device *pdev)
255 return PTR_ERR(gr3d->clk); 258 return PTR_ERR(gr3d->clk);
256 } 259 }
257 260
261 gr3d->rst = devm_reset_control_get(&pdev->dev, "3d");
262 if (IS_ERR(gr3d->rst)) {
263 dev_err(&pdev->dev, "cannot get reset\n");
264 return PTR_ERR(gr3d->rst);
265 }
266
258 if (of_device_is_compatible(np, "nvidia,tegra30-gr3d")) { 267 if (of_device_is_compatible(np, "nvidia,tegra30-gr3d")) {
259 gr3d->clk_secondary = devm_clk_get(&pdev->dev, "3d2"); 268 gr3d->clk_secondary = devm_clk_get(&pdev->dev, "3d2");
260 if (IS_ERR(gr3d->clk)) { 269 if (IS_ERR(gr3d->clk)) {
261 dev_err(&pdev->dev, "cannot get secondary clock\n"); 270 dev_err(&pdev->dev, "cannot get secondary clock\n");
262 return PTR_ERR(gr3d->clk); 271 return PTR_ERR(gr3d->clk);
263 } 272 }
273
274 gr3d->rst_secondary = devm_reset_control_get(&pdev->dev,
275 "3d2");
276 if (IS_ERR(gr3d->rst_secondary)) {
277 dev_err(&pdev->dev, "cannot get secondary reset\n");
278 return PTR_ERR(gr3d->rst_secondary);
279 }
264 } 280 }
265 281
266 err = tegra_powergate_sequence_power_up(TEGRA_POWERGATE_3D, gr3d->clk); 282 err = tegra_powergate_sequence_power_up(TEGRA_POWERGATE_3D, gr3d->clk,
283 gr3d->rst);
267 if (err < 0) { 284 if (err < 0) {
268 dev_err(&pdev->dev, "failed to power up 3D unit\n"); 285 dev_err(&pdev->dev, "failed to power up 3D unit\n");
269 return err; 286 return err;
@@ -271,7 +288,8 @@ static int gr3d_probe(struct platform_device *pdev)
271 288
272 if (gr3d->clk_secondary) { 289 if (gr3d->clk_secondary) {
273 err = tegra_powergate_sequence_power_up(TEGRA_POWERGATE_3D1, 290 err = tegra_powergate_sequence_power_up(TEGRA_POWERGATE_3D1,
274 gr3d->clk_secondary); 291 gr3d->clk_secondary,
292 gr3d->rst_secondary);
275 if (err < 0) { 293 if (err < 0) {
276 dev_err(&pdev->dev, 294 dev_err(&pdev->dev,
277 "failed to power up secondary 3D unit\n"); 295 "failed to power up secondary 3D unit\n");
diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c
index 0cd9bc2056e8..7f6253ea5cb5 100644
--- a/drivers/gpu/drm/tegra/hdmi.c
+++ b/drivers/gpu/drm/tegra/hdmi.c
@@ -8,10 +8,10 @@
8 */ 8 */
9 9
10#include <linux/clk.h> 10#include <linux/clk.h>
11#include <linux/clk/tegra.h>
12#include <linux/debugfs.h> 11#include <linux/debugfs.h>
13#include <linux/hdmi.h> 12#include <linux/hdmi.h>
14#include <linux/regulator/consumer.h> 13#include <linux/regulator/consumer.h>
14#include <linux/reset.h>
15 15
16#include "hdmi.h" 16#include "hdmi.h"
17#include "drm.h" 17#include "drm.h"
@@ -49,6 +49,7 @@ struct tegra_hdmi {
49 49
50 struct clk *clk_parent; 50 struct clk *clk_parent;
51 struct clk *clk; 51 struct clk *clk;
52 struct reset_control *rst;
52 53
53 const struct tegra_hdmi_config *config; 54 const struct tegra_hdmi_config *config;
54 55
@@ -731,9 +732,9 @@ static int tegra_output_hdmi_enable(struct tegra_output *output)
731 return err; 732 return err;
732 } 733 }
733 734
734 tegra_periph_reset_assert(hdmi->clk); 735 reset_control_assert(hdmi->rst);
735 usleep_range(1000, 2000); 736 usleep_range(1000, 2000);
736 tegra_periph_reset_deassert(hdmi->clk); 737 reset_control_deassert(hdmi->rst);
737 738
738 tegra_dc_writel(dc, VSYNC_H_POSITION(1), 739 tegra_dc_writel(dc, VSYNC_H_POSITION(1),
739 DC_DISP_DISP_TIMING_OPTIONS); 740 DC_DISP_DISP_TIMING_OPTIONS);
@@ -912,7 +913,7 @@ static int tegra_output_hdmi_disable(struct tegra_output *output)
912{ 913{
913 struct tegra_hdmi *hdmi = to_hdmi(output); 914 struct tegra_hdmi *hdmi = to_hdmi(output);
914 915
915 tegra_periph_reset_assert(hdmi->clk); 916 reset_control_assert(hdmi->rst);
916 clk_disable(hdmi->clk); 917 clk_disable(hdmi->clk);
917 regulator_disable(hdmi->pll); 918 regulator_disable(hdmi->pll);
918 919
@@ -1338,6 +1339,12 @@ static int tegra_hdmi_probe(struct platform_device *pdev)
1338 return PTR_ERR(hdmi->clk); 1339 return PTR_ERR(hdmi->clk);
1339 } 1340 }
1340 1341
1342 hdmi->rst = devm_reset_control_get(&pdev->dev, "hdmi");
1343 if (IS_ERR(hdmi->rst)) {
1344 dev_err(&pdev->dev, "failed to get reset\n");
1345 return PTR_ERR(hdmi->rst);
1346 }
1347
1341 err = clk_prepare(hdmi->clk); 1348 err = clk_prepare(hdmi->clk);
1342 if (err < 0) 1349 if (err < 0)
1343 return err; 1350 return err;