aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/host1x
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2014-10-02 08:33:31 -0400
committerThierry Reding <treding@nvidia.com>2014-11-13 10:11:48 -0500
commit57b17ae71f412b870415b698655f00846e34ce0a (patch)
tree8bd069766e5844210032d1c1f1cbd947a5fe6a5d /drivers/gpu/host1x
parent3880e95f2706e4ad9ba37e382e7f5bb82f911c68 (diff)
gpu: host1x: mipi: Registers are 32 bits wide
On 64-bit platforms an unsigned long would be 64 bit and cause unnecessary casting when being passed to writel() or returned from readl(). Make register values 32 bits wide to avoid that. Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/host1x')
-rw-r--r--drivers/gpu/host1x/mipi.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/gpu/host1x/mipi.c b/drivers/gpu/host1x/mipi.c
index 9882ea122024..a3e215a0116f 100644
--- a/drivers/gpu/host1x/mipi.c
+++ b/drivers/gpu/host1x/mipi.c
@@ -90,16 +90,16 @@ struct tegra_mipi_device {
90 unsigned long pads; 90 unsigned long pads;
91}; 91};
92 92
93static inline unsigned long tegra_mipi_readl(struct tegra_mipi *mipi, 93static inline u32 tegra_mipi_readl(struct tegra_mipi *mipi,
94 unsigned long reg) 94 unsigned long offset)
95{ 95{
96 return readl(mipi->regs + (reg << 2)); 96 return readl(mipi->regs + (offset << 2));
97} 97}
98 98
99static inline void tegra_mipi_writel(struct tegra_mipi *mipi, 99static inline void tegra_mipi_writel(struct tegra_mipi *mipi, u32 value,
100 unsigned long value, unsigned long reg) 100 unsigned long offset)
101{ 101{
102 writel(value, mipi->regs + (reg << 2)); 102 writel(value, mipi->regs + (offset << 2));
103} 103}
104 104
105struct tegra_mipi_device *tegra_mipi_request(struct device *device) 105struct tegra_mipi_device *tegra_mipi_request(struct device *device)
@@ -161,7 +161,7 @@ EXPORT_SYMBOL(tegra_mipi_free);
161static int tegra_mipi_wait(struct tegra_mipi *mipi) 161static int tegra_mipi_wait(struct tegra_mipi *mipi)
162{ 162{
163 unsigned long timeout = jiffies + msecs_to_jiffies(250); 163 unsigned long timeout = jiffies + msecs_to_jiffies(250);
164 unsigned long value; 164 u32 value;
165 165
166 while (time_before(jiffies, timeout)) { 166 while (time_before(jiffies, timeout)) {
167 value = tegra_mipi_readl(mipi, MIPI_CAL_STATUS); 167 value = tegra_mipi_readl(mipi, MIPI_CAL_STATUS);
@@ -177,8 +177,8 @@ static int tegra_mipi_wait(struct tegra_mipi *mipi)
177 177
178int tegra_mipi_calibrate(struct tegra_mipi_device *device) 178int tegra_mipi_calibrate(struct tegra_mipi_device *device)
179{ 179{
180 unsigned long value;
181 unsigned int i; 180 unsigned int i;
181 u32 value;
182 int err; 182 int err;
183 183
184 err = clk_enable(device->mipi->clk); 184 err = clk_enable(device->mipi->clk);