Commit 90cecc29 authored by Paul Walmsley's avatar Paul Walmsley Committed by Tony Lindgren

SmartReflex: fix sparse issues

Fix sparse issues with smartreflex.c.
Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 68fb659f
...@@ -60,9 +60,11 @@ struct sr_custom_clk { ...@@ -60,9 +60,11 @@ struct sr_custom_clk {
struct omap_sr *sr; struct omap_sr *sr;
}; };
#define SR_REGADDR(offs) (__force void __iomem *)(sr->srbase_addr + offset)
static inline void sr_write_reg(struct omap_sr *sr, int offset, u32 value) static inline void sr_write_reg(struct omap_sr *sr, int offset, u32 value)
{ {
__raw_writel(value, sr->srbase_addr + offset); __raw_writel(value, SR_REGADDR(offset));
} }
static inline void sr_modify_reg(struct omap_sr *sr, int offset, u32 mask, static inline void sr_modify_reg(struct omap_sr *sr, int offset, u32 mask,
...@@ -70,16 +72,16 @@ static inline void sr_modify_reg(struct omap_sr *sr, int offset, u32 mask, ...@@ -70,16 +72,16 @@ static inline void sr_modify_reg(struct omap_sr *sr, int offset, u32 mask,
{ {
u32 reg_val; u32 reg_val;
reg_val = __raw_readl(sr->srbase_addr + offset); reg_val = __raw_readl(SR_REGADDR(offset));
reg_val &= ~mask; reg_val &= ~mask;
reg_val |= value; reg_val |= value;
__raw_writel(reg_val, sr->srbase_addr + offset); __raw_writel(reg_val, SR_REGADDR(offset));
} }
static inline u32 sr_read_reg(struct omap_sr *sr, int offset) static inline u32 sr_read_reg(struct omap_sr *sr, int offset)
{ {
return __raw_readl(sr->srbase_addr + offset); return __raw_readl(SR_REGADDR(offset));
} }
/* Custom clock handling functions */ /* Custom clock handling functions */
......
...@@ -248,6 +248,9 @@ extern u32 current_vdd2_opp; ...@@ -248,6 +248,9 @@ extern u32 current_vdd2_opp;
#ifdef CONFIG_OMAP_SMARTREFLEX #ifdef CONFIG_OMAP_SMARTREFLEX
void enable_smartreflex(int srid); void enable_smartreflex(int srid);
void disable_smartreflex(int srid); void disable_smartreflex(int srid);
int sr_voltagescale_vcbypass(u32 target_opp, u8 vsel);
void sr_start_vddautocomap(int srid, u32 target_opp_no);
int sr_stop_vddautocomap(int srid);
#else #else
static inline void enable_smartreflex(int srid) {} static inline void enable_smartreflex(int srid) {}
static inline void disable_smartreflex(int srid) {} static inline void disable_smartreflex(int srid) {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment