From 3a65dd4ea32c3e3a3befec58ad20d1c96580834e Mon Sep 17 00:00:00 2001 From: Tomas Winkler Date: Tue, 25 Dec 2012 19:06:06 +0200 Subject: mei: move hw dependent functions to interface.c 1. move direct register handling to interface.c and make them static 2. add new function mei_clear_interrupts that wraps direct register access 3. export other functions in mei_dev.h Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman --- drivers/misc/mei/mei_dev.h | 71 ++++------------------------------------------ 1 file changed, 5 insertions(+), 66 deletions(-) (limited to 'drivers/misc/mei/mei_dev.h') diff --git a/drivers/misc/mei/mei_dev.h b/drivers/misc/mei/mei_dev.h index 228a98c97b37..472c9cacc543 100644 --- a/drivers/misc/mei/mei_dev.h +++ b/drivers/misc/mei/mei_dev.h @@ -440,79 +440,18 @@ int mei_amthif_irq_read(struct mei_device *dev, s32 *slots); * Register Access Function */ -/** - * mei_reg_read - Reads 32bit data from the mei device - * - * @dev: the device structure - * @offset: offset from which to read the data - * - * returns register value (u32) - */ -static inline u32 mei_reg_read(const struct mei_device *dev, - unsigned long offset) -{ - return ioread32(dev->mem_addr + offset); -} - -/** - * mei_reg_write - Writes 32bit data to the mei device - * - * @dev: the device structure - * @offset: offset from which to write the data - * @value: register value to write (u32) - */ -static inline void mei_reg_write(const struct mei_device *dev, - unsigned long offset, u32 value) -{ - iowrite32(value, dev->mem_addr + offset); -} - -/** - * mei_hcsr_read - Reads 32bit data from the host CSR - * - * @dev: the device structure - * - * returns the byte read. - */ -static inline u32 mei_hcsr_read(const struct mei_device *dev) -{ - return mei_reg_read(dev, H_CSR); -} +u32 mei_hcsr_read(const struct mei_device *dev); +u32 mei_mecsr_read(const struct mei_device *dev); +u32 mei_mecbrw_read(const struct mei_device *dev); -/** - * mei_mecsr_read - Reads 32bit data from the ME CSR - * - * @dev: the device structure - * - * returns ME_CSR_HA register value (u32) - */ -static inline u32 mei_mecsr_read(const struct mei_device *dev) -{ - return mei_reg_read(dev, ME_CSR_HA); -} - -/** - * get_me_cb_rw - Reads 32bit data from the mei ME_CB_RW register - * - * @dev: the device structure - * - * returns ME_CB_RW register value (u32) - */ -static inline u32 mei_mecbrw_read(const struct mei_device *dev) -{ - return mei_reg_read(dev, ME_CB_RW); -} - - -/* - * mei interface function prototypes - */ void mei_hcsr_set(struct mei_device *dev); void mei_csr_clear_his(struct mei_device *dev); +void mei_clear_interrupts(struct mei_device *dev); void mei_enable_interrupts(struct mei_device *dev); void mei_disable_interrupts(struct mei_device *dev); + static inline struct mei_msg_hdr *mei_hbm_hdr(u32 *buf, size_t length) { struct mei_msg_hdr *hdr = (struct mei_msg_hdr *)buf; -- cgit