mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2025-04-21 12:27:27 +03:00
[mcs814x] use the recommended ARM I/O accessors
use {read,write}l_relaxed instead of the plain __raw_{read,write}l variants.
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33330 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
@@ -28,7 +28,7 @@ static int mcs814x_rng_data_read(struct hwrng *rng, u32 *buffer)
|
||||
{
|
||||
struct mcs814x_rng_priv *priv = (struct mcs814x_rng_priv *)rng->priv;
|
||||
|
||||
*buffer = __raw_readl(priv->regs + RND);
|
||||
*buffer = readl_relaxed(priv->regs + RND);
|
||||
|
||||
return 4;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ static int mcs814x_gpio_get(struct gpio_chip *chip, unsigned offset)
|
||||
{
|
||||
struct mcs814x_gpio_chip *mcs814x = to_mcs814x_gpio_chip(chip);
|
||||
|
||||
return __raw_readl(mcs814x->regs + GPIO_PIN) & (1 << offset);
|
||||
return readl_relaxed(mcs814x->regs + GPIO_PIN) & (1 << offset);
|
||||
}
|
||||
|
||||
static void mcs814x_gpio_set(struct gpio_chip *chip,
|
||||
@@ -39,12 +39,12 @@ static void mcs814x_gpio_set(struct gpio_chip *chip,
|
||||
struct mcs814x_gpio_chip *mcs814x = to_mcs814x_gpio_chip(chip);
|
||||
u32 mask;
|
||||
|
||||
mask = __raw_readl(mcs814x->regs + GPIO_PIN);
|
||||
mask = readl_relaxed(mcs814x->regs + GPIO_PIN);
|
||||
if (value)
|
||||
mask |= (1 << offset);
|
||||
else
|
||||
mask &= ~(1 << offset);
|
||||
__raw_writel(mask, mcs814x->regs + GPIO_PIN);
|
||||
writel_relaxed(mask, mcs814x->regs + GPIO_PIN);
|
||||
}
|
||||
|
||||
static int mcs814x_gpio_direction_output(struct gpio_chip *chip,
|
||||
@@ -53,9 +53,9 @@ static int mcs814x_gpio_direction_output(struct gpio_chip *chip,
|
||||
struct mcs814x_gpio_chip *mcs814x = to_mcs814x_gpio_chip(chip);
|
||||
u32 mask;
|
||||
|
||||
mask = __raw_readl(mcs814x->regs + GPIO_DIR);
|
||||
mask = readl_relaxed(mcs814x->regs + GPIO_DIR);
|
||||
mask &= ~(1 << offset);
|
||||
__raw_writel(mask, mcs814x->regs + GPIO_DIR);
|
||||
writel_relaxed(mask, mcs814x->regs + GPIO_DIR);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -66,9 +66,9 @@ static int mcs814x_gpio_direction_input(struct gpio_chip *chip,
|
||||
struct mcs814x_gpio_chip *mcs814x = to_mcs814x_gpio_chip(chip);
|
||||
u32 mask;
|
||||
|
||||
mask = __raw_readl(mcs814x->regs + GPIO_DIR);
|
||||
mask = readl_relaxed(mcs814x->regs + GPIO_DIR);
|
||||
mask |= (1 << offset);
|
||||
__raw_writel(mask, mcs814x->regs + GPIO_DIR);
|
||||
writel_relaxed(mask, mcs814x->regs + GPIO_DIR);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
|
||||
static inline u32 nuport_mac_readl(void __iomem *reg)
|
||||
{
|
||||
return __raw_readl(reg);
|
||||
return readl_relaxed(reg);
|
||||
}
|
||||
|
||||
static inline u8 nuport_mac_readb(void __iomem *reg)
|
||||
@@ -122,12 +122,12 @@ static inline u8 nuport_mac_readb(void __iomem *reg)
|
||||
|
||||
static inline void nuport_mac_writel(u32 value, void __iomem *reg)
|
||||
{
|
||||
__raw_writel(value, reg);
|
||||
writel_relaxed(value, reg);
|
||||
}
|
||||
|
||||
static inline void nuport_mac_writeb(u8 value, void __iomem *reg)
|
||||
{
|
||||
__raw_writel(value, reg);
|
||||
writel_relaxed(value, reg);
|
||||
}
|
||||
|
||||
/* MAC private data */
|
||||
|
||||
@@ -49,9 +49,9 @@ static int mcs814x_wdt_start(struct watchdog_device *dev)
|
||||
u32 reg;
|
||||
|
||||
spin_lock(&wdt->lock);
|
||||
reg = __raw_readl(wdt->regs + WDT_CTRL);
|
||||
reg = readl_relaxed(wdt->regs + WDT_CTRL);
|
||||
reg |= WDT_CTRL_EN;
|
||||
__raw_writel(reg, wdt->regs + WDT_CTRL);
|
||||
writel_relaxed(reg, wdt->regs + WDT_CTRL);
|
||||
spin_unlock(&wdt->lock);
|
||||
|
||||
return 0;
|
||||
@@ -63,9 +63,9 @@ static int mcs814x_wdt_stop(struct watchdog_device *dev)
|
||||
u32 reg;
|
||||
|
||||
spin_lock(&wdt->lock);
|
||||
reg = __raw_readl(wdt->regs + WDT_CTRL);
|
||||
reg = readl_relaxed(wdt->regs + WDT_CTRL);
|
||||
reg &= ~WDT_CTRL_EN;
|
||||
__raw_writel(reg, wdt->regs + WDT_CTRL);
|
||||
writel_relaxed(reg, wdt->regs + WDT_CTRL);
|
||||
spin_unlock(&wdt->lock);
|
||||
|
||||
return 0;
|
||||
@@ -80,7 +80,7 @@ static int mcs814x_wdt_set_timeout(struct watchdog_device *dev,
|
||||
/* watchdog counts upward and rollover (0xfffffff -> 0)
|
||||
* triggers the reboot
|
||||
*/
|
||||
__raw_writel(WDT_MAX_VALUE - (new_timeout * clk_get_rate(wdt->clk)),
|
||||
writel_relaxed(WDT_MAX_VALUE - (new_timeout * clk_get_rate(wdt->clk)),
|
||||
wdt->regs + WDT_COUNT);
|
||||
spin_unlock(&wdt->lock);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user