Commit d98ff22b authored by Madhusudhan Chikkature's avatar Madhusudhan Chikkature Committed by Tony Lindgren

HDQ driver: use ioremap for HDQ base

This patch provides the ioremap related changes to the driver.
Signed-off-by: default avatarMadhusudhan Chikkature <madhu.cr@ti.com>
Acked-by: default avatarEvgeniy Polyakov <johnpol@2ka.mipt.ru>
Acked-by: default avatarFelipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 72a74519
......@@ -54,7 +54,7 @@ static int w1_id;
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;
......@@ -99,12 +99,12 @@ static struct w1_bus_master omap_w1_master = {
*/
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;
}
......@@ -112,9 +112,9 @@ static inline u8 hdq_reg_out(struct hdq_data *hdq_data, u32 offset, u8 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;
}
......@@ -589,7 +589,12 @@ static int __init omap_hdq_probe(struct platform_device *pdev)
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");
......@@ -668,8 +673,9 @@ err_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);
......@@ -695,6 +701,7 @@ static int omap_hdq_remove(struct platform_device *pdev)
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;
......
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