struct hdq_data {
struct device *dev;
- resource_size_t hdq_base;
+ void __iomem *hdq_base;
struct semaphore hdq_semlock;
int hdq_usecount;
struct clk *hdq_ick;
*/
static inline u8 hdq_reg_in(struct hdq_data *hdq_data, u32 offset)
{
- return omap_readb(hdq_data->hdq_base + offset);
+ return __raw_readb(hdq_data->hdq_base + offset);
}
static inline u8 hdq_reg_out(struct hdq_data *hdq_data, u32 offset, u8 val)
{
- omap_writeb(val, hdq_data->hdq_base + offset);
+ __raw_writeb(val, hdq_data->hdq_base + offset);
return val;
}
static inline u8 hdq_reg_merge(struct hdq_data *hdq_data, u32 offset,
u8 val, u8 mask)
{
- u8 new_val = (omap_readb(hdq_data->hdq_base + offset) & ~mask)
+ u8 new_val = (__raw_readb(hdq_data->hdq_base + offset) & ~mask)
| (val & mask);
- omap_writeb(new_val, hdq_data->hdq_base + offset);
+ __raw_writeb(new_val, hdq_data->hdq_base + offset);
return new_val;
}
goto err_resource;
}
- hdq_data->hdq_base = res->start;
+ hdq_data->hdq_base = ioremap(res->start, SZ_4K);
+ if (!hdq_data->hdq_base) {
+ dev_dbg(&pdev->dev, "ioremap failed\n");
+ ret = -EINVAL;
+ goto err_ioremap;
+ }
/* get interface & functional clock objects */
hdq_data->hdq_ick = clk_get(&pdev->dev, "hdq_ick");
clk_put(hdq_data->hdq_fck);
err_clk:
- hdq_data->hdq_base = NULL;
+ iounmap(hdq_data->hdq_base);
+err_ioremap:
err_resource:
platform_set_drvdata(pdev, NULL);
kfree(hdq_data);
clk_put(hdq_data->hdq_fck);
free_irq(INT_24XX_HDQ_IRQ, hdq_data);
platform_set_drvdata(pdev, NULL);
+ iounmap(hdq_data->hdq_base);
kfree(hdq_data);
return 0;