[<prev] [next>] [day] [month] [year] [list]
Message-ID: <m3hbc6pw28.fsf@t19.piap.pl>
Date: Mon, 14 Feb 2011 14:47:27 +0100
From: khalasa@...p.pl (Krzysztof HaĆasa)
To: Ben Collins <bcollins@...echerry.net>
Cc: lkml <linux-kernel@...r.kernel.org>
Subject: SOLO6x10 readl() and writel() usage
Hi,
BTW why are you using this instead of simple register readl/writel()?
Does the hardware needs something like this?
static inline u32 solo_reg_read(struct solo_dev *solo_dev, int reg)
{
unsigned long flags;
u32 ret;
u16 val;
spin_lock_irqsave(&solo_dev->reg_io_lock, flags);
ret = readl(solo_dev->reg_base + reg);
rmb();
pci_read_config_word(solo_dev->pdev, PCI_STATUS, &val);
rmb();
spin_unlock_irqrestore(&solo_dev->reg_io_lock, flags);
return ret;
}
static inline void solo_reg_write(struct solo_dev *solo_dev, int reg, u32 data)
{
unsigned long flags;
u16 val;
spin_lock_irqsave(&solo_dev->reg_io_lock, flags);
writel(data, solo_dev->reg_base + reg);
wmb();
pci_read_config_word(solo_dev->pdev, PCI_STATUS, &val);
rmb();
spin_unlock_irqrestore(&solo_dev->reg_io_lock, flags);
}
--
Krzysztof Halasa
Research Institute for Automation and Measurements
Al. Jerozolimskie 202, 02-486 Warsaw, Poland
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists