blob: 1fa2ab18a9e180c0d80fb3cdf4ba0cb9a7218ff5 [file] [log] [blame]
Bob Copeland0764de62009-08-07 13:32:56 +03001/*
2 * This file is part of wl12xx
3 *
4 * Copyright (C) 2008 Nokia Corporation
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18 * 02110-1301 USA
19 *
20 */
21#ifndef __WL1251_IO_H__
22#define __WL1251_IO_H__
23
24#include "wl1251.h"
Bob Copeland0764de62009-08-07 13:32:56 +030025
26static inline u32 wl1251_read32(struct wl1251 *wl, int addr)
27{
28 u32 response;
29
Bob Copeland08d9f5722009-08-07 13:33:11 +030030 wl->if_ops->read(wl, addr, &response, sizeof(u32));
Bob Copeland0764de62009-08-07 13:32:56 +030031
32 return response;
33}
34
35static inline void wl1251_write32(struct wl1251 *wl, int addr, u32 val)
36{
Bob Copeland08d9f5722009-08-07 13:33:11 +030037 wl->if_ops->write(wl, addr, &val, sizeof(u32));
Bob Copeland0764de62009-08-07 13:32:56 +030038}
39
40/* Memory target IO, address is translated to partition 0 */
41void wl1251_mem_read(struct wl1251 *wl, int addr, void *buf, size_t len);
42void wl1251_mem_write(struct wl1251 *wl, int addr, void *buf, size_t len);
43u32 wl1251_mem_read32(struct wl1251 *wl, int addr);
44void wl1251_mem_write32(struct wl1251 *wl, int addr, u32 val);
45/* Registers IO */
46u32 wl1251_reg_read32(struct wl1251 *wl, int addr);
47void wl1251_reg_write32(struct wl1251 *wl, int addr, u32 val);
48
49#endif