Skip to content

Commit

Permalink
ARM: tegra: Provide dummy powergate implementation
Browse files Browse the repository at this point in the history
In order to support increased build test coverage for drivers, implement
dummies for the powergate implementation. This will allow the drivers to
be built without requiring support for Tegra to be selected.

This patch solves the following build errors, which can be triggered in
v3.13-rc1 by selecting DRM_TEGRA without ARCH_TEGRA:

drivers/built-in.o: In function `gr3d_remove':
drivers/gpu/drm/tegra/gr3d.c:321: undefined reference to `tegra_powergate_power_off'
drivers/gpu/drm/tegra/gr3d.c:325: undefined reference to `tegra_powergate_power_off'
drivers/built-in.o: In function `gr3d_probe':
drivers/gpu/drm/tegra/gr3d.c:266: undefined reference to `tegra_powergate_sequence_power_up'
drivers/gpu/drm/tegra/gr3d.c:273: undefined reference to `tegra_powergate_sequence_power_up'

Signed-off-by: Thierry Reding <treding@nvidia.com>
[swarren, updated commit description]
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
  • Loading branch information
Thierry Reding authored and Olof Johansson committed Nov 25, 2013
1 parent 5c1f34c commit 9886e1f
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions include/linux/tegra-powergate.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,39 @@ struct clk;

#define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D

#ifdef CONFIG_ARCH_TEGRA
int tegra_powergate_is_powered(int id);
int tegra_powergate_power_on(int id);
int tegra_powergate_power_off(int id);
int tegra_powergate_remove_clamping(int id);

/* Must be called with clk disabled, and returns with clk enabled */
int tegra_powergate_sequence_power_up(int id, struct clk *clk);
#else
static inline int tegra_powergate_is_powered(int id)
{
return -ENOSYS;
}

static inline int tegra_powergate_power_on(int id)
{
return -ENOSYS;
}

static inline int tegra_powergate_power_off(int id)
{
return -ENOSYS;
}

static inline int tegra_powergate_remove_clamping(int id)
{
return -ENOSYS;
}

static inline int tegra_powergate_sequence_power_up(int id, struct clk *clk)
{
return -ENOSYS;
}
#endif

#endif /* _MACH_TEGRA_POWERGATE_H_ */

0 comments on commit 9886e1f

Please sign in to comment.